maytes-api-client-py 0.1.1__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.
- maytes_api_client/__init__.py +150 -0
- maytes_api_client/api/__init__.py +5 -0
- maytes_api_client/api/default_api.py +2661 -0
- maytes_api_client/api_client.py +804 -0
- maytes_api_client/api_response.py +21 -0
- maytes_api_client/configuration.py +630 -0
- maytes_api_client/exceptions.py +218 -0
- maytes_api_client/managed_client.py +199 -0
- maytes_api_client/models/__init__.py +64 -0
- maytes_api_client/models/cancel_checkout409_response.py +101 -0
- maytes_api_client/models/cancel_checkout_request.py +88 -0
- maytes_api_client/models/cancel_checkout_response.py +92 -0
- maytes_api_client/models/capture_checkout409_response.py +101 -0
- maytes_api_client/models/capture_checkout422_response.py +101 -0
- maytes_api_client/models/capture_checkout_request.py +118 -0
- maytes_api_client/models/capture_checkout_response.py +92 -0
- maytes_api_client/models/checkout.py +159 -0
- maytes_api_client/models/checkout_cancelled.py +97 -0
- maytes_api_client/models/checkout_captured.py +109 -0
- maytes_api_client/models/checkout_created.py +95 -0
- maytes_api_client/models/checkout_discount.py +133 -0
- maytes_api_client/models/checkout_fee.py +150 -0
- maytes_api_client/models/create_checkout401_response.py +101 -0
- maytes_api_client/models/create_checkout409_response.py +101 -0
- maytes_api_client/models/create_checkout422_response.py +101 -0
- maytes_api_client/models/create_checkout_request.py +213 -0
- maytes_api_client/models/create_checkout_response.py +92 -0
- maytes_api_client/models/create_refund_request.py +91 -0
- maytes_api_client/models/customer_data.py +107 -0
- maytes_api_client/models/digital_goods_custom_data.py +93 -0
- maytes_api_client/models/digital_goods_line_item.py +150 -0
- maytes_api_client/models/donation_line_item.py +144 -0
- maytes_api_client/models/error_response_dto.py +94 -0
- maytes_api_client/models/fee.py +103 -0
- maytes_api_client/models/fee_breakdown_line.py +101 -0
- maytes_api_client/models/food_beverage_line_item.py +144 -0
- maytes_api_client/models/get_checkout404_response.py +101 -0
- maytes_api_client/models/get_checkout422_response.py +101 -0
- maytes_api_client/models/get_checkout_response.py +92 -0
- maytes_api_client/models/get_settlement_response.py +92 -0
- maytes_api_client/models/health_response.py +88 -0
- maytes_api_client/models/line_item.py +210 -0
- maytes_api_client/models/list_settlements_response.py +96 -0
- maytes_api_client/models/o_auth_token_request.py +102 -0
- maytes_api_client/models/o_auth_token_response.py +96 -0
- maytes_api_client/models/other_line_item.py +144 -0
- maytes_api_client/models/physical_goods_custom_data.py +90 -0
- maytes_api_client/models/physical_goods_line_item.py +150 -0
- maytes_api_client/models/refund_checkout402_response.py +101 -0
- maytes_api_client/models/refund_checkout409_response.py +101 -0
- maytes_api_client/models/service_custom_data.py +93 -0
- maytes_api_client/models/service_line_item.py +150 -0
- maytes_api_client/models/settlement.py +160 -0
- maytes_api_client/models/tax.py +111 -0
- maytes_api_client/models/ticket_custom_data.py +125 -0
- maytes_api_client/models/ticket_line_item.py +150 -0
- maytes_api_client/models/ticket_seating.py +94 -0
- maytes_api_client/py.typed +0 -0
- maytes_api_client/rest.py +263 -0
- maytes_api_client/webhook_verifier.py +197 -0
- maytes_api_client_py-0.1.1.dist-info/METADATA +70 -0
- maytes_api_client_py-0.1.1.dist-info/RECORD +65 -0
- maytes_api_client_py-0.1.1.dist-info/WHEEL +5 -0
- maytes_api_client_py-0.1.1.dist-info/licenses/LICENSE +21 -0
- maytes_api_client_py-0.1.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Maytes API
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
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
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
from pydantic_core import to_jsonable_python
|
|
25
|
+
|
|
26
|
+
class CheckoutCancelled(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
CheckoutCancelled
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
checkout_uuid: StrictStr
|
|
31
|
+
merchant_order_id: Optional[StrictStr]
|
|
32
|
+
status: StrictStr
|
|
33
|
+
__properties: ClassVar[List[str]] = ["checkout_uuid", "merchant_order_id", "status"]
|
|
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 CheckoutCancelled 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
|
+
# set to None if merchant_order_id (nullable) is None
|
|
75
|
+
# and model_fields_set contains the field
|
|
76
|
+
if self.merchant_order_id is None and "merchant_order_id" in self.model_fields_set:
|
|
77
|
+
_dict['merchant_order_id'] = None
|
|
78
|
+
|
|
79
|
+
return _dict
|
|
80
|
+
|
|
81
|
+
@classmethod
|
|
82
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
83
|
+
"""Create an instance of CheckoutCancelled from a dict"""
|
|
84
|
+
if obj is None:
|
|
85
|
+
return None
|
|
86
|
+
|
|
87
|
+
if not isinstance(obj, dict):
|
|
88
|
+
return cls.model_validate(obj)
|
|
89
|
+
|
|
90
|
+
_obj = cls.model_validate({
|
|
91
|
+
"checkout_uuid": obj.get("checkout_uuid"),
|
|
92
|
+
"merchant_order_id": obj.get("merchant_order_id"),
|
|
93
|
+
"status": obj.get("status")
|
|
94
|
+
})
|
|
95
|
+
return _obj
|
|
96
|
+
|
|
97
|
+
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Maytes API
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
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
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from datetime import datetime
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
|
|
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 CheckoutCaptured(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
CheckoutCaptured
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
checkout_uuid: StrictStr
|
|
32
|
+
merchant_order_id: Optional[StrictStr]
|
|
33
|
+
status: StrictStr
|
|
34
|
+
captured_at: Optional[datetime]
|
|
35
|
+
amount: StrictInt
|
|
36
|
+
currency: StrictStr
|
|
37
|
+
__properties: ClassVar[List[str]] = ["checkout_uuid", "merchant_order_id", "status", "captured_at", "amount", "currency"]
|
|
38
|
+
|
|
39
|
+
model_config = ConfigDict(
|
|
40
|
+
validate_by_name=True,
|
|
41
|
+
validate_by_alias=True,
|
|
42
|
+
validate_assignment=True,
|
|
43
|
+
protected_namespaces=(),
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def to_str(self) -> str:
|
|
48
|
+
"""Returns the string representation of the model using alias"""
|
|
49
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
50
|
+
|
|
51
|
+
def to_json(self) -> str:
|
|
52
|
+
"""Returns the JSON representation of the model using alias"""
|
|
53
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
54
|
+
|
|
55
|
+
@classmethod
|
|
56
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
57
|
+
"""Create an instance of CheckoutCaptured from a JSON string"""
|
|
58
|
+
return cls.from_dict(json.loads(json_str))
|
|
59
|
+
|
|
60
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
61
|
+
"""Return the dictionary representation of the model using alias.
|
|
62
|
+
|
|
63
|
+
This has the following differences from calling pydantic's
|
|
64
|
+
`self.model_dump(by_alias=True)`:
|
|
65
|
+
|
|
66
|
+
* `None` is only added to the output dict for nullable fields that
|
|
67
|
+
were set at model initialization. Other fields with value `None`
|
|
68
|
+
are ignored.
|
|
69
|
+
"""
|
|
70
|
+
excluded_fields: Set[str] = set([
|
|
71
|
+
])
|
|
72
|
+
|
|
73
|
+
_dict = self.model_dump(
|
|
74
|
+
by_alias=True,
|
|
75
|
+
exclude=excluded_fields,
|
|
76
|
+
exclude_none=True,
|
|
77
|
+
)
|
|
78
|
+
# set to None if merchant_order_id (nullable) is None
|
|
79
|
+
# and model_fields_set contains the field
|
|
80
|
+
if self.merchant_order_id is None and "merchant_order_id" in self.model_fields_set:
|
|
81
|
+
_dict['merchant_order_id'] = None
|
|
82
|
+
|
|
83
|
+
# set to None if captured_at (nullable) is None
|
|
84
|
+
# and model_fields_set contains the field
|
|
85
|
+
if self.captured_at is None and "captured_at" in self.model_fields_set:
|
|
86
|
+
_dict['captured_at'] = None
|
|
87
|
+
|
|
88
|
+
return _dict
|
|
89
|
+
|
|
90
|
+
@classmethod
|
|
91
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
92
|
+
"""Create an instance of CheckoutCaptured 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
|
+
"checkout_uuid": obj.get("checkout_uuid"),
|
|
101
|
+
"merchant_order_id": obj.get("merchant_order_id"),
|
|
102
|
+
"status": obj.get("status"),
|
|
103
|
+
"captured_at": obj.get("captured_at"),
|
|
104
|
+
"amount": obj.get("amount"),
|
|
105
|
+
"currency": obj.get("currency")
|
|
106
|
+
})
|
|
107
|
+
return _obj
|
|
108
|
+
|
|
109
|
+
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Maytes API
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
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
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from datetime import datetime
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, 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 CheckoutCreated(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
CheckoutCreated
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
checkout_uuid: StrictStr
|
|
32
|
+
status: StrictStr
|
|
33
|
+
checkout_url: StrictStr
|
|
34
|
+
expires_at: datetime
|
|
35
|
+
__properties: ClassVar[List[str]] = ["checkout_uuid", "status", "checkout_url", "expires_at"]
|
|
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 CheckoutCreated 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 CheckoutCreated 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
|
+
"checkout_uuid": obj.get("checkout_uuid"),
|
|
89
|
+
"status": obj.get("status"),
|
|
90
|
+
"checkout_url": obj.get("checkout_url"),
|
|
91
|
+
"expires_at": obj.get("expires_at")
|
|
92
|
+
})
|
|
93
|
+
return _obj
|
|
94
|
+
|
|
95
|
+
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Maytes API
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
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
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing_extensions import Annotated
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
from pydantic_core import to_jsonable_python
|
|
26
|
+
|
|
27
|
+
class CheckoutDiscount(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
CheckoutDiscount
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
name: Annotated[str, Field(min_length=1, strict=True)]
|
|
32
|
+
description: Optional[StrictStr] = None
|
|
33
|
+
scope: StrictStr
|
|
34
|
+
amount: Annotated[int, Field(strict=True, ge=0)]
|
|
35
|
+
currency: Annotated[str, Field(strict=True)]
|
|
36
|
+
metadata: Optional[Dict[str, Any]] = None
|
|
37
|
+
applies_to: Optional[List[StrictStr]] = None
|
|
38
|
+
__properties: ClassVar[List[str]] = ["name", "description", "scope", "amount", "currency", "metadata", "applies_to"]
|
|
39
|
+
|
|
40
|
+
@field_validator('scope')
|
|
41
|
+
def scope_validate_enum(cls, value):
|
|
42
|
+
"""Validates the enum"""
|
|
43
|
+
if value not in set(['cart', 'item']):
|
|
44
|
+
raise ValueError("must be one of enum values ('cart', 'item')")
|
|
45
|
+
return value
|
|
46
|
+
|
|
47
|
+
@field_validator('currency')
|
|
48
|
+
def currency_validate_regular_expression(cls, value):
|
|
49
|
+
"""Validates the regular expression"""
|
|
50
|
+
if not isinstance(value, str):
|
|
51
|
+
value = str(value)
|
|
52
|
+
|
|
53
|
+
if not re.match(r"^[A-Z]{3}$", value):
|
|
54
|
+
raise ValueError(r"must validate the regular expression /^[A-Z]{3}$/")
|
|
55
|
+
return value
|
|
56
|
+
|
|
57
|
+
model_config = ConfigDict(
|
|
58
|
+
validate_by_name=True,
|
|
59
|
+
validate_by_alias=True,
|
|
60
|
+
validate_assignment=True,
|
|
61
|
+
protected_namespaces=(),
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def to_str(self) -> str:
|
|
66
|
+
"""Returns the string representation of the model using alias"""
|
|
67
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
68
|
+
|
|
69
|
+
def to_json(self) -> str:
|
|
70
|
+
"""Returns the JSON representation of the model using alias"""
|
|
71
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
72
|
+
|
|
73
|
+
@classmethod
|
|
74
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
75
|
+
"""Create an instance of CheckoutDiscount from a JSON string"""
|
|
76
|
+
return cls.from_dict(json.loads(json_str))
|
|
77
|
+
|
|
78
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
79
|
+
"""Return the dictionary representation of the model using alias.
|
|
80
|
+
|
|
81
|
+
This has the following differences from calling pydantic's
|
|
82
|
+
`self.model_dump(by_alias=True)`:
|
|
83
|
+
|
|
84
|
+
* `None` is only added to the output dict for nullable fields that
|
|
85
|
+
were set at model initialization. Other fields with value `None`
|
|
86
|
+
are ignored.
|
|
87
|
+
"""
|
|
88
|
+
excluded_fields: Set[str] = set([
|
|
89
|
+
])
|
|
90
|
+
|
|
91
|
+
_dict = self.model_dump(
|
|
92
|
+
by_alias=True,
|
|
93
|
+
exclude=excluded_fields,
|
|
94
|
+
exclude_none=True,
|
|
95
|
+
)
|
|
96
|
+
# set to None if description (nullable) is None
|
|
97
|
+
# and model_fields_set contains the field
|
|
98
|
+
if self.description is None and "description" in self.model_fields_set:
|
|
99
|
+
_dict['description'] = None
|
|
100
|
+
|
|
101
|
+
# set to None if metadata (nullable) is None
|
|
102
|
+
# and model_fields_set contains the field
|
|
103
|
+
if self.metadata is None and "metadata" in self.model_fields_set:
|
|
104
|
+
_dict['metadata'] = None
|
|
105
|
+
|
|
106
|
+
# set to None if applies_to (nullable) is None
|
|
107
|
+
# and model_fields_set contains the field
|
|
108
|
+
if self.applies_to is None and "applies_to" in self.model_fields_set:
|
|
109
|
+
_dict['applies_to'] = None
|
|
110
|
+
|
|
111
|
+
return _dict
|
|
112
|
+
|
|
113
|
+
@classmethod
|
|
114
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
115
|
+
"""Create an instance of CheckoutDiscount from a dict"""
|
|
116
|
+
if obj is None:
|
|
117
|
+
return None
|
|
118
|
+
|
|
119
|
+
if not isinstance(obj, dict):
|
|
120
|
+
return cls.model_validate(obj)
|
|
121
|
+
|
|
122
|
+
_obj = cls.model_validate({
|
|
123
|
+
"name": obj.get("name"),
|
|
124
|
+
"description": obj.get("description"),
|
|
125
|
+
"scope": obj.get("scope"),
|
|
126
|
+
"amount": obj.get("amount"),
|
|
127
|
+
"currency": obj.get("currency"),
|
|
128
|
+
"metadata": obj.get("metadata"),
|
|
129
|
+
"applies_to": obj.get("applies_to")
|
|
130
|
+
})
|
|
131
|
+
return _obj
|
|
132
|
+
|
|
133
|
+
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Maytes API
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
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
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing_extensions import Annotated
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
from pydantic_core import to_jsonable_python
|
|
26
|
+
|
|
27
|
+
class CheckoutFee(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
CheckoutFee
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
name: Annotated[str, Field(min_length=1, strict=True)]
|
|
32
|
+
description: Optional[StrictStr] = None
|
|
33
|
+
fee_type: Optional[StrictStr] = None
|
|
34
|
+
scope: StrictStr
|
|
35
|
+
amount: Annotated[int, Field(strict=True, ge=0)]
|
|
36
|
+
currency: Annotated[str, Field(strict=True)]
|
|
37
|
+
metadata: Optional[Dict[str, Any]] = None
|
|
38
|
+
applies_to: Optional[List[StrictStr]] = None
|
|
39
|
+
__properties: ClassVar[List[str]] = ["name", "description", "fee_type", "scope", "amount", "currency", "metadata", "applies_to"]
|
|
40
|
+
|
|
41
|
+
@field_validator('fee_type')
|
|
42
|
+
def fee_type_validate_enum(cls, value):
|
|
43
|
+
"""Validates the enum"""
|
|
44
|
+
if value is None:
|
|
45
|
+
return value
|
|
46
|
+
|
|
47
|
+
if value not in set(['refund_protection', 'surcharge', 'transaction_fee', 'service_fee', 'delivery_fee', 'carbon_offset', 'other']):
|
|
48
|
+
raise ValueError("must be one of enum values ('refund_protection', 'surcharge', 'transaction_fee', 'service_fee', 'delivery_fee', 'carbon_offset', 'other')")
|
|
49
|
+
return value
|
|
50
|
+
|
|
51
|
+
@field_validator('scope')
|
|
52
|
+
def scope_validate_enum(cls, value):
|
|
53
|
+
"""Validates the enum"""
|
|
54
|
+
if value not in set(['cart', 'item']):
|
|
55
|
+
raise ValueError("must be one of enum values ('cart', 'item')")
|
|
56
|
+
return value
|
|
57
|
+
|
|
58
|
+
@field_validator('currency')
|
|
59
|
+
def currency_validate_regular_expression(cls, value):
|
|
60
|
+
"""Validates the regular expression"""
|
|
61
|
+
if not isinstance(value, str):
|
|
62
|
+
value = str(value)
|
|
63
|
+
|
|
64
|
+
if not re.match(r"^[A-Z]{3}$", value):
|
|
65
|
+
raise ValueError(r"must validate the regular expression /^[A-Z]{3}$/")
|
|
66
|
+
return value
|
|
67
|
+
|
|
68
|
+
model_config = ConfigDict(
|
|
69
|
+
validate_by_name=True,
|
|
70
|
+
validate_by_alias=True,
|
|
71
|
+
validate_assignment=True,
|
|
72
|
+
protected_namespaces=(),
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def to_str(self) -> str:
|
|
77
|
+
"""Returns the string representation of the model using alias"""
|
|
78
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
79
|
+
|
|
80
|
+
def to_json(self) -> str:
|
|
81
|
+
"""Returns the JSON representation of the model using alias"""
|
|
82
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
83
|
+
|
|
84
|
+
@classmethod
|
|
85
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
86
|
+
"""Create an instance of CheckoutFee from a JSON string"""
|
|
87
|
+
return cls.from_dict(json.loads(json_str))
|
|
88
|
+
|
|
89
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
90
|
+
"""Return the dictionary representation of the model using alias.
|
|
91
|
+
|
|
92
|
+
This has the following differences from calling pydantic's
|
|
93
|
+
`self.model_dump(by_alias=True)`:
|
|
94
|
+
|
|
95
|
+
* `None` is only added to the output dict for nullable fields that
|
|
96
|
+
were set at model initialization. Other fields with value `None`
|
|
97
|
+
are ignored.
|
|
98
|
+
"""
|
|
99
|
+
excluded_fields: Set[str] = set([
|
|
100
|
+
])
|
|
101
|
+
|
|
102
|
+
_dict = self.model_dump(
|
|
103
|
+
by_alias=True,
|
|
104
|
+
exclude=excluded_fields,
|
|
105
|
+
exclude_none=True,
|
|
106
|
+
)
|
|
107
|
+
# set to None if description (nullable) is None
|
|
108
|
+
# and model_fields_set contains the field
|
|
109
|
+
if self.description is None and "description" in self.model_fields_set:
|
|
110
|
+
_dict['description'] = None
|
|
111
|
+
|
|
112
|
+
# set to None if fee_type (nullable) is None
|
|
113
|
+
# and model_fields_set contains the field
|
|
114
|
+
if self.fee_type is None and "fee_type" in self.model_fields_set:
|
|
115
|
+
_dict['fee_type'] = None
|
|
116
|
+
|
|
117
|
+
# set to None if metadata (nullable) is None
|
|
118
|
+
# and model_fields_set contains the field
|
|
119
|
+
if self.metadata is None and "metadata" in self.model_fields_set:
|
|
120
|
+
_dict['metadata'] = None
|
|
121
|
+
|
|
122
|
+
# set to None if applies_to (nullable) is None
|
|
123
|
+
# and model_fields_set contains the field
|
|
124
|
+
if self.applies_to is None and "applies_to" in self.model_fields_set:
|
|
125
|
+
_dict['applies_to'] = None
|
|
126
|
+
|
|
127
|
+
return _dict
|
|
128
|
+
|
|
129
|
+
@classmethod
|
|
130
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
131
|
+
"""Create an instance of CheckoutFee from a dict"""
|
|
132
|
+
if obj is None:
|
|
133
|
+
return None
|
|
134
|
+
|
|
135
|
+
if not isinstance(obj, dict):
|
|
136
|
+
return cls.model_validate(obj)
|
|
137
|
+
|
|
138
|
+
_obj = cls.model_validate({
|
|
139
|
+
"name": obj.get("name"),
|
|
140
|
+
"description": obj.get("description"),
|
|
141
|
+
"fee_type": obj.get("fee_type"),
|
|
142
|
+
"scope": obj.get("scope"),
|
|
143
|
+
"amount": obj.get("amount"),
|
|
144
|
+
"currency": obj.get("currency"),
|
|
145
|
+
"metadata": obj.get("metadata"),
|
|
146
|
+
"applies_to": obj.get("applies_to")
|
|
147
|
+
})
|
|
148
|
+
return _obj
|
|
149
|
+
|
|
150
|
+
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Maytes API
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
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
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, StrictStr, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
from pydantic_core import to_jsonable_python
|
|
25
|
+
|
|
26
|
+
class CreateCheckout401Response(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
CreateCheckout401Response
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
message: StrictStr
|
|
31
|
+
error: StrictStr
|
|
32
|
+
code: StrictStr
|
|
33
|
+
metadata: Optional[Dict[str, Any]] = None
|
|
34
|
+
__properties: ClassVar[List[str]] = ["message", "error", "code", "metadata"]
|
|
35
|
+
|
|
36
|
+
@field_validator('code')
|
|
37
|
+
def code_validate_enum(cls, value):
|
|
38
|
+
"""Validates the enum"""
|
|
39
|
+
if value not in set(['unauthorized']):
|
|
40
|
+
raise ValueError("must be one of enum values ('unauthorized')")
|
|
41
|
+
return value
|
|
42
|
+
|
|
43
|
+
model_config = ConfigDict(
|
|
44
|
+
validate_by_name=True,
|
|
45
|
+
validate_by_alias=True,
|
|
46
|
+
validate_assignment=True,
|
|
47
|
+
protected_namespaces=(),
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def to_str(self) -> str:
|
|
52
|
+
"""Returns the string representation of the model using alias"""
|
|
53
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
54
|
+
|
|
55
|
+
def to_json(self) -> str:
|
|
56
|
+
"""Returns the JSON representation of the model using alias"""
|
|
57
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
58
|
+
|
|
59
|
+
@classmethod
|
|
60
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
61
|
+
"""Create an instance of CreateCheckout401Response from a JSON string"""
|
|
62
|
+
return cls.from_dict(json.loads(json_str))
|
|
63
|
+
|
|
64
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
65
|
+
"""Return the dictionary representation of the model using alias.
|
|
66
|
+
|
|
67
|
+
This has the following differences from calling pydantic's
|
|
68
|
+
`self.model_dump(by_alias=True)`:
|
|
69
|
+
|
|
70
|
+
* `None` is only added to the output dict for nullable fields that
|
|
71
|
+
were set at model initialization. Other fields with value `None`
|
|
72
|
+
are ignored.
|
|
73
|
+
"""
|
|
74
|
+
excluded_fields: Set[str] = set([
|
|
75
|
+
])
|
|
76
|
+
|
|
77
|
+
_dict = self.model_dump(
|
|
78
|
+
by_alias=True,
|
|
79
|
+
exclude=excluded_fields,
|
|
80
|
+
exclude_none=True,
|
|
81
|
+
)
|
|
82
|
+
return _dict
|
|
83
|
+
|
|
84
|
+
@classmethod
|
|
85
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
86
|
+
"""Create an instance of CreateCheckout401Response from a dict"""
|
|
87
|
+
if obj is None:
|
|
88
|
+
return None
|
|
89
|
+
|
|
90
|
+
if not isinstance(obj, dict):
|
|
91
|
+
return cls.model_validate(obj)
|
|
92
|
+
|
|
93
|
+
_obj = cls.model_validate({
|
|
94
|
+
"message": obj.get("message"),
|
|
95
|
+
"error": obj.get("error"),
|
|
96
|
+
"code": obj.get("code"),
|
|
97
|
+
"metadata": obj.get("metadata")
|
|
98
|
+
})
|
|
99
|
+
return _obj
|
|
100
|
+
|
|
101
|
+
|