elastly 0.1.0__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.
Files changed (49) hide show
  1. elastly/__init__.py +117 -0
  2. elastly/api/__init__.py +7 -0
  3. elastly/api/ingest_api.py +1167 -0
  4. elastly/api/prices_api.py +349 -0
  5. elastly/api/writebacks_api.py +618 -0
  6. elastly/api_client.py +805 -0
  7. elastly/api_response.py +21 -0
  8. elastly/configuration.py +606 -0
  9. elastly/exceptions.py +219 -0
  10. elastly/models/__init__.py +49 -0
  11. elastly/models/ack_writebacks_response.py +94 -0
  12. elastly/models/api_error.py +93 -0
  13. elastly/models/api_error_error.py +102 -0
  14. elastly/models/batch_created_response.py +91 -0
  15. elastly/models/batch_status_response.py +110 -0
  16. elastly/models/claim_writebacks_request.py +90 -0
  17. elastly/models/claim_writebacks_response.py +97 -0
  18. elastly/models/claim_writebacks_response_tasks_inner.py +122 -0
  19. elastly/models/commit_batch_response.py +89 -0
  20. elastly/models/prices_request.py +98 -0
  21. elastly/models/prices_request_lines_inner.py +114 -0
  22. elastly/models/prices_response.py +97 -0
  23. elastly/models/prices_response_lines_inner.py +138 -0
  24. elastly/models/prices_response_lines_inner_one_of.py +131 -0
  25. elastly/models/prices_response_lines_inner_one_of1.py +105 -0
  26. elastly/models/prices_response_lines_inner_one_of_explanation.py +121 -0
  27. elastly/models/prices_response_lines_inner_one_of_explanation_drivers_inner.py +102 -0
  28. elastly/models/prices_response_lines_inner_one_of_reason_inner.py +95 -0
  29. elastly/models/stage_records_request.py +166 -0
  30. elastly/models/stage_records_request_one_of.py +107 -0
  31. elastly/models/stage_records_request_one_of1.py +107 -0
  32. elastly/models/stage_records_request_one_of1_records_inner.py +126 -0
  33. elastly/models/stage_records_request_one_of2.py +107 -0
  34. elastly/models/stage_records_request_one_of2_records_inner.py +160 -0
  35. elastly/models/stage_records_request_one_of2_records_inner_lines_inner.py +119 -0
  36. elastly/models/stage_records_request_one_of3.py +107 -0
  37. elastly/models/stage_records_request_one_of3_records_inner.py +131 -0
  38. elastly/models/stage_records_request_one_of3_records_inner_lines_inner.py +98 -0
  39. elastly/models/stage_records_request_one_of_records_inner.py +118 -0
  40. elastly/models/stage_records_response.py +90 -0
  41. elastly/models/writeback_ack_request.py +98 -0
  42. elastly/models/writeback_ack_request_results_inner.py +93 -0
  43. elastly/py.typed +0 -0
  44. elastly/rest.py +264 -0
  45. elastly-0.1.0.dist-info/METADATA +100 -0
  46. elastly-0.1.0.dist-info/RECORD +49 -0
  47. elastly-0.1.0.dist-info/WHEEL +5 -0
  48. elastly-0.1.0.dist-info/licenses/LICENSE +21 -0
  49. elastly-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,349 @@
1
+ """
2
+ Elastly API
3
+
4
+ Elastly public API v1: price serving, canonical ingest, write-back claims and webhooks. Authenticate every request with an API key: Authorization: Bearer elastly_live_...
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: support@elastly.io
8
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
9
+
10
+ Do not edit the class manually.
11
+ """ # noqa: E501
12
+
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_extensions import Annotated
21
+ from elastly.models.prices_request import PricesRequest
22
+ from elastly.models.prices_response import PricesResponse
23
+
24
+ from elastly.api_client import ApiClient, RequestSerialized
25
+ from elastly.api_response import ApiResponse
26
+ from elastly.rest import RESTResponseType
27
+
28
+
29
+ class PricesApi:
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_prices(
44
+ self,
45
+ idempotency_key: Annotated[StrictStr, Field(description="Unique key for this logical request. Retries must reuse the same key; a replay returns the stored response.")],
46
+ prices_request: PricesRequest,
47
+ _request_timeout: Union[
48
+ None,
49
+ Annotated[StrictFloat, Field(gt=0)],
50
+ Tuple[
51
+ Annotated[StrictFloat, Field(gt=0)],
52
+ Annotated[StrictFloat, Field(gt=0)]
53
+ ]
54
+ ] = None,
55
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
56
+ _content_type: Optional[StrictStr] = None,
57
+ _headers: Optional[Dict[StrictStr, Any]] = None,
58
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
59
+ ) -> PricesResponse:
60
+ """Price up to 100 lines in one idempotent call
61
+
62
+ Requires an erp-scope key. Every response line is either a priced output (ok: true) or a typed per-line error (ok: false); a single bad line never fails the batch.
63
+
64
+ :param idempotency_key: Unique key for this logical request. Retries must reuse the same key; a replay returns the stored response. (required)
65
+ :type idempotency_key: str
66
+ :param prices_request: (required)
67
+ :type prices_request: PricesRequest
68
+ :param _request_timeout: timeout setting for this request. If one
69
+ number provided, it will be total request
70
+ timeout. It can also be a pair (tuple) of
71
+ (connection, read) timeouts.
72
+ :type _request_timeout: int, tuple(int, int), optional
73
+ :param _request_auth: set to override the auth_settings for an a single
74
+ request; this effectively ignores the
75
+ authentication in the spec for a single request.
76
+ :type _request_auth: dict, optional
77
+ :param _content_type: force content-type for the request.
78
+ :type _content_type: str, Optional
79
+ :param _headers: set to override the headers for a single
80
+ request; this effectively ignores the headers
81
+ in the spec for a single request.
82
+ :type _headers: dict, optional
83
+ :param _host_index: set to override the host_index for a single
84
+ request; this effectively ignores the host_index
85
+ in the spec for a single request.
86
+ :type _host_index: int, optional
87
+ :return: Returns the result object.
88
+ """ # noqa: E501
89
+
90
+ _param = self._get_prices_serialize(
91
+ idempotency_key=idempotency_key,
92
+ prices_request=prices_request,
93
+ _request_auth=_request_auth,
94
+ _content_type=_content_type,
95
+ _headers=_headers,
96
+ _host_index=_host_index
97
+ )
98
+
99
+ _response_types_map: Dict[str, Optional[str]] = {
100
+ '200': "PricesResponse",
101
+ '401': "ApiError",
102
+ '402': "ApiError",
103
+ '403': "ApiError",
104
+ '409': "ApiError",
105
+ '422': "ApiError",
106
+ '429': "ApiError",
107
+ '500': "ApiError",
108
+ }
109
+ response_data = self.api_client.call_api(
110
+ *_param,
111
+ _request_timeout=_request_timeout
112
+ )
113
+ response_data.read()
114
+ return self.api_client.response_deserialize(
115
+ response_data=response_data,
116
+ response_types_map=_response_types_map,
117
+ ).data
118
+
119
+
120
+ @validate_call
121
+ def get_prices_with_http_info(
122
+ self,
123
+ idempotency_key: Annotated[StrictStr, Field(description="Unique key for this logical request. Retries must reuse the same key; a replay returns the stored response.")],
124
+ prices_request: PricesRequest,
125
+ _request_timeout: Union[
126
+ None,
127
+ Annotated[StrictFloat, Field(gt=0)],
128
+ Tuple[
129
+ Annotated[StrictFloat, Field(gt=0)],
130
+ Annotated[StrictFloat, Field(gt=0)]
131
+ ]
132
+ ] = None,
133
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
134
+ _content_type: Optional[StrictStr] = None,
135
+ _headers: Optional[Dict[StrictStr, Any]] = None,
136
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
137
+ ) -> ApiResponse[PricesResponse]:
138
+ """Price up to 100 lines in one idempotent call
139
+
140
+ Requires an erp-scope key. Every response line is either a priced output (ok: true) or a typed per-line error (ok: false); a single bad line never fails the batch.
141
+
142
+ :param idempotency_key: Unique key for this logical request. Retries must reuse the same key; a replay returns the stored response. (required)
143
+ :type idempotency_key: str
144
+ :param prices_request: (required)
145
+ :type prices_request: PricesRequest
146
+ :param _request_timeout: timeout setting for this request. If one
147
+ number provided, it will be total request
148
+ timeout. It can also be a pair (tuple) of
149
+ (connection, read) timeouts.
150
+ :type _request_timeout: int, tuple(int, int), optional
151
+ :param _request_auth: set to override the auth_settings for an a single
152
+ request; this effectively ignores the
153
+ authentication in the spec for a single request.
154
+ :type _request_auth: dict, optional
155
+ :param _content_type: force content-type for the request.
156
+ :type _content_type: str, Optional
157
+ :param _headers: set to override the headers for a single
158
+ request; this effectively ignores the headers
159
+ in the spec for a single request.
160
+ :type _headers: dict, optional
161
+ :param _host_index: set to override the host_index for a single
162
+ request; this effectively ignores the host_index
163
+ in the spec for a single request.
164
+ :type _host_index: int, optional
165
+ :return: Returns the result object.
166
+ """ # noqa: E501
167
+
168
+ _param = self._get_prices_serialize(
169
+ idempotency_key=idempotency_key,
170
+ prices_request=prices_request,
171
+ _request_auth=_request_auth,
172
+ _content_type=_content_type,
173
+ _headers=_headers,
174
+ _host_index=_host_index
175
+ )
176
+
177
+ _response_types_map: Dict[str, Optional[str]] = {
178
+ '200': "PricesResponse",
179
+ '401': "ApiError",
180
+ '402': "ApiError",
181
+ '403': "ApiError",
182
+ '409': "ApiError",
183
+ '422': "ApiError",
184
+ '429': "ApiError",
185
+ '500': "ApiError",
186
+ }
187
+ response_data = self.api_client.call_api(
188
+ *_param,
189
+ _request_timeout=_request_timeout
190
+ )
191
+ response_data.read()
192
+ return self.api_client.response_deserialize(
193
+ response_data=response_data,
194
+ response_types_map=_response_types_map,
195
+ )
196
+
197
+
198
+ @validate_call
199
+ def get_prices_without_preload_content(
200
+ self,
201
+ idempotency_key: Annotated[StrictStr, Field(description="Unique key for this logical request. Retries must reuse the same key; a replay returns the stored response.")],
202
+ prices_request: PricesRequest,
203
+ _request_timeout: Union[
204
+ None,
205
+ Annotated[StrictFloat, Field(gt=0)],
206
+ Tuple[
207
+ Annotated[StrictFloat, Field(gt=0)],
208
+ Annotated[StrictFloat, Field(gt=0)]
209
+ ]
210
+ ] = None,
211
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
212
+ _content_type: Optional[StrictStr] = None,
213
+ _headers: Optional[Dict[StrictStr, Any]] = None,
214
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
215
+ ) -> RESTResponseType:
216
+ """Price up to 100 lines in one idempotent call
217
+
218
+ Requires an erp-scope key. Every response line is either a priced output (ok: true) or a typed per-line error (ok: false); a single bad line never fails the batch.
219
+
220
+ :param idempotency_key: Unique key for this logical request. Retries must reuse the same key; a replay returns the stored response. (required)
221
+ :type idempotency_key: str
222
+ :param prices_request: (required)
223
+ :type prices_request: PricesRequest
224
+ :param _request_timeout: timeout setting for this request. If one
225
+ number provided, it will be total request
226
+ timeout. It can also be a pair (tuple) of
227
+ (connection, read) timeouts.
228
+ :type _request_timeout: int, tuple(int, int), optional
229
+ :param _request_auth: set to override the auth_settings for an a single
230
+ request; this effectively ignores the
231
+ authentication in the spec for a single request.
232
+ :type _request_auth: dict, optional
233
+ :param _content_type: force content-type for the request.
234
+ :type _content_type: str, Optional
235
+ :param _headers: set to override the headers for a single
236
+ request; this effectively ignores the headers
237
+ in the spec for a single request.
238
+ :type _headers: dict, optional
239
+ :param _host_index: set to override the host_index for a single
240
+ request; this effectively ignores the host_index
241
+ in the spec for a single request.
242
+ :type _host_index: int, optional
243
+ :return: Returns the result object.
244
+ """ # noqa: E501
245
+
246
+ _param = self._get_prices_serialize(
247
+ idempotency_key=idempotency_key,
248
+ prices_request=prices_request,
249
+ _request_auth=_request_auth,
250
+ _content_type=_content_type,
251
+ _headers=_headers,
252
+ _host_index=_host_index
253
+ )
254
+
255
+ _response_types_map: Dict[str, Optional[str]] = {
256
+ '200': "PricesResponse",
257
+ '401': "ApiError",
258
+ '402': "ApiError",
259
+ '403': "ApiError",
260
+ '409': "ApiError",
261
+ '422': "ApiError",
262
+ '429': "ApiError",
263
+ '500': "ApiError",
264
+ }
265
+ response_data = self.api_client.call_api(
266
+ *_param,
267
+ _request_timeout=_request_timeout
268
+ )
269
+ return response_data.response
270
+
271
+
272
+ def _get_prices_serialize(
273
+ self,
274
+ idempotency_key,
275
+ prices_request,
276
+ _request_auth,
277
+ _content_type,
278
+ _headers,
279
+ _host_index,
280
+ ) -> RequestSerialized:
281
+
282
+ _host = None
283
+
284
+ _collection_formats: Dict[str, str] = {
285
+ }
286
+
287
+ _path_params: Dict[str, str] = {}
288
+ _query_params: List[Tuple[str, str]] = []
289
+ _header_params: Dict[str, Optional[str]] = _headers or {}
290
+ _form_params: List[Tuple[str, str]] = []
291
+ _files: Dict[
292
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
293
+ ] = {}
294
+ _body_params: Optional[bytes] = None
295
+
296
+ # process the path parameters
297
+ # process the query parameters
298
+ # process the header parameters
299
+ if idempotency_key is not None:
300
+ _header_params['Idempotency-Key'] = idempotency_key
301
+ # process the form parameters
302
+ # process the body parameter
303
+ if prices_request is not None:
304
+ _body_params = prices_request
305
+
306
+
307
+ # set the HTTP header `Accept`
308
+ if 'Accept' not in _header_params:
309
+ _header_params['Accept'] = self.api_client.select_header_accept(
310
+ [
311
+ 'application/json'
312
+ ]
313
+ )
314
+
315
+ # set the HTTP header `Content-Type`
316
+ if _content_type:
317
+ _header_params['Content-Type'] = _content_type
318
+ else:
319
+ _default_content_type = (
320
+ self.api_client.select_header_content_type(
321
+ [
322
+ 'application/json'
323
+ ]
324
+ )
325
+ )
326
+ if _default_content_type is not None:
327
+ _header_params['Content-Type'] = _default_content_type
328
+
329
+ # authentication setting
330
+ _auth_settings: List[str] = [
331
+ 'apiKey'
332
+ ]
333
+
334
+ return self.api_client.param_serialize(
335
+ method='POST',
336
+ resource_path='/api/v1/prices',
337
+ path_params=_path_params,
338
+ query_params=_query_params,
339
+ header_params=_header_params,
340
+ body=_body_params,
341
+ post_params=_form_params,
342
+ files=_files,
343
+ auth_settings=_auth_settings,
344
+ collection_formats=_collection_formats,
345
+ _host=_host,
346
+ _request_auth=_request_auth
347
+ )
348
+
349
+