aind-metadata-service-async-client 1.0.7__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.

Potentially problematic release.


This version of aind-metadata-service-async-client might be problematic. Click here for more details.

Files changed (33) hide show
  1. aind_metadata_service_async_client/__init__.py +52 -0
  2. aind_metadata_service_async_client/api/__init__.py +6 -0
  3. aind_metadata_service_async_client/api/default_api.py +3818 -0
  4. aind_metadata_service_async_client/api/healthcheck_api.py +281 -0
  5. aind_metadata_service_async_client/api_client.py +800 -0
  6. aind_metadata_service_async_client/api_response.py +21 -0
  7. aind_metadata_service_async_client/configuration.py +568 -0
  8. aind_metadata_service_async_client/exceptions.py +216 -0
  9. aind_metadata_service_async_client/models/__init__.py +34 -0
  10. aind_metadata_service_async_client/models/anyof_schema1_validator.py +144 -0
  11. aind_metadata_service_async_client/models/average_hit_rate.py +144 -0
  12. aind_metadata_service_async_client/models/fov_coordinate_ap.py +144 -0
  13. aind_metadata_service_async_client/models/fov_coordinate_ml.py +112 -0
  14. aind_metadata_service_async_client/models/health_check.py +99 -0
  15. aind_metadata_service_async_client/models/hit_rate_trials010.py +144 -0
  16. aind_metadata_service_async_client/models/hit_rate_trials2040.py +144 -0
  17. aind_metadata_service_async_client/models/http_validation_error.py +95 -0
  18. aind_metadata_service_async_client/models/input_source.py +122 -0
  19. aind_metadata_service_async_client/models/job_settings.py +369 -0
  20. aind_metadata_service_async_client/models/job_settings_starting_lickport_position_inner.py +138 -0
  21. aind_metadata_service_async_client/models/output_directory.py +108 -0
  22. aind_metadata_service_async_client/models/slims_workflow.py +40 -0
  23. aind_metadata_service_async_client/models/total_hits.py +144 -0
  24. aind_metadata_service_async_client/models/trial_num.py +144 -0
  25. aind_metadata_service_async_client/models/user_settings_config_file.py +108 -0
  26. aind_metadata_service_async_client/models/validation_error.py +99 -0
  27. aind_metadata_service_async_client/models/validation_error_loc_inner.py +138 -0
  28. aind_metadata_service_async_client/py.typed +0 -0
  29. aind_metadata_service_async_client/rest.py +213 -0
  30. aind_metadata_service_async_client-1.0.7.dist-info/METADATA +25 -0
  31. aind_metadata_service_async_client-1.0.7.dist-info/RECORD +33 -0
  32. aind_metadata_service_async_client-1.0.7.dist-info/WHEEL +5 -0
  33. aind_metadata_service_async_client-1.0.7.dist-info/top_level.txt +1 -0
@@ -0,0 +1,138 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ aind-metadata-service
5
+
6
+ ## aind-metadata-service Service to pull data from example backend.
7
+
8
+ The version of the OpenAPI document: 1.0.7
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ from inspect import getfullargspec
17
+ import json
18
+ import pprint
19
+ import re # noqa: F401
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, ValidationError, field_validator
21
+ from typing import Optional
22
+ from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
23
+ from typing_extensions import Literal, Self
24
+ from pydantic import Field
25
+
26
+ VALIDATIONERRORLOCINNER_ANY_OF_SCHEMAS = ["int", "str"]
27
+
28
+ class ValidationErrorLocInner(BaseModel):
29
+ """
30
+ ValidationErrorLocInner
31
+ """
32
+
33
+ # data type: str
34
+ anyof_schema_1_validator: Optional[StrictStr] = None
35
+ # data type: int
36
+ anyof_schema_2_validator: Optional[StrictInt] = None
37
+ if TYPE_CHECKING:
38
+ actual_instance: Optional[Union[int, str]] = None
39
+ else:
40
+ actual_instance: Any = None
41
+ any_of_schemas: Set[str] = { "int", "str" }
42
+
43
+ model_config = {
44
+ "validate_assignment": True,
45
+ "protected_namespaces": (),
46
+ }
47
+
48
+ def __init__(self, *args, **kwargs) -> None:
49
+ if args:
50
+ if len(args) > 1:
51
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
52
+ if kwargs:
53
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
54
+ super().__init__(actual_instance=args[0])
55
+ else:
56
+ super().__init__(**kwargs)
57
+
58
+ @field_validator('actual_instance')
59
+ def actual_instance_must_validate_anyof(cls, v):
60
+ instance = ValidationErrorLocInner.model_construct()
61
+ error_messages = []
62
+ # validate data type: str
63
+ try:
64
+ instance.anyof_schema_1_validator = v
65
+ return v
66
+ except (ValidationError, ValueError) as e:
67
+ error_messages.append(str(e))
68
+ # validate data type: int
69
+ try:
70
+ instance.anyof_schema_2_validator = v
71
+ return v
72
+ except (ValidationError, ValueError) as e:
73
+ error_messages.append(str(e))
74
+ if error_messages:
75
+ # no match
76
+ raise ValueError("No match found when setting the actual_instance in ValidationErrorLocInner with anyOf schemas: int, str. Details: " + ", ".join(error_messages))
77
+ else:
78
+ return v
79
+
80
+ @classmethod
81
+ def from_dict(cls, obj: Dict[str, Any]) -> Self:
82
+ return cls.from_json(json.dumps(obj))
83
+
84
+ @classmethod
85
+ def from_json(cls, json_str: str) -> Self:
86
+ """Returns the object represented by the json string"""
87
+ instance = cls.model_construct()
88
+ error_messages = []
89
+ # deserialize data into str
90
+ try:
91
+ # validation
92
+ instance.anyof_schema_1_validator = json.loads(json_str)
93
+ # assign value to actual_instance
94
+ instance.actual_instance = instance.anyof_schema_1_validator
95
+ return instance
96
+ except (ValidationError, ValueError) as e:
97
+ error_messages.append(str(e))
98
+ # deserialize data into int
99
+ try:
100
+ # validation
101
+ instance.anyof_schema_2_validator = json.loads(json_str)
102
+ # assign value to actual_instance
103
+ instance.actual_instance = instance.anyof_schema_2_validator
104
+ return instance
105
+ except (ValidationError, ValueError) as e:
106
+ error_messages.append(str(e))
107
+
108
+ if error_messages:
109
+ # no match
110
+ raise ValueError("No match found when deserializing the JSON string into ValidationErrorLocInner with anyOf schemas: int, str. Details: " + ", ".join(error_messages))
111
+ else:
112
+ return instance
113
+
114
+ def to_json(self) -> str:
115
+ """Returns the JSON representation of the actual instance"""
116
+ if self.actual_instance is None:
117
+ return "null"
118
+
119
+ if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
120
+ return self.actual_instance.to_json()
121
+ else:
122
+ return json.dumps(self.actual_instance)
123
+
124
+ def to_dict(self) -> Optional[Union[Dict[str, Any], int, str]]:
125
+ """Returns the dict representation of the actual instance"""
126
+ if self.actual_instance is None:
127
+ return None
128
+
129
+ if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
130
+ return self.actual_instance.to_dict()
131
+ else:
132
+ return self.actual_instance
133
+
134
+ def to_str(self) -> str:
135
+ """Returns the string representation of the actual instance"""
136
+ return pprint.pformat(self.model_dump())
137
+
138
+
File without changes
@@ -0,0 +1,213 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ aind-metadata-service
5
+
6
+ ## aind-metadata-service Service to pull data from example backend.
7
+
8
+ The version of the OpenAPI document: 1.0.7
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ import io
16
+ import json
17
+ import re
18
+ import ssl
19
+ from typing import Optional, Union
20
+
21
+ import aiohttp
22
+ import aiohttp_retry
23
+
24
+ from aind_metadata_service_async_client.exceptions import ApiException, ApiValueError
25
+
26
+ RESTResponseType = aiohttp.ClientResponse
27
+
28
+ ALLOW_RETRY_METHODS = frozenset({'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PUT', 'TRACE'})
29
+
30
+ class RESTResponse(io.IOBase):
31
+
32
+ def __init__(self, resp) -> None:
33
+ self.response = resp
34
+ self.status = resp.status
35
+ self.reason = resp.reason
36
+ self.data = None
37
+
38
+ async def read(self):
39
+ if self.data is None:
40
+ self.data = await self.response.read()
41
+ return self.data
42
+
43
+ def getheaders(self):
44
+ """Returns a CIMultiDictProxy of the response headers."""
45
+ return self.response.headers
46
+
47
+ def getheader(self, name, default=None):
48
+ """Returns a given response header."""
49
+ return self.response.headers.get(name, default)
50
+
51
+
52
+ class RESTClientObject:
53
+
54
+ def __init__(self, configuration) -> None:
55
+
56
+ # maxsize is number of requests to host that are allowed in parallel
57
+ self.maxsize = configuration.connection_pool_maxsize
58
+
59
+ self.ssl_context = ssl.create_default_context(
60
+ cafile=configuration.ssl_ca_cert,
61
+ cadata=configuration.ca_cert_data,
62
+ )
63
+ if configuration.cert_file:
64
+ self.ssl_context.load_cert_chain(
65
+ configuration.cert_file, keyfile=configuration.key_file
66
+ )
67
+
68
+ if not configuration.verify_ssl:
69
+ self.ssl_context.check_hostname = False
70
+ self.ssl_context.verify_mode = ssl.CERT_NONE
71
+
72
+ self.proxy = configuration.proxy
73
+ self.proxy_headers = configuration.proxy_headers
74
+
75
+ self.retries = configuration.retries
76
+
77
+ self.pool_manager: Optional[aiohttp.ClientSession] = None
78
+ self.retry_client: Optional[aiohttp_retry.RetryClient] = None
79
+
80
+ async def close(self) -> None:
81
+ if self.pool_manager:
82
+ await self.pool_manager.close()
83
+ if self.retry_client is not None:
84
+ await self.retry_client.close()
85
+
86
+ async def request(
87
+ self,
88
+ method,
89
+ url,
90
+ headers=None,
91
+ body=None,
92
+ post_params=None,
93
+ _request_timeout=None
94
+ ):
95
+ """Execute request
96
+
97
+ :param method: http request method
98
+ :param url: http request url
99
+ :param headers: http request headers
100
+ :param body: request json body, for `application/json`
101
+ :param post_params: request post parameters,
102
+ `application/x-www-form-urlencoded`
103
+ and `multipart/form-data`
104
+ :param _request_timeout: timeout setting for this request. If one
105
+ number provided, it will be total request
106
+ timeout. It can also be a pair (tuple) of
107
+ (connection, read) timeouts.
108
+ """
109
+ method = method.upper()
110
+ assert method in [
111
+ 'GET',
112
+ 'HEAD',
113
+ 'DELETE',
114
+ 'POST',
115
+ 'PUT',
116
+ 'PATCH',
117
+ 'OPTIONS'
118
+ ]
119
+
120
+ if post_params and body:
121
+ raise ApiValueError(
122
+ "body parameter cannot be used with post_params parameter."
123
+ )
124
+
125
+ post_params = post_params or {}
126
+ headers = headers or {}
127
+ # url already contains the URL query string
128
+ timeout = _request_timeout or 5 * 60
129
+
130
+ if 'Content-Type' not in headers:
131
+ headers['Content-Type'] = 'application/json'
132
+
133
+ args = {
134
+ "method": method,
135
+ "url": url,
136
+ "timeout": timeout,
137
+ "headers": headers
138
+ }
139
+
140
+ if self.proxy:
141
+ args["proxy"] = self.proxy
142
+ if self.proxy_headers:
143
+ args["proxy_headers"] = self.proxy_headers
144
+
145
+ # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE`
146
+ if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']:
147
+ if re.search('json', headers['Content-Type'], re.IGNORECASE):
148
+ if body is not None:
149
+ body = json.dumps(body)
150
+ args["data"] = body
151
+ elif headers['Content-Type'] == 'application/x-www-form-urlencoded':
152
+ args["data"] = aiohttp.FormData(post_params)
153
+ elif headers['Content-Type'] == 'multipart/form-data':
154
+ # must del headers['Content-Type'], or the correct
155
+ # Content-Type which generated by aiohttp
156
+ del headers['Content-Type']
157
+ data = aiohttp.FormData()
158
+ for param in post_params:
159
+ k, v = param
160
+ if isinstance(v, tuple) and len(v) == 3:
161
+ data.add_field(
162
+ k,
163
+ value=v[1],
164
+ filename=v[0],
165
+ content_type=v[2]
166
+ )
167
+ else:
168
+ # Ensures that dict objects are serialized
169
+ if isinstance(v, dict):
170
+ v = json.dumps(v)
171
+ elif isinstance(v, int):
172
+ v = str(v)
173
+ data.add_field(k, v)
174
+ args["data"] = data
175
+
176
+ # Pass a `bytes` or `str` parameter directly in the body to support
177
+ # other content types than Json when `body` argument is provided
178
+ # in serialized form
179
+ elif isinstance(body, str) or isinstance(body, bytes):
180
+ args["data"] = body
181
+ else:
182
+ # Cannot generate the request from given parameters
183
+ msg = """Cannot prepare a request message for provided
184
+ arguments. Please check that your arguments match
185
+ declared content type."""
186
+ raise ApiException(status=0, reason=msg)
187
+
188
+ pool_manager: Union[aiohttp.ClientSession, aiohttp_retry.RetryClient]
189
+
190
+ # https pool manager
191
+ if self.pool_manager is None:
192
+ self.pool_manager = aiohttp.ClientSession(
193
+ connector=aiohttp.TCPConnector(limit=self.maxsize, ssl=self.ssl_context),
194
+ trust_env=True,
195
+ )
196
+ pool_manager = self.pool_manager
197
+
198
+ if self.retries is not None and method in ALLOW_RETRY_METHODS:
199
+ if self.retry_client is None:
200
+ self.retry_client = aiohttp_retry.RetryClient(
201
+ client_session=self.pool_manager,
202
+ retry_options=aiohttp_retry.ExponentialRetry(
203
+ attempts=self.retries,
204
+ factor=2.0,
205
+ start_timeout=0.1,
206
+ max_timeout=120.0
207
+ )
208
+ )
209
+ pool_manager = self.retry_client
210
+
211
+ r = await pool_manager.request(**args)
212
+
213
+ return RESTResponse(r)
@@ -0,0 +1,25 @@
1
+ Metadata-Version: 2.4
2
+ Name: aind-metadata-service-async-client
3
+ Version: 1.0.7
4
+ Summary: aind-metadata-service
5
+ Home-page:
6
+ Author: OpenAPI Generator community
7
+ Author-email: team@openapitools.org
8
+ Keywords: OpenAPI,OpenAPI-Generator,aind-metadata-service
9
+ Description-Content-Type: text/markdown
10
+ Requires-Dist: urllib3<3.0.0,>=2.1.0
11
+ Requires-Dist: python-dateutil>=2.8.2
12
+ Requires-Dist: aiohttp>=3.8.4
13
+ Requires-Dist: aiohttp-retry>=2.8.3
14
+ Requires-Dist: pydantic>=2
15
+ Requires-Dist: typing-extensions>=4.7.1
16
+ Dynamic: author
17
+ Dynamic: author-email
18
+ Dynamic: description
19
+ Dynamic: description-content-type
20
+ Dynamic: keywords
21
+ Dynamic: requires-dist
22
+ Dynamic: summary
23
+
24
+ ## aind-metadata-service Service to pull data from example backend.
25
+
@@ -0,0 +1,33 @@
1
+ aind_metadata_service_async_client/__init__.py,sha256=V60TCybQ7Vnn04eYRusHcXN7FuC40uF69Y1rUDD9AtQ,2858
2
+ aind_metadata_service_async_client/api_client.py,sha256=QZg-OsoOn0A44sqYuZPTVs5PmSUP3nrq8P-3cmZVP40,27680
3
+ aind_metadata_service_async_client/api_response.py,sha256=eMxw1mpmJcoGZ3gs9z6jM4oYoZ10Gjk333s9sKxGv7s,652
4
+ aind_metadata_service_async_client/configuration.py,sha256=dx9kr6PiqF-WsqmN-1T3Y1221Qemj6ky4z6Mr6nuxpc,17633
5
+ aind_metadata_service_async_client/exceptions.py,sha256=J2pO34xzbEsOvZoNJtDaH8-dBMG14l4NMtbpZcoSFcU,6450
6
+ aind_metadata_service_async_client/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
+ aind_metadata_service_async_client/rest.py,sha256=U183Ou1oA2g-wUsYTk1eqApt0Adi9GZyPHUqB8GJq7Q,7291
8
+ aind_metadata_service_async_client/api/__init__.py,sha256=d96ze7sPL5kXXzyh_qEhQY8xwPQP7HlPQzA_hU2u4Ck,204
9
+ aind_metadata_service_async_client/api/default_api.py,sha256=HDqZIuPKs6QvKTVrkqMimCR5BpS_JcstxIeFyGo2y3c,145771
10
+ aind_metadata_service_async_client/api/healthcheck_api.py,sha256=5Iia7RDFVakWHZd92qTVGGLcVe_01fIj0YIEZGVmVZY,10642
11
+ aind_metadata_service_async_client/models/__init__.py,sha256=K9aEeMLPF5O0709RNphreU8D-ZMiL426U_AHjcpjTlQ,1978
12
+ aind_metadata_service_async_client/models/anyof_schema1_validator.py,sha256=3wNO0tq5GxoN67q3vwj7BBSamihX_UYMETcTRY4XuRQ,5012
13
+ aind_metadata_service_async_client/models/average_hit_rate.py,sha256=N1yG6sMAl6PtUCcrRwWAluFYPNhyIaYCmj_S5eOIrcY,4970
14
+ aind_metadata_service_async_client/models/fov_coordinate_ap.py,sha256=wK37y5IMJIbdJt9L9NfOeObiw12avRS2laoXEhxzoIQ,4976
15
+ aind_metadata_service_async_client/models/fov_coordinate_ml.py,sha256=RmQabTx_mOQlBtbxix0JPuyctw2HuiLJjZk3593rtKI,4208
16
+ aind_metadata_service_async_client/models/health_check.py,sha256=2ukPxmeJ_bx8ssigF2su-GAI9ieupdWkM4M8b1248zM,3059
17
+ aind_metadata_service_async_client/models/hit_rate_trials010.py,sha256=ZX4-IUvQMTWiC85D-2NaP8a6dkPDRKiTNvhJ3KbgYMA,4982
18
+ aind_metadata_service_async_client/models/hit_rate_trials2040.py,sha256=O6Phra0bYJt5AGHnaz91VwKr7fahd5Vgt53tNzlXZXE,4988
19
+ aind_metadata_service_async_client/models/http_validation_error.py,sha256=l_4P8eaQtFvFWNcihSpIjbz60OCgibqkjlEuyRYIe-Y,3003
20
+ aind_metadata_service_async_client/models/input_source.py,sha256=1c_amjXDriBTLEg6tWl3ApzKXc4g1Q7-CVjJflnd_f4,4700
21
+ aind_metadata_service_async_client/models/job_settings.py,sha256=uu9-Clan47HNR67T1oIT19QSA0_nyzPbW9vHqeYix-I,19877
22
+ aind_metadata_service_async_client/models/job_settings_starting_lickport_position_inner.py,sha256=pUnIwM_0QdZDTBMcQ_gEgjCFj7eqoay1hdddFFeTu2I,5024
23
+ aind_metadata_service_async_client/models/output_directory.py,sha256=vLnuSD0RuxzUqlHnfBuLDaOwgpe0slh2_LeSINp3kco,3815
24
+ aind_metadata_service_async_client/models/slims_workflow.py,sha256=aoEkKGWaY05Bap1nbFTi0r1aB8esz6kgKkMXmtMR4Cc,914
25
+ aind_metadata_service_async_client/models/total_hits.py,sha256=EebACMYIoh8PwySE7aFYMU6AhpFAxA1KLyknNMw_VXY,4940
26
+ aind_metadata_service_async_client/models/trial_num.py,sha256=YAe9aW-B1T6J0zrnlBwAvNBdGFAdhy4Q73D9xNIEf0E,4934
27
+ aind_metadata_service_async_client/models/user_settings_config_file.py,sha256=WFrDztsFDCmyiMqTZzuf9FasR-Sc2TbYHbnmyExHP3Y,3829
28
+ aind_metadata_service_async_client/models/validation_error.py,sha256=DlTlLNEkLl7YpK-vprLRsHnkp7rGY3jzQ6sjjB-Fo9I,3095
29
+ aind_metadata_service_async_client/models/validation_error_loc_inner.py,sha256=_69nuKsO5R6EOGTCRWHk6WD7_C6Vvz8SN5aaDU2HUtY,4864
30
+ aind_metadata_service_async_client-1.0.7.dist-info/METADATA,sha256=SlYVI0DsaKCrDcvSIOXi25Kjdb2d1Imnu_N0KfWBr6A,732
31
+ aind_metadata_service_async_client-1.0.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
32
+ aind_metadata_service_async_client-1.0.7.dist-info/top_level.txt,sha256=qZsXHVGh-0uni82lQ-rEHhHR5xE4vTvVjd5Km-m4GJE,35
33
+ aind_metadata_service_async_client-1.0.7.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1 @@
1
+ aind_metadata_service_async_client