statuspro-openapi-client 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.
- statuspro_openapi_client-0.1.0.dist-info/METADATA +337 -0
- statuspro_openapi_client-0.1.0.dist-info/RECORD +74 -0
- statuspro_openapi_client-0.1.0.dist-info/WHEEL +4 -0
- statuspro_openapi_client-0.1.0.dist-info/entry_points.txt +3 -0
- statuspro_openapi_client-0.1.0.dist-info/licenses/LICENSE +21 -0
- statuspro_public_api_client/__init__.py +36 -0
- statuspro_public_api_client/_logging.py +33 -0
- statuspro_public_api_client/api/__init__.py +1 -0
- statuspro_public_api_client/api/orders/__init__.py +1 -0
- statuspro_public_api_client/api/orders/add_order_comment.py +215 -0
- statuspro_public_api_client/api/orders/bulk_update_order_status.py +194 -0
- statuspro_public_api_client/api/orders/get_order.py +188 -0
- statuspro_public_api_client/api/orders/get_viable_statuses.py +193 -0
- statuspro_public_api_client/api/orders/list_orders.py +366 -0
- statuspro_public_api_client/api/orders/lookup_order.py +208 -0
- statuspro_public_api_client/api/orders/set_order_due_date.py +215 -0
- statuspro_public_api_client/api/orders/update_order_status.py +215 -0
- statuspro_public_api_client/api/statuses/__init__.py +1 -0
- statuspro_public_api_client/api/statuses/get_statuses.py +161 -0
- statuspro_public_api_client/api_wrapper/__init__.py +15 -0
- statuspro_public_api_client/api_wrapper/_namespace.py +40 -0
- statuspro_public_api_client/api_wrapper/_registry.py +43 -0
- statuspro_public_api_client/api_wrapper/_resource.py +116 -0
- statuspro_public_api_client/client.py +267 -0
- statuspro_public_api_client/client_types.py +54 -0
- statuspro_public_api_client/domain/__init__.py +33 -0
- statuspro_public_api_client/domain/base.py +117 -0
- statuspro_public_api_client/domain/converters.py +71 -0
- statuspro_public_api_client/domain/order.py +87 -0
- statuspro_public_api_client/domain/status.py +30 -0
- statuspro_public_api_client/errors.py +16 -0
- statuspro_public_api_client/helpers/__init__.py +21 -0
- statuspro_public_api_client/helpers/base.py +26 -0
- statuspro_public_api_client/helpers/orders.py +78 -0
- statuspro_public_api_client/helpers/statuses.py +37 -0
- statuspro_public_api_client/log_setup.py +99 -0
- statuspro_public_api_client/models/__init__.py +53 -0
- statuspro_public_api_client/models/add_order_comment_request.py +68 -0
- statuspro_public_api_client/models/bulk_status_update_request.py +124 -0
- statuspro_public_api_client/models/bulk_status_update_response.py +72 -0
- statuspro_public_api_client/models/customer.py +74 -0
- statuspro_public_api_client/models/error_response.py +58 -0
- statuspro_public_api_client/models/history_item.py +171 -0
- statuspro_public_api_client/models/list_orders_financial_status_item.py +15 -0
- statuspro_public_api_client/models/list_orders_fulfillment_status_item.py +11 -0
- statuspro_public_api_client/models/locale_translation.py +66 -0
- statuspro_public_api_client/models/mail_log.py +82 -0
- statuspro_public_api_client/models/message_response.py +58 -0
- statuspro_public_api_client/models/order_list_item.py +180 -0
- statuspro_public_api_client/models/order_list_meta.py +120 -0
- statuspro_public_api_client/models/order_list_response.py +81 -0
- statuspro_public_api_client/models/order_response.py +220 -0
- statuspro_public_api_client/models/progress_timeline_item.py +93 -0
- statuspro_public_api_client/models/set_due_date_request.py +95 -0
- statuspro_public_api_client/models/status.py +190 -0
- statuspro_public_api_client/models/status_definition.py +82 -0
- statuspro_public_api_client/models/status_translations.py +62 -0
- statuspro_public_api_client/models/update_order_status_request.py +92 -0
- statuspro_public_api_client/models/validation_error_response.py +81 -0
- statuspro_public_api_client/models/validation_error_response_errors.py +54 -0
- statuspro_public_api_client/models/viable_status.py +82 -0
- statuspro_public_api_client/models_pydantic/__init__.py +122 -0
- statuspro_public_api_client/models_pydantic/_auto_registry.py +115 -0
- statuspro_public_api_client/models_pydantic/_base.py +349 -0
- statuspro_public_api_client/models_pydantic/_generated/__init__.py +53 -0
- statuspro_public_api_client/models_pydantic/_generated/errors.py +24 -0
- statuspro_public_api_client/models_pydantic/_generated/orders.py +136 -0
- statuspro_public_api_client/models_pydantic/_generated/statuses.py +25 -0
- statuspro_public_api_client/models_pydantic/_registry.py +171 -0
- statuspro_public_api_client/models_pydantic/converters.py +184 -0
- statuspro_public_api_client/py.typed +1 -0
- statuspro_public_api_client/statuspro-openapi.yaml +859 -0
- statuspro_public_api_client/statuspro_client.py +1156 -0
- statuspro_public_api_client/utils.py +290 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"""Contains all the data models used in inputs/outputs"""
|
|
2
|
+
|
|
3
|
+
from .add_order_comment_request import AddOrderCommentRequest
|
|
4
|
+
from .bulk_status_update_request import BulkStatusUpdateRequest
|
|
5
|
+
from .bulk_status_update_response import BulkStatusUpdateResponse
|
|
6
|
+
from .customer import Customer
|
|
7
|
+
from .error_response import ErrorResponse
|
|
8
|
+
from .history_item import HistoryItem
|
|
9
|
+
from .list_orders_financial_status_item import ListOrdersFinancialStatusItem
|
|
10
|
+
from .list_orders_fulfillment_status_item import ListOrdersFulfillmentStatusItem
|
|
11
|
+
from .locale_translation import LocaleTranslation
|
|
12
|
+
from .mail_log import MailLog
|
|
13
|
+
from .message_response import MessageResponse
|
|
14
|
+
from .order_list_item import OrderListItem
|
|
15
|
+
from .order_list_meta import OrderListMeta
|
|
16
|
+
from .order_list_response import OrderListResponse
|
|
17
|
+
from .order_response import OrderResponse
|
|
18
|
+
from .progress_timeline_item import ProgressTimelineItem
|
|
19
|
+
from .set_due_date_request import SetDueDateRequest
|
|
20
|
+
from .status import Status
|
|
21
|
+
from .status_definition import StatusDefinition
|
|
22
|
+
from .status_translations import StatusTranslations
|
|
23
|
+
from .update_order_status_request import UpdateOrderStatusRequest
|
|
24
|
+
from .validation_error_response import ValidationErrorResponse
|
|
25
|
+
from .validation_error_response_errors import ValidationErrorResponseErrors
|
|
26
|
+
from .viable_status import ViableStatus
|
|
27
|
+
|
|
28
|
+
__all__ = (
|
|
29
|
+
"AddOrderCommentRequest",
|
|
30
|
+
"BulkStatusUpdateRequest",
|
|
31
|
+
"BulkStatusUpdateResponse",
|
|
32
|
+
"Customer",
|
|
33
|
+
"ErrorResponse",
|
|
34
|
+
"HistoryItem",
|
|
35
|
+
"ListOrdersFinancialStatusItem",
|
|
36
|
+
"ListOrdersFulfillmentStatusItem",
|
|
37
|
+
"LocaleTranslation",
|
|
38
|
+
"MailLog",
|
|
39
|
+
"MessageResponse",
|
|
40
|
+
"OrderListItem",
|
|
41
|
+
"OrderListMeta",
|
|
42
|
+
"OrderListResponse",
|
|
43
|
+
"OrderResponse",
|
|
44
|
+
"ProgressTimelineItem",
|
|
45
|
+
"SetDueDateRequest",
|
|
46
|
+
"Status",
|
|
47
|
+
"StatusDefinition",
|
|
48
|
+
"StatusTranslations",
|
|
49
|
+
"UpdateOrderStatusRequest",
|
|
50
|
+
"ValidationErrorResponse",
|
|
51
|
+
"ValidationErrorResponseErrors",
|
|
52
|
+
"ViableStatus",
|
|
53
|
+
)
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import (
|
|
7
|
+
define as _attrs_define,
|
|
8
|
+
field as _attrs_field,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
from ..client_types import UNSET, Unset
|
|
12
|
+
|
|
13
|
+
T = TypeVar("T", bound="AddOrderCommentRequest")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@_attrs_define
|
|
17
|
+
class AddOrderCommentRequest:
|
|
18
|
+
comment: str
|
|
19
|
+
public: bool | Unset = False
|
|
20
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
21
|
+
|
|
22
|
+
def to_dict(self) -> dict[str, Any]:
|
|
23
|
+
comment = self.comment
|
|
24
|
+
|
|
25
|
+
public = self.public
|
|
26
|
+
|
|
27
|
+
field_dict: dict[str, Any] = {}
|
|
28
|
+
field_dict.update(self.additional_properties)
|
|
29
|
+
field_dict.update(
|
|
30
|
+
{
|
|
31
|
+
"comment": comment,
|
|
32
|
+
}
|
|
33
|
+
)
|
|
34
|
+
if public is not UNSET:
|
|
35
|
+
field_dict["public"] = public
|
|
36
|
+
|
|
37
|
+
return field_dict
|
|
38
|
+
|
|
39
|
+
@classmethod
|
|
40
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
41
|
+
d = dict(src_dict)
|
|
42
|
+
comment = d.pop("comment")
|
|
43
|
+
|
|
44
|
+
public = d.pop("public", UNSET)
|
|
45
|
+
|
|
46
|
+
add_order_comment_request = cls(
|
|
47
|
+
comment=comment,
|
|
48
|
+
public=public,
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
add_order_comment_request.additional_properties = d
|
|
52
|
+
return add_order_comment_request
|
|
53
|
+
|
|
54
|
+
@property
|
|
55
|
+
def additional_keys(self) -> list[str]:
|
|
56
|
+
return list(self.additional_properties.keys())
|
|
57
|
+
|
|
58
|
+
def __getitem__(self, key: str) -> Any:
|
|
59
|
+
return self.additional_properties[key]
|
|
60
|
+
|
|
61
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
62
|
+
self.additional_properties[key] = value
|
|
63
|
+
|
|
64
|
+
def __delitem__(self, key: str) -> None:
|
|
65
|
+
del self.additional_properties[key]
|
|
66
|
+
|
|
67
|
+
def __contains__(self, key: str) -> bool:
|
|
68
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import datetime
|
|
4
|
+
from collections.abc import Mapping
|
|
5
|
+
from typing import Any, TypeVar, cast
|
|
6
|
+
|
|
7
|
+
from attrs import (
|
|
8
|
+
define as _attrs_define,
|
|
9
|
+
field as _attrs_field,
|
|
10
|
+
)
|
|
11
|
+
from dateutil.parser import isoparse
|
|
12
|
+
|
|
13
|
+
from ..client_types import UNSET, Unset
|
|
14
|
+
|
|
15
|
+
T = TypeVar("T", bound="BulkStatusUpdateRequest")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@_attrs_define
|
|
19
|
+
class BulkStatusUpdateRequest:
|
|
20
|
+
order_ids: list[int]
|
|
21
|
+
status_code: str
|
|
22
|
+
comment: str | Unset = UNSET
|
|
23
|
+
public: bool | Unset = False
|
|
24
|
+
email_customer: bool | Unset = True
|
|
25
|
+
email_additional: bool | Unset = True
|
|
26
|
+
send_at: int | Unset = UNSET
|
|
27
|
+
due_date: datetime.date | Unset = UNSET
|
|
28
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
29
|
+
|
|
30
|
+
def to_dict(self) -> dict[str, Any]:
|
|
31
|
+
order_ids = self.order_ids
|
|
32
|
+
|
|
33
|
+
status_code = self.status_code
|
|
34
|
+
|
|
35
|
+
comment = self.comment
|
|
36
|
+
|
|
37
|
+
public = self.public
|
|
38
|
+
|
|
39
|
+
email_customer = self.email_customer
|
|
40
|
+
|
|
41
|
+
email_additional = self.email_additional
|
|
42
|
+
|
|
43
|
+
send_at = self.send_at
|
|
44
|
+
|
|
45
|
+
due_date: str | Unset = UNSET
|
|
46
|
+
if not isinstance(self.due_date, Unset):
|
|
47
|
+
due_date = self.due_date.isoformat()
|
|
48
|
+
|
|
49
|
+
field_dict: dict[str, Any] = {}
|
|
50
|
+
field_dict.update(self.additional_properties)
|
|
51
|
+
field_dict.update(
|
|
52
|
+
{
|
|
53
|
+
"order_ids": order_ids,
|
|
54
|
+
"status_code": status_code,
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
if comment is not UNSET:
|
|
58
|
+
field_dict["comment"] = comment
|
|
59
|
+
if public is not UNSET:
|
|
60
|
+
field_dict["public"] = public
|
|
61
|
+
if email_customer is not UNSET:
|
|
62
|
+
field_dict["email_customer"] = email_customer
|
|
63
|
+
if email_additional is not UNSET:
|
|
64
|
+
field_dict["email_additional"] = email_additional
|
|
65
|
+
if send_at is not UNSET:
|
|
66
|
+
field_dict["send_at"] = send_at
|
|
67
|
+
if due_date is not UNSET:
|
|
68
|
+
field_dict["due_date"] = due_date
|
|
69
|
+
|
|
70
|
+
return field_dict
|
|
71
|
+
|
|
72
|
+
@classmethod
|
|
73
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
74
|
+
d = dict(src_dict)
|
|
75
|
+
order_ids = cast(list[int], d.pop("order_ids"))
|
|
76
|
+
|
|
77
|
+
status_code = d.pop("status_code")
|
|
78
|
+
|
|
79
|
+
comment = d.pop("comment", UNSET)
|
|
80
|
+
|
|
81
|
+
public = d.pop("public", UNSET)
|
|
82
|
+
|
|
83
|
+
email_customer = d.pop("email_customer", UNSET)
|
|
84
|
+
|
|
85
|
+
email_additional = d.pop("email_additional", UNSET)
|
|
86
|
+
|
|
87
|
+
send_at = d.pop("send_at", UNSET)
|
|
88
|
+
|
|
89
|
+
_due_date = d.pop("due_date", UNSET)
|
|
90
|
+
due_date: datetime.date | Unset
|
|
91
|
+
if isinstance(_due_date, Unset):
|
|
92
|
+
due_date = UNSET
|
|
93
|
+
else:
|
|
94
|
+
due_date = isoparse(_due_date).date()
|
|
95
|
+
|
|
96
|
+
bulk_status_update_request = cls(
|
|
97
|
+
order_ids=order_ids,
|
|
98
|
+
status_code=status_code,
|
|
99
|
+
comment=comment,
|
|
100
|
+
public=public,
|
|
101
|
+
email_customer=email_customer,
|
|
102
|
+
email_additional=email_additional,
|
|
103
|
+
send_at=send_at,
|
|
104
|
+
due_date=due_date,
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
bulk_status_update_request.additional_properties = d
|
|
108
|
+
return bulk_status_update_request
|
|
109
|
+
|
|
110
|
+
@property
|
|
111
|
+
def additional_keys(self) -> list[str]:
|
|
112
|
+
return list(self.additional_properties.keys())
|
|
113
|
+
|
|
114
|
+
def __getitem__(self, key: str) -> Any:
|
|
115
|
+
return self.additional_properties[key]
|
|
116
|
+
|
|
117
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
118
|
+
self.additional_properties[key] = value
|
|
119
|
+
|
|
120
|
+
def __delitem__(self, key: str) -> None:
|
|
121
|
+
del self.additional_properties[key]
|
|
122
|
+
|
|
123
|
+
def __contains__(self, key: str) -> bool:
|
|
124
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import (
|
|
7
|
+
define as _attrs_define,
|
|
8
|
+
field as _attrs_field,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
T = TypeVar("T", bound="BulkStatusUpdateResponse")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@_attrs_define
|
|
15
|
+
class BulkStatusUpdateResponse:
|
|
16
|
+
message: str
|
|
17
|
+
count: int
|
|
18
|
+
limit: int
|
|
19
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
20
|
+
|
|
21
|
+
def to_dict(self) -> dict[str, Any]:
|
|
22
|
+
message = self.message
|
|
23
|
+
|
|
24
|
+
count = self.count
|
|
25
|
+
|
|
26
|
+
limit = self.limit
|
|
27
|
+
|
|
28
|
+
field_dict: dict[str, Any] = {}
|
|
29
|
+
field_dict.update(self.additional_properties)
|
|
30
|
+
field_dict.update(
|
|
31
|
+
{
|
|
32
|
+
"message": message,
|
|
33
|
+
"count": count,
|
|
34
|
+
"limit": limit,
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
return field_dict
|
|
39
|
+
|
|
40
|
+
@classmethod
|
|
41
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
42
|
+
d = dict(src_dict)
|
|
43
|
+
message = d.pop("message")
|
|
44
|
+
|
|
45
|
+
count = d.pop("count")
|
|
46
|
+
|
|
47
|
+
limit = d.pop("limit")
|
|
48
|
+
|
|
49
|
+
bulk_status_update_response = cls(
|
|
50
|
+
message=message,
|
|
51
|
+
count=count,
|
|
52
|
+
limit=limit,
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
bulk_status_update_response.additional_properties = d
|
|
56
|
+
return bulk_status_update_response
|
|
57
|
+
|
|
58
|
+
@property
|
|
59
|
+
def additional_keys(self) -> list[str]:
|
|
60
|
+
return list(self.additional_properties.keys())
|
|
61
|
+
|
|
62
|
+
def __getitem__(self, key: str) -> Any:
|
|
63
|
+
return self.additional_properties[key]
|
|
64
|
+
|
|
65
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
66
|
+
self.additional_properties[key] = value
|
|
67
|
+
|
|
68
|
+
def __delitem__(self, key: str) -> None:
|
|
69
|
+
del self.additional_properties[key]
|
|
70
|
+
|
|
71
|
+
def __contains__(self, key: str) -> bool:
|
|
72
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import (
|
|
7
|
+
define as _attrs_define,
|
|
8
|
+
field as _attrs_field,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
from ..client_types import UNSET, Unset
|
|
12
|
+
|
|
13
|
+
T = TypeVar("T", bound="Customer")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@_attrs_define
|
|
17
|
+
class Customer:
|
|
18
|
+
name: str | Unset = UNSET
|
|
19
|
+
email: str | Unset = UNSET
|
|
20
|
+
locale: str | Unset = UNSET
|
|
21
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
22
|
+
|
|
23
|
+
def to_dict(self) -> dict[str, Any]:
|
|
24
|
+
name = self.name
|
|
25
|
+
|
|
26
|
+
email = self.email
|
|
27
|
+
|
|
28
|
+
locale = self.locale
|
|
29
|
+
|
|
30
|
+
field_dict: dict[str, Any] = {}
|
|
31
|
+
field_dict.update(self.additional_properties)
|
|
32
|
+
field_dict.update({})
|
|
33
|
+
if name is not UNSET:
|
|
34
|
+
field_dict["name"] = name
|
|
35
|
+
if email is not UNSET:
|
|
36
|
+
field_dict["email"] = email
|
|
37
|
+
if locale is not UNSET:
|
|
38
|
+
field_dict["locale"] = locale
|
|
39
|
+
|
|
40
|
+
return field_dict
|
|
41
|
+
|
|
42
|
+
@classmethod
|
|
43
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
44
|
+
d = dict(src_dict)
|
|
45
|
+
name = d.pop("name", UNSET)
|
|
46
|
+
|
|
47
|
+
email = d.pop("email", UNSET)
|
|
48
|
+
|
|
49
|
+
locale = d.pop("locale", UNSET)
|
|
50
|
+
|
|
51
|
+
customer = cls(
|
|
52
|
+
name=name,
|
|
53
|
+
email=email,
|
|
54
|
+
locale=locale,
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
customer.additional_properties = d
|
|
58
|
+
return customer
|
|
59
|
+
|
|
60
|
+
@property
|
|
61
|
+
def additional_keys(self) -> list[str]:
|
|
62
|
+
return list(self.additional_properties.keys())
|
|
63
|
+
|
|
64
|
+
def __getitem__(self, key: str) -> Any:
|
|
65
|
+
return self.additional_properties[key]
|
|
66
|
+
|
|
67
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
68
|
+
self.additional_properties[key] = value
|
|
69
|
+
|
|
70
|
+
def __delitem__(self, key: str) -> None:
|
|
71
|
+
del self.additional_properties[key]
|
|
72
|
+
|
|
73
|
+
def __contains__(self, key: str) -> bool:
|
|
74
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import (
|
|
7
|
+
define as _attrs_define,
|
|
8
|
+
field as _attrs_field,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
from ..client_types import UNSET, Unset
|
|
12
|
+
|
|
13
|
+
T = TypeVar("T", bound="ErrorResponse")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@_attrs_define
|
|
17
|
+
class ErrorResponse:
|
|
18
|
+
message: str | Unset = UNSET
|
|
19
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
20
|
+
|
|
21
|
+
def to_dict(self) -> dict[str, Any]:
|
|
22
|
+
message = self.message
|
|
23
|
+
|
|
24
|
+
field_dict: dict[str, Any] = {}
|
|
25
|
+
field_dict.update(self.additional_properties)
|
|
26
|
+
field_dict.update({})
|
|
27
|
+
if message is not UNSET:
|
|
28
|
+
field_dict["message"] = message
|
|
29
|
+
|
|
30
|
+
return field_dict
|
|
31
|
+
|
|
32
|
+
@classmethod
|
|
33
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
34
|
+
d = dict(src_dict)
|
|
35
|
+
message = d.pop("message", UNSET)
|
|
36
|
+
|
|
37
|
+
error_response = cls(
|
|
38
|
+
message=message,
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
error_response.additional_properties = d
|
|
42
|
+
return error_response
|
|
43
|
+
|
|
44
|
+
@property
|
|
45
|
+
def additional_keys(self) -> list[str]:
|
|
46
|
+
return list(self.additional_properties.keys())
|
|
47
|
+
|
|
48
|
+
def __getitem__(self, key: str) -> Any:
|
|
49
|
+
return self.additional_properties[key]
|
|
50
|
+
|
|
51
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
52
|
+
self.additional_properties[key] = value
|
|
53
|
+
|
|
54
|
+
def __delitem__(self, key: str) -> None:
|
|
55
|
+
del self.additional_properties[key]
|
|
56
|
+
|
|
57
|
+
def __contains__(self, key: str) -> bool:
|
|
58
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import datetime
|
|
4
|
+
from collections.abc import Mapping
|
|
5
|
+
from typing import TYPE_CHECKING, Any, TypeVar, cast
|
|
6
|
+
|
|
7
|
+
from attrs import (
|
|
8
|
+
define as _attrs_define,
|
|
9
|
+
field as _attrs_field,
|
|
10
|
+
)
|
|
11
|
+
from dateutil.parser import isoparse
|
|
12
|
+
|
|
13
|
+
from ..client_types import UNSET, Unset
|
|
14
|
+
|
|
15
|
+
if TYPE_CHECKING:
|
|
16
|
+
from ..models.mail_log import MailLog
|
|
17
|
+
from ..models.status import Status
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
T = TypeVar("T", bound="HistoryItem")
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
@_attrs_define
|
|
24
|
+
class HistoryItem:
|
|
25
|
+
event: str | Unset = UNSET
|
|
26
|
+
status: None | Status | Unset = UNSET
|
|
27
|
+
comment: None | str | Unset = UNSET
|
|
28
|
+
comment_is_public: bool | Unset = UNSET
|
|
29
|
+
created_at: datetime.datetime | Unset = UNSET
|
|
30
|
+
mail_log: MailLog | None | Unset = UNSET
|
|
31
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
32
|
+
|
|
33
|
+
def to_dict(self) -> dict[str, Any]:
|
|
34
|
+
from ..models.mail_log import MailLog
|
|
35
|
+
from ..models.status import Status
|
|
36
|
+
|
|
37
|
+
event = self.event
|
|
38
|
+
|
|
39
|
+
status: dict[str, Any] | None | Unset
|
|
40
|
+
if isinstance(self.status, Unset):
|
|
41
|
+
status = UNSET
|
|
42
|
+
elif isinstance(self.status, Status):
|
|
43
|
+
status = self.status.to_dict()
|
|
44
|
+
else:
|
|
45
|
+
status = self.status
|
|
46
|
+
|
|
47
|
+
comment: None | str | Unset
|
|
48
|
+
if isinstance(self.comment, Unset):
|
|
49
|
+
comment = UNSET
|
|
50
|
+
else:
|
|
51
|
+
comment = self.comment
|
|
52
|
+
|
|
53
|
+
comment_is_public = self.comment_is_public
|
|
54
|
+
|
|
55
|
+
created_at: str | Unset = UNSET
|
|
56
|
+
if not isinstance(self.created_at, Unset):
|
|
57
|
+
created_at = self.created_at.isoformat()
|
|
58
|
+
|
|
59
|
+
mail_log: dict[str, Any] | None | Unset
|
|
60
|
+
if isinstance(self.mail_log, Unset):
|
|
61
|
+
mail_log = UNSET
|
|
62
|
+
elif isinstance(self.mail_log, MailLog):
|
|
63
|
+
mail_log = self.mail_log.to_dict()
|
|
64
|
+
else:
|
|
65
|
+
mail_log = self.mail_log
|
|
66
|
+
|
|
67
|
+
field_dict: dict[str, Any] = {}
|
|
68
|
+
field_dict.update(self.additional_properties)
|
|
69
|
+
field_dict.update({})
|
|
70
|
+
if event is not UNSET:
|
|
71
|
+
field_dict["event"] = event
|
|
72
|
+
if status is not UNSET:
|
|
73
|
+
field_dict["status"] = status
|
|
74
|
+
if comment is not UNSET:
|
|
75
|
+
field_dict["comment"] = comment
|
|
76
|
+
if comment_is_public is not UNSET:
|
|
77
|
+
field_dict["comment_is_public"] = comment_is_public
|
|
78
|
+
if created_at is not UNSET:
|
|
79
|
+
field_dict["created_at"] = created_at
|
|
80
|
+
if mail_log is not UNSET:
|
|
81
|
+
field_dict["mail_log"] = mail_log
|
|
82
|
+
|
|
83
|
+
return field_dict
|
|
84
|
+
|
|
85
|
+
@classmethod
|
|
86
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
87
|
+
from ..models.mail_log import MailLog
|
|
88
|
+
from ..models.status import Status
|
|
89
|
+
|
|
90
|
+
d = dict(src_dict)
|
|
91
|
+
event = d.pop("event", UNSET)
|
|
92
|
+
|
|
93
|
+
def _parse_status(data: object) -> None | Status | Unset:
|
|
94
|
+
if data is None:
|
|
95
|
+
return data
|
|
96
|
+
if isinstance(data, Unset):
|
|
97
|
+
return data
|
|
98
|
+
try:
|
|
99
|
+
if not isinstance(data, dict):
|
|
100
|
+
raise TypeError()
|
|
101
|
+
status_type_0 = Status.from_dict(cast(Mapping[str, Any], data))
|
|
102
|
+
|
|
103
|
+
return status_type_0
|
|
104
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
105
|
+
pass
|
|
106
|
+
return cast(None | Status | Unset, data)
|
|
107
|
+
|
|
108
|
+
status = _parse_status(d.pop("status", UNSET))
|
|
109
|
+
|
|
110
|
+
def _parse_comment(data: object) -> None | str | Unset:
|
|
111
|
+
if data is None:
|
|
112
|
+
return data
|
|
113
|
+
if isinstance(data, Unset):
|
|
114
|
+
return data
|
|
115
|
+
return cast(None | str | Unset, data)
|
|
116
|
+
|
|
117
|
+
comment = _parse_comment(d.pop("comment", UNSET))
|
|
118
|
+
|
|
119
|
+
comment_is_public = d.pop("comment_is_public", UNSET)
|
|
120
|
+
|
|
121
|
+
_created_at = d.pop("created_at", UNSET)
|
|
122
|
+
created_at: datetime.datetime | Unset
|
|
123
|
+
if isinstance(_created_at, Unset):
|
|
124
|
+
created_at = UNSET
|
|
125
|
+
else:
|
|
126
|
+
created_at = isoparse(_created_at)
|
|
127
|
+
|
|
128
|
+
def _parse_mail_log(data: object) -> MailLog | None | Unset:
|
|
129
|
+
if data is None:
|
|
130
|
+
return data
|
|
131
|
+
if isinstance(data, Unset):
|
|
132
|
+
return data
|
|
133
|
+
try:
|
|
134
|
+
if not isinstance(data, dict):
|
|
135
|
+
raise TypeError()
|
|
136
|
+
mail_log_type_0 = MailLog.from_dict(cast(Mapping[str, Any], data))
|
|
137
|
+
|
|
138
|
+
return mail_log_type_0
|
|
139
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
140
|
+
pass
|
|
141
|
+
return cast(MailLog | None | Unset, data)
|
|
142
|
+
|
|
143
|
+
mail_log = _parse_mail_log(d.pop("mail_log", UNSET))
|
|
144
|
+
|
|
145
|
+
history_item = cls(
|
|
146
|
+
event=event,
|
|
147
|
+
status=status,
|
|
148
|
+
comment=comment,
|
|
149
|
+
comment_is_public=comment_is_public,
|
|
150
|
+
created_at=created_at,
|
|
151
|
+
mail_log=mail_log,
|
|
152
|
+
)
|
|
153
|
+
|
|
154
|
+
history_item.additional_properties = d
|
|
155
|
+
return history_item
|
|
156
|
+
|
|
157
|
+
@property
|
|
158
|
+
def additional_keys(self) -> list[str]:
|
|
159
|
+
return list(self.additional_properties.keys())
|
|
160
|
+
|
|
161
|
+
def __getitem__(self, key: str) -> Any:
|
|
162
|
+
return self.additional_properties[key]
|
|
163
|
+
|
|
164
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
165
|
+
self.additional_properties[key] = value
|
|
166
|
+
|
|
167
|
+
def __delitem__(self, key: str) -> None:
|
|
168
|
+
del self.additional_properties[key]
|
|
169
|
+
|
|
170
|
+
def __contains__(self, key: str) -> bool:
|
|
171
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
from enum import StrEnum
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class ListOrdersFinancialStatusItem(StrEnum):
|
|
5
|
+
AUTHORIZED = "authorized"
|
|
6
|
+
PAID = "paid"
|
|
7
|
+
PARTIALLY_PAID = "partially_paid"
|
|
8
|
+
PARTIALLY_REFUNDED = "partially_refunded"
|
|
9
|
+
PENDING = "pending"
|
|
10
|
+
REFUNDED = "refunded"
|
|
11
|
+
UNPAID = "unpaid"
|
|
12
|
+
VOIDED = "voided"
|
|
13
|
+
|
|
14
|
+
def __str__(self) -> str:
|
|
15
|
+
return str(self.value)
|