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
elastly/exceptions.py ADDED
@@ -0,0 +1,219 @@
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
+ from typing import Any, Optional
15
+ from typing_extensions import Self
16
+
17
+ class OpenApiException(Exception):
18
+ """The base exception class for all OpenAPIExceptions"""
19
+
20
+
21
+ class ApiTypeError(OpenApiException, TypeError):
22
+ def __init__(self, msg, path_to_item=None, valid_classes=None,
23
+ key_type=None) -> None:
24
+ """ Raises an exception for TypeErrors
25
+
26
+ Args:
27
+ msg (str): the exception message
28
+
29
+ Keyword Args:
30
+ path_to_item (list): a list of keys an indices to get to the
31
+ current_item
32
+ None if unset
33
+ valid_classes (tuple): the primitive classes that current item
34
+ should be an instance of
35
+ None if unset
36
+ key_type (bool): False if our value is a value in a dict
37
+ True if it is a key in a dict
38
+ False if our item is an item in a list
39
+ None if unset
40
+ """
41
+ self.path_to_item = path_to_item
42
+ self.valid_classes = valid_classes
43
+ self.key_type = key_type
44
+ full_msg = msg
45
+ if path_to_item:
46
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
47
+ super(ApiTypeError, self).__init__(full_msg)
48
+
49
+
50
+ class ApiValueError(OpenApiException, ValueError):
51
+ def __init__(self, msg, path_to_item=None) -> None:
52
+ """
53
+ Args:
54
+ msg (str): the exception message
55
+
56
+ Keyword Args:
57
+ path_to_item (list) the path to the exception in the
58
+ received_data dict. None if unset
59
+ """
60
+
61
+ self.path_to_item = path_to_item
62
+ full_msg = msg
63
+ if path_to_item:
64
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
65
+ super(ApiValueError, self).__init__(full_msg)
66
+
67
+
68
+ class ApiAttributeError(OpenApiException, AttributeError):
69
+ def __init__(self, msg, path_to_item=None) -> None:
70
+ """
71
+ Raised when an attribute reference or assignment fails.
72
+
73
+ Args:
74
+ msg (str): the exception message
75
+
76
+ Keyword Args:
77
+ path_to_item (None/list) the path to the exception in the
78
+ received_data dict
79
+ """
80
+ self.path_to_item = path_to_item
81
+ full_msg = msg
82
+ if path_to_item:
83
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
84
+ super(ApiAttributeError, self).__init__(full_msg)
85
+
86
+
87
+ class ApiKeyError(OpenApiException, KeyError):
88
+ def __init__(self, msg, path_to_item=None) -> None:
89
+ """
90
+ Args:
91
+ msg (str): the exception message
92
+
93
+ Keyword Args:
94
+ path_to_item (None/list) the path to the exception in the
95
+ received_data dict
96
+ """
97
+ self.path_to_item = path_to_item
98
+ full_msg = msg
99
+ if path_to_item:
100
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
101
+ super(ApiKeyError, self).__init__(full_msg)
102
+
103
+
104
+ class ApiException(OpenApiException):
105
+
106
+ def __init__(
107
+ self,
108
+ status=None,
109
+ reason=None,
110
+ http_resp=None,
111
+ *,
112
+ body: Optional[str] = None,
113
+ data: Optional[Any] = None,
114
+ ) -> None:
115
+ self.status = status
116
+ self.reason = reason
117
+ self.body = body
118
+ self.data = data
119
+ self.headers = None
120
+
121
+ if http_resp:
122
+ if self.status is None:
123
+ self.status = http_resp.status
124
+ if self.reason is None:
125
+ self.reason = http_resp.reason
126
+ if self.body is None:
127
+ try:
128
+ self.body = http_resp.data.decode('utf-8')
129
+ except Exception:
130
+ pass
131
+ self.headers = http_resp.headers
132
+
133
+ @classmethod
134
+ def from_response(
135
+ cls,
136
+ *,
137
+ http_resp,
138
+ body: Optional[str],
139
+ data: Optional[Any],
140
+ ) -> Self:
141
+ if http_resp.status == 400:
142
+ raise BadRequestException(http_resp=http_resp, body=body, data=data)
143
+
144
+ if http_resp.status == 401:
145
+ raise UnauthorizedException(http_resp=http_resp, body=body, data=data)
146
+
147
+ if http_resp.status == 403:
148
+ raise ForbiddenException(http_resp=http_resp, body=body, data=data)
149
+
150
+ if http_resp.status == 404:
151
+ raise NotFoundException(http_resp=http_resp, body=body, data=data)
152
+
153
+ # Added new conditions for 409 and 422
154
+ if http_resp.status == 409:
155
+ raise ConflictException(http_resp=http_resp, body=body, data=data)
156
+
157
+ if http_resp.status == 422:
158
+ raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data)
159
+
160
+ if 500 <= http_resp.status <= 599:
161
+ raise ServiceException(http_resp=http_resp, body=body, data=data)
162
+ raise ApiException(http_resp=http_resp, body=body, data=data)
163
+
164
+ def __str__(self):
165
+ """Custom error messages for exception"""
166
+ error_message = "({0})\n"\
167
+ "Reason: {1}\n".format(self.status, self.reason)
168
+ if self.headers:
169
+ error_message += "HTTP response headers: {0}\n".format(
170
+ self.headers)
171
+
172
+ if self.body:
173
+ error_message += "HTTP response body: {0}\n".format(self.body)
174
+
175
+ if self.data:
176
+ error_message += "HTTP response data: {0}\n".format(self.data)
177
+
178
+ return error_message
179
+
180
+
181
+ class BadRequestException(ApiException):
182
+ pass
183
+
184
+
185
+ class NotFoundException(ApiException):
186
+ pass
187
+
188
+
189
+ class UnauthorizedException(ApiException):
190
+ pass
191
+
192
+
193
+ class ForbiddenException(ApiException):
194
+ pass
195
+
196
+
197
+ class ServiceException(ApiException):
198
+ pass
199
+
200
+
201
+ class ConflictException(ApiException):
202
+ """Exception for HTTP 409 Conflict."""
203
+ pass
204
+
205
+
206
+ class UnprocessableEntityException(ApiException):
207
+ """Exception for HTTP 422 Unprocessable Entity."""
208
+ pass
209
+
210
+
211
+ def render_path(path_to_item):
212
+ """Returns a string representation of a path"""
213
+ result = ""
214
+ for pth in path_to_item:
215
+ if isinstance(pth, int):
216
+ result += "[{0}]".format(pth)
217
+ else:
218
+ result += "['{0}']".format(pth)
219
+ return result
@@ -0,0 +1,49 @@
1
+ # coding: utf-8
2
+
3
+ # flake8: noqa
4
+ """
5
+ Elastly API
6
+
7
+ Elastly public API v1: price serving, canonical ingest, write-back claims and webhooks. Authenticate every request with an API key: Authorization: Bearer elastly_live_...
8
+
9
+ The version of the OpenAPI document: 1.0.0
10
+ Contact: support@elastly.io
11
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
12
+
13
+ Do not edit the class manually.
14
+ """ # noqa: E501
15
+
16
+ # import models into model package
17
+ from elastly.models.ack_writebacks_response import AckWritebacksResponse
18
+ from elastly.models.api_error import ApiError
19
+ from elastly.models.api_error_error import ApiErrorError
20
+ from elastly.models.batch_created_response import BatchCreatedResponse
21
+ from elastly.models.batch_status_response import BatchStatusResponse
22
+ from elastly.models.claim_writebacks_request import ClaimWritebacksRequest
23
+ from elastly.models.claim_writebacks_response import ClaimWritebacksResponse
24
+ from elastly.models.claim_writebacks_response_tasks_inner import ClaimWritebacksResponseTasksInner
25
+ from elastly.models.commit_batch_response import CommitBatchResponse
26
+ from elastly.models.prices_request import PricesRequest
27
+ from elastly.models.prices_request_lines_inner import PricesRequestLinesInner
28
+ from elastly.models.prices_response import PricesResponse
29
+ from elastly.models.prices_response_lines_inner import PricesResponseLinesInner
30
+ from elastly.models.prices_response_lines_inner_one_of import PricesResponseLinesInnerOneOf
31
+ from elastly.models.prices_response_lines_inner_one_of1 import PricesResponseLinesInnerOneOf1
32
+ from elastly.models.prices_response_lines_inner_one_of_explanation import PricesResponseLinesInnerOneOfExplanation
33
+ from elastly.models.prices_response_lines_inner_one_of_explanation_drivers_inner import PricesResponseLinesInnerOneOfExplanationDriversInner
34
+ from elastly.models.prices_response_lines_inner_one_of_reason_inner import PricesResponseLinesInnerOneOfReasonInner
35
+ from elastly.models.stage_records_request import StageRecordsRequest
36
+ from elastly.models.stage_records_request_one_of import StageRecordsRequestOneOf
37
+ from elastly.models.stage_records_request_one_of1 import StageRecordsRequestOneOf1
38
+ from elastly.models.stage_records_request_one_of1_records_inner import StageRecordsRequestOneOf1RecordsInner
39
+ from elastly.models.stage_records_request_one_of2 import StageRecordsRequestOneOf2
40
+ from elastly.models.stage_records_request_one_of2_records_inner import StageRecordsRequestOneOf2RecordsInner
41
+ from elastly.models.stage_records_request_one_of2_records_inner_lines_inner import StageRecordsRequestOneOf2RecordsInnerLinesInner
42
+ from elastly.models.stage_records_request_one_of3 import StageRecordsRequestOneOf3
43
+ from elastly.models.stage_records_request_one_of3_records_inner import StageRecordsRequestOneOf3RecordsInner
44
+ from elastly.models.stage_records_request_one_of3_records_inner_lines_inner import StageRecordsRequestOneOf3RecordsInnerLinesInner
45
+ from elastly.models.stage_records_request_one_of_records_inner import StageRecordsRequestOneOfRecordsInner
46
+ from elastly.models.stage_records_response import StageRecordsResponse
47
+ from elastly.models.writeback_ack_request import WritebackAckRequest
48
+ from elastly.models.writeback_ack_request_results_inner import WritebackAckRequestResultsInner
49
+
@@ -0,0 +1,94 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Elastly API
5
+
6
+ Elastly public API v1: price serving, canonical ingest, write-back claims and webhooks. Authenticate every request with an API key: Authorization: Bearer elastly_live_...
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: support@elastly.io
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict, Field
22
+ from typing import Any, ClassVar, Dict, List
23
+ from typing_extensions import Annotated
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+ from pydantic_core import to_jsonable_python
27
+
28
+ class AckWritebacksResponse(BaseModel):
29
+ """
30
+ AckWritebacksResponse
31
+ """ # noqa: E501
32
+ applied: Annotated[int, Field(le=9007199254740991, strict=True, ge=-9007199254740991)]
33
+ failed: Annotated[int, Field(le=9007199254740991, strict=True, ge=-9007199254740991)]
34
+ expired: Annotated[int, Field(le=9007199254740991, strict=True, ge=-9007199254740991)]
35
+ __properties: ClassVar[List[str]] = ["applied", "failed", "expired"]
36
+
37
+ model_config = ConfigDict(
38
+ validate_by_name=True,
39
+ validate_by_alias=True,
40
+ validate_assignment=True,
41
+ protected_namespaces=(),
42
+ )
43
+
44
+
45
+ def to_str(self) -> str:
46
+ """Returns the string representation of the model using alias"""
47
+ return pprint.pformat(self.model_dump(by_alias=True))
48
+
49
+ def to_json(self) -> str:
50
+ """Returns the JSON representation of the model using alias"""
51
+ return json.dumps(to_jsonable_python(self.to_dict()))
52
+
53
+ @classmethod
54
+ def from_json(cls, json_str: str) -> Optional[Self]:
55
+ """Create an instance of AckWritebacksResponse from a JSON string"""
56
+ return cls.from_dict(json.loads(json_str))
57
+
58
+ def to_dict(self) -> Dict[str, Any]:
59
+ """Return the dictionary representation of the model using alias.
60
+
61
+ This has the following differences from calling pydantic's
62
+ `self.model_dump(by_alias=True)`:
63
+
64
+ * `None` is only added to the output dict for nullable fields that
65
+ were set at model initialization. Other fields with value `None`
66
+ are ignored.
67
+ """
68
+ excluded_fields: Set[str] = set([
69
+ ])
70
+
71
+ _dict = self.model_dump(
72
+ by_alias=True,
73
+ exclude=excluded_fields,
74
+ exclude_none=True,
75
+ )
76
+ return _dict
77
+
78
+ @classmethod
79
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
80
+ """Create an instance of AckWritebacksResponse from a dict"""
81
+ if obj is None:
82
+ return None
83
+
84
+ if not isinstance(obj, dict):
85
+ return cls.model_validate(obj)
86
+
87
+ _obj = cls.model_validate({
88
+ "applied": obj.get("applied"),
89
+ "failed": obj.get("failed"),
90
+ "expired": obj.get("expired")
91
+ })
92
+ return _obj
93
+
94
+
@@ -0,0 +1,93 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Elastly API
5
+
6
+ Elastly public API v1: price serving, canonical ingest, write-back claims and webhooks. Authenticate every request with an API key: Authorization: Bearer elastly_live_...
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: support@elastly.io
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict
22
+ from typing import Any, ClassVar, Dict, List
23
+ from elastly.models.api_error_error import ApiErrorError
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+ from pydantic_core import to_jsonable_python
27
+
28
+ class ApiError(BaseModel):
29
+ """
30
+ ApiError
31
+ """ # noqa: E501
32
+ error: ApiErrorError
33
+ __properties: ClassVar[List[str]] = ["error"]
34
+
35
+ model_config = ConfigDict(
36
+ validate_by_name=True,
37
+ validate_by_alias=True,
38
+ validate_assignment=True,
39
+ protected_namespaces=(),
40
+ )
41
+
42
+
43
+ def to_str(self) -> str:
44
+ """Returns the string representation of the model using alias"""
45
+ return pprint.pformat(self.model_dump(by_alias=True))
46
+
47
+ def to_json(self) -> str:
48
+ """Returns the JSON representation of the model using alias"""
49
+ return json.dumps(to_jsonable_python(self.to_dict()))
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
+ """Create an instance of ApiError from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ """
66
+ excluded_fields: Set[str] = set([
67
+ ])
68
+
69
+ _dict = self.model_dump(
70
+ by_alias=True,
71
+ exclude=excluded_fields,
72
+ exclude_none=True,
73
+ )
74
+ # override the default output from pydantic by calling `to_dict()` of error
75
+ if self.error:
76
+ _dict['error'] = self.error.to_dict()
77
+ return _dict
78
+
79
+ @classmethod
80
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
81
+ """Create an instance of ApiError from a dict"""
82
+ if obj is None:
83
+ return None
84
+
85
+ if not isinstance(obj, dict):
86
+ return cls.model_validate(obj)
87
+
88
+ _obj = cls.model_validate({
89
+ "error": ApiErrorError.from_dict(obj["error"]) if obj.get("error") is not None else None
90
+ })
91
+ return _obj
92
+
93
+
@@ -0,0 +1,102 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Elastly API
5
+
6
+ Elastly public API v1: price serving, canonical ingest, write-back claims and webhooks. Authenticate every request with an API key: Authorization: Bearer elastly_live_...
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: support@elastly.io
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+ from pydantic_core import to_jsonable_python
26
+
27
+ class ApiErrorError(BaseModel):
28
+ """
29
+ ApiErrorError
30
+ """ # noqa: E501
31
+ code: StrictStr
32
+ message: StrictStr
33
+ param: Optional[StrictStr] = None
34
+ request_id: StrictStr = Field(alias="requestId")
35
+ __properties: ClassVar[List[str]] = ["code", "message", "param", "requestId"]
36
+
37
+ @field_validator('code')
38
+ def code_validate_enum(cls, value):
39
+ """Validates the enum"""
40
+ if value not in set(['unauthorized', 'forbidden', 'feature_not_enabled', 'subscription_inactive', 'rate_limited', 'monthly_volume_exceeded', 'invalid_request', 'invalid_json', 'unknown_product', 'unknown_customer', 'no_cost_basis', 'fx_rate_unavailable', 'fx_rate_stale', 'idempotency_key_reused', 'idempotency_key_in_flight', 'batch_not_found', 'batch_already_committed', 'batch_entity_order_violation', 'entity_not_supported', 'writeback_lease_expired', 'internal_error']):
41
+ raise ValueError("must be one of enum values ('unauthorized', 'forbidden', 'feature_not_enabled', 'subscription_inactive', 'rate_limited', 'monthly_volume_exceeded', 'invalid_request', 'invalid_json', 'unknown_product', 'unknown_customer', 'no_cost_basis', 'fx_rate_unavailable', 'fx_rate_stale', 'idempotency_key_reused', 'idempotency_key_in_flight', 'batch_not_found', 'batch_already_committed', 'batch_entity_order_violation', 'entity_not_supported', 'writeback_lease_expired', 'internal_error')")
42
+ return value
43
+
44
+ model_config = ConfigDict(
45
+ validate_by_name=True,
46
+ validate_by_alias=True,
47
+ validate_assignment=True,
48
+ protected_namespaces=(),
49
+ )
50
+
51
+
52
+ def to_str(self) -> str:
53
+ """Returns the string representation of the model using alias"""
54
+ return pprint.pformat(self.model_dump(by_alias=True))
55
+
56
+ def to_json(self) -> str:
57
+ """Returns the JSON representation of the model using alias"""
58
+ return json.dumps(to_jsonable_python(self.to_dict()))
59
+
60
+ @classmethod
61
+ def from_json(cls, json_str: str) -> Optional[Self]:
62
+ """Create an instance of ApiErrorError from a JSON string"""
63
+ return cls.from_dict(json.loads(json_str))
64
+
65
+ def to_dict(self) -> Dict[str, Any]:
66
+ """Return the dictionary representation of the model using alias.
67
+
68
+ This has the following differences from calling pydantic's
69
+ `self.model_dump(by_alias=True)`:
70
+
71
+ * `None` is only added to the output dict for nullable fields that
72
+ were set at model initialization. Other fields with value `None`
73
+ are ignored.
74
+ """
75
+ excluded_fields: Set[str] = set([
76
+ ])
77
+
78
+ _dict = self.model_dump(
79
+ by_alias=True,
80
+ exclude=excluded_fields,
81
+ exclude_none=True,
82
+ )
83
+ return _dict
84
+
85
+ @classmethod
86
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
87
+ """Create an instance of ApiErrorError from a dict"""
88
+ if obj is None:
89
+ return None
90
+
91
+ if not isinstance(obj, dict):
92
+ return cls.model_validate(obj)
93
+
94
+ _obj = cls.model_validate({
95
+ "code": obj.get("code"),
96
+ "message": obj.get("message"),
97
+ "param": obj.get("param"),
98
+ "requestId": obj.get("requestId")
99
+ })
100
+ return _obj
101
+
102
+
@@ -0,0 +1,91 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Elastly API
5
+
6
+ Elastly public API v1: price serving, canonical ingest, write-back claims and webhooks. Authenticate every request with an API key: Authorization: Bearer elastly_live_...
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: support@elastly.io
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
22
+ from typing import Any, ClassVar, Dict, List
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+ from pydantic_core import to_jsonable_python
26
+
27
+ class BatchCreatedResponse(BaseModel):
28
+ """
29
+ BatchCreatedResponse
30
+ """ # noqa: E501
31
+ batch_id: StrictStr = Field(alias="batchId")
32
+ connector_id: StrictStr = Field(alias="connectorId")
33
+ __properties: ClassVar[List[str]] = ["batchId", "connectorId"]
34
+
35
+ model_config = ConfigDict(
36
+ validate_by_name=True,
37
+ validate_by_alias=True,
38
+ validate_assignment=True,
39
+ protected_namespaces=(),
40
+ )
41
+
42
+
43
+ def to_str(self) -> str:
44
+ """Returns the string representation of the model using alias"""
45
+ return pprint.pformat(self.model_dump(by_alias=True))
46
+
47
+ def to_json(self) -> str:
48
+ """Returns the JSON representation of the model using alias"""
49
+ return json.dumps(to_jsonable_python(self.to_dict()))
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
+ """Create an instance of BatchCreatedResponse from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ """
66
+ excluded_fields: Set[str] = set([
67
+ ])
68
+
69
+ _dict = self.model_dump(
70
+ by_alias=True,
71
+ exclude=excluded_fields,
72
+ exclude_none=True,
73
+ )
74
+ return _dict
75
+
76
+ @classmethod
77
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
78
+ """Create an instance of BatchCreatedResponse from a dict"""
79
+ if obj is None:
80
+ return None
81
+
82
+ if not isinstance(obj, dict):
83
+ return cls.model_validate(obj)
84
+
85
+ _obj = cls.model_validate({
86
+ "batchId": obj.get("batchId"),
87
+ "connectorId": obj.get("connectorId")
88
+ })
89
+ return _obj
90
+
91
+