PyGlobal.cpp 47.2 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/****************************************************************************
** Copyright 2019 The Open Group
** Copyright 2019 Bluware, Inc.
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
**     http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
****************************************************************************/

#include "PyGlobal.h"

20
#include <OpenVDS/Vector.h>
21
22
using namespace native;

23

24
25
26
void 
PyGlobal::initModule(py::module& m)
{
27
  // These are opaque pointers, so they must not be destructed from pybind11 code
28
29
30
  py::class_<VDS, std::unique_ptr<VDS, py::nodelete>>
    VDS_(m, "VDS");
  VDS_.def("__int__", [](VDS* self) { return (int64_t)self; });
31
32
33
  VDS_.def("__enter__", [](VDS *self) { return self;});
  VDS_.def("__exit__", [](VDS *self, py::args) { OpenVDS::Close(reinterpret_cast<OpenVDS::VDSHandle>(self)); });

34
  py::class_<IOManager, std::unique_ptr<IOManager, py::nodelete>>(m, "IOManager");
35
36

//AUTOGEN-BEGIN
37
38
39
40
41
42
43
  py::enum_<WaveletAdaptiveMode> 
    WaveletAdaptiveMode_(m,"WaveletAdaptiveMode", OPENVDS_DOCSTRING(WaveletAdaptiveMode));

  WaveletAdaptiveMode_.value("BestQuality"                 , WaveletAdaptiveMode::BestQuality        , OPENVDS_DOCSTRING(WaveletAdaptiveMode_BestQuality));
  WaveletAdaptiveMode_.value("Tolerance"                   , WaveletAdaptiveMode::Tolerance          , OPENVDS_DOCSTRING(WaveletAdaptiveMode_Tolerance));
  WaveletAdaptiveMode_.value("Ratio"                       , WaveletAdaptiveMode::Ratio              , OPENVDS_DOCSTRING(WaveletAdaptiveMode_Ratio));

44
  // OpenOptions
45
  py::class_<OpenOptions> 
46
47
    OpenOptions_(m,"OpenOptions", OPENVDS_DOCSTRING(OpenOptions));

Stein Pedersen's avatar
Stein Pedersen committed
48
  OpenOptions_.def_readwrite("connectionType"              , &OpenOptions::connectionType   , OPENVDS_DOCSTRING(OpenOptions_connectionType));
49
50
51
  OpenOptions_.def_readwrite("waveletAdaptiveMode"         , &OpenOptions::waveletAdaptiveMode, OPENVDS_DOCSTRING(OpenOptions_waveletAdaptiveMode));
  OpenOptions_.def_readwrite("waveletAdaptiveTolerance"    , &OpenOptions::waveletAdaptiveTolerance, OPENVDS_DOCSTRING(OpenOptions_waveletAdaptiveTolerance));
  OpenOptions_.def_readwrite("waveletAdaptiveRatio"        , &OpenOptions::waveletAdaptiveRatio, OPENVDS_DOCSTRING(OpenOptions_waveletAdaptiveRatio));
52

Stein Pedersen's avatar
Stein Pedersen committed
53
  py::enum_<OpenOptions::ConnectionType> 
54
55
    OpenOptions_ConnectionType_(OpenOptions_,"ConnectionType", OPENVDS_DOCSTRING(OpenOptions_ConnectionType));

Stein Pedersen's avatar
Stein Pedersen committed
56
57
  OpenOptions_ConnectionType_.value("AWS"                         , OpenOptions::ConnectionType::AWS        , OPENVDS_DOCSTRING(OpenOptions_ConnectionType_AWS));
  OpenOptions_ConnectionType_.value("Azure"                       , OpenOptions::ConnectionType::Azure      , OPENVDS_DOCSTRING(OpenOptions_ConnectionType_Azure));
Jørgen Lind's avatar
Jørgen Lind committed
58
  OpenOptions_ConnectionType_.value("AzureSdkForCpp"              , OpenOptions::ConnectionType::AzureSdkForCpp, OPENVDS_DOCSTRING(OpenOptions_ConnectionType_AzureSdkForCpp));
59
  OpenOptions_ConnectionType_.value("AzurePresigned"              , OpenOptions::ConnectionType::AzurePresigned, OPENVDS_DOCSTRING(OpenOptions_ConnectionType_AzurePresigned));
60
  OpenOptions_ConnectionType_.value("GoogleStorage"               , OpenOptions::ConnectionType::GoogleStorage, OPENVDS_DOCSTRING(OpenOptions_ConnectionType_GoogleStorage));
Jørgen Lind's avatar
Jørgen Lind committed
61
  OpenOptions_ConnectionType_.value("DMS"                         , OpenOptions::ConnectionType::DMS        , OPENVDS_DOCSTRING(OpenOptions_ConnectionType_DMS));
62
  OpenOptions_ConnectionType_.value("Http"                        , OpenOptions::ConnectionType::Http       , OPENVDS_DOCSTRING(OpenOptions_ConnectionType_Http));
Morten Ofstad's avatar
Morten Ofstad committed
63
  OpenOptions_ConnectionType_.value("VDSFile"                     , OpenOptions::ConnectionType::VDSFile    , OPENVDS_DOCSTRING(OpenOptions_ConnectionType_VDSFile));
Stein Pedersen's avatar
Stein Pedersen committed
64
  OpenOptions_ConnectionType_.value("InMemory"                    , OpenOptions::ConnectionType::InMemory   , OPENVDS_DOCSTRING(OpenOptions_ConnectionType_InMemory));
Jørgen Lind's avatar
Jørgen Lind committed
65
66
  OpenOptions_ConnectionType_.value("Other"                       , OpenOptions::ConnectionType::Other      , OPENVDS_DOCSTRING(OpenOptions_ConnectionType_Other));
  OpenOptions_ConnectionType_.value("ConnectionTypeCount"         , OpenOptions::ConnectionType::ConnectionTypeCount, OPENVDS_DOCSTRING(OpenOptions_ConnectionType_ConnectionTypeCount));
67
68

  // AWSOpenOptions
69
  py::class_<AWSOpenOptions, OpenOptions> 
70
71
72
    AWSOpenOptions_(m,"AWSOpenOptions", OPENVDS_DOCSTRING(AWSOpenOptions));

  AWSOpenOptions_.def(py::init<                              >(), OPENVDS_DOCSTRING(AWSOpenOptions_AWSOpenOptions));
Jørgen Lind's avatar
Jørgen Lind committed
73
  AWSOpenOptions_.def(py::init<const std::string &, const std::string &, const std::string &, const std::string &, int, int, bool>(), py::arg("bucket").none(false), py::arg("key").none(false), py::arg("region").none(false), py::arg("endpointOverride").none(false), py::arg("connectionTimeoutMs") = 3000, py::arg("requestTimeoutMs") = 6000, py::arg("disableInitApi") = false, OPENVDS_DOCSTRING(AWSOpenOptions_AWSOpenOptions_2));
Stein Pedersen's avatar
Stein Pedersen committed
74
75
76
  AWSOpenOptions_.def_readwrite("bucket"                      , &AWSOpenOptions::bucket        , OPENVDS_DOCSTRING(AWSOpenOptions_bucket));
  AWSOpenOptions_.def_readwrite("key"                         , &AWSOpenOptions::key           , OPENVDS_DOCSTRING(AWSOpenOptions_key));
  AWSOpenOptions_.def_readwrite("region"                      , &AWSOpenOptions::region        , OPENVDS_DOCSTRING(AWSOpenOptions_region));
77
  AWSOpenOptions_.def_readwrite("endpointOverride"            , &AWSOpenOptions::endpointOverride, OPENVDS_DOCSTRING(AWSOpenOptions_endpointOverride));
78
79
80
81
  AWSOpenOptions_.def_readwrite("accessKeyId"                 , &AWSOpenOptions::accessKeyId   , OPENVDS_DOCSTRING(AWSOpenOptions_accessKeyId));
  AWSOpenOptions_.def_readwrite("secretKey"                   , &AWSOpenOptions::secretKey     , OPENVDS_DOCSTRING(AWSOpenOptions_secretKey));
  AWSOpenOptions_.def_readwrite("sessionToken"                , &AWSOpenOptions::sessionToken  , OPENVDS_DOCSTRING(AWSOpenOptions_sessionToken));
  AWSOpenOptions_.def_readwrite("expiration"                  , &AWSOpenOptions::expiration    , OPENVDS_DOCSTRING(AWSOpenOptions_expiration));
82
83
  AWSOpenOptions_.def_readwrite("logFilenamePrefix"           , &AWSOpenOptions::logFilenamePrefix, OPENVDS_DOCSTRING(AWSOpenOptions_logFilenamePrefix));
  AWSOpenOptions_.def_readwrite("loglevel"                    , &AWSOpenOptions::loglevel      , OPENVDS_DOCSTRING(AWSOpenOptions_loglevel));
84
85
  AWSOpenOptions_.def_readwrite("connectionTimeoutMs"         , &AWSOpenOptions::connectionTimeoutMs, OPENVDS_DOCSTRING(AWSOpenOptions_connectionTimeoutMs));
  AWSOpenOptions_.def_readwrite("requestTimeoutMs"            , &AWSOpenOptions::requestTimeoutMs, OPENVDS_DOCSTRING(AWSOpenOptions_requestTimeoutMs));
Jørgen Lind's avatar
Jørgen Lind committed
86
  AWSOpenOptions_.def_readwrite("disableInitApi"              , &AWSOpenOptions::disableInitApi, OPENVDS_DOCSTRING(AWSOpenOptions_disableInitApi));
Stein Pedersen's avatar
Stein Pedersen committed
87

88
  // AzureOpenOptions
89
  py::class_<AzureOpenOptions, OpenOptions> 
90
91
92
    AzureOpenOptions_(m,"AzureOpenOptions", OPENVDS_DOCSTRING(AzureOpenOptions));

  AzureOpenOptions_.def(py::init<                              >(), OPENVDS_DOCSTRING(AzureOpenOptions_AzureOpenOptions));
93
94
  AzureOpenOptions_.def(py::init<const std::string &, const std::string &, const std::string &>(), py::arg("connectionString").none(false), py::arg("container").none(false), py::arg("blob").none(false), OPENVDS_DOCSTRING(AzureOpenOptions_AzureOpenOptions_2));
  AzureOpenOptions_.def(py::init<const std::string &, const std::string &, const std::string &, int &, int &>(), py::arg("connectionString").none(false), py::arg("container").none(false), py::arg("blob").none(false), py::arg("parallelism_factor").none(false), py::arg("max_execution_time").none(false), OPENVDS_DOCSTRING(AzureOpenOptions_AzureOpenOptions_3));
95
  AzureOpenOptions_.def_static("azureOpenOptionsBearer"      , static_cast<native::AzureOpenOptions(*)(const std::string &, const std::string &, const std::string &, const std::string &)>(&AzureOpenOptions::AzureOpenOptionsBearer), py::arg("accountName").none(false), py::arg("bearerToken").none(false), py::arg("container").none(false), py::arg("blob").none(false), py::call_guard<py::gil_scoped_release>(), OPENVDS_DOCSTRING(AzureOpenOptions_AzureOpenOptionsBearer));
96
  AzureOpenOptions_.def_readwrite("connectionString"            , &AzureOpenOptions::connectionString, OPENVDS_DOCSTRING(AzureOpenOptions_connectionString));
97
98
  AzureOpenOptions_.def_readwrite("accountName"                 , &AzureOpenOptions::accountName , OPENVDS_DOCSTRING(AzureOpenOptions_accountName));
  AzureOpenOptions_.def_readwrite("bearerToken"                 , &AzureOpenOptions::bearerToken , OPENVDS_DOCSTRING(AzureOpenOptions_bearerToken));
99
  AzureOpenOptions_.def_readwrite("container"                   , &AzureOpenOptions::container   , OPENVDS_DOCSTRING(AzureOpenOptions_container));
100
  AzureOpenOptions_.def_readwrite("blob"                        , &AzureOpenOptions::blob        , OPENVDS_DOCSTRING(AzureOpenOptions_blob));
101
102
103
  AzureOpenOptions_.def_readwrite("parallelism_factor"          , &AzureOpenOptions::parallelism_factor, OPENVDS_DOCSTRING(AzureOpenOptions_parallelism_factor));
  AzureOpenOptions_.def_readwrite("max_execution_time"          , &AzureOpenOptions::max_execution_time, OPENVDS_DOCSTRING(AzureOpenOptions_max_execution_time));

104
  // AzurePresignedOpenOptions
105
  py::class_<AzurePresignedOpenOptions, OpenOptions> 
106
107
108
    AzurePresignedOpenOptions_(m,"AzurePresignedOpenOptions", OPENVDS_DOCSTRING(AzurePresignedOpenOptions));

  AzurePresignedOpenOptions_.def(py::init<                              >(), OPENVDS_DOCSTRING(AzurePresignedOpenOptions_AzurePresignedOpenOptions));
109
  AzurePresignedOpenOptions_.def(py::init<const std::string &, const std::string &>(), py::arg("baseUrl").none(false), py::arg("urlSuffix").none(false), OPENVDS_DOCSTRING(AzurePresignedOpenOptions_AzurePresignedOpenOptions_2));
110
111
112
  AzurePresignedOpenOptions_.def_readwrite("baseUrl"                     , &AzurePresignedOpenOptions::baseUrl, OPENVDS_DOCSTRING(AzurePresignedOpenOptions_baseUrl));
  AzurePresignedOpenOptions_.def_readwrite("urlSuffix"                   , &AzurePresignedOpenOptions::urlSuffix, OPENVDS_DOCSTRING(AzurePresignedOpenOptions_urlSuffix));

113
  // GoogleCredentialsToken
114
  py::class_<GoogleCredentialsToken> 
115
116
    GoogleCredentialsToken_(m,"GoogleCredentialsToken", OPENVDS_DOCSTRING(GoogleCredentialsToken));

117
118
  GoogleCredentialsToken_.def(py::init<const std::string &           >(), py::arg("token").none(false), OPENVDS_DOCSTRING(GoogleCredentialsToken_GoogleCredentialsToken));
  GoogleCredentialsToken_.def(py::init<std::string &&                >(), py::arg("token").none(false), OPENVDS_DOCSTRING(GoogleCredentialsToken_GoogleCredentialsToken_2));
119
120

  // GoogleCredentialsPath
121
  py::class_<GoogleCredentialsPath> 
122
123
    GoogleCredentialsPath_(m,"GoogleCredentialsPath", OPENVDS_DOCSTRING(GoogleCredentialsPath));

124
125
  GoogleCredentialsPath_.def(py::init<const std::string &           >(), py::arg("path").none(false), OPENVDS_DOCSTRING(GoogleCredentialsPath_GoogleCredentialsPath));
  GoogleCredentialsPath_.def(py::init<std::string &&                >(), py::arg("path").none(false), OPENVDS_DOCSTRING(GoogleCredentialsPath_GoogleCredentialsPath_2));
126
127

  // GoogleCredentialsJson
128
  py::class_<GoogleCredentialsJson> 
129
130
    GoogleCredentialsJson_(m,"GoogleCredentialsJson", OPENVDS_DOCSTRING(GoogleCredentialsJson));

131
132
  GoogleCredentialsJson_.def(py::init<const std::string &           >(), py::arg("json").none(false), OPENVDS_DOCSTRING(GoogleCredentialsJson_GoogleCredentialsJson));
  GoogleCredentialsJson_.def(py::init<std::string &&                >(), py::arg("json").none(false), OPENVDS_DOCSTRING(GoogleCredentialsJson_GoogleCredentialsJson_2));
133

134
  // GoogleCredentialsSignedUrl
135
  py::class_<GoogleCredentialsSignedUrl> 
136
137
138
139
140
141
    GoogleCredentialsSignedUrl_(m,"GoogleCredentialsSignedUrl", OPENVDS_DOCSTRING(GoogleCredentialsSignedUrl));

  GoogleCredentialsSignedUrl_.def(py::init<const std::string &           >(), py::arg("region").none(false), OPENVDS_DOCSTRING(GoogleCredentialsSignedUrl_GoogleCredentialsSignedUrl));
  GoogleCredentialsSignedUrl_.def(py::init<std::string &&                >(), py::arg("region").none(false), OPENVDS_DOCSTRING(GoogleCredentialsSignedUrl_GoogleCredentialsSignedUrl_2));

  // GoogleCredentialsSignedUrlPath
142
  py::class_<GoogleCredentialsSignedUrlPath> 
143
144
145
146
147
148
149
150
    GoogleCredentialsSignedUrlPath_(m,"GoogleCredentialsSignedUrlPath", OPENVDS_DOCSTRING(GoogleCredentialsSignedUrlPath));

  GoogleCredentialsSignedUrlPath_.def(py::init<const std::string &, const std::string &>(), py::arg("region").none(false), py::arg("path").none(false), OPENVDS_DOCSTRING(GoogleCredentialsSignedUrlPath_GoogleCredentialsSignedUrlPath));
  GoogleCredentialsSignedUrlPath_.def(py::init<std::string &&, const std::string &>(), py::arg("region").none(false), py::arg("path").none(false), OPENVDS_DOCSTRING(GoogleCredentialsSignedUrlPath_GoogleCredentialsSignedUrlPath_2));
  GoogleCredentialsSignedUrlPath_.def(py::init<const std::string &, std::string &&>(), py::arg("region").none(false), py::arg("path").none(false), OPENVDS_DOCSTRING(GoogleCredentialsSignedUrlPath_GoogleCredentialsSignedUrlPath_3));
  GoogleCredentialsSignedUrlPath_.def(py::init<std::string &&, std::string &&>(), py::arg("region").none(false), py::arg("path").none(false), OPENVDS_DOCSTRING(GoogleCredentialsSignedUrlPath_GoogleCredentialsSignedUrlPath_4));

  // GoogleCredentialsSignedUrlJson
151
  py::class_<GoogleCredentialsSignedUrlJson> 
152
153
154
155
156
157
158
    GoogleCredentialsSignedUrlJson_(m,"GoogleCredentialsSignedUrlJson", OPENVDS_DOCSTRING(GoogleCredentialsSignedUrlJson));

  GoogleCredentialsSignedUrlJson_.def(py::init<const std::string &, const std::string &>(), py::arg("region").none(false), py::arg("json").none(false), OPENVDS_DOCSTRING(GoogleCredentialsSignedUrlJson_GoogleCredentialsSignedUrlJson));
  GoogleCredentialsSignedUrlJson_.def(py::init<std::string &&, const std::string &>(), py::arg("region").none(false), py::arg("json").none(false), OPENVDS_DOCSTRING(GoogleCredentialsSignedUrlJson_GoogleCredentialsSignedUrlJson_2));
  GoogleCredentialsSignedUrlJson_.def(py::init<const std::string &, std::string &&>(), py::arg("region").none(false), py::arg("json").none(false), OPENVDS_DOCSTRING(GoogleCredentialsSignedUrlJson_GoogleCredentialsSignedUrlJson_3));
  GoogleCredentialsSignedUrlJson_.def(py::init<std::string &&, std::string &&>(), py::arg("region").none(false), py::arg("json").none(false), OPENVDS_DOCSTRING(GoogleCredentialsSignedUrlJson_GoogleCredentialsSignedUrlJson_4));

159
  // GoogleOpenOptions
160
  py::class_<GoogleOpenOptions, OpenOptions> 
161
162
163
    GoogleOpenOptions_(m,"GoogleOpenOptions", OPENVDS_DOCSTRING(GoogleOpenOptions));

  GoogleOpenOptions_.def(py::init<                              >(), OPENVDS_DOCSTRING(GoogleOpenOptions_GoogleOpenOptions));
164
  GoogleOpenOptions_.def(py::init<const std::string &, const std::string &>(), py::arg("bucket").none(false), py::arg("pathPrefix").none(false), OPENVDS_DOCSTRING(GoogleOpenOptions_GoogleOpenOptions_2));
165
166
167
  GoogleOpenOptions_.def(py::init<const std::string &, const std::string &, const native::GoogleCredentialsToken &>(), py::arg("bucket").none(false), py::arg("pathPrefix").none(false), py::arg("credentials").none(false), OPENVDS_DOCSTRING(GoogleOpenOptions_GoogleOpenOptions_3));
  GoogleOpenOptions_.def(py::init<const std::string &, const std::string &, const native::GoogleCredentialsPath &>(), py::arg("bucket").none(false), py::arg("pathPrefix").none(false), py::arg("credentials").none(false), OPENVDS_DOCSTRING(GoogleOpenOptions_GoogleOpenOptions_4));
  GoogleOpenOptions_.def(py::init<const std::string &, const std::string &, const native::GoogleCredentialsJson &>(), py::arg("bucket").none(false), py::arg("pathPrefix").none(false), py::arg("credentials").none(false), OPENVDS_DOCSTRING(GoogleOpenOptions_GoogleOpenOptions_5));
168
169
170
  GoogleOpenOptions_.def(py::init<const std::string &, const std::string &, const native::GoogleCredentialsSignedUrl &>(), py::arg("bucket").none(false), py::arg("pathPrefix").none(false), py::arg("credentials").none(false), OPENVDS_DOCSTRING(GoogleOpenOptions_GoogleOpenOptions_6));
  GoogleOpenOptions_.def(py::init<const std::string &, const std::string &, const native::GoogleCredentialsSignedUrlPath &>(), py::arg("bucket").none(false), py::arg("pathPrefix").none(false), py::arg("credentials").none(false), OPENVDS_DOCSTRING(GoogleOpenOptions_GoogleOpenOptions_7));
  GoogleOpenOptions_.def(py::init<const std::string &, const std::string &, const native::GoogleCredentialsSignedUrlJson &>(), py::arg("bucket").none(false), py::arg("pathPrefix").none(false), py::arg("credentials").none(false), OPENVDS_DOCSTRING(GoogleOpenOptions_GoogleOpenOptions_8));
171
  GoogleOpenOptions_.def("setSignedUrl"                , static_cast<bool(GoogleOpenOptions::*)()>(&GoogleOpenOptions::SetSignedUrl), py::call_guard<py::gil_scoped_release>(), OPENVDS_DOCSTRING(GoogleOpenOptions_SetSignedUrl));
172
  GoogleOpenOptions_.def_readwrite("credentialsType"             , &GoogleOpenOptions::credentialsType, OPENVDS_DOCSTRING(GoogleOpenOptions_credentialsType));
173
  GoogleOpenOptions_.def_readwrite("bucket"                      , &GoogleOpenOptions::bucket     , OPENVDS_DOCSTRING(GoogleOpenOptions_bucket));
174
  GoogleOpenOptions_.def_readwrite("pathPrefix"                  , &GoogleOpenOptions::pathPrefix , OPENVDS_DOCSTRING(GoogleOpenOptions_pathPrefix));
175
  GoogleOpenOptions_.def_readwrite("credentials"                 , &GoogleOpenOptions::credentials, OPENVDS_DOCSTRING(GoogleOpenOptions_credentials));
176
  GoogleOpenOptions_.def_readwrite("storageClass"                , &GoogleOpenOptions::storageClass, OPENVDS_DOCSTRING(GoogleOpenOptions_storageClass));
177
  GoogleOpenOptions_.def_readwrite("region"                      , &GoogleOpenOptions::region     , OPENVDS_DOCSTRING(GoogleOpenOptions_region));
178
179
180
181
182
183

  py::enum_<GoogleOpenOptions::CredentialsType> 
    GoogleOpenOptions_CredentialsType_(GoogleOpenOptions_,"CredentialsType", OPENVDS_DOCSTRING(GoogleOpenOptions_CredentialsType));

  GoogleOpenOptions_CredentialsType_.value("Default"                     , GoogleOpenOptions::CredentialsType::Default, OPENVDS_DOCSTRING(GoogleOpenOptions_CredentialsType_Default));
  GoogleOpenOptions_CredentialsType_.value("AccessToken"                 , GoogleOpenOptions::CredentialsType::AccessToken, OPENVDS_DOCSTRING(GoogleOpenOptions_CredentialsType_AccessToken));
184
  GoogleOpenOptions_CredentialsType_.value("Path"                        , GoogleOpenOptions::CredentialsType::Path, OPENVDS_DOCSTRING(GoogleOpenOptions_CredentialsType_Path));
185
  GoogleOpenOptions_CredentialsType_.value("Json"                        , GoogleOpenOptions::CredentialsType::Json, OPENVDS_DOCSTRING(GoogleOpenOptions_CredentialsType_Json));
186
  GoogleOpenOptions_CredentialsType_.value("SignedUrl"                   , GoogleOpenOptions::CredentialsType::SignedUrl, OPENVDS_DOCSTRING(GoogleOpenOptions_CredentialsType_SignedUrl));
187
  GoogleOpenOptions_CredentialsType_.value("SignedUrlPath"               , GoogleOpenOptions::CredentialsType::SignedUrlPath, OPENVDS_DOCSTRING(GoogleOpenOptions_CredentialsType_SignedUrlPath));
188
  GoogleOpenOptions_CredentialsType_.value("SignedUrlJson"               , GoogleOpenOptions::CredentialsType::SignedUrlJson, OPENVDS_DOCSTRING(GoogleOpenOptions_CredentialsType_SignedUrlJson));
189

Jørgen Lind's avatar
Jørgen Lind committed
190
  // DMSOpenOptions
191
  py::class_<DMSOpenOptions, OpenOptions> 
Jørgen Lind's avatar
Jørgen Lind committed
192
193
194
    DMSOpenOptions_(m,"DMSOpenOptions", OPENVDS_DOCSTRING(DMSOpenOptions));

  DMSOpenOptions_.def(py::init<                              >(), OPENVDS_DOCSTRING(DMSOpenOptions_DMSOpenOptions));
Jørgen Lind's avatar
Jørgen Lind committed
195
  DMSOpenOptions_.def(py::init<const std::string &, const std::string &, const std::string &, const std::string &, int, const std::string &, const std::string &, const std::string &, const std::string &, const std::string &, bool>(), py::arg("sdAuthorityUrl").none(false), py::arg("sdApiKey").none(false), py::arg("sdToken").none(false), py::arg("datasetPath").none(false), py::arg("logLevel").none(false), py::arg("authTokenUrl").none(false), py::arg("refreshToken").none(false), py::arg("clientId").none(false), py::arg("clientSecret").none(false), py::arg("scopes").none(false), py::arg("useFileNameForSingleFileDatasets") = false, OPENVDS_DOCSTRING(DMSOpenOptions_DMSOpenOptions_2));
Jørgen Lind's avatar
Jørgen Lind committed
196
197
198
199
200
  DMSOpenOptions_.def_readwrite("sdAuthorityUrl"              , &DMSOpenOptions::sdAuthorityUrl, OPENVDS_DOCSTRING(DMSOpenOptions_sdAuthorityUrl));
  DMSOpenOptions_.def_readwrite("sdApiKey"                    , &DMSOpenOptions::sdApiKey      , OPENVDS_DOCSTRING(DMSOpenOptions_sdApiKey));
  DMSOpenOptions_.def_readwrite("sdToken"                     , &DMSOpenOptions::sdToken       , OPENVDS_DOCSTRING(DMSOpenOptions_sdToken));
  DMSOpenOptions_.def_readwrite("datasetPath"                 , &DMSOpenOptions::datasetPath   , OPENVDS_DOCSTRING(DMSOpenOptions_datasetPath));
  DMSOpenOptions_.def_readwrite("logLevel"                    , &DMSOpenOptions::logLevel      , OPENVDS_DOCSTRING(DMSOpenOptions_logLevel));
Jørgen Lind's avatar
Jørgen Lind committed
201
202
203
204
  DMSOpenOptions_.def_readwrite("authTokenUrl"                , &DMSOpenOptions::authTokenUrl  , OPENVDS_DOCSTRING(DMSOpenOptions_authTokenUrl));
  DMSOpenOptions_.def_readwrite("refreshToken"                , &DMSOpenOptions::refreshToken  , OPENVDS_DOCSTRING(DMSOpenOptions_refreshToken));
  DMSOpenOptions_.def_readwrite("clientId"                    , &DMSOpenOptions::clientId      , OPENVDS_DOCSTRING(DMSOpenOptions_clientId));
  DMSOpenOptions_.def_readwrite("clientSecret"                , &DMSOpenOptions::clientSecret  , OPENVDS_DOCSTRING(DMSOpenOptions_clientSecret));
Jørgen Lind's avatar
Jørgen Lind committed
205
206
  DMSOpenOptions_.def_readwrite("scopes"                      , &DMSOpenOptions::scopes        , OPENVDS_DOCSTRING(DMSOpenOptions_scopes));
  DMSOpenOptions_.def_readwrite("useFileNameForSingleFileDatasets", &DMSOpenOptions::useFileNameForSingleFileDatasets, OPENVDS_DOCSTRING(DMSOpenOptions_useFileNameForSingleFileDatasets));
Jørgen Lind's avatar
Jørgen Lind committed
207

208
  // HttpOpenOptions
209
  py::class_<HttpOpenOptions, OpenOptions> 
210
211
212
    HttpOpenOptions_(m,"HttpOpenOptions", OPENVDS_DOCSTRING(HttpOpenOptions));

  HttpOpenOptions_.def(py::init<                              >(), OPENVDS_DOCSTRING(HttpOpenOptions_HttpOpenOptions));
213
  HttpOpenOptions_.def(py::init<const std::string &           >(), py::arg("url").none(false), OPENVDS_DOCSTRING(HttpOpenOptions_HttpOpenOptions_2));
214
215
  HttpOpenOptions_.def_readwrite("url"                         , &HttpOpenOptions::url          , OPENVDS_DOCSTRING(HttpOpenOptions_url));

Stein Pedersen's avatar
Stein Pedersen committed
216
  // InMemoryOpenOptions
217
  py::class_<InMemoryOpenOptions, OpenOptions> 
Stein Pedersen's avatar
Stein Pedersen committed
218
219
220
    InMemoryOpenOptions_(m,"InMemoryOpenOptions", OPENVDS_DOCSTRING(InMemoryOpenOptions));

  InMemoryOpenOptions_.def(py::init<                              >(), OPENVDS_DOCSTRING(InMemoryOpenOptions_InMemoryOpenOptions));
221
222
  InMemoryOpenOptions_.def(py::init<const char *                  >(), py::arg("name").none(false), OPENVDS_DOCSTRING(InMemoryOpenOptions_InMemoryOpenOptions_2));
  InMemoryOpenOptions_.def(py::init<const std::string &           >(), py::arg("name").none(false), OPENVDS_DOCSTRING(InMemoryOpenOptions_InMemoryOpenOptions_3));
Jørgen Lind's avatar
Jørgen Lind committed
223
  InMemoryOpenOptions_.def_readwrite("name"                        , &InMemoryOpenOptions::name     , OPENVDS_DOCSTRING(InMemoryOpenOptions_name));
224

Morten Ofstad's avatar
Morten Ofstad committed
225
  // VDSFileOpenOptions
226
  py::class_<VDSFileOpenOptions, OpenOptions> 
Morten Ofstad's avatar
Morten Ofstad committed
227
228
229
    VDSFileOpenOptions_(m,"VDSFileOpenOptions", OPENVDS_DOCSTRING(VDSFileOpenOptions));

  VDSFileOpenOptions_.def(py::init<                              >(), OPENVDS_DOCSTRING(VDSFileOpenOptions_VDSFileOpenOptions));
230
  VDSFileOpenOptions_.def(py::init<const std::string &           >(), py::arg("fileName").none(false), OPENVDS_DOCSTRING(VDSFileOpenOptions_VDSFileOpenOptions_2));
Morten Ofstad's avatar
Morten Ofstad committed
231
232
  VDSFileOpenOptions_.def_readwrite("fileName"                    , &VDSFileOpenOptions::fileName  , OPENVDS_DOCSTRING(VDSFileOpenOptions_fileName));

233
  // Error
234
  py::class_<Error> 
235
236
    Error_(m,"Error", OPENVDS_DOCSTRING(Error));

Stein Pedersen's avatar
Stein Pedersen committed
237
238
  Error_.def_readwrite("code"                        , &Error::code                   , OPENVDS_DOCSTRING(Error_code));
  Error_.def_readwrite("string"                      , &Error::string                 , OPENVDS_DOCSTRING(Error_string));
239

240
  // StringWrapper
241
  py::class_<StringWrapper> 
242
243
    StringWrapper_(m,"StringWrapper", OPENVDS_DOCSTRING(StringWrapper));

244
245
  StringWrapper_.def(py::init<                              >(), OPENVDS_DOCSTRING(StringWrapper_StringWrapper));
  StringWrapper_.def(py::init<const std::string &           >(), py::arg("toWrap").none(false), OPENVDS_DOCSTRING(StringWrapper_StringWrapper_2));
246
247
248
  StringWrapper_.def_readwrite("data"                        , &StringWrapper::data           , OPENVDS_DOCSTRING(StringWrapper_data));
  StringWrapper_.def_readwrite("size"                        , &StringWrapper::size           , OPENVDS_DOCSTRING(StringWrapper_size));

249
250
251
252
253
254
255
256
257
258
259
  m.def("createOpenOptions"           , static_cast<native::OpenOptions *(*)(native::StringWrapper, native::StringWrapper, native::Error &)>(&CreateOpenOptions), py::arg("url").none(false), py::arg("connectionString").none(false), py::arg("error").none(false), py::call_guard<py::gil_scoped_release>(), OPENVDS_DOCSTRING(CreateOpenOptions));
  m.def("createOpenOptions"           , [](OpenVDS::StringWrapper url, OpenVDS::StringWrapper connectionString) { native::Error err; auto ret = CreateOpenOptions(url, connectionString, err); if (err.code) throw std::runtime_error(err.string); return ret; }, py::call_guard<py::gil_scoped_release>(), py::arg("url").none(false), py::arg("connectionString").none(false));
  m.def("isSupportedProtocol"         , static_cast<bool(*)(native::StringWrapper)>(&IsSupportedProtocol), py::arg("url").none(false), py::call_guard<py::gil_scoped_release>(), OPENVDS_DOCSTRING(IsSupportedProtocol));
  m.def("open"                        , static_cast<native::VDSHandle(*)(native::StringWrapper, native::StringWrapper, native::Error &)>(&Open), py::arg("url").none(false), py::arg("connectionString").none(false), py::arg("error").none(false), py::call_guard<py::gil_scoped_release>(), OPENVDS_DOCSTRING(Open));
  m.def("open"                        , [](OpenVDS::StringWrapper url, OpenVDS::StringWrapper connectionString) { native::Error err; auto ret = Open(url, connectionString, err); if (err.code) throw std::runtime_error(err.string); return ret; }, py::call_guard<py::gil_scoped_release>(), py::arg("url").none(false), py::arg("connectionString").none(false));
  m.def("openWithAdaptiveCompressionTolerance", static_cast<native::VDSHandle(*)(native::StringWrapper, native::StringWrapper, float, native::Error &)>(&OpenWithAdaptiveCompressionTolerance), py::arg("url").none(false), py::arg("connectionString").none(false), py::arg("waveletAdaptiveTolerance").none(false), py::arg("error").none(false), py::call_guard<py::gil_scoped_release>(), OPENVDS_DOCSTRING(OpenWithAdaptiveCompressionTolerance));
  m.def("openWithAdaptiveCompressionTolerance", [](OpenVDS::StringWrapper url, OpenVDS::StringWrapper connectionString, float waveletAdaptiveTolerance) { native::Error err; auto ret = OpenWithAdaptiveCompressionTolerance(url, connectionString, waveletAdaptiveTolerance, err); if (err.code) throw std::runtime_error(err.string); return ret; }, py::call_guard<py::gil_scoped_release>(), py::arg("url").none(false), py::arg("connectionString").none(false), py::arg("waveletAdaptiveTolerance").none(false));
  m.def("openWithAdaptiveCompressionRatio", static_cast<native::VDSHandle(*)(native::StringWrapper, native::StringWrapper, float, native::Error &)>(&OpenWithAdaptiveCompressionRatio), py::arg("url").none(false), py::arg("connectionString").none(false), py::arg("waveletAdaptiveRatio").none(false), py::arg("error").none(false), py::call_guard<py::gil_scoped_release>(), OPENVDS_DOCSTRING(OpenWithAdaptiveCompressionRatio));
  m.def("openWithAdaptiveCompressionRatio", [](OpenVDS::StringWrapper url, OpenVDS::StringWrapper connectionString, float waveletAdaptiveRatio) { native::Error err; auto ret = OpenWithAdaptiveCompressionRatio(url, connectionString, waveletAdaptiveRatio, err); if (err.code) throw std::runtime_error(err.string); return ret; }, py::call_guard<py::gil_scoped_release>(), py::arg("url").none(false), py::arg("connectionString").none(false), py::arg("waveletAdaptiveRatio").none(false));
  m.def("open"                        , static_cast<native::VDSHandle(*)(native::StringWrapper, native::Error &)>(&Open), py::arg("url").none(false), py::arg("error").none(false), py::call_guard<py::gil_scoped_release>(), OPENVDS_DOCSTRING(Open_2));
  m.def("open"                        , [](OpenVDS::StringWrapper url) { native::Error err; auto ret = Open(url, err); if (err.code) throw std::runtime_error(err.string); return ret; }, py::call_guard<py::gil_scoped_release>(), py::arg("url").none(false));
260
  m.def("open"                        , static_cast<native::VDSHandle(*)(const native::OpenOptions &, native::Error &)>(&Open), py::arg("options").none(false), py::arg("error").none(false), py::call_guard<py::gil_scoped_release>(), OPENVDS_DOCSTRING(Open_3));
261
  m.def("open"                        , [](const OpenVDS::OpenOptions & options) { native::Error err; auto ret = Open(options, err); if (err.code) throw std::runtime_error(err.string); return ret; }, py::call_guard<py::gil_scoped_release>(), py::arg("options").none(false));
262
  m.def("open"                        , static_cast<native::VDSHandle(*)(native::IOManager *, native::Error &)>(&Open), py::arg("ioManager").none(false), py::arg("error").none(false), py::call_guard<py::gil_scoped_release>(), OPENVDS_DOCSTRING(Open_4));
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
  m.def("open"                        , [](OpenVDS::IOManager * ioManager) { native::Error err; auto ret = Open(ioManager, err); if (err.code) throw std::runtime_error(err.string); return ret; }, py::call_guard<py::gil_scoped_release>(), py::arg("ioManager").none(false));
  m.def("isCompressionMethodSupported", static_cast<bool(*)(native::CompressionMethod)>(&IsCompressionMethodSupported), py::arg("compressionMethod").none(false), py::call_guard<py::gil_scoped_release>(), OPENVDS_DOCSTRING(IsCompressionMethodSupported));
  m.def("create"                      , static_cast<native::VDSHandle(*)(native::StringWrapper, native::StringWrapper, const native::VolumeDataLayoutDescriptor &, VectorWrapper<native::VolumeDataAxisDescriptor>, VectorWrapper<native::VolumeDataChannelDescriptor>, const native::MetadataReadAccess &, native::CompressionMethod, float, native::Error &)>(&Create), py::arg("url").none(false), py::arg("connectionString").none(false), py::arg("layoutDescriptor").none(false), py::arg("axisDescriptors").none(false), py::arg("channelDescriptors").none(false), py::arg("metadata").none(false), py::arg("compressionMethod").none(false), py::arg("compressionTolerance").none(false), py::arg("error").none(false), py::call_guard<py::gil_scoped_release>(), OPENVDS_DOCSTRING(Create));
  m.def("create"                      , [](OpenVDS::StringWrapper url, OpenVDS::StringWrapper connectionString, const OpenVDS::VolumeDataLayoutDescriptor & layoutDescriptor, VectorWrapper<OpenVDS::VolumeDataAxisDescriptor> axisDescriptors, VectorWrapper<OpenVDS::VolumeDataChannelDescriptor> channelDescriptors, const OpenVDS::MetadataReadAccess & metadata, OpenVDS::CompressionMethod compressionMethod, float compressionTolerance) { native::Error err; auto ret = Create(url, connectionString, layoutDescriptor, axisDescriptors, channelDescriptors, metadata, compressionMethod, compressionTolerance, err); if (err.code) throw std::runtime_error(err.string); return ret; }, py::call_guard<py::gil_scoped_release>(), py::arg("url").none(false), py::arg("connectionString").none(false), py::arg("layoutDescriptor").none(false), py::arg("axisDescriptors").none(false), py::arg("channelDescriptors").none(false), py::arg("metadata").none(false), py::arg("compressionMethod").none(false), py::arg("compressionTolerance").none(false));
  m.def("create"                      , static_cast<native::VDSHandle(*)(native::StringWrapper, native::StringWrapper, const native::VolumeDataLayoutDescriptor &, VectorWrapper<native::VolumeDataAxisDescriptor>, VectorWrapper<native::VolumeDataChannelDescriptor>, const native::MetadataReadAccess &, native::Error &)>(&Create), py::arg("url").none(false), py::arg("connectionString").none(false), py::arg("layoutDescriptor").none(false), py::arg("axisDescriptors").none(false), py::arg("channelDescriptors").none(false), py::arg("metadata").none(false), py::arg("error").none(false), py::call_guard<py::gil_scoped_release>(), OPENVDS_DOCSTRING(Create_2));
  m.def("create"                      , [](OpenVDS::StringWrapper url, OpenVDS::StringWrapper connectionString, const OpenVDS::VolumeDataLayoutDescriptor & layoutDescriptor, VectorWrapper<OpenVDS::VolumeDataAxisDescriptor> axisDescriptors, VectorWrapper<OpenVDS::VolumeDataChannelDescriptor> channelDescriptors, const OpenVDS::MetadataReadAccess & metadata) { native::Error err; auto ret = Create(url, connectionString, layoutDescriptor, axisDescriptors, channelDescriptors, metadata, err); if (err.code) throw std::runtime_error(err.string); return ret; }, py::call_guard<py::gil_scoped_release>(), py::arg("url").none(false), py::arg("connectionString").none(false), py::arg("layoutDescriptor").none(false), py::arg("axisDescriptors").none(false), py::arg("channelDescriptors").none(false), py::arg("metadata").none(false));
  m.def("create"                      , static_cast<native::VDSHandle(*)(native::StringWrapper, const native::VolumeDataLayoutDescriptor &, VectorWrapper<native::VolumeDataAxisDescriptor>, VectorWrapper<native::VolumeDataChannelDescriptor>, const native::MetadataReadAccess &, native::CompressionMethod, float, native::Error &)>(&Create), py::arg("url").none(false), py::arg("layoutDescriptor").none(false), py::arg("axisDescriptors").none(false), py::arg("channelDescriptors").none(false), py::arg("metadata").none(false), py::arg("compressionMethod").none(false), py::arg("compressionTolerance").none(false), py::arg("error").none(false), py::call_guard<py::gil_scoped_release>(), OPENVDS_DOCSTRING(Create_3));
  m.def("create"                      , [](OpenVDS::StringWrapper url, const OpenVDS::VolumeDataLayoutDescriptor & layoutDescriptor, VectorWrapper<OpenVDS::VolumeDataAxisDescriptor> axisDescriptors, VectorWrapper<OpenVDS::VolumeDataChannelDescriptor> channelDescriptors, const OpenVDS::MetadataReadAccess & metadata, OpenVDS::CompressionMethod compressionMethod, float compressionTolerance) { native::Error err; auto ret = Create(url, layoutDescriptor, axisDescriptors, channelDescriptors, metadata, compressionMethod, compressionTolerance, err); if (err.code) throw std::runtime_error(err.string); return ret; }, py::call_guard<py::gil_scoped_release>(), py::arg("url").none(false), py::arg("layoutDescriptor").none(false), py::arg("axisDescriptors").none(false), py::arg("channelDescriptors").none(false), py::arg("metadata").none(false), py::arg("compressionMethod").none(false), py::arg("compressionTolerance").none(false));
  m.def("create"                      , static_cast<native::VDSHandle(*)(native::StringWrapper, const native::VolumeDataLayoutDescriptor &, VectorWrapper<native::VolumeDataAxisDescriptor>, VectorWrapper<native::VolumeDataChannelDescriptor>, const native::MetadataReadAccess &, native::Error &)>(&Create), py::arg("url").none(false), py::arg("layoutDescriptor").none(false), py::arg("axisDescriptors").none(false), py::arg("channelDescriptors").none(false), py::arg("metadata").none(false), py::arg("error").none(false), py::call_guard<py::gil_scoped_release>(), OPENVDS_DOCSTRING(Create_4));
  m.def("create"                      , [](OpenVDS::StringWrapper url, const OpenVDS::VolumeDataLayoutDescriptor & layoutDescriptor, VectorWrapper<OpenVDS::VolumeDataAxisDescriptor> axisDescriptors, VectorWrapper<OpenVDS::VolumeDataChannelDescriptor> channelDescriptors, const OpenVDS::MetadataReadAccess & metadata) { native::Error err; auto ret = Create(url, layoutDescriptor, axisDescriptors, channelDescriptors, metadata, err); if (err.code) throw std::runtime_error(err.string); return ret; }, py::call_guard<py::gil_scoped_release>(), py::arg("url").none(false), py::arg("layoutDescriptor").none(false), py::arg("axisDescriptors").none(false), py::arg("channelDescriptors").none(false), py::arg("metadata").none(false));
  m.def("create"                      , static_cast<native::VDSHandle(*)(const native::OpenOptions &, const native::VolumeDataLayoutDescriptor &, VectorWrapper<native::VolumeDataAxisDescriptor>, VectorWrapper<native::VolumeDataChannelDescriptor>, const native::MetadataReadAccess &, native::CompressionMethod, float, native::Error &)>(&Create), py::arg("options").none(false), py::arg("layoutDescriptor").none(false), py::arg("axisDescriptors").none(false), py::arg("channelDescriptors").none(false), py::arg("metadata").none(false), py::arg("compressionMethod").none(false), py::arg("compressionTolerance").none(false), py::arg("error").none(false), py::call_guard<py::gil_scoped_release>(), OPENVDS_DOCSTRING(Create_5));
  m.def("create"                      , [](const OpenVDS::OpenOptions & options, const OpenVDS::VolumeDataLayoutDescriptor & layoutDescriptor, VectorWrapper<OpenVDS::VolumeDataAxisDescriptor> axisDescriptors, VectorWrapper<OpenVDS::VolumeDataChannelDescriptor> channelDescriptors, const OpenVDS::MetadataReadAccess & metadata, OpenVDS::CompressionMethod compressionMethod, float compressionTolerance) { native::Error err; auto ret = Create(options, layoutDescriptor, axisDescriptors, channelDescriptors, metadata, compressionMethod, compressionTolerance, err); if (err.code) throw std::runtime_error(err.string); return ret; }, py::call_guard<py::gil_scoped_release>(), py::arg("options").none(false), py::arg("layoutDescriptor").none(false), py::arg("axisDescriptors").none(false), py::arg("channelDescriptors").none(false), py::arg("metadata").none(false), py::arg("compressionMethod").none(false), py::arg("compressionTolerance").none(false));
  m.def("create"                      , static_cast<native::VDSHandle(*)(const native::OpenOptions &, const native::VolumeDataLayoutDescriptor &, VectorWrapper<native::VolumeDataAxisDescriptor>, VectorWrapper<native::VolumeDataChannelDescriptor>, const native::MetadataReadAccess &, native::Error &)>(&Create), py::arg("options").none(false), py::arg("layoutDescriptor").none(false), py::arg("axisDescriptors").none(false), py::arg("channelDescriptors").none(false), py::arg("metadata").none(false), py::arg("error").none(false), py::call_guard<py::gil_scoped_release>(), OPENVDS_DOCSTRING(Create_6));
  m.def("create"                      , [](const OpenVDS::OpenOptions & options, const OpenVDS::VolumeDataLayoutDescriptor & layoutDescriptor, VectorWrapper<OpenVDS::VolumeDataAxisDescriptor> axisDescriptors, VectorWrapper<OpenVDS::VolumeDataChannelDescriptor> channelDescriptors, const OpenVDS::MetadataReadAccess & metadata) { native::Error err; auto ret = Create(options, layoutDescriptor, axisDescriptors, channelDescriptors, metadata, err); if (err.code) throw std::runtime_error(err.string); return ret; }, py::call_guard<py::gil_scoped_release>(), py::arg("options").none(false), py::arg("layoutDescriptor").none(false), py::arg("axisDescriptors").none(false), py::arg("channelDescriptors").none(false), py::arg("metadata").none(false));
  m.def("create"                      , static_cast<native::VDSHandle(*)(native::IOManager *, const native::VolumeDataLayoutDescriptor &, VectorWrapper<native::VolumeDataAxisDescriptor>, VectorWrapper<native::VolumeDataChannelDescriptor>, const native::MetadataReadAccess &, native::CompressionMethod, float, native::Error &)>(&Create), py::arg("ioManager").none(false), py::arg("layoutDescriptor").none(false), py::arg("axisDescriptors").none(false), py::arg("channelDescriptors").none(false), py::arg("metadata").none(false), py::arg("compressionMethod").none(false), py::arg("compressionTolerance").none(false), py::arg("error").none(false), py::call_guard<py::gil_scoped_release>(), OPENVDS_DOCSTRING(Create_7));
  m.def("create"                      , [](OpenVDS::IOManager * ioManager, const OpenVDS::VolumeDataLayoutDescriptor & layoutDescriptor, VectorWrapper<OpenVDS::VolumeDataAxisDescriptor> axisDescriptors, VectorWrapper<OpenVDS::VolumeDataChannelDescriptor> channelDescriptors, const OpenVDS::MetadataReadAccess & metadata, OpenVDS::CompressionMethod compressionMethod, float compressionTolerance) { native::Error err; auto ret = Create(ioManager, layoutDescriptor, axisDescriptors, channelDescriptors, metadata, compressionMethod, compressionTolerance, err); if (err.code) throw std::runtime_error(err.string); return ret; }, py::call_guard<py::gil_scoped_release>(), py::arg("ioManager").none(false), py::arg("layoutDescriptor").none(false), py::arg("axisDescriptors").none(false), py::arg("channelDescriptors").none(false), py::arg("metadata").none(false), py::arg("compressionMethod").none(false), py::arg("compressionTolerance").none(false));
  m.def("create"                      , static_cast<native::VDSHandle(*)(native::IOManager *, const native::VolumeDataLayoutDescriptor &, VectorWrapper<native::VolumeDataAxisDescriptor>, VectorWrapper<native::VolumeDataChannelDescriptor>, const native::MetadataReadAccess &, native::Error &)>(&Create), py::arg("ioManager").none(false), py::arg("layoutDescriptor").none(false), py::arg("axisDescriptors").none(false), py::arg("channelDescriptors").none(false), py::arg("metadata").none(false), py::arg("error").none(false), py::call_guard<py::gil_scoped_release>(), OPENVDS_DOCSTRING(Create_8));
  m.def("create"                      , [](OpenVDS::IOManager * ioManager, const OpenVDS::VolumeDataLayoutDescriptor & layoutDescriptor, VectorWrapper<OpenVDS::VolumeDataAxisDescriptor> axisDescriptors, VectorWrapper<OpenVDS::VolumeDataChannelDescriptor> channelDescriptors, const OpenVDS::MetadataReadAccess & metadata) { native::Error err; auto ret = Create(ioManager, layoutDescriptor, axisDescriptors, channelDescriptors, metadata, err); if (err.code) throw std::runtime_error(err.string); return ret; }, py::call_guard<py::gil_scoped_release>(), py::arg("ioManager").none(false), py::arg("layoutDescriptor").none(false), py::arg("axisDescriptors").none(false), py::arg("channelDescriptors").none(false), py::arg("metadata").none(false));
281
282
283
  m.def("getLayout"                   , static_cast<native::VolumeDataLayout *(*)(native::VDSHandle)>(&GetLayout), py::arg("handle").none(false), py::call_guard<py::gil_scoped_release>(), OPENVDS_DOCSTRING(GetLayout));
  m.def("getAccessManagerInterface"   , static_cast<native::IVolumeDataAccessManager *(*)(native::VDSHandle)>(&GetAccessManagerInterface), py::arg("handle").none(false), py::call_guard<py::gil_scoped_release>(), OPENVDS_DOCSTRING(GetAccessManagerInterface));
  m.def("getAccessManager"            , static_cast<native::VolumeDataAccessManager(*)(native::VDSHandle)>(&GetAccessManager), py::arg("handle").none(false), py::call_guard<py::gil_scoped_release>(), OPENVDS_DOCSTRING(GetAccessManager));
Jørgen Lind's avatar
Jørgen Lind committed
284
285
  m.def("getCompressionMethod"        , static_cast<native::CompressionMethod(*)(native::VDSHandle)>(&GetCompressionMethod), py::arg("handle").none(false), py::call_guard<py::gil_scoped_release>(), OPENVDS_DOCSTRING(GetCompressionMethod));
  m.def("getCompressionTolerance"     , static_cast<float(*)(native::VDSHandle)>(&GetCompressionTolerance), py::arg("handle").none(false), py::call_guard<py::gil_scoped_release>(), OPENVDS_DOCSTRING(GetCompressionTolerance));
286
287
  m.def("close"                       , static_cast<void(*)(native::VDSHandle)>(&Close), py::arg("handle").none(false), py::call_guard<py::gil_scoped_release>(), OPENVDS_DOCSTRING(Close));
  m.def("getGlobalState"              , static_cast<native::GlobalState *(*)()>(&GetGlobalState), py::call_guard<py::gil_scoped_release>(), OPENVDS_DOCSTRING(GetGlobalState));
288
289
290
  m.def("getOpenVDSName"              , static_cast<const char *(*)()>(&GetOpenVDSName), py::call_guard<py::gil_scoped_release>(), OPENVDS_DOCSTRING(GetOpenVDSName));
  m.def("getOpenVDSVersion"           , static_cast<const char *(*)()>(&GetOpenVDSVersion), py::call_guard<py::gil_scoped_release>(), OPENVDS_DOCSTRING(GetOpenVDSVersion));
  m.def("getOpenVDSRevision"          , static_cast<const char *(*)()>(&GetOpenVDSRevision), py::call_guard<py::gil_scoped_release>(), OPENVDS_DOCSTRING(GetOpenVDSRevision));
291
//AUTOGEN-END
292
  Error_.def(py::init<>());
Jørgen Lind's avatar
Jørgen Lind committed
293
  Error_.def("__repr__", [](native::Error const& self){ std::string tmp = std::to_string(self.code); return std::string("Error(code=") + tmp + ", string='" + self.string + "')"; });
294
295
296
297
298
299

  OpenOptions_.def("__repr__", [](OpenOptions const& self)
    {
      std::string conn = "Unknown";
      switch(self.connectionType)
      {
300
301
      case OpenOptions::ConnectionType::AWS            : conn = std::string("AWS"            ); break;
      case OpenOptions::ConnectionType::Azure          : conn = std::string("Azure"          ); break;
Jørgen Lind's avatar
Jørgen Lind committed
302
      case OpenOptions::ConnectionType::AzureSdkForCpp : conn = std::string("AzureSdkForCpp" ); break;
303
304
      case OpenOptions::ConnectionType::AzurePresigned : conn = std::string("AzurePresigned" ); break;
      case OpenOptions::ConnectionType::GoogleStorage  : conn = std::string("GoogleStorage"  ); break;
Jørgen Lind's avatar
Jørgen Lind committed
305
      case OpenOptions::ConnectionType::Http           : conn = std::string("Http"           ); break;
Jørgen Lind's avatar
Jørgen Lind committed
306
      case OpenOptions::ConnectionType::DMS            : conn = std::string("Dms"            ); break;
307
      case OpenOptions::ConnectionType::VDSFile        : conn = std::string("VDSFile"        ); break;
308
      case OpenOptions::ConnectionType::InMemory       : conn = std::string("InMemory"       ); break;
Jørgen Lind's avatar
Jørgen Lind committed
309
310
      case OpenOptions::ConnectionType::Other          : conn = std::string("Other"          ); break;
      case OpenOptions::ConnectionType::ConnectionTypeCount : conn = std::string("ConnectionTypeCount"); break;
311
312
313
      }
      return std::string("OpenOptions(connectionType='" + conn + "')");
    });
314

315
316
317

// IMPLEMENTED : AWSOpenOptions_.def(py::init<const std::string &, const std::string &, const std::string &, const std::string &>(), py::arg("bucket").none(false), py::arg("key").none(false), py::arg("region").none(false), py::arg("endpointOverride").none(false), OPENVDS_DOCSTRING(AWSOpenOptions_AWSOpenOptions_2));
  AWSOpenOptions_.def(py::init<const std::string &, const std::string &, const std::string &, const std::string &>(), py::arg("bucket").none(false), py::arg("key").none(false), py::arg("region").none(false) = "", py::arg("endpointOverride").none(false) = "", OPENVDS_DOCSTRING(AWSOpenOptions_AWSOpenOptions_2));
318
319
}

320
321
322
323
// IMPLEMENTED : m.def_property_readonly("openVDSName", &GetOpenVDSName, OPENVDS_DOCSTRING(GetOpenVDSName));
// IMPLEMENTED : m.def_property_readonly("openVDSVersion", &GetOpenVDSVersion, OPENVDS_DOCSTRING(GetOpenVDSVersion));
// IMPLEMENTED : m.def_property_readonly("openVDSRevision", &GetOpenVDSRevision, OPENVDS_DOCSTRING(GetOpenVDSRevision));

Paal Kvamme's avatar
Paal Kvamme committed
324
325
326
// IMPLEMENTED : DMSOpenOptions_.def(py::init<const std::string &, const std::string &, const std::string &, std::string (*)(const void *), const void *, int, bool>(), py::arg("sdAuthorityUrl").none(false), py::arg("sdApiKey").none(false), py::arg("datasetPath").none(false), py::arg("authProviderCallback").none(false), py::arg("authProviderCallbackData").none(false), py::arg("logLevel") = 0, py::arg("useFileNameForSingleFileDatasets") = false, OPENVDS_DOCSTRING(DMSOpenOptions_DMSOpenOptions_3));
// IMPLEMENTED : DMSOpenOptions_.def_readwrite("authProviderCallback"        , &DMSOpenOptions::authProviderCallback, OPENVDS_DOCSTRING(DMSOpenOptions_authProviderCallback));
// IMPLEMENTED : DMSOpenOptions_.def_readwrite("authProviderCallbackData"    , &DMSOpenOptions::authProviderCallbackData, OPENVDS_DOCSTRING(DMSOpenOptions_authProviderCallbackData));