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,220 @@
|
|
|
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.customer import Customer
|
|
17
|
+
from ..models.history_item import HistoryItem
|
|
18
|
+
from ..models.progress_timeline_item import ProgressTimelineItem
|
|
19
|
+
from ..models.status import Status
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
T = TypeVar("T", bound="OrderResponse")
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@_attrs_define
|
|
26
|
+
class OrderResponse:
|
|
27
|
+
id: int | Unset = UNSET
|
|
28
|
+
name: str | Unset = UNSET
|
|
29
|
+
order_number: str | Unset = UNSET
|
|
30
|
+
customer: Customer | Unset = UNSET
|
|
31
|
+
status: Status | Unset = UNSET
|
|
32
|
+
history: list[HistoryItem] | Unset = UNSET
|
|
33
|
+
public_progress_timeline: list[ProgressTimelineItem] | Unset = UNSET
|
|
34
|
+
due_date: datetime.datetime | None | Unset = UNSET
|
|
35
|
+
due_date_to: datetime.datetime | None | Unset = UNSET
|
|
36
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
37
|
+
|
|
38
|
+
def to_dict(self) -> dict[str, Any]:
|
|
39
|
+
id = self.id
|
|
40
|
+
|
|
41
|
+
name = self.name
|
|
42
|
+
|
|
43
|
+
order_number = self.order_number
|
|
44
|
+
|
|
45
|
+
customer: dict[str, Any] | Unset = UNSET
|
|
46
|
+
if not isinstance(self.customer, Unset):
|
|
47
|
+
customer = self.customer.to_dict()
|
|
48
|
+
|
|
49
|
+
status: dict[str, Any] | Unset = UNSET
|
|
50
|
+
if not isinstance(self.status, Unset):
|
|
51
|
+
status = self.status.to_dict()
|
|
52
|
+
|
|
53
|
+
history: list[dict[str, Any]] | Unset = UNSET
|
|
54
|
+
if not isinstance(self.history, Unset):
|
|
55
|
+
history = []
|
|
56
|
+
for history_item_data in self.history:
|
|
57
|
+
history_item = history_item_data.to_dict()
|
|
58
|
+
history.append(history_item)
|
|
59
|
+
|
|
60
|
+
public_progress_timeline: list[dict[str, Any]] | Unset = UNSET
|
|
61
|
+
if not isinstance(self.public_progress_timeline, Unset):
|
|
62
|
+
public_progress_timeline = []
|
|
63
|
+
for public_progress_timeline_item_data in self.public_progress_timeline:
|
|
64
|
+
public_progress_timeline_item = (
|
|
65
|
+
public_progress_timeline_item_data.to_dict()
|
|
66
|
+
)
|
|
67
|
+
public_progress_timeline.append(public_progress_timeline_item)
|
|
68
|
+
|
|
69
|
+
due_date: None | str | Unset
|
|
70
|
+
if isinstance(self.due_date, Unset):
|
|
71
|
+
due_date = UNSET
|
|
72
|
+
elif isinstance(self.due_date, datetime.datetime):
|
|
73
|
+
due_date = self.due_date.isoformat()
|
|
74
|
+
else:
|
|
75
|
+
due_date = self.due_date
|
|
76
|
+
|
|
77
|
+
due_date_to: None | str | Unset
|
|
78
|
+
if isinstance(self.due_date_to, Unset):
|
|
79
|
+
due_date_to = UNSET
|
|
80
|
+
elif isinstance(self.due_date_to, datetime.datetime):
|
|
81
|
+
due_date_to = self.due_date_to.isoformat()
|
|
82
|
+
else:
|
|
83
|
+
due_date_to = self.due_date_to
|
|
84
|
+
|
|
85
|
+
field_dict: dict[str, Any] = {}
|
|
86
|
+
field_dict.update(self.additional_properties)
|
|
87
|
+
field_dict.update({})
|
|
88
|
+
if id is not UNSET:
|
|
89
|
+
field_dict["id"] = id
|
|
90
|
+
if name is not UNSET:
|
|
91
|
+
field_dict["name"] = name
|
|
92
|
+
if order_number is not UNSET:
|
|
93
|
+
field_dict["order_number"] = order_number
|
|
94
|
+
if customer is not UNSET:
|
|
95
|
+
field_dict["customer"] = customer
|
|
96
|
+
if status is not UNSET:
|
|
97
|
+
field_dict["status"] = status
|
|
98
|
+
if history is not UNSET:
|
|
99
|
+
field_dict["history"] = history
|
|
100
|
+
if public_progress_timeline is not UNSET:
|
|
101
|
+
field_dict["public_progress_timeline"] = public_progress_timeline
|
|
102
|
+
if due_date is not UNSET:
|
|
103
|
+
field_dict["due_date"] = due_date
|
|
104
|
+
if due_date_to is not UNSET:
|
|
105
|
+
field_dict["due_date_to"] = due_date_to
|
|
106
|
+
|
|
107
|
+
return field_dict
|
|
108
|
+
|
|
109
|
+
@classmethod
|
|
110
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
111
|
+
from ..models.customer import Customer
|
|
112
|
+
from ..models.history_item import HistoryItem
|
|
113
|
+
from ..models.progress_timeline_item import ProgressTimelineItem
|
|
114
|
+
from ..models.status import Status
|
|
115
|
+
|
|
116
|
+
d = dict(src_dict)
|
|
117
|
+
id = d.pop("id", UNSET)
|
|
118
|
+
|
|
119
|
+
name = d.pop("name", UNSET)
|
|
120
|
+
|
|
121
|
+
order_number = d.pop("order_number", UNSET)
|
|
122
|
+
|
|
123
|
+
_customer = d.pop("customer", UNSET)
|
|
124
|
+
customer: Customer | Unset
|
|
125
|
+
if isinstance(_customer, Unset):
|
|
126
|
+
customer = UNSET
|
|
127
|
+
else:
|
|
128
|
+
customer = Customer.from_dict(_customer)
|
|
129
|
+
|
|
130
|
+
_status = d.pop("status", UNSET)
|
|
131
|
+
status: Status | Unset
|
|
132
|
+
if isinstance(_status, Unset):
|
|
133
|
+
status = UNSET
|
|
134
|
+
else:
|
|
135
|
+
status = Status.from_dict(_status)
|
|
136
|
+
|
|
137
|
+
_history = d.pop("history", UNSET)
|
|
138
|
+
history: list[HistoryItem] | Unset = UNSET
|
|
139
|
+
if _history is not UNSET:
|
|
140
|
+
history = []
|
|
141
|
+
for history_item_data in _history:
|
|
142
|
+
history_item = HistoryItem.from_dict(history_item_data)
|
|
143
|
+
|
|
144
|
+
history.append(history_item)
|
|
145
|
+
|
|
146
|
+
_public_progress_timeline = d.pop("public_progress_timeline", UNSET)
|
|
147
|
+
public_progress_timeline: list[ProgressTimelineItem] | Unset = UNSET
|
|
148
|
+
if _public_progress_timeline is not UNSET:
|
|
149
|
+
public_progress_timeline = []
|
|
150
|
+
for public_progress_timeline_item_data in _public_progress_timeline:
|
|
151
|
+
public_progress_timeline_item = ProgressTimelineItem.from_dict(
|
|
152
|
+
public_progress_timeline_item_data
|
|
153
|
+
)
|
|
154
|
+
|
|
155
|
+
public_progress_timeline.append(public_progress_timeline_item)
|
|
156
|
+
|
|
157
|
+
def _parse_due_date(data: object) -> datetime.datetime | None | Unset:
|
|
158
|
+
if data is None:
|
|
159
|
+
return data
|
|
160
|
+
if isinstance(data, Unset):
|
|
161
|
+
return data
|
|
162
|
+
try:
|
|
163
|
+
if not isinstance(data, str):
|
|
164
|
+
raise TypeError()
|
|
165
|
+
due_date_type_0 = isoparse(data)
|
|
166
|
+
|
|
167
|
+
return due_date_type_0
|
|
168
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
169
|
+
pass
|
|
170
|
+
return cast(datetime.datetime | None | Unset, data)
|
|
171
|
+
|
|
172
|
+
due_date = _parse_due_date(d.pop("due_date", UNSET))
|
|
173
|
+
|
|
174
|
+
def _parse_due_date_to(data: object) -> datetime.datetime | None | Unset:
|
|
175
|
+
if data is None:
|
|
176
|
+
return data
|
|
177
|
+
if isinstance(data, Unset):
|
|
178
|
+
return data
|
|
179
|
+
try:
|
|
180
|
+
if not isinstance(data, str):
|
|
181
|
+
raise TypeError()
|
|
182
|
+
due_date_to_type_0 = isoparse(data)
|
|
183
|
+
|
|
184
|
+
return due_date_to_type_0
|
|
185
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
186
|
+
pass
|
|
187
|
+
return cast(datetime.datetime | None | Unset, data)
|
|
188
|
+
|
|
189
|
+
due_date_to = _parse_due_date_to(d.pop("due_date_to", UNSET))
|
|
190
|
+
|
|
191
|
+
order_response = cls(
|
|
192
|
+
id=id,
|
|
193
|
+
name=name,
|
|
194
|
+
order_number=order_number,
|
|
195
|
+
customer=customer,
|
|
196
|
+
status=status,
|
|
197
|
+
history=history,
|
|
198
|
+
public_progress_timeline=public_progress_timeline,
|
|
199
|
+
due_date=due_date,
|
|
200
|
+
due_date_to=due_date_to,
|
|
201
|
+
)
|
|
202
|
+
|
|
203
|
+
order_response.additional_properties = d
|
|
204
|
+
return order_response
|
|
205
|
+
|
|
206
|
+
@property
|
|
207
|
+
def additional_keys(self) -> list[str]:
|
|
208
|
+
return list(self.additional_properties.keys())
|
|
209
|
+
|
|
210
|
+
def __getitem__(self, key: str) -> Any:
|
|
211
|
+
return self.additional_properties[key]
|
|
212
|
+
|
|
213
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
214
|
+
self.additional_properties[key] = value
|
|
215
|
+
|
|
216
|
+
def __delitem__(self, key: str) -> None:
|
|
217
|
+
del self.additional_properties[key]
|
|
218
|
+
|
|
219
|
+
def __contains__(self, key: str) -> bool:
|
|
220
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar, cast
|
|
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="ProgressTimelineItem")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@_attrs_define
|
|
17
|
+
class ProgressTimelineItem:
|
|
18
|
+
name: str | Unset = UNSET
|
|
19
|
+
description: str | Unset = UNSET
|
|
20
|
+
progress: str | Unset = UNSET
|
|
21
|
+
timestamp: None | str | Unset = UNSET
|
|
22
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
23
|
+
|
|
24
|
+
def to_dict(self) -> dict[str, Any]:
|
|
25
|
+
name = self.name
|
|
26
|
+
|
|
27
|
+
description = self.description
|
|
28
|
+
|
|
29
|
+
progress = self.progress
|
|
30
|
+
|
|
31
|
+
timestamp: None | str | Unset
|
|
32
|
+
if isinstance(self.timestamp, Unset):
|
|
33
|
+
timestamp = UNSET
|
|
34
|
+
else:
|
|
35
|
+
timestamp = self.timestamp
|
|
36
|
+
|
|
37
|
+
field_dict: dict[str, Any] = {}
|
|
38
|
+
field_dict.update(self.additional_properties)
|
|
39
|
+
field_dict.update({})
|
|
40
|
+
if name is not UNSET:
|
|
41
|
+
field_dict["name"] = name
|
|
42
|
+
if description is not UNSET:
|
|
43
|
+
field_dict["description"] = description
|
|
44
|
+
if progress is not UNSET:
|
|
45
|
+
field_dict["progress"] = progress
|
|
46
|
+
if timestamp is not UNSET:
|
|
47
|
+
field_dict["timestamp"] = timestamp
|
|
48
|
+
|
|
49
|
+
return field_dict
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
53
|
+
d = dict(src_dict)
|
|
54
|
+
name = d.pop("name", UNSET)
|
|
55
|
+
|
|
56
|
+
description = d.pop("description", UNSET)
|
|
57
|
+
|
|
58
|
+
progress = d.pop("progress", UNSET)
|
|
59
|
+
|
|
60
|
+
def _parse_timestamp(data: object) -> None | str | Unset:
|
|
61
|
+
if data is None:
|
|
62
|
+
return data
|
|
63
|
+
if isinstance(data, Unset):
|
|
64
|
+
return data
|
|
65
|
+
return cast(None | str | Unset, data)
|
|
66
|
+
|
|
67
|
+
timestamp = _parse_timestamp(d.pop("timestamp", UNSET))
|
|
68
|
+
|
|
69
|
+
progress_timeline_item = cls(
|
|
70
|
+
name=name,
|
|
71
|
+
description=description,
|
|
72
|
+
progress=progress,
|
|
73
|
+
timestamp=timestamp,
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
progress_timeline_item.additional_properties = d
|
|
77
|
+
return progress_timeline_item
|
|
78
|
+
|
|
79
|
+
@property
|
|
80
|
+
def additional_keys(self) -> list[str]:
|
|
81
|
+
return list(self.additional_properties.keys())
|
|
82
|
+
|
|
83
|
+
def __getitem__(self, key: str) -> Any:
|
|
84
|
+
return self.additional_properties[key]
|
|
85
|
+
|
|
86
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
87
|
+
self.additional_properties[key] = value
|
|
88
|
+
|
|
89
|
+
def __delitem__(self, key: str) -> None:
|
|
90
|
+
del self.additional_properties[key]
|
|
91
|
+
|
|
92
|
+
def __contains__(self, key: str) -> bool:
|
|
93
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,95 @@
|
|
|
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="SetDueDateRequest")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@_attrs_define
|
|
19
|
+
class SetDueDateRequest:
|
|
20
|
+
due_date: datetime.date | None
|
|
21
|
+
due_date_to: datetime.date | Unset = UNSET
|
|
22
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
23
|
+
|
|
24
|
+
def to_dict(self) -> dict[str, Any]:
|
|
25
|
+
due_date: None | str
|
|
26
|
+
if isinstance(self.due_date, datetime.date):
|
|
27
|
+
due_date = self.due_date.isoformat()
|
|
28
|
+
else:
|
|
29
|
+
due_date = self.due_date
|
|
30
|
+
|
|
31
|
+
due_date_to: str | Unset = UNSET
|
|
32
|
+
if not isinstance(self.due_date_to, Unset):
|
|
33
|
+
due_date_to = self.due_date_to.isoformat()
|
|
34
|
+
|
|
35
|
+
field_dict: dict[str, Any] = {}
|
|
36
|
+
field_dict.update(self.additional_properties)
|
|
37
|
+
field_dict.update(
|
|
38
|
+
{
|
|
39
|
+
"due_date": due_date,
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
if due_date_to is not UNSET:
|
|
43
|
+
field_dict["due_date_to"] = due_date_to
|
|
44
|
+
|
|
45
|
+
return field_dict
|
|
46
|
+
|
|
47
|
+
@classmethod
|
|
48
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
49
|
+
d = dict(src_dict)
|
|
50
|
+
|
|
51
|
+
def _parse_due_date(data: object) -> datetime.date | None:
|
|
52
|
+
if data is None:
|
|
53
|
+
return data
|
|
54
|
+
try:
|
|
55
|
+
if not isinstance(data, str):
|
|
56
|
+
raise TypeError()
|
|
57
|
+
due_date_type_0 = isoparse(data).date()
|
|
58
|
+
|
|
59
|
+
return due_date_type_0
|
|
60
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
61
|
+
pass
|
|
62
|
+
return cast(datetime.date | None, data)
|
|
63
|
+
|
|
64
|
+
due_date = _parse_due_date(d.pop("due_date"))
|
|
65
|
+
|
|
66
|
+
_due_date_to = d.pop("due_date_to", UNSET)
|
|
67
|
+
due_date_to: datetime.date | Unset
|
|
68
|
+
if isinstance(_due_date_to, Unset):
|
|
69
|
+
due_date_to = UNSET
|
|
70
|
+
else:
|
|
71
|
+
due_date_to = isoparse(_due_date_to).date()
|
|
72
|
+
|
|
73
|
+
set_due_date_request = cls(
|
|
74
|
+
due_date=due_date,
|
|
75
|
+
due_date_to=due_date_to,
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
set_due_date_request.additional_properties = d
|
|
79
|
+
return set_due_date_request
|
|
80
|
+
|
|
81
|
+
@property
|
|
82
|
+
def additional_keys(self) -> list[str]:
|
|
83
|
+
return list(self.additional_properties.keys())
|
|
84
|
+
|
|
85
|
+
def __getitem__(self, key: str) -> Any:
|
|
86
|
+
return self.additional_properties[key]
|
|
87
|
+
|
|
88
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
89
|
+
self.additional_properties[key] = value
|
|
90
|
+
|
|
91
|
+
def __delitem__(self, key: str) -> None:
|
|
92
|
+
del self.additional_properties[key]
|
|
93
|
+
|
|
94
|
+
def __contains__(self, key: str) -> bool:
|
|
95
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,190 @@
|
|
|
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.status_translations import StatusTranslations
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
T = TypeVar("T", bound="Status")
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@_attrs_define
|
|
23
|
+
class Status:
|
|
24
|
+
is_set: bool | Unset = UNSET
|
|
25
|
+
code: str | Unset = UNSET
|
|
26
|
+
name: str | Unset = UNSET
|
|
27
|
+
public_name: None | str | Unset = UNSET
|
|
28
|
+
description: str | Unset = UNSET
|
|
29
|
+
public: bool | Unset = UNSET
|
|
30
|
+
set_at: datetime.datetime | None | Unset = UNSET
|
|
31
|
+
auto_change_at: datetime.datetime | None | Unset = UNSET
|
|
32
|
+
translations: StatusTranslations | Unset = UNSET
|
|
33
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
34
|
+
|
|
35
|
+
def to_dict(self) -> dict[str, Any]:
|
|
36
|
+
is_set = self.is_set
|
|
37
|
+
|
|
38
|
+
code = self.code
|
|
39
|
+
|
|
40
|
+
name = self.name
|
|
41
|
+
|
|
42
|
+
public_name: None | str | Unset
|
|
43
|
+
if isinstance(self.public_name, Unset):
|
|
44
|
+
public_name = UNSET
|
|
45
|
+
else:
|
|
46
|
+
public_name = self.public_name
|
|
47
|
+
|
|
48
|
+
description = self.description
|
|
49
|
+
|
|
50
|
+
public = self.public
|
|
51
|
+
|
|
52
|
+
set_at: None | str | Unset
|
|
53
|
+
if isinstance(self.set_at, Unset):
|
|
54
|
+
set_at = UNSET
|
|
55
|
+
elif isinstance(self.set_at, datetime.datetime):
|
|
56
|
+
set_at = self.set_at.isoformat()
|
|
57
|
+
else:
|
|
58
|
+
set_at = self.set_at
|
|
59
|
+
|
|
60
|
+
auto_change_at: None | str | Unset
|
|
61
|
+
if isinstance(self.auto_change_at, Unset):
|
|
62
|
+
auto_change_at = UNSET
|
|
63
|
+
elif isinstance(self.auto_change_at, datetime.datetime):
|
|
64
|
+
auto_change_at = self.auto_change_at.isoformat()
|
|
65
|
+
else:
|
|
66
|
+
auto_change_at = self.auto_change_at
|
|
67
|
+
|
|
68
|
+
translations: dict[str, Any] | Unset = UNSET
|
|
69
|
+
if not isinstance(self.translations, Unset):
|
|
70
|
+
translations = self.translations.to_dict()
|
|
71
|
+
|
|
72
|
+
field_dict: dict[str, Any] = {}
|
|
73
|
+
field_dict.update(self.additional_properties)
|
|
74
|
+
field_dict.update({})
|
|
75
|
+
if is_set is not UNSET:
|
|
76
|
+
field_dict["is_set"] = is_set
|
|
77
|
+
if code is not UNSET:
|
|
78
|
+
field_dict["code"] = code
|
|
79
|
+
if name is not UNSET:
|
|
80
|
+
field_dict["name"] = name
|
|
81
|
+
if public_name is not UNSET:
|
|
82
|
+
field_dict["public_name"] = public_name
|
|
83
|
+
if description is not UNSET:
|
|
84
|
+
field_dict["description"] = description
|
|
85
|
+
if public is not UNSET:
|
|
86
|
+
field_dict["public"] = public
|
|
87
|
+
if set_at is not UNSET:
|
|
88
|
+
field_dict["set_at"] = set_at
|
|
89
|
+
if auto_change_at is not UNSET:
|
|
90
|
+
field_dict["auto_change_at"] = auto_change_at
|
|
91
|
+
if translations is not UNSET:
|
|
92
|
+
field_dict["translations"] = translations
|
|
93
|
+
|
|
94
|
+
return field_dict
|
|
95
|
+
|
|
96
|
+
@classmethod
|
|
97
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
98
|
+
from ..models.status_translations import StatusTranslations
|
|
99
|
+
|
|
100
|
+
d = dict(src_dict)
|
|
101
|
+
is_set = d.pop("is_set", UNSET)
|
|
102
|
+
|
|
103
|
+
code = d.pop("code", UNSET)
|
|
104
|
+
|
|
105
|
+
name = d.pop("name", UNSET)
|
|
106
|
+
|
|
107
|
+
def _parse_public_name(data: object) -> None | str | Unset:
|
|
108
|
+
if data is None:
|
|
109
|
+
return data
|
|
110
|
+
if isinstance(data, Unset):
|
|
111
|
+
return data
|
|
112
|
+
return cast(None | str | Unset, data)
|
|
113
|
+
|
|
114
|
+
public_name = _parse_public_name(d.pop("public_name", UNSET))
|
|
115
|
+
|
|
116
|
+
description = d.pop("description", UNSET)
|
|
117
|
+
|
|
118
|
+
public = d.pop("public", UNSET)
|
|
119
|
+
|
|
120
|
+
def _parse_set_at(data: object) -> datetime.datetime | None | Unset:
|
|
121
|
+
if data is None:
|
|
122
|
+
return data
|
|
123
|
+
if isinstance(data, Unset):
|
|
124
|
+
return data
|
|
125
|
+
try:
|
|
126
|
+
if not isinstance(data, str):
|
|
127
|
+
raise TypeError()
|
|
128
|
+
set_at_type_0 = isoparse(data)
|
|
129
|
+
|
|
130
|
+
return set_at_type_0
|
|
131
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
132
|
+
pass
|
|
133
|
+
return cast(datetime.datetime | None | Unset, data)
|
|
134
|
+
|
|
135
|
+
set_at = _parse_set_at(d.pop("set_at", UNSET))
|
|
136
|
+
|
|
137
|
+
def _parse_auto_change_at(data: object) -> datetime.datetime | None | Unset:
|
|
138
|
+
if data is None:
|
|
139
|
+
return data
|
|
140
|
+
if isinstance(data, Unset):
|
|
141
|
+
return data
|
|
142
|
+
try:
|
|
143
|
+
if not isinstance(data, str):
|
|
144
|
+
raise TypeError()
|
|
145
|
+
auto_change_at_type_0 = isoparse(data)
|
|
146
|
+
|
|
147
|
+
return auto_change_at_type_0
|
|
148
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
149
|
+
pass
|
|
150
|
+
return cast(datetime.datetime | None | Unset, data)
|
|
151
|
+
|
|
152
|
+
auto_change_at = _parse_auto_change_at(d.pop("auto_change_at", UNSET))
|
|
153
|
+
|
|
154
|
+
_translations = d.pop("translations", UNSET)
|
|
155
|
+
translations: StatusTranslations | Unset
|
|
156
|
+
if isinstance(_translations, Unset):
|
|
157
|
+
translations = UNSET
|
|
158
|
+
else:
|
|
159
|
+
translations = StatusTranslations.from_dict(_translations)
|
|
160
|
+
|
|
161
|
+
status = cls(
|
|
162
|
+
is_set=is_set,
|
|
163
|
+
code=code,
|
|
164
|
+
name=name,
|
|
165
|
+
public_name=public_name,
|
|
166
|
+
description=description,
|
|
167
|
+
public=public,
|
|
168
|
+
set_at=set_at,
|
|
169
|
+
auto_change_at=auto_change_at,
|
|
170
|
+
translations=translations,
|
|
171
|
+
)
|
|
172
|
+
|
|
173
|
+
status.additional_properties = d
|
|
174
|
+
return status
|
|
175
|
+
|
|
176
|
+
@property
|
|
177
|
+
def additional_keys(self) -> list[str]:
|
|
178
|
+
return list(self.additional_properties.keys())
|
|
179
|
+
|
|
180
|
+
def __getitem__(self, key: str) -> Any:
|
|
181
|
+
return self.additional_properties[key]
|
|
182
|
+
|
|
183
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
184
|
+
self.additional_properties[key] = value
|
|
185
|
+
|
|
186
|
+
def __delitem__(self, key: str) -> None:
|
|
187
|
+
del self.additional_properties[key]
|
|
188
|
+
|
|
189
|
+
def __contains__(self, key: str) -> bool:
|
|
190
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,82 @@
|
|
|
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="StatusDefinition")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@_attrs_define
|
|
17
|
+
class StatusDefinition:
|
|
18
|
+
name: str | Unset = UNSET
|
|
19
|
+
description: str | Unset = UNSET
|
|
20
|
+
code: str | Unset = UNSET
|
|
21
|
+
color: str | Unset = UNSET
|
|
22
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
23
|
+
|
|
24
|
+
def to_dict(self) -> dict[str, Any]:
|
|
25
|
+
name = self.name
|
|
26
|
+
|
|
27
|
+
description = self.description
|
|
28
|
+
|
|
29
|
+
code = self.code
|
|
30
|
+
|
|
31
|
+
color = self.color
|
|
32
|
+
|
|
33
|
+
field_dict: dict[str, Any] = {}
|
|
34
|
+
field_dict.update(self.additional_properties)
|
|
35
|
+
field_dict.update({})
|
|
36
|
+
if name is not UNSET:
|
|
37
|
+
field_dict["name"] = name
|
|
38
|
+
if description is not UNSET:
|
|
39
|
+
field_dict["description"] = description
|
|
40
|
+
if code is not UNSET:
|
|
41
|
+
field_dict["code"] = code
|
|
42
|
+
if color is not UNSET:
|
|
43
|
+
field_dict["color"] = color
|
|
44
|
+
|
|
45
|
+
return field_dict
|
|
46
|
+
|
|
47
|
+
@classmethod
|
|
48
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
49
|
+
d = dict(src_dict)
|
|
50
|
+
name = d.pop("name", UNSET)
|
|
51
|
+
|
|
52
|
+
description = d.pop("description", UNSET)
|
|
53
|
+
|
|
54
|
+
code = d.pop("code", UNSET)
|
|
55
|
+
|
|
56
|
+
color = d.pop("color", UNSET)
|
|
57
|
+
|
|
58
|
+
status_definition = cls(
|
|
59
|
+
name=name,
|
|
60
|
+
description=description,
|
|
61
|
+
code=code,
|
|
62
|
+
color=color,
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
status_definition.additional_properties = d
|
|
66
|
+
return status_definition
|
|
67
|
+
|
|
68
|
+
@property
|
|
69
|
+
def additional_keys(self) -> list[str]:
|
|
70
|
+
return list(self.additional_properties.keys())
|
|
71
|
+
|
|
72
|
+
def __getitem__(self, key: str) -> Any:
|
|
73
|
+
return self.additional_properties[key]
|
|
74
|
+
|
|
75
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
76
|
+
self.additional_properties[key] = value
|
|
77
|
+
|
|
78
|
+
def __delitem__(self, key: str) -> None:
|
|
79
|
+
del self.additional_properties[key]
|
|
80
|
+
|
|
81
|
+
def __contains__(self, key: str) -> bool:
|
|
82
|
+
return key in self.additional_properties
|