aind-dataverse-service-client 0.0.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,39 @@
1
+ # coding: utf-8
2
+
3
+ # flake8: noqa
4
+
5
+ """
6
+ aind-dataverse-service
7
+
8
+ ## aind-dataverse-service Service to pull data from Allen Institute's Dataverse database.
9
+
10
+ The version of the OpenAPI document: 0.0.2
11
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
12
+
13
+ Do not edit the class manually.
14
+ """ # noqa: E501
15
+
16
+
17
+ __version__ = "0.0.2"
18
+
19
+ # import apis into sdk package
20
+ from aind_dataverse_service_client.api.default_api import DefaultApi
21
+ from aind_dataverse_service_client.api.healthcheck_api import HealthcheckApi
22
+
23
+ # import ApiClient
24
+ from aind_dataverse_service_client.api_response import ApiResponse
25
+ from aind_dataverse_service_client.api_client import ApiClient
26
+ from aind_dataverse_service_client.configuration import Configuration
27
+ from aind_dataverse_service_client.exceptions import OpenApiException
28
+ from aind_dataverse_service_client.exceptions import ApiTypeError
29
+ from aind_dataverse_service_client.exceptions import ApiValueError
30
+ from aind_dataverse_service_client.exceptions import ApiKeyError
31
+ from aind_dataverse_service_client.exceptions import ApiAttributeError
32
+ from aind_dataverse_service_client.exceptions import ApiException
33
+
34
+ # import models into sdk package
35
+ from aind_dataverse_service_client.models.entity_table_row import EntityTableRow
36
+ from aind_dataverse_service_client.models.http_validation_error import HTTPValidationError
37
+ from aind_dataverse_service_client.models.health_check import HealthCheck
38
+ from aind_dataverse_service_client.models.validation_error import ValidationError
39
+ from aind_dataverse_service_client.models.validation_error_loc_inner import ValidationErrorLocInner
@@ -0,0 +1,6 @@
1
+ # flake8: noqa
2
+
3
+ # import apis into api package
4
+ from aind_dataverse_service_client.api.default_api import DefaultApi
5
+ from aind_dataverse_service_client.api.healthcheck_api import HealthcheckApi
6
+
@@ -0,0 +1,547 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ aind-dataverse-service
5
+
6
+ ## aind-dataverse-service Service to pull data from Allen Institute's Dataverse database.
7
+
8
+ The version of the OpenAPI document: 0.0.2
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ import warnings
15
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
16
+ from typing import Any, Dict, List, Optional, Tuple, Union
17
+ from typing_extensions import Annotated
18
+
19
+ from pydantic import Field, StrictStr
20
+ from typing import Any, Dict, List
21
+ from typing_extensions import Annotated
22
+ from aind_dataverse_service_client.models.entity_table_row import EntityTableRow
23
+
24
+ from aind_dataverse_service_client.api_client import ApiClient, RequestSerialized
25
+ from aind_dataverse_service_client.api_response import ApiResponse
26
+ from aind_dataverse_service_client.rest import RESTResponseType
27
+
28
+
29
+ class DefaultApi:
30
+ """NOTE: This class is auto generated by OpenAPI Generator
31
+ Ref: https://openapi-generator.tech
32
+
33
+ Do not edit the class manually.
34
+ """
35
+
36
+ def __init__(self, api_client=None) -> None:
37
+ if api_client is None:
38
+ api_client = ApiClient.get_default()
39
+ self.api_client = api_client
40
+
41
+
42
+ @validate_call
43
+ def get_table(
44
+ self,
45
+ entity_set_table_name: Annotated[StrictStr, Field(description="The entity set name of the table to fetch")],
46
+ _request_timeout: Union[
47
+ None,
48
+ Annotated[StrictFloat, Field(gt=0)],
49
+ Tuple[
50
+ Annotated[StrictFloat, Field(gt=0)],
51
+ Annotated[StrictFloat, Field(gt=0)]
52
+ ]
53
+ ] = None,
54
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
55
+ _content_type: Optional[StrictStr] = None,
56
+ _headers: Optional[Dict[StrictStr, Any]] = None,
57
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
58
+ ) -> List[Dict[str, object]]:
59
+ """Get Table
60
+
61
+ ## Table Data Retrieve data from the specified entity set table.
62
+
63
+ :param entity_set_table_name: The entity set name of the table to fetch (required)
64
+ :type entity_set_table_name: str
65
+ :param _request_timeout: timeout setting for this request. If one
66
+ number provided, it will be total request
67
+ timeout. It can also be a pair (tuple) of
68
+ (connection, read) timeouts.
69
+ :type _request_timeout: int, tuple(int, int), optional
70
+ :param _request_auth: set to override the auth_settings for an a single
71
+ request; this effectively ignores the
72
+ authentication in the spec for a single request.
73
+ :type _request_auth: dict, optional
74
+ :param _content_type: force content-type for the request.
75
+ :type _content_type: str, Optional
76
+ :param _headers: set to override the headers for a single
77
+ request; this effectively ignores the headers
78
+ in the spec for a single request.
79
+ :type _headers: dict, optional
80
+ :param _host_index: set to override the host_index for a single
81
+ request; this effectively ignores the host_index
82
+ in the spec for a single request.
83
+ :type _host_index: int, optional
84
+ :return: Returns the result object.
85
+ """ # noqa: E501
86
+
87
+ _param = self._get_table_serialize(
88
+ entity_set_table_name=entity_set_table_name,
89
+ _request_auth=_request_auth,
90
+ _content_type=_content_type,
91
+ _headers=_headers,
92
+ _host_index=_host_index
93
+ )
94
+
95
+ _response_types_map: Dict[str, Optional[str]] = {
96
+ '200': "List[Dict[str, object]]",
97
+ '422': "HTTPValidationError",
98
+ }
99
+ response_data = self.api_client.call_api(
100
+ *_param,
101
+ _request_timeout=_request_timeout
102
+ )
103
+ response_data.read()
104
+ return self.api_client.response_deserialize(
105
+ response_data=response_data,
106
+ response_types_map=_response_types_map,
107
+ ).data
108
+
109
+
110
+ @validate_call
111
+ def get_table_with_http_info(
112
+ self,
113
+ entity_set_table_name: Annotated[StrictStr, Field(description="The entity set name of the table to fetch")],
114
+ _request_timeout: Union[
115
+ None,
116
+ Annotated[StrictFloat, Field(gt=0)],
117
+ Tuple[
118
+ Annotated[StrictFloat, Field(gt=0)],
119
+ Annotated[StrictFloat, Field(gt=0)]
120
+ ]
121
+ ] = None,
122
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
123
+ _content_type: Optional[StrictStr] = None,
124
+ _headers: Optional[Dict[StrictStr, Any]] = None,
125
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
126
+ ) -> ApiResponse[List[Dict[str, object]]]:
127
+ """Get Table
128
+
129
+ ## Table Data Retrieve data from the specified entity set table.
130
+
131
+ :param entity_set_table_name: The entity set name of the table to fetch (required)
132
+ :type entity_set_table_name: str
133
+ :param _request_timeout: timeout setting for this request. If one
134
+ number provided, it will be total request
135
+ timeout. It can also be a pair (tuple) of
136
+ (connection, read) timeouts.
137
+ :type _request_timeout: int, tuple(int, int), optional
138
+ :param _request_auth: set to override the auth_settings for an a single
139
+ request; this effectively ignores the
140
+ authentication in the spec for a single request.
141
+ :type _request_auth: dict, optional
142
+ :param _content_type: force content-type for the request.
143
+ :type _content_type: str, Optional
144
+ :param _headers: set to override the headers for a single
145
+ request; this effectively ignores the headers
146
+ in the spec for a single request.
147
+ :type _headers: dict, optional
148
+ :param _host_index: set to override the host_index for a single
149
+ request; this effectively ignores the host_index
150
+ in the spec for a single request.
151
+ :type _host_index: int, optional
152
+ :return: Returns the result object.
153
+ """ # noqa: E501
154
+
155
+ _param = self._get_table_serialize(
156
+ entity_set_table_name=entity_set_table_name,
157
+ _request_auth=_request_auth,
158
+ _content_type=_content_type,
159
+ _headers=_headers,
160
+ _host_index=_host_index
161
+ )
162
+
163
+ _response_types_map: Dict[str, Optional[str]] = {
164
+ '200': "List[Dict[str, object]]",
165
+ '422': "HTTPValidationError",
166
+ }
167
+ response_data = self.api_client.call_api(
168
+ *_param,
169
+ _request_timeout=_request_timeout
170
+ )
171
+ response_data.read()
172
+ return self.api_client.response_deserialize(
173
+ response_data=response_data,
174
+ response_types_map=_response_types_map,
175
+ )
176
+
177
+
178
+ @validate_call
179
+ def get_table_without_preload_content(
180
+ self,
181
+ entity_set_table_name: Annotated[StrictStr, Field(description="The entity set name of the table to fetch")],
182
+ _request_timeout: Union[
183
+ None,
184
+ Annotated[StrictFloat, Field(gt=0)],
185
+ Tuple[
186
+ Annotated[StrictFloat, Field(gt=0)],
187
+ Annotated[StrictFloat, Field(gt=0)]
188
+ ]
189
+ ] = None,
190
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
191
+ _content_type: Optional[StrictStr] = None,
192
+ _headers: Optional[Dict[StrictStr, Any]] = None,
193
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
194
+ ) -> RESTResponseType:
195
+ """Get Table
196
+
197
+ ## Table Data Retrieve data from the specified entity set table.
198
+
199
+ :param entity_set_table_name: The entity set name of the table to fetch (required)
200
+ :type entity_set_table_name: str
201
+ :param _request_timeout: timeout setting for this request. If one
202
+ number provided, it will be total request
203
+ timeout. It can also be a pair (tuple) of
204
+ (connection, read) timeouts.
205
+ :type _request_timeout: int, tuple(int, int), optional
206
+ :param _request_auth: set to override the auth_settings for an a single
207
+ request; this effectively ignores the
208
+ authentication in the spec for a single request.
209
+ :type _request_auth: dict, optional
210
+ :param _content_type: force content-type for the request.
211
+ :type _content_type: str, Optional
212
+ :param _headers: set to override the headers for a single
213
+ request; this effectively ignores the headers
214
+ in the spec for a single request.
215
+ :type _headers: dict, optional
216
+ :param _host_index: set to override the host_index for a single
217
+ request; this effectively ignores the host_index
218
+ in the spec for a single request.
219
+ :type _host_index: int, optional
220
+ :return: Returns the result object.
221
+ """ # noqa: E501
222
+
223
+ _param = self._get_table_serialize(
224
+ entity_set_table_name=entity_set_table_name,
225
+ _request_auth=_request_auth,
226
+ _content_type=_content_type,
227
+ _headers=_headers,
228
+ _host_index=_host_index
229
+ )
230
+
231
+ _response_types_map: Dict[str, Optional[str]] = {
232
+ '200': "List[Dict[str, object]]",
233
+ '422': "HTTPValidationError",
234
+ }
235
+ response_data = self.api_client.call_api(
236
+ *_param,
237
+ _request_timeout=_request_timeout
238
+ )
239
+ return response_data.response
240
+
241
+
242
+ def _get_table_serialize(
243
+ self,
244
+ entity_set_table_name,
245
+ _request_auth,
246
+ _content_type,
247
+ _headers,
248
+ _host_index,
249
+ ) -> RequestSerialized:
250
+
251
+ _host = None
252
+
253
+ _collection_formats: Dict[str, str] = {
254
+ }
255
+
256
+ _path_params: Dict[str, str] = {}
257
+ _query_params: List[Tuple[str, str]] = []
258
+ _header_params: Dict[str, Optional[str]] = _headers or {}
259
+ _form_params: List[Tuple[str, str]] = []
260
+ _files: Dict[
261
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
262
+ ] = {}
263
+ _body_params: Optional[bytes] = None
264
+
265
+ # process the path parameters
266
+ if entity_set_table_name is not None:
267
+ _path_params['entity_set_table_name'] = entity_set_table_name
268
+ # process the query parameters
269
+ # process the header parameters
270
+ # process the form parameters
271
+ # process the body parameter
272
+
273
+
274
+ # set the HTTP header `Accept`
275
+ if 'Accept' not in _header_params:
276
+ _header_params['Accept'] = self.api_client.select_header_accept(
277
+ [
278
+ 'application/json'
279
+ ]
280
+ )
281
+
282
+
283
+ # authentication setting
284
+ _auth_settings: List[str] = [
285
+ ]
286
+
287
+ return self.api_client.param_serialize(
288
+ method='GET',
289
+ resource_path='/tables/{entity_set_table_name}',
290
+ path_params=_path_params,
291
+ query_params=_query_params,
292
+ header_params=_header_params,
293
+ body=_body_params,
294
+ post_params=_form_params,
295
+ files=_files,
296
+ auth_settings=_auth_settings,
297
+ collection_formats=_collection_formats,
298
+ _host=_host,
299
+ _request_auth=_request_auth
300
+ )
301
+
302
+
303
+
304
+
305
+ @validate_call
306
+ def get_table_info(
307
+ self,
308
+ _request_timeout: Union[
309
+ None,
310
+ Annotated[StrictFloat, Field(gt=0)],
311
+ Tuple[
312
+ Annotated[StrictFloat, Field(gt=0)],
313
+ Annotated[StrictFloat, Field(gt=0)]
314
+ ]
315
+ ] = None,
316
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
317
+ _content_type: Optional[StrictStr] = None,
318
+ _headers: Optional[Dict[StrictStr, Any]] = None,
319
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
320
+ ) -> List[EntityTableRow]:
321
+ """Get Table Info
322
+
323
+ ## Get entity table identifying information Retrieves identifying information for tables in an environment.
324
+
325
+ :param _request_timeout: timeout setting for this request. If one
326
+ number provided, it will be total request
327
+ timeout. It can also be a pair (tuple) of
328
+ (connection, read) timeouts.
329
+ :type _request_timeout: int, tuple(int, int), optional
330
+ :param _request_auth: set to override the auth_settings for an a single
331
+ request; this effectively ignores the
332
+ authentication in the spec for a single request.
333
+ :type _request_auth: dict, optional
334
+ :param _content_type: force content-type for the request.
335
+ :type _content_type: str, Optional
336
+ :param _headers: set to override the headers for a single
337
+ request; this effectively ignores the headers
338
+ in the spec for a single request.
339
+ :type _headers: dict, optional
340
+ :param _host_index: set to override the host_index for a single
341
+ request; this effectively ignores the host_index
342
+ in the spec for a single request.
343
+ :type _host_index: int, optional
344
+ :return: Returns the result object.
345
+ """ # noqa: E501
346
+
347
+ _param = self._get_table_info_serialize(
348
+ _request_auth=_request_auth,
349
+ _content_type=_content_type,
350
+ _headers=_headers,
351
+ _host_index=_host_index
352
+ )
353
+
354
+ _response_types_map: Dict[str, Optional[str]] = {
355
+ '200': "List[EntityTableRow]",
356
+ }
357
+ response_data = self.api_client.call_api(
358
+ *_param,
359
+ _request_timeout=_request_timeout
360
+ )
361
+ response_data.read()
362
+ return self.api_client.response_deserialize(
363
+ response_data=response_data,
364
+ response_types_map=_response_types_map,
365
+ ).data
366
+
367
+
368
+ @validate_call
369
+ def get_table_info_with_http_info(
370
+ self,
371
+ _request_timeout: Union[
372
+ None,
373
+ Annotated[StrictFloat, Field(gt=0)],
374
+ Tuple[
375
+ Annotated[StrictFloat, Field(gt=0)],
376
+ Annotated[StrictFloat, Field(gt=0)]
377
+ ]
378
+ ] = None,
379
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
380
+ _content_type: Optional[StrictStr] = None,
381
+ _headers: Optional[Dict[StrictStr, Any]] = None,
382
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
383
+ ) -> ApiResponse[List[EntityTableRow]]:
384
+ """Get Table Info
385
+
386
+ ## Get entity table identifying information Retrieves identifying information for tables in an environment.
387
+
388
+ :param _request_timeout: timeout setting for this request. If one
389
+ number provided, it will be total request
390
+ timeout. It can also be a pair (tuple) of
391
+ (connection, read) timeouts.
392
+ :type _request_timeout: int, tuple(int, int), optional
393
+ :param _request_auth: set to override the auth_settings for an a single
394
+ request; this effectively ignores the
395
+ authentication in the spec for a single request.
396
+ :type _request_auth: dict, optional
397
+ :param _content_type: force content-type for the request.
398
+ :type _content_type: str, Optional
399
+ :param _headers: set to override the headers for a single
400
+ request; this effectively ignores the headers
401
+ in the spec for a single request.
402
+ :type _headers: dict, optional
403
+ :param _host_index: set to override the host_index for a single
404
+ request; this effectively ignores the host_index
405
+ in the spec for a single request.
406
+ :type _host_index: int, optional
407
+ :return: Returns the result object.
408
+ """ # noqa: E501
409
+
410
+ _param = self._get_table_info_serialize(
411
+ _request_auth=_request_auth,
412
+ _content_type=_content_type,
413
+ _headers=_headers,
414
+ _host_index=_host_index
415
+ )
416
+
417
+ _response_types_map: Dict[str, Optional[str]] = {
418
+ '200': "List[EntityTableRow]",
419
+ }
420
+ response_data = self.api_client.call_api(
421
+ *_param,
422
+ _request_timeout=_request_timeout
423
+ )
424
+ response_data.read()
425
+ return self.api_client.response_deserialize(
426
+ response_data=response_data,
427
+ response_types_map=_response_types_map,
428
+ )
429
+
430
+
431
+ @validate_call
432
+ def get_table_info_without_preload_content(
433
+ self,
434
+ _request_timeout: Union[
435
+ None,
436
+ Annotated[StrictFloat, Field(gt=0)],
437
+ Tuple[
438
+ Annotated[StrictFloat, Field(gt=0)],
439
+ Annotated[StrictFloat, Field(gt=0)]
440
+ ]
441
+ ] = None,
442
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
443
+ _content_type: Optional[StrictStr] = None,
444
+ _headers: Optional[Dict[StrictStr, Any]] = None,
445
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
446
+ ) -> RESTResponseType:
447
+ """Get Table Info
448
+
449
+ ## Get entity table identifying information Retrieves identifying information for tables in an environment.
450
+
451
+ :param _request_timeout: timeout setting for this request. If one
452
+ number provided, it will be total request
453
+ timeout. It can also be a pair (tuple) of
454
+ (connection, read) timeouts.
455
+ :type _request_timeout: int, tuple(int, int), optional
456
+ :param _request_auth: set to override the auth_settings for an a single
457
+ request; this effectively ignores the
458
+ authentication in the spec for a single request.
459
+ :type _request_auth: dict, optional
460
+ :param _content_type: force content-type for the request.
461
+ :type _content_type: str, Optional
462
+ :param _headers: set to override the headers for a single
463
+ request; this effectively ignores the headers
464
+ in the spec for a single request.
465
+ :type _headers: dict, optional
466
+ :param _host_index: set to override the host_index for a single
467
+ request; this effectively ignores the host_index
468
+ in the spec for a single request.
469
+ :type _host_index: int, optional
470
+ :return: Returns the result object.
471
+ """ # noqa: E501
472
+
473
+ _param = self._get_table_info_serialize(
474
+ _request_auth=_request_auth,
475
+ _content_type=_content_type,
476
+ _headers=_headers,
477
+ _host_index=_host_index
478
+ )
479
+
480
+ _response_types_map: Dict[str, Optional[str]] = {
481
+ '200': "List[EntityTableRow]",
482
+ }
483
+ response_data = self.api_client.call_api(
484
+ *_param,
485
+ _request_timeout=_request_timeout
486
+ )
487
+ return response_data.response
488
+
489
+
490
+ def _get_table_info_serialize(
491
+ self,
492
+ _request_auth,
493
+ _content_type,
494
+ _headers,
495
+ _host_index,
496
+ ) -> RequestSerialized:
497
+
498
+ _host = None
499
+
500
+ _collection_formats: Dict[str, str] = {
501
+ }
502
+
503
+ _path_params: Dict[str, str] = {}
504
+ _query_params: List[Tuple[str, str]] = []
505
+ _header_params: Dict[str, Optional[str]] = _headers or {}
506
+ _form_params: List[Tuple[str, str]] = []
507
+ _files: Dict[
508
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
509
+ ] = {}
510
+ _body_params: Optional[bytes] = None
511
+
512
+ # process the path parameters
513
+ # process the query parameters
514
+ # process the header parameters
515
+ # process the form parameters
516
+ # process the body parameter
517
+
518
+
519
+ # set the HTTP header `Accept`
520
+ if 'Accept' not in _header_params:
521
+ _header_params['Accept'] = self.api_client.select_header_accept(
522
+ [
523
+ 'application/json'
524
+ ]
525
+ )
526
+
527
+
528
+ # authentication setting
529
+ _auth_settings: List[str] = [
530
+ ]
531
+
532
+ return self.api_client.param_serialize(
533
+ method='GET',
534
+ resource_path='/tables',
535
+ path_params=_path_params,
536
+ query_params=_query_params,
537
+ header_params=_header_params,
538
+ body=_body_params,
539
+ post_params=_form_params,
540
+ files=_files,
541
+ auth_settings=_auth_settings,
542
+ collection_formats=_collection_formats,
543
+ _host=_host,
544
+ _request_auth=_request_auth
545
+ )
546
+
547
+