wildberries-sdk 0.1.20__py3-none-any.whl → 0.1.23__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.
- wildberries_sdk/analytics/__init__.py +1 -1
- wildberries_sdk/analytics/api/default_api.py +3 -3
- wildberries_sdk/analytics/api_client.py +1 -1
- wildberries_sdk/analytics/configuration.py +1 -1
- wildberries_sdk/communications/__init__.py +1 -1
- wildberries_sdk/communications/api/default_api.py +3 -3
- wildberries_sdk/communications/api_client.py +1 -1
- wildberries_sdk/communications/configuration.py +1 -1
- wildberries_sdk/finances/__init__.py +1 -1
- wildberries_sdk/finances/api_client.py +1 -1
- wildberries_sdk/finances/configuration.py +1 -1
- wildberries_sdk/general/__init__.py +1 -1
- wildberries_sdk/general/api_client.py +1 -1
- wildberries_sdk/general/configuration.py +1 -1
- wildberries_sdk/in_store_pickup/__init__.py +1 -1
- wildberries_sdk/in_store_pickup/api/default_api.py +3 -3
- wildberries_sdk/in_store_pickup/api_client.py +1 -1
- wildberries_sdk/in_store_pickup/configuration.py +1 -1
- wildberries_sdk/orders_dbs/__init__.py +49 -1
- wildberries_sdk/orders_dbs/api/default_api.py +3906 -78
- wildberries_sdk/orders_dbs/api_client.py +1 -1
- wildberries_sdk/orders_dbs/configuration.py +1 -1
- wildberries_sdk/orders_dbs/models/__init__.py +24 -0
- wildberries_sdk/orders_dbs/models/api_batch_error.py +93 -0
- wildberries_sdk/orders_dbs/models/api_batch_error_response.py +89 -0
- wildberries_sdk/orders_dbs/models/api_error.py +93 -0
- wildberries_sdk/orders_dbs/models/api_gtin.py +90 -0
- wildberries_sdk/orders_dbs/models/api_imei.py +90 -0
- wildberries_sdk/orders_dbs/models/api_marketplace_v3_dbs_meta_customs_declaration_post_request.py +96 -0
- wildberries_sdk/orders_dbs/models/api_marketplace_v3_dbs_meta_customs_declaration_post_request_orders_inner.py +90 -0
- wildberries_sdk/orders_dbs/models/api_order_code_request.py +89 -0
- wildberries_sdk/orders_dbs/models/api_order_meta_v2.py +103 -0
- wildberries_sdk/orders_dbs/models/api_order_status_v2.py +101 -0
- wildberries_sdk/orders_dbs/models/api_order_statuses_v2.py +95 -0
- wildberries_sdk/orders_dbs/models/api_orders_code_request.py +96 -0
- wildberries_sdk/orders_dbs/models/api_orders_gtin_set_request.py +96 -0
- wildberries_sdk/orders_dbs/models/api_orders_imei_set_request.py +96 -0
- wildberries_sdk/orders_dbs/models/api_orders_meta_delete_request.py +90 -0
- wildberries_sdk/orders_dbs/models/api_orders_meta_response.py +95 -0
- wildberries_sdk/orders_dbs/models/api_orders_request_v2.py +88 -0
- wildberries_sdk/orders_dbs/models/api_orders_sgtins_set_request.py +96 -0
- wildberries_sdk/orders_dbs/models/api_orders_uin_set_request.py +96 -0
- wildberries_sdk/orders_dbs/models/api_sgtins.py +90 -0
- wildberries_sdk/orders_dbs/models/api_status_set_response.py +99 -0
- wildberries_sdk/orders_dbs/models/api_status_set_responses.py +97 -0
- wildberries_sdk/orders_dbs/models/api_uin.py +90 -0
- wildberries_sdk/orders_dbs/models/error.py +1 -1
- wildberries_sdk/orders_dbs/models/meta.py +9 -3
- wildberries_sdk/orders_dbs/models/meta_customs_declaration.py +92 -0
- wildberries_sdk/orders_dbs/models/order_new_dbs.py +1 -1
- wildberries_sdk/orders_dbw/__init__.py +1 -1
- wildberries_sdk/orders_dbw/api_client.py +1 -1
- wildberries_sdk/orders_dbw/configuration.py +1 -1
- wildberries_sdk/orders_fbs/__init__.py +6 -2
- wildberries_sdk/orders_fbs/api/default_api.py +324 -13
- wildberries_sdk/orders_fbs/api_client.py +2 -2
- wildberries_sdk/orders_fbs/configuration.py +2 -2
- wildberries_sdk/orders_fbs/exceptions.py +1 -1
- wildberries_sdk/orders_fbs/models/__init__.py +3 -1
- wildberries_sdk/orders_fbs/models/api_marketplace_v3_orders_order_id_meta_customs_declaration_put_request.py +88 -0
- wildberries_sdk/orders_fbs/models/api_marketplace_v3_supplies_supply_id_orders_patch_request.py +1 -1
- wildberries_sdk/orders_fbs/models/api_v3_orders_get200_response.py +1 -1
- wildberries_sdk/orders_fbs/models/api_v3_orders_new_get200_response.py +1 -1
- wildberries_sdk/orders_fbs/models/api_v3_orders_order_id_meta_expiration_put_request.py +1 -1
- wildberries_sdk/orders_fbs/models/api_v3_orders_order_id_meta_gtin_put_request.py +1 -1
- wildberries_sdk/orders_fbs/models/api_v3_orders_order_id_meta_imei_put_request.py +1 -1
- wildberries_sdk/orders_fbs/models/api_v3_orders_order_id_meta_sgtin_put_request.py +1 -1
- wildberries_sdk/orders_fbs/models/api_v3_orders_order_id_meta_uin_put_request.py +1 -1
- wildberries_sdk/orders_fbs/models/api_v3_orders_status_history_post200_response.py +1 -1
- wildberries_sdk/orders_fbs/models/api_v3_orders_status_history_post200_response_orders_inner.py +1 -1
- wildberries_sdk/orders_fbs/models/api_v3_orders_status_history_post200_response_orders_inner_statuses_inner.py +1 -1
- wildberries_sdk/orders_fbs/models/api_v3_orders_status_history_post_request.py +1 -1
- wildberries_sdk/orders_fbs/models/api_v3_orders_status_post200_response.py +1 -1
- wildberries_sdk/orders_fbs/models/api_v3_orders_status_post200_response_orders_inner.py +1 -1
- wildberries_sdk/orders_fbs/models/api_v3_orders_status_post_request.py +1 -1
- wildberries_sdk/orders_fbs/models/api_v3_orders_stickers_cross_border_post200_response.py +1 -1
- wildberries_sdk/orders_fbs/models/api_v3_orders_stickers_cross_border_post200_response_stickers_inner.py +1 -1
- wildberries_sdk/orders_fbs/models/api_v3_orders_stickers_cross_border_post_request.py +1 -1
- wildberries_sdk/orders_fbs/models/api_v3_orders_stickers_post200_response.py +1 -1
- wildberries_sdk/orders_fbs/models/api_v3_orders_stickers_post200_response_stickers_inner.py +1 -1
- wildberries_sdk/orders_fbs/models/api_v3_orders_stickers_post_request.py +1 -1
- wildberries_sdk/orders_fbs/models/api_v3_passes_offices_get401_response.py +1 -1
- wildberries_sdk/orders_fbs/models/api_v3_passes_pass_id_put_request.py +1 -1
- wildberries_sdk/orders_fbs/models/api_v3_passes_post201_response.py +1 -1
- wildberries_sdk/orders_fbs/models/api_v3_passes_post_request.py +1 -1
- wildberries_sdk/orders_fbs/models/api_v3_supplies_get200_response.py +1 -1
- wildberries_sdk/orders_fbs/models/api_v3_supplies_orders_reshipment_get200_response.py +1 -1
- wildberries_sdk/orders_fbs/models/api_v3_supplies_orders_reshipment_get200_response_orders_inner.py +1 -1
- wildberries_sdk/orders_fbs/models/api_v3_supplies_post201_response.py +1 -1
- wildberries_sdk/orders_fbs/models/api_v3_supplies_post_request.py +1 -1
- wildberries_sdk/orders_fbs/models/api_v3_supplies_supply_id_barcode_get200_response.py +1 -1
- wildberries_sdk/orders_fbs/models/api_v3_supplies_supply_id_orders_get200_response.py +1 -1
- wildberries_sdk/orders_fbs/models/api_v3_supplies_supply_id_trbx_delete_request.py +1 -1
- wildberries_sdk/orders_fbs/models/api_v3_supplies_supply_id_trbx_get200_response.py +1 -1
- wildberries_sdk/orders_fbs/models/api_v3_supplies_supply_id_trbx_post201_response.py +1 -1
- wildberries_sdk/orders_fbs/models/api_v3_supplies_supply_id_trbx_post_request.py +1 -1
- wildberries_sdk/orders_fbs/models/api_v3_supplies_supply_id_trbx_stickers_post200_response.py +1 -1
- wildberries_sdk/orders_fbs/models/api_v3_supplies_supply_id_trbx_stickers_post_request.py +1 -1
- wildberries_sdk/orders_fbs/models/crossborder_turkey_client_info.py +1 -1
- wildberries_sdk/orders_fbs/models/crossborder_turkey_client_info_resp.py +1 -1
- wildberries_sdk/orders_fbs/models/error.py +1 -1
- wildberries_sdk/orders_fbs/models/meta.py +10 -4
- wildberries_sdk/orders_fbs/models/meta_customs_declaration.py +92 -0
- wildberries_sdk/orders_fbs/models/meta_expiration.py +1 -1
- wildberries_sdk/orders_fbs/models/meta_gtin.py +1 -1
- wildberries_sdk/orders_fbs/models/meta_imei.py +1 -1
- wildberries_sdk/orders_fbs/models/meta_sgtin.py +1 -1
- wildberries_sdk/orders_fbs/models/meta_uin.py +1 -1
- wildberries_sdk/orders_fbs/models/model_pass.py +1 -1
- wildberries_sdk/orders_fbs/models/order.py +1 -1
- wildberries_sdk/orders_fbs/models/order_address.py +1 -1
- wildberries_sdk/orders_fbs/models/order_new.py +1 -1
- wildberries_sdk/orders_fbs/models/order_options.py +1 -1
- wildberries_sdk/orders_fbs/models/orders_request_api.py +1 -1
- wildberries_sdk/orders_fbs/models/pass_office.py +1 -1
- wildberries_sdk/orders_fbs/models/supply.py +1 -1
- wildberries_sdk/orders_fbs/models/supply_order.py +1 -1
- wildberries_sdk/orders_fbs/models/supply_trbx.py +1 -1
- wildberries_sdk/orders_fbs/models/trbx_stickers.py +1 -1
- wildberries_sdk/orders_fbs/models/v3_api_error.py +1 -1
- wildberries_sdk/orders_fbs/models/v3_get_meta_multi_request.py +1 -1
- wildberries_sdk/orders_fbs/models/v3_order_meta_api.py +1 -1
- wildberries_sdk/orders_fbs/models/v3_orders_meta_api.py +1 -1
- wildberries_sdk/orders_fbs/models/v3_supply_order_ids_api.py +1 -1
- wildberries_sdk/orders_fbs/rest.py +1 -1
- wildberries_sdk/orders_fbw/__init__.py +1 -1
- wildberries_sdk/orders_fbw/api_client.py +1 -1
- wildberries_sdk/orders_fbw/configuration.py +1 -1
- wildberries_sdk/products/__init__.py +1 -1
- wildberries_sdk/products/api_client.py +1 -1
- wildberries_sdk/products/configuration.py +1 -1
- wildberries_sdk/promotion/__init__.py +1 -1
- wildberries_sdk/promotion/api_client.py +1 -1
- wildberries_sdk/promotion/configuration.py +1 -1
- wildberries_sdk/reports/__init__.py +1 -1
- wildberries_sdk/reports/api/default_api.py +21 -21
- wildberries_sdk/reports/api_client.py +1 -1
- wildberries_sdk/reports/configuration.py +1 -1
- wildberries_sdk/reports/models/orders_item.py +1 -1
- wildberries_sdk/reports/models/sales_item.py +3 -3
- wildberries_sdk/tariffs/__init__.py +1 -1
- wildberries_sdk/tariffs/api_client.py +1 -1
- wildberries_sdk/tariffs/configuration.py +1 -1
- wildberries_sdk/wbd/__init__.py +1 -1
- wildberries_sdk/wbd/api_client.py +1 -1
- wildberries_sdk/wbd/configuration.py +1 -1
- {wildberries_sdk-0.1.20.dist-info → wildberries_sdk-0.1.23.dist-info}/METADATA +35 -15
- {wildberries_sdk-0.1.20.dist-info → wildberries_sdk-0.1.23.dist-info}/RECORD +151 -125
- {wildberries_sdk-0.1.20.dist-info → wildberries_sdk-0.1.23.dist-info}/LICENSE +0 -0
- {wildberries_sdk-0.1.20.dist-info → wildberries_sdk-0.1.23.dist-info}/WHEEL +0 -0
- {wildberries_sdk-0.1.20.dist-info → wildberries_sdk-0.1.23.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Заказы DBS
|
|
5
|
+
|
|
6
|
+
<div class=\"description_important\"> Узнать больше о заказах DBS можно в <a href=\"https://seller.wildberries.ru/instructions/category/6572e024-7428-4db1-86a8-a4c7dbebbfcf?goBackOption=prevRoute&categoryId=5a8e1202-0865-45b7-acae-5d0afc7add56\">справочном центре</a> </div> Управление [сборочными заданиями](/openapi/orders-dbs#tag/Sborochnye-zadaniya-DBS) и [метаданными](/openapi/orders-dbs#tag/Metadannye-DBS) заказов DBS (Delivery by Seller).
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: order
|
|
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, StrictInt
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing_extensions import Annotated
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class ApiMarketplaceV3DbsMetaCustomsDeclarationPostRequestOrdersInner(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
ApiMarketplaceV3DbsMetaCustomsDeclarationPostRequestOrdersInner
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
customs_declaration: Annotated[str, Field(min_length=17, strict=True, max_length=29)] = Field(description="Номер ГТД", alias="customsDeclaration")
|
|
31
|
+
order_id: StrictInt = Field(description="ID сборочного задания", alias="orderId")
|
|
32
|
+
__properties: ClassVar[List[str]] = ["customsDeclaration", "orderId"]
|
|
33
|
+
|
|
34
|
+
model_config = ConfigDict(
|
|
35
|
+
populate_by_name=True,
|
|
36
|
+
validate_assignment=True,
|
|
37
|
+
protected_namespaces=(),
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def to_str(self) -> str:
|
|
42
|
+
"""Returns the string representation of the model using alias"""
|
|
43
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
44
|
+
|
|
45
|
+
def to_json(self) -> str:
|
|
46
|
+
"""Returns the JSON representation of the model using alias"""
|
|
47
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
48
|
+
return json.dumps(self.to_dict())
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
52
|
+
"""Create an instance of ApiMarketplaceV3DbsMetaCustomsDeclarationPostRequestOrdersInner from a JSON string"""
|
|
53
|
+
return cls.from_dict(json.loads(json_str))
|
|
54
|
+
|
|
55
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
56
|
+
"""Return the dictionary representation of the model using alias.
|
|
57
|
+
|
|
58
|
+
This has the following differences from calling pydantic's
|
|
59
|
+
`self.model_dump(by_alias=True)`:
|
|
60
|
+
|
|
61
|
+
* `None` is only added to the output dict for nullable fields that
|
|
62
|
+
were set at model initialization. Other fields with value `None`
|
|
63
|
+
are ignored.
|
|
64
|
+
"""
|
|
65
|
+
excluded_fields: Set[str] = set([
|
|
66
|
+
])
|
|
67
|
+
|
|
68
|
+
_dict = self.model_dump(
|
|
69
|
+
by_alias=True,
|
|
70
|
+
exclude=excluded_fields,
|
|
71
|
+
exclude_none=True,
|
|
72
|
+
)
|
|
73
|
+
return _dict
|
|
74
|
+
|
|
75
|
+
@classmethod
|
|
76
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
77
|
+
"""Create an instance of ApiMarketplaceV3DbsMetaCustomsDeclarationPostRequestOrdersInner from a dict"""
|
|
78
|
+
if obj is None:
|
|
79
|
+
return None
|
|
80
|
+
|
|
81
|
+
if not isinstance(obj, dict):
|
|
82
|
+
return cls.model_validate(obj)
|
|
83
|
+
|
|
84
|
+
_obj = cls.model_validate({
|
|
85
|
+
"customsDeclaration": obj.get("customsDeclaration"),
|
|
86
|
+
"orderId": obj.get("orderId")
|
|
87
|
+
})
|
|
88
|
+
return _obj
|
|
89
|
+
|
|
90
|
+
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Заказы DBS
|
|
5
|
+
|
|
6
|
+
<div class=\"description_important\"> Узнать больше о заказах DBS можно в <a href=\"https://seller.wildberries.ru/instructions/category/6572e024-7428-4db1-86a8-a4c7dbebbfcf?goBackOption=prevRoute&categoryId=5a8e1202-0865-45b7-acae-5d0afc7add56\">справочном центре</a> </div> Управление [сборочными заданиями](/openapi/orders-dbs#tag/Sborochnye-zadaniya-DBS) и [метаданными](/openapi/orders-dbs#tag/Metadannye-DBS) заказов DBS (Delivery by Seller).
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: order
|
|
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, StrictInt, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class ApiOrderCodeRequest(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
ApiOrderCodeRequest
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
code: Optional[StrictStr] = Field(default=None, description="Код подтверждения. <br> Отображается у покупателя на сайте и в приложении Wildberries")
|
|
30
|
+
order_id: Optional[StrictInt] = Field(default=None, description="ID сборочного задания", alias="orderId")
|
|
31
|
+
__properties: ClassVar[List[str]] = ["code", "orderId"]
|
|
32
|
+
|
|
33
|
+
model_config = ConfigDict(
|
|
34
|
+
populate_by_name=True,
|
|
35
|
+
validate_assignment=True,
|
|
36
|
+
protected_namespaces=(),
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def to_str(self) -> str:
|
|
41
|
+
"""Returns the string representation of the model using alias"""
|
|
42
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
43
|
+
|
|
44
|
+
def to_json(self) -> str:
|
|
45
|
+
"""Returns the JSON representation of the model using alias"""
|
|
46
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
47
|
+
return json.dumps(self.to_dict())
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
51
|
+
"""Create an instance of ApiOrderCodeRequest from a JSON string"""
|
|
52
|
+
return cls.from_dict(json.loads(json_str))
|
|
53
|
+
|
|
54
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
55
|
+
"""Return the dictionary representation of the model using alias.
|
|
56
|
+
|
|
57
|
+
This has the following differences from calling pydantic's
|
|
58
|
+
`self.model_dump(by_alias=True)`:
|
|
59
|
+
|
|
60
|
+
* `None` is only added to the output dict for nullable fields that
|
|
61
|
+
were set at model initialization. Other fields with value `None`
|
|
62
|
+
are ignored.
|
|
63
|
+
"""
|
|
64
|
+
excluded_fields: Set[str] = set([
|
|
65
|
+
])
|
|
66
|
+
|
|
67
|
+
_dict = self.model_dump(
|
|
68
|
+
by_alias=True,
|
|
69
|
+
exclude=excluded_fields,
|
|
70
|
+
exclude_none=True,
|
|
71
|
+
)
|
|
72
|
+
return _dict
|
|
73
|
+
|
|
74
|
+
@classmethod
|
|
75
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
76
|
+
"""Create an instance of ApiOrderCodeRequest from a dict"""
|
|
77
|
+
if obj is None:
|
|
78
|
+
return None
|
|
79
|
+
|
|
80
|
+
if not isinstance(obj, dict):
|
|
81
|
+
return cls.model_validate(obj)
|
|
82
|
+
|
|
83
|
+
_obj = cls.model_validate({
|
|
84
|
+
"code": obj.get("code"),
|
|
85
|
+
"orderId": obj.get("orderId")
|
|
86
|
+
})
|
|
87
|
+
return _obj
|
|
88
|
+
|
|
89
|
+
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Заказы DBS
|
|
5
|
+
|
|
6
|
+
<div class=\"description_important\"> Узнать больше о заказах DBS можно в <a href=\"https://seller.wildberries.ru/instructions/category/6572e024-7428-4db1-86a8-a4c7dbebbfcf?goBackOption=prevRoute&categoryId=5a8e1202-0865-45b7-acae-5d0afc7add56\">справочном центре</a> </div> Управление [сборочными заданиями](/openapi/orders-dbs#tag/Sborochnye-zadaniya-DBS) и [метаданными](/openapi/orders-dbs#tag/Metadannye-DBS) заказов DBS (Delivery by Seller).
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: order
|
|
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, StrictInt, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from wildberries_sdk.orders_dbs.models.meta_customs_declaration import MetaCustomsDeclaration
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class ApiOrderMetaV2(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
ApiOrderMetaV2
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
error: Optional[StrictStr] = Field(default=None, description="Сообщение об ошибке. <br> Если `error: not found`, сборочное задание не найдено ")
|
|
31
|
+
gtin: Optional[StrictStr] = Field(default=None, description="GTIN")
|
|
32
|
+
imei: Optional[StrictStr] = Field(default=None, description="IMEI")
|
|
33
|
+
order_id: Optional[StrictInt] = Field(default=None, description="ID сборочного задания", alias="orderId")
|
|
34
|
+
sgtin: Optional[List[StrictStr]] = Field(default=None, description="Код маркировки Честного знака")
|
|
35
|
+
uin: Optional[StrictStr] = Field(default=None, description="УИН")
|
|
36
|
+
customs_declaration: Optional[MetaCustomsDeclaration] = Field(default=None, alias="customsDeclaration")
|
|
37
|
+
__properties: ClassVar[List[str]] = ["error", "gtin", "imei", "orderId", "sgtin", "uin", "customsDeclaration"]
|
|
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
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
53
|
+
return json.dumps(self.to_dict())
|
|
54
|
+
|
|
55
|
+
@classmethod
|
|
56
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
57
|
+
"""Create an instance of ApiOrderMetaV2 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
|
+
# override the default output from pydantic by calling `to_dict()` of customs_declaration
|
|
79
|
+
if self.customs_declaration:
|
|
80
|
+
_dict['customsDeclaration'] = self.customs_declaration.to_dict()
|
|
81
|
+
return _dict
|
|
82
|
+
|
|
83
|
+
@classmethod
|
|
84
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
85
|
+
"""Create an instance of ApiOrderMetaV2 from a dict"""
|
|
86
|
+
if obj is None:
|
|
87
|
+
return None
|
|
88
|
+
|
|
89
|
+
if not isinstance(obj, dict):
|
|
90
|
+
return cls.model_validate(obj)
|
|
91
|
+
|
|
92
|
+
_obj = cls.model_validate({
|
|
93
|
+
"error": obj.get("error"),
|
|
94
|
+
"gtin": obj.get("gtin"),
|
|
95
|
+
"imei": obj.get("imei"),
|
|
96
|
+
"orderId": obj.get("orderId"),
|
|
97
|
+
"sgtin": obj.get("sgtin"),
|
|
98
|
+
"uin": obj.get("uin"),
|
|
99
|
+
"customsDeclaration": MetaCustomsDeclaration.from_dict(obj["customsDeclaration"]) if obj.get("customsDeclaration") is not None else None
|
|
100
|
+
})
|
|
101
|
+
return _obj
|
|
102
|
+
|
|
103
|
+
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Заказы DBS
|
|
5
|
+
|
|
6
|
+
<div class=\"description_important\"> Узнать больше о заказах DBS можно в <a href=\"https://seller.wildberries.ru/instructions/category/6572e024-7428-4db1-86a8-a4c7dbebbfcf?goBackOption=prevRoute&categoryId=5a8e1202-0865-45b7-acae-5d0afc7add56\">справочном центре</a> </div> Управление [сборочными заданиями](/openapi/orders-dbs#tag/Sborochnye-zadaniya-DBS) и [метаданными](/openapi/orders-dbs#tag/Metadannye-DBS) заказов DBS (Delivery by Seller).
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: order
|
|
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, StrictInt, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from wildberries_sdk.orders_dbs.models.api_batch_error_response import ApiBatchErrorResponse
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class ApiOrderStatusV2(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
ApiOrderStatusV2
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
errors: Optional[List[ApiBatchErrorResponse]] = Field(default=None, description="Информация об ошибке")
|
|
31
|
+
order_id: Optional[StrictInt] = Field(default=None, description="ID сборочного задания", alias="orderId")
|
|
32
|
+
supplier_status: Optional[StrictStr] = Field(default=None, description="Статус сборочного задания, установленный продавцом", alias="supplierStatus")
|
|
33
|
+
wb_status: Optional[StrictStr] = Field(default=None, description="Статус сборочного задания в системе Wildberries", alias="wbStatus")
|
|
34
|
+
__properties: ClassVar[List[str]] = ["errors", "orderId", "supplierStatus", "wbStatus"]
|
|
35
|
+
|
|
36
|
+
model_config = ConfigDict(
|
|
37
|
+
populate_by_name=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
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
50
|
+
return json.dumps(self.to_dict())
|
|
51
|
+
|
|
52
|
+
@classmethod
|
|
53
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
54
|
+
"""Create an instance of ApiOrderStatusV2 from a JSON string"""
|
|
55
|
+
return cls.from_dict(json.loads(json_str))
|
|
56
|
+
|
|
57
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
58
|
+
"""Return the dictionary representation of the model using alias.
|
|
59
|
+
|
|
60
|
+
This has the following differences from calling pydantic's
|
|
61
|
+
`self.model_dump(by_alias=True)`:
|
|
62
|
+
|
|
63
|
+
* `None` is only added to the output dict for nullable fields that
|
|
64
|
+
were set at model initialization. Other fields with value `None`
|
|
65
|
+
are ignored.
|
|
66
|
+
"""
|
|
67
|
+
excluded_fields: Set[str] = set([
|
|
68
|
+
])
|
|
69
|
+
|
|
70
|
+
_dict = self.model_dump(
|
|
71
|
+
by_alias=True,
|
|
72
|
+
exclude=excluded_fields,
|
|
73
|
+
exclude_none=True,
|
|
74
|
+
)
|
|
75
|
+
# override the default output from pydantic by calling `to_dict()` of each item in errors (list)
|
|
76
|
+
_items = []
|
|
77
|
+
if self.errors:
|
|
78
|
+
for _item_errors in self.errors:
|
|
79
|
+
if _item_errors:
|
|
80
|
+
_items.append(_item_errors.to_dict())
|
|
81
|
+
_dict['errors'] = _items
|
|
82
|
+
return _dict
|
|
83
|
+
|
|
84
|
+
@classmethod
|
|
85
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
86
|
+
"""Create an instance of ApiOrderStatusV2 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
|
+
"errors": [ApiBatchErrorResponse.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None,
|
|
95
|
+
"orderId": obj.get("orderId"),
|
|
96
|
+
"supplierStatus": obj.get("supplierStatus"),
|
|
97
|
+
"wbStatus": obj.get("wbStatus")
|
|
98
|
+
})
|
|
99
|
+
return _obj
|
|
100
|
+
|
|
101
|
+
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Заказы DBS
|
|
5
|
+
|
|
6
|
+
<div class=\"description_important\"> Узнать больше о заказах DBS можно в <a href=\"https://seller.wildberries.ru/instructions/category/6572e024-7428-4db1-86a8-a4c7dbebbfcf?goBackOption=prevRoute&categoryId=5a8e1202-0865-45b7-acae-5d0afc7add56\">справочном центре</a> </div> Управление [сборочными заданиями](/openapi/orders-dbs#tag/Sborochnye-zadaniya-DBS) и [метаданными](/openapi/orders-dbs#tag/Metadannye-DBS) заказов DBS (Delivery by Seller).
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: order
|
|
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
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from wildberries_sdk.orders_dbs.models.api_order_status_v2 import ApiOrderStatusV2
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class ApiOrderStatusesV2(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
ApiOrderStatusesV2
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
orders: Optional[List[ApiOrderStatusV2]] = Field(default=None, description="Информация о статусах")
|
|
31
|
+
__properties: ClassVar[List[str]] = ["orders"]
|
|
32
|
+
|
|
33
|
+
model_config = ConfigDict(
|
|
34
|
+
populate_by_name=True,
|
|
35
|
+
validate_assignment=True,
|
|
36
|
+
protected_namespaces=(),
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def to_str(self) -> str:
|
|
41
|
+
"""Returns the string representation of the model using alias"""
|
|
42
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
43
|
+
|
|
44
|
+
def to_json(self) -> str:
|
|
45
|
+
"""Returns the JSON representation of the model using alias"""
|
|
46
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
47
|
+
return json.dumps(self.to_dict())
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
51
|
+
"""Create an instance of ApiOrderStatusesV2 from a JSON string"""
|
|
52
|
+
return cls.from_dict(json.loads(json_str))
|
|
53
|
+
|
|
54
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
55
|
+
"""Return the dictionary representation of the model using alias.
|
|
56
|
+
|
|
57
|
+
This has the following differences from calling pydantic's
|
|
58
|
+
`self.model_dump(by_alias=True)`:
|
|
59
|
+
|
|
60
|
+
* `None` is only added to the output dict for nullable fields that
|
|
61
|
+
were set at model initialization. Other fields with value `None`
|
|
62
|
+
are ignored.
|
|
63
|
+
"""
|
|
64
|
+
excluded_fields: Set[str] = set([
|
|
65
|
+
])
|
|
66
|
+
|
|
67
|
+
_dict = self.model_dump(
|
|
68
|
+
by_alias=True,
|
|
69
|
+
exclude=excluded_fields,
|
|
70
|
+
exclude_none=True,
|
|
71
|
+
)
|
|
72
|
+
# override the default output from pydantic by calling `to_dict()` of each item in orders (list)
|
|
73
|
+
_items = []
|
|
74
|
+
if self.orders:
|
|
75
|
+
for _item_orders in self.orders:
|
|
76
|
+
if _item_orders:
|
|
77
|
+
_items.append(_item_orders.to_dict())
|
|
78
|
+
_dict['orders'] = _items
|
|
79
|
+
return _dict
|
|
80
|
+
|
|
81
|
+
@classmethod
|
|
82
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
83
|
+
"""Create an instance of ApiOrderStatusesV2 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
|
+
"orders": [ApiOrderStatusV2.from_dict(_item) for _item in obj["orders"]] if obj.get("orders") is not None else None
|
|
92
|
+
})
|
|
93
|
+
return _obj
|
|
94
|
+
|
|
95
|
+
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Заказы DBS
|
|
5
|
+
|
|
6
|
+
<div class=\"description_important\"> Узнать больше о заказах DBS можно в <a href=\"https://seller.wildberries.ru/instructions/category/6572e024-7428-4db1-86a8-a4c7dbebbfcf?goBackOption=prevRoute&categoryId=5a8e1202-0865-45b7-acae-5d0afc7add56\">справочном центре</a> </div> Управление [сборочными заданиями](/openapi/orders-dbs#tag/Sborochnye-zadaniya-DBS) и [метаданными](/openapi/orders-dbs#tag/Metadannye-DBS) заказов DBS (Delivery by Seller).
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: order
|
|
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
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing_extensions import Annotated
|
|
23
|
+
from wildberries_sdk.orders_dbs.models.api_order_code_request import ApiOrderCodeRequest
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class ApiOrdersCodeRequest(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
ApiOrdersCodeRequest
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
orders: Annotated[List[ApiOrderCodeRequest], Field(max_length=1000)]
|
|
32
|
+
__properties: ClassVar[List[str]] = ["orders"]
|
|
33
|
+
|
|
34
|
+
model_config = ConfigDict(
|
|
35
|
+
populate_by_name=True,
|
|
36
|
+
validate_assignment=True,
|
|
37
|
+
protected_namespaces=(),
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def to_str(self) -> str:
|
|
42
|
+
"""Returns the string representation of the model using alias"""
|
|
43
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
44
|
+
|
|
45
|
+
def to_json(self) -> str:
|
|
46
|
+
"""Returns the JSON representation of the model using alias"""
|
|
47
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
48
|
+
return json.dumps(self.to_dict())
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
52
|
+
"""Create an instance of ApiOrdersCodeRequest from a JSON string"""
|
|
53
|
+
return cls.from_dict(json.loads(json_str))
|
|
54
|
+
|
|
55
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
56
|
+
"""Return the dictionary representation of the model using alias.
|
|
57
|
+
|
|
58
|
+
This has the following differences from calling pydantic's
|
|
59
|
+
`self.model_dump(by_alias=True)`:
|
|
60
|
+
|
|
61
|
+
* `None` is only added to the output dict for nullable fields that
|
|
62
|
+
were set at model initialization. Other fields with value `None`
|
|
63
|
+
are ignored.
|
|
64
|
+
"""
|
|
65
|
+
excluded_fields: Set[str] = set([
|
|
66
|
+
])
|
|
67
|
+
|
|
68
|
+
_dict = self.model_dump(
|
|
69
|
+
by_alias=True,
|
|
70
|
+
exclude=excluded_fields,
|
|
71
|
+
exclude_none=True,
|
|
72
|
+
)
|
|
73
|
+
# override the default output from pydantic by calling `to_dict()` of each item in orders (list)
|
|
74
|
+
_items = []
|
|
75
|
+
if self.orders:
|
|
76
|
+
for _item_orders in self.orders:
|
|
77
|
+
if _item_orders:
|
|
78
|
+
_items.append(_item_orders.to_dict())
|
|
79
|
+
_dict['orders'] = _items
|
|
80
|
+
return _dict
|
|
81
|
+
|
|
82
|
+
@classmethod
|
|
83
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
84
|
+
"""Create an instance of ApiOrdersCodeRequest from a dict"""
|
|
85
|
+
if obj is None:
|
|
86
|
+
return None
|
|
87
|
+
|
|
88
|
+
if not isinstance(obj, dict):
|
|
89
|
+
return cls.model_validate(obj)
|
|
90
|
+
|
|
91
|
+
_obj = cls.model_validate({
|
|
92
|
+
"orders": [ApiOrderCodeRequest.from_dict(_item) for _item in obj["orders"]] if obj.get("orders") is not None else None
|
|
93
|
+
})
|
|
94
|
+
return _obj
|
|
95
|
+
|
|
96
|
+
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Заказы DBS
|
|
5
|
+
|
|
6
|
+
<div class=\"description_important\"> Узнать больше о заказах DBS можно в <a href=\"https://seller.wildberries.ru/instructions/category/6572e024-7428-4db1-86a8-a4c7dbebbfcf?goBackOption=prevRoute&categoryId=5a8e1202-0865-45b7-acae-5d0afc7add56\">справочном центре</a> </div> Управление [сборочными заданиями](/openapi/orders-dbs#tag/Sborochnye-zadaniya-DBS) и [метаданными](/openapi/orders-dbs#tag/Metadannye-DBS) заказов DBS (Delivery by Seller).
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: order
|
|
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
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing_extensions import Annotated
|
|
23
|
+
from wildberries_sdk.orders_dbs.models.api_gtin import ApiGTIN
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class ApiOrdersGTINSetRequest(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
ApiOrdersGTINSetRequest
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
orders: Annotated[List[ApiGTIN], Field(max_length=1000)]
|
|
32
|
+
__properties: ClassVar[List[str]] = ["orders"]
|
|
33
|
+
|
|
34
|
+
model_config = ConfigDict(
|
|
35
|
+
populate_by_name=True,
|
|
36
|
+
validate_assignment=True,
|
|
37
|
+
protected_namespaces=(),
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def to_str(self) -> str:
|
|
42
|
+
"""Returns the string representation of the model using alias"""
|
|
43
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
44
|
+
|
|
45
|
+
def to_json(self) -> str:
|
|
46
|
+
"""Returns the JSON representation of the model using alias"""
|
|
47
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
48
|
+
return json.dumps(self.to_dict())
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
52
|
+
"""Create an instance of ApiOrdersGTINSetRequest from a JSON string"""
|
|
53
|
+
return cls.from_dict(json.loads(json_str))
|
|
54
|
+
|
|
55
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
56
|
+
"""Return the dictionary representation of the model using alias.
|
|
57
|
+
|
|
58
|
+
This has the following differences from calling pydantic's
|
|
59
|
+
`self.model_dump(by_alias=True)`:
|
|
60
|
+
|
|
61
|
+
* `None` is only added to the output dict for nullable fields that
|
|
62
|
+
were set at model initialization. Other fields with value `None`
|
|
63
|
+
are ignored.
|
|
64
|
+
"""
|
|
65
|
+
excluded_fields: Set[str] = set([
|
|
66
|
+
])
|
|
67
|
+
|
|
68
|
+
_dict = self.model_dump(
|
|
69
|
+
by_alias=True,
|
|
70
|
+
exclude=excluded_fields,
|
|
71
|
+
exclude_none=True,
|
|
72
|
+
)
|
|
73
|
+
# override the default output from pydantic by calling `to_dict()` of each item in orders (list)
|
|
74
|
+
_items = []
|
|
75
|
+
if self.orders:
|
|
76
|
+
for _item_orders in self.orders:
|
|
77
|
+
if _item_orders:
|
|
78
|
+
_items.append(_item_orders.to_dict())
|
|
79
|
+
_dict['orders'] = _items
|
|
80
|
+
return _dict
|
|
81
|
+
|
|
82
|
+
@classmethod
|
|
83
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
84
|
+
"""Create an instance of ApiOrdersGTINSetRequest from a dict"""
|
|
85
|
+
if obj is None:
|
|
86
|
+
return None
|
|
87
|
+
|
|
88
|
+
if not isinstance(obj, dict):
|
|
89
|
+
return cls.model_validate(obj)
|
|
90
|
+
|
|
91
|
+
_obj = cls.model_validate({
|
|
92
|
+
"orders": [ApiGTIN.from_dict(_item) for _item in obj["orders"]] if obj.get("orders") is not None else None
|
|
93
|
+
})
|
|
94
|
+
return _obj
|
|
95
|
+
|
|
96
|
+
|