amazon-creatorsapi-python-sdk 1.0.0__py3-none-any.whl → 1.2.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.
- {amazon_creatorsapi_python_sdk-1.0.0.dist-info → amazon_creatorsapi_python_sdk-1.2.0.dist-info}/METADATA +11 -5
- amazon_creatorsapi_python_sdk-1.2.0.dist-info/RECORD +109 -0
- {amazon_creatorsapi_python_sdk-1.0.0.dist-info → amazon_creatorsapi_python_sdk-1.2.0.dist-info}/WHEEL +1 -1
- creatorsapi_python_sdk/__init__.py +128 -127
- creatorsapi_python_sdk/api/__init__.py +5 -5
- creatorsapi_python_sdk/api/default_api.py +2427 -2412
- creatorsapi_python_sdk/api_client.py +915 -912
- creatorsapi_python_sdk/api_response.py +21 -21
- creatorsapi_python_sdk/auth/__init__.py +21 -21
- creatorsapi_python_sdk/auth/oauth2_config.py +139 -123
- creatorsapi_python_sdk/auth/oauth2_token_manager.py +133 -120
- creatorsapi_python_sdk/configuration.py +455 -455
- creatorsapi_python_sdk/exceptions.py +204 -204
- creatorsapi_python_sdk/models/__init__.py +111 -110
- creatorsapi_python_sdk/models/access_denied_exception_response_content.py +97 -97
- creatorsapi_python_sdk/models/access_denied_reason.py +45 -45
- creatorsapi_python_sdk/models/availability.py +44 -44
- creatorsapi_python_sdk/models/browse_node.py +116 -116
- creatorsapi_python_sdk/models/browse_node_ancestor.py +103 -103
- creatorsapi_python_sdk/models/browse_node_child.py +96 -96
- creatorsapi_python_sdk/models/browse_node_info.py +106 -106
- creatorsapi_python_sdk/models/browse_nodes_result.py +100 -100
- creatorsapi_python_sdk/models/by_line_info.py +111 -111
- creatorsapi_python_sdk/models/classifications.py +101 -101
- creatorsapi_python_sdk/models/condition.py +44 -44
- creatorsapi_python_sdk/models/content_info.py +113 -113
- creatorsapi_python_sdk/models/content_rating.py +96 -96
- creatorsapi_python_sdk/models/contributor.py +98 -98
- creatorsapi_python_sdk/models/customer_reviews.py +98 -98
- creatorsapi_python_sdk/models/deal_details.py +102 -102
- creatorsapi_python_sdk/models/delivery_flag.py +46 -46
- creatorsapi_python_sdk/models/dimension_based_attribute.py +111 -111
- creatorsapi_python_sdk/models/error_data.py +94 -94
- creatorsapi_python_sdk/models/external_ids.py +106 -106
- creatorsapi_python_sdk/models/feed.py +98 -98
- creatorsapi_python_sdk/models/get_browse_nodes_request_content.py +107 -107
- creatorsapi_python_sdk/models/get_browse_nodes_resource.py +44 -44
- creatorsapi_python_sdk/models/get_browse_nodes_response_content.py +106 -106
- creatorsapi_python_sdk/models/get_feed_request_content.py +93 -93
- creatorsapi_python_sdk/models/get_feed_response_content.py +92 -92
- creatorsapi_python_sdk/models/get_items_request_content.py +124 -124
- creatorsapi_python_sdk/models/get_items_resource.py +76 -76
- creatorsapi_python_sdk/models/get_items_response_content.py +106 -106
- creatorsapi_python_sdk/models/get_report_request_content.py +93 -93
- creatorsapi_python_sdk/models/get_report_response_content.py +92 -92
- creatorsapi_python_sdk/models/get_variations_request_content.py +135 -135
- creatorsapi_python_sdk/models/get_variations_resource.py +79 -79
- creatorsapi_python_sdk/models/get_variations_response_content.py +106 -106
- creatorsapi_python_sdk/models/image_size.py +96 -96
- creatorsapi_python_sdk/models/image_type.py +111 -111
- creatorsapi_python_sdk/models/images.py +105 -105
- creatorsapi_python_sdk/models/internal_server_exception_response_content.py +94 -94
- creatorsapi_python_sdk/models/item.py +138 -138
- creatorsapi_python_sdk/models/item_info.py +156 -156
- creatorsapi_python_sdk/models/items_result.py +100 -100
- creatorsapi_python_sdk/models/language_type.py +94 -94
- creatorsapi_python_sdk/models/languages.py +104 -104
- creatorsapi_python_sdk/models/list_feeds_response_content.py +100 -100
- creatorsapi_python_sdk/models/list_reports_response_content.py +100 -100
- creatorsapi_python_sdk/models/manufacture_info.py +106 -106
- creatorsapi_python_sdk/models/money.py +96 -96
- creatorsapi_python_sdk/models/multi_valued_attribute.py +96 -96
- creatorsapi_python_sdk/models/offer_availability_v2.py +98 -98
- creatorsapi_python_sdk/models/offer_condition_v2.py +96 -96
- creatorsapi_python_sdk/models/offer_listing_v2.py +133 -133
- creatorsapi_python_sdk/models/offer_loyalty_points_v2.py +92 -92
- creatorsapi_python_sdk/models/offer_merchant_info_v2.py +94 -94
- creatorsapi_python_sdk/models/offer_price_v2.py +113 -113
- creatorsapi_python_sdk/models/offer_saving_basis.py +101 -101
- creatorsapi_python_sdk/models/offer_savings.py +98 -98
- creatorsapi_python_sdk/models/offer_type.py +45 -45
- creatorsapi_python_sdk/models/offers_v2.py +100 -100
- creatorsapi_python_sdk/models/product_info.py +124 -124
- creatorsapi_python_sdk/models/rating.py +92 -92
- creatorsapi_python_sdk/models/refinement.py +104 -104
- creatorsapi_python_sdk/models/refinement_bin.py +94 -94
- creatorsapi_python_sdk/models/report_metadata.py +98 -98
- creatorsapi_python_sdk/models/resource_not_found_exception_response_content.py +98 -98
- creatorsapi_python_sdk/models/saving_basis_type.py +46 -46
- creatorsapi_python_sdk/models/search_items_request_content.py +242 -242
- creatorsapi_python_sdk/models/search_items_resource.py +77 -77
- creatorsapi_python_sdk/models/search_items_response_content.py +106 -106
- creatorsapi_python_sdk/models/search_refinements.py +110 -110
- creatorsapi_python_sdk/models/search_result.py +110 -110
- creatorsapi_python_sdk/models/single_boolean_valued_attribute.py +96 -96
- creatorsapi_python_sdk/models/single_integer_valued_attribute.py +96 -96
- creatorsapi_python_sdk/models/single_string_valued_attribute.py +96 -96
- creatorsapi_python_sdk/models/sort_by.py +48 -48
- creatorsapi_python_sdk/models/technical_info.py +102 -102
- creatorsapi_python_sdk/models/throttle_exception_response_content.py +98 -98
- creatorsapi_python_sdk/models/trade_in_info.py +98 -98
- creatorsapi_python_sdk/models/trade_in_price.py +96 -96
- creatorsapi_python_sdk/models/unauthorized_exception_reason.py +51 -51
- creatorsapi_python_sdk/models/unauthorized_exception_response_content.py +97 -97
- creatorsapi_python_sdk/models/unit_based_attribute.py +98 -98
- creatorsapi_python_sdk/models/validation_exception_field.py +94 -94
- creatorsapi_python_sdk/models/validation_exception_reason.py +48 -48
- creatorsapi_python_sdk/models/validation_exception_response_content.py +107 -107
- creatorsapi_python_sdk/models/variation_attribute.py +94 -94
- creatorsapi_python_sdk/models/variation_dimension.py +98 -98
- creatorsapi_python_sdk/models/variation_summary.py +110 -104
- creatorsapi_python_sdk/models/variation_summary_price.py +101 -0
- creatorsapi_python_sdk/models/variations_result.py +106 -106
- creatorsapi_python_sdk/models/website_sales_rank.py +98 -98
- creatorsapi_python_sdk/rest.py +262 -262
- amazon_creatorsapi_python_sdk-1.0.0.dist-info/RECORD +0 -108
- {amazon_creatorsapi_python_sdk-1.0.0.dist-info → amazon_creatorsapi_python_sdk-1.2.0.dist-info}/licenses/LICENSE.txt +0 -0
- {amazon_creatorsapi_python_sdk-1.0.0.dist-info → amazon_creatorsapi_python_sdk-1.2.0.dist-info}/licenses/NOTICE.txt +0 -0
- {amazon_creatorsapi_python_sdk-1.0.0.dist-info → amazon_creatorsapi_python_sdk-1.2.0.dist-info}/top_level.txt +0 -0
|
@@ -1,94 +1,94 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
|
|
3
|
-
"""
|
|
4
|
-
Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
5
|
-
|
|
6
|
-
Licensed under the Apache License, Version 2.0 (the "License").
|
|
7
|
-
You may not use this file except in compliance with the License.
|
|
8
|
-
A copy of the License is located at
|
|
9
|
-
|
|
10
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
|
|
12
|
-
or in the "license" file accompanying this file. This file is distributed
|
|
13
|
-
on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
|
14
|
-
express or implied. See the License for the specific language governing
|
|
15
|
-
permissions and limitations under the License.
|
|
16
|
-
|
|
17
|
-
""" # noqa: E501
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
from __future__ import annotations
|
|
22
|
-
import pprint
|
|
23
|
-
import re # noqa: F401
|
|
24
|
-
import json
|
|
25
|
-
|
|
26
|
-
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
27
|
-
from typing import Any, ClassVar, Dict, List
|
|
28
|
-
from typing import Optional, Set
|
|
29
|
-
from typing_extensions import Self
|
|
30
|
-
|
|
31
|
-
class ValidationExceptionField(BaseModel):
|
|
32
|
-
"""
|
|
33
|
-
Stores information about a field that failed validation
|
|
34
|
-
""" # noqa: E501
|
|
35
|
-
name: StrictStr
|
|
36
|
-
message: StrictStr
|
|
37
|
-
__properties: ClassVar[List[str]] = ["name", "message"]
|
|
38
|
-
|
|
39
|
-
model_config = ConfigDict(
|
|
40
|
-
populate_by_name=True,
|
|
41
|
-
validate_assignment=True,
|
|
42
|
-
protected_namespaces=(),
|
|
43
|
-
)
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
def to_str(self) -> str:
|
|
47
|
-
"""Returns the string representation of the model using alias"""
|
|
48
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
|
49
|
-
|
|
50
|
-
def to_json(self) -> str:
|
|
51
|
-
"""Returns the JSON representation of the model using alias"""
|
|
52
|
-
return self.model_dump_json(by_alias=True, exclude_unset=True)
|
|
53
|
-
|
|
54
|
-
@classmethod
|
|
55
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
56
|
-
"""Create an instance of ValidationExceptionField from a JSON string"""
|
|
57
|
-
return cls.from_dict(json.loads(json_str))
|
|
58
|
-
|
|
59
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
60
|
-
"""Return the dictionary representation of the model using alias.
|
|
61
|
-
|
|
62
|
-
This has the following differences from calling pydantic's
|
|
63
|
-
`self.model_dump(by_alias=True)`:
|
|
64
|
-
|
|
65
|
-
* `None` is only added to the output dict for nullable fields that
|
|
66
|
-
were set at model initialization. Other fields with value `None`
|
|
67
|
-
are ignored.
|
|
68
|
-
"""
|
|
69
|
-
excluded_fields: Set[str] = set([
|
|
70
|
-
])
|
|
71
|
-
|
|
72
|
-
_dict = self.model_dump(
|
|
73
|
-
by_alias=True,
|
|
74
|
-
exclude=excluded_fields,
|
|
75
|
-
exclude_none=True,
|
|
76
|
-
)
|
|
77
|
-
return _dict
|
|
78
|
-
|
|
79
|
-
@classmethod
|
|
80
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
81
|
-
"""Create an instance of ValidationExceptionField 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
|
-
"name": obj.get("name"),
|
|
90
|
-
"message": obj.get("message")
|
|
91
|
-
})
|
|
92
|
-
return _obj
|
|
93
|
-
|
|
94
|
-
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
5
|
+
|
|
6
|
+
Licensed under the Apache License, Version 2.0 (the "License").
|
|
7
|
+
You may not use this file except in compliance with the License.
|
|
8
|
+
A copy of the License is located at
|
|
9
|
+
|
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
|
|
12
|
+
or in the "license" file accompanying this file. This file is distributed
|
|
13
|
+
on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
|
14
|
+
express or implied. See the License for the specific language governing
|
|
15
|
+
permissions and limitations under the License.
|
|
16
|
+
|
|
17
|
+
""" # noqa: E501
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
from __future__ import annotations
|
|
22
|
+
import pprint
|
|
23
|
+
import re # noqa: F401
|
|
24
|
+
import json
|
|
25
|
+
|
|
26
|
+
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
27
|
+
from typing import Any, ClassVar, Dict, List
|
|
28
|
+
from typing import Optional, Set
|
|
29
|
+
from typing_extensions import Self
|
|
30
|
+
|
|
31
|
+
class ValidationExceptionField(BaseModel):
|
|
32
|
+
"""
|
|
33
|
+
Stores information about a field that failed validation
|
|
34
|
+
""" # noqa: E501
|
|
35
|
+
name: StrictStr
|
|
36
|
+
message: StrictStr
|
|
37
|
+
__properties: ClassVar[List[str]] = ["name", "message"]
|
|
38
|
+
|
|
39
|
+
model_config = ConfigDict(
|
|
40
|
+
populate_by_name=True,
|
|
41
|
+
validate_assignment=True,
|
|
42
|
+
protected_namespaces=(),
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def to_str(self) -> str:
|
|
47
|
+
"""Returns the string representation of the model using alias"""
|
|
48
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
49
|
+
|
|
50
|
+
def to_json(self) -> str:
|
|
51
|
+
"""Returns the JSON representation of the model using alias"""
|
|
52
|
+
return self.model_dump_json(by_alias=True, exclude_unset=True)
|
|
53
|
+
|
|
54
|
+
@classmethod
|
|
55
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
56
|
+
"""Create an instance of ValidationExceptionField from a JSON string"""
|
|
57
|
+
return cls.from_dict(json.loads(json_str))
|
|
58
|
+
|
|
59
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
60
|
+
"""Return the dictionary representation of the model using alias.
|
|
61
|
+
|
|
62
|
+
This has the following differences from calling pydantic's
|
|
63
|
+
`self.model_dump(by_alias=True)`:
|
|
64
|
+
|
|
65
|
+
* `None` is only added to the output dict for nullable fields that
|
|
66
|
+
were set at model initialization. Other fields with value `None`
|
|
67
|
+
are ignored.
|
|
68
|
+
"""
|
|
69
|
+
excluded_fields: Set[str] = set([
|
|
70
|
+
])
|
|
71
|
+
|
|
72
|
+
_dict = self.model_dump(
|
|
73
|
+
by_alias=True,
|
|
74
|
+
exclude=excluded_fields,
|
|
75
|
+
exclude_none=True,
|
|
76
|
+
)
|
|
77
|
+
return _dict
|
|
78
|
+
|
|
79
|
+
@classmethod
|
|
80
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
81
|
+
"""Create an instance of ValidationExceptionField 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
|
+
"name": obj.get("name"),
|
|
90
|
+
"message": obj.get("message")
|
|
91
|
+
})
|
|
92
|
+
return _obj
|
|
93
|
+
|
|
94
|
+
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
|
|
3
|
-
"""
|
|
4
|
-
Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
5
|
-
|
|
6
|
-
Licensed under the Apache License, Version 2.0 (the "License").
|
|
7
|
-
You may not use this file except in compliance with the License.
|
|
8
|
-
A copy of the License is located at
|
|
9
|
-
|
|
10
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
|
|
12
|
-
or in the "license" file accompanying this file. This file is distributed
|
|
13
|
-
on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
|
14
|
-
express or implied. See the License for the specific language governing
|
|
15
|
-
permissions and limitations under the License.
|
|
16
|
-
|
|
17
|
-
""" # noqa: E501
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
from __future__ import annotations
|
|
22
|
-
import json
|
|
23
|
-
from enum import Enum
|
|
24
|
-
from typing_extensions import Self
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
class ValidationExceptionReason(str, Enum):
|
|
28
|
-
"""
|
|
29
|
-
Possible reasons a request failed validation
|
|
30
|
-
"""
|
|
31
|
-
|
|
32
|
-
"""
|
|
33
|
-
allowed enum values
|
|
34
|
-
"""
|
|
35
|
-
UNKNOWNOPERATION = 'UnknownOperation'
|
|
36
|
-
CANNOTPARSE = 'CannotParse'
|
|
37
|
-
FIELDVALIDATIONFAILED = 'FieldValidationFailed'
|
|
38
|
-
INVALIDASSOCIATE = 'InvalidAssociate'
|
|
39
|
-
INVALIDPARTNERTAG = 'InvalidPartnerTag'
|
|
40
|
-
OTHER = 'Other'
|
|
41
|
-
|
|
42
|
-
@classmethod
|
|
43
|
-
def from_json(cls, json_str: str) -> Self:
|
|
44
|
-
"""Create an instance of ValidationExceptionReason from a JSON string"""
|
|
45
|
-
return cls(json.loads(json_str))
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
5
|
+
|
|
6
|
+
Licensed under the Apache License, Version 2.0 (the "License").
|
|
7
|
+
You may not use this file except in compliance with the License.
|
|
8
|
+
A copy of the License is located at
|
|
9
|
+
|
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
|
|
12
|
+
or in the "license" file accompanying this file. This file is distributed
|
|
13
|
+
on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
|
14
|
+
express or implied. See the License for the specific language governing
|
|
15
|
+
permissions and limitations under the License.
|
|
16
|
+
|
|
17
|
+
""" # noqa: E501
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
from __future__ import annotations
|
|
22
|
+
import json
|
|
23
|
+
from enum import Enum
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class ValidationExceptionReason(str, Enum):
|
|
28
|
+
"""
|
|
29
|
+
Possible reasons a request failed validation
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
"""
|
|
33
|
+
allowed enum values
|
|
34
|
+
"""
|
|
35
|
+
UNKNOWNOPERATION = 'UnknownOperation'
|
|
36
|
+
CANNOTPARSE = 'CannotParse'
|
|
37
|
+
FIELDVALIDATIONFAILED = 'FieldValidationFailed'
|
|
38
|
+
INVALIDASSOCIATE = 'InvalidAssociate'
|
|
39
|
+
INVALIDPARTNERTAG = 'InvalidPartnerTag'
|
|
40
|
+
OTHER = 'Other'
|
|
41
|
+
|
|
42
|
+
@classmethod
|
|
43
|
+
def from_json(cls, json_str: str) -> Self:
|
|
44
|
+
"""Create an instance of ValidationExceptionReason from a JSON string"""
|
|
45
|
+
return cls(json.loads(json_str))
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
@@ -1,107 +1,107 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
|
|
3
|
-
"""
|
|
4
|
-
Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
5
|
-
|
|
6
|
-
Licensed under the Apache License, Version 2.0 (the "License").
|
|
7
|
-
You may not use this file except in compliance with the License.
|
|
8
|
-
A copy of the License is located at
|
|
9
|
-
|
|
10
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
|
|
12
|
-
or in the "license" file accompanying this file. This file is distributed
|
|
13
|
-
on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
|
14
|
-
express or implied. See the License for the specific language governing
|
|
15
|
-
permissions and limitations under the License.
|
|
16
|
-
|
|
17
|
-
""" # noqa: E501
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
from __future__ import annotations
|
|
22
|
-
import pprint
|
|
23
|
-
import re # noqa: F401
|
|
24
|
-
import json
|
|
25
|
-
|
|
26
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
27
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
|
28
|
-
from creatorsapi_python_sdk.models.validation_exception_field import ValidationExceptionField
|
|
29
|
-
from creatorsapi_python_sdk.models.validation_exception_reason import ValidationExceptionReason
|
|
30
|
-
from typing import Optional, Set
|
|
31
|
-
from typing_extensions import Self
|
|
32
|
-
|
|
33
|
-
class ValidationExceptionResponseContent(BaseModel):
|
|
34
|
-
"""
|
|
35
|
-
The input fails to satisfy the constraints specified by the service. Use ValidationExceptionReason and fieldList to identify specific issues.
|
|
36
|
-
""" # noqa: E501
|
|
37
|
-
type: Optional[StrictStr] = Field(default=None, description="The exception type identifier for clients to programmatically identify the exception")
|
|
38
|
-
message: StrictStr
|
|
39
|
-
reason: ValidationExceptionReason
|
|
40
|
-
field_list: Optional[List[ValidationExceptionField]] = Field(default=None, description="List of validation exception fields", alias="fieldList")
|
|
41
|
-
__properties: ClassVar[List[str]] = ["type", "message", "reason", "fieldList"]
|
|
42
|
-
|
|
43
|
-
model_config = ConfigDict(
|
|
44
|
-
populate_by_name=True,
|
|
45
|
-
validate_assignment=True,
|
|
46
|
-
protected_namespaces=(),
|
|
47
|
-
)
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
def to_str(self) -> str:
|
|
51
|
-
"""Returns the string representation of the model using alias"""
|
|
52
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
|
53
|
-
|
|
54
|
-
def to_json(self) -> str:
|
|
55
|
-
"""Returns the JSON representation of the model using alias"""
|
|
56
|
-
return self.model_dump_json(by_alias=True, exclude_unset=True)
|
|
57
|
-
|
|
58
|
-
@classmethod
|
|
59
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
60
|
-
"""Create an instance of ValidationExceptionResponseContent from a JSON string"""
|
|
61
|
-
return cls.from_dict(json.loads(json_str))
|
|
62
|
-
|
|
63
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
64
|
-
"""Return the dictionary representation of the model using alias.
|
|
65
|
-
|
|
66
|
-
This has the following differences from calling pydantic's
|
|
67
|
-
`self.model_dump(by_alias=True)`:
|
|
68
|
-
|
|
69
|
-
* `None` is only added to the output dict for nullable fields that
|
|
70
|
-
were set at model initialization. Other fields with value `None`
|
|
71
|
-
are ignored.
|
|
72
|
-
"""
|
|
73
|
-
excluded_fields: Set[str] = set([
|
|
74
|
-
])
|
|
75
|
-
|
|
76
|
-
_dict = self.model_dump(
|
|
77
|
-
by_alias=True,
|
|
78
|
-
exclude=excluded_fields,
|
|
79
|
-
exclude_none=True,
|
|
80
|
-
)
|
|
81
|
-
# override the default output from pydantic by calling `to_dict()` of each item in field_list (list)
|
|
82
|
-
_items = []
|
|
83
|
-
if self.field_list:
|
|
84
|
-
for _item_field_list in self.field_list:
|
|
85
|
-
if _item_field_list:
|
|
86
|
-
_items.append(_item_field_list.to_dict())
|
|
87
|
-
_dict['fieldList'] = _items
|
|
88
|
-
return _dict
|
|
89
|
-
|
|
90
|
-
@classmethod
|
|
91
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
92
|
-
"""Create an instance of ValidationExceptionResponseContent from a dict"""
|
|
93
|
-
if obj is None:
|
|
94
|
-
return None
|
|
95
|
-
|
|
96
|
-
if not isinstance(obj, dict):
|
|
97
|
-
return cls.model_validate(obj)
|
|
98
|
-
|
|
99
|
-
_obj = cls.model_validate({
|
|
100
|
-
"type": obj.get("type"),
|
|
101
|
-
"message": obj.get("message"),
|
|
102
|
-
"reason": obj.get("reason"),
|
|
103
|
-
"fieldList": [ValidationExceptionField.from_dict(_item) for _item in obj["fieldList"]] if obj.get("fieldList") is not None else None
|
|
104
|
-
})
|
|
105
|
-
return _obj
|
|
106
|
-
|
|
107
|
-
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
5
|
+
|
|
6
|
+
Licensed under the Apache License, Version 2.0 (the "License").
|
|
7
|
+
You may not use this file except in compliance with the License.
|
|
8
|
+
A copy of the License is located at
|
|
9
|
+
|
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
|
|
12
|
+
or in the "license" file accompanying this file. This file is distributed
|
|
13
|
+
on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
|
14
|
+
express or implied. See the License for the specific language governing
|
|
15
|
+
permissions and limitations under the License.
|
|
16
|
+
|
|
17
|
+
""" # noqa: E501
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
from __future__ import annotations
|
|
22
|
+
import pprint
|
|
23
|
+
import re # noqa: F401
|
|
24
|
+
import json
|
|
25
|
+
|
|
26
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
27
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
28
|
+
from creatorsapi_python_sdk.models.validation_exception_field import ValidationExceptionField
|
|
29
|
+
from creatorsapi_python_sdk.models.validation_exception_reason import ValidationExceptionReason
|
|
30
|
+
from typing import Optional, Set
|
|
31
|
+
from typing_extensions import Self
|
|
32
|
+
|
|
33
|
+
class ValidationExceptionResponseContent(BaseModel):
|
|
34
|
+
"""
|
|
35
|
+
The input fails to satisfy the constraints specified by the service. Use ValidationExceptionReason and fieldList to identify specific issues.
|
|
36
|
+
""" # noqa: E501
|
|
37
|
+
type: Optional[StrictStr] = Field(default=None, description="The exception type identifier for clients to programmatically identify the exception")
|
|
38
|
+
message: StrictStr
|
|
39
|
+
reason: ValidationExceptionReason
|
|
40
|
+
field_list: Optional[List[ValidationExceptionField]] = Field(default=None, description="List of validation exception fields", alias="fieldList")
|
|
41
|
+
__properties: ClassVar[List[str]] = ["type", "message", "reason", "fieldList"]
|
|
42
|
+
|
|
43
|
+
model_config = ConfigDict(
|
|
44
|
+
populate_by_name=True,
|
|
45
|
+
validate_assignment=True,
|
|
46
|
+
protected_namespaces=(),
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def to_str(self) -> str:
|
|
51
|
+
"""Returns the string representation of the model using alias"""
|
|
52
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
53
|
+
|
|
54
|
+
def to_json(self) -> str:
|
|
55
|
+
"""Returns the JSON representation of the model using alias"""
|
|
56
|
+
return self.model_dump_json(by_alias=True, exclude_unset=True)
|
|
57
|
+
|
|
58
|
+
@classmethod
|
|
59
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
60
|
+
"""Create an instance of ValidationExceptionResponseContent from a JSON string"""
|
|
61
|
+
return cls.from_dict(json.loads(json_str))
|
|
62
|
+
|
|
63
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
64
|
+
"""Return the dictionary representation of the model using alias.
|
|
65
|
+
|
|
66
|
+
This has the following differences from calling pydantic's
|
|
67
|
+
`self.model_dump(by_alias=True)`:
|
|
68
|
+
|
|
69
|
+
* `None` is only added to the output dict for nullable fields that
|
|
70
|
+
were set at model initialization. Other fields with value `None`
|
|
71
|
+
are ignored.
|
|
72
|
+
"""
|
|
73
|
+
excluded_fields: Set[str] = set([
|
|
74
|
+
])
|
|
75
|
+
|
|
76
|
+
_dict = self.model_dump(
|
|
77
|
+
by_alias=True,
|
|
78
|
+
exclude=excluded_fields,
|
|
79
|
+
exclude_none=True,
|
|
80
|
+
)
|
|
81
|
+
# override the default output from pydantic by calling `to_dict()` of each item in field_list (list)
|
|
82
|
+
_items = []
|
|
83
|
+
if self.field_list:
|
|
84
|
+
for _item_field_list in self.field_list:
|
|
85
|
+
if _item_field_list:
|
|
86
|
+
_items.append(_item_field_list.to_dict())
|
|
87
|
+
_dict['fieldList'] = _items
|
|
88
|
+
return _dict
|
|
89
|
+
|
|
90
|
+
@classmethod
|
|
91
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
92
|
+
"""Create an instance of ValidationExceptionResponseContent from a dict"""
|
|
93
|
+
if obj is None:
|
|
94
|
+
return None
|
|
95
|
+
|
|
96
|
+
if not isinstance(obj, dict):
|
|
97
|
+
return cls.model_validate(obj)
|
|
98
|
+
|
|
99
|
+
_obj = cls.model_validate({
|
|
100
|
+
"type": obj.get("type"),
|
|
101
|
+
"message": obj.get("message"),
|
|
102
|
+
"reason": obj.get("reason"),
|
|
103
|
+
"fieldList": [ValidationExceptionField.from_dict(_item) for _item in obj["fieldList"]] if obj.get("fieldList") is not None else None
|
|
104
|
+
})
|
|
105
|
+
return _obj
|
|
106
|
+
|
|
107
|
+
|