dockflow-sdk 0.3.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.
Files changed (52) hide show
  1. dockflow_sdk/__init__.py +124 -0
  2. dockflow_sdk/api/__init__.py +8 -0
  3. dockflow_sdk/api/documents_api.py +1382 -0
  4. dockflow_sdk/api/tradeflows_api.py +615 -0
  5. dockflow_sdk/api/upstream_api.py +471 -0
  6. dockflow_sdk/api/widget_api.py +303 -0
  7. dockflow_sdk/api_client.py +865 -0
  8. dockflow_sdk/api_response.py +21 -0
  9. dockflow_sdk/configuration.py +658 -0
  10. dockflow_sdk/exceptions.py +218 -0
  11. dockflow_sdk/models/__init__.py +51 -0
  12. dockflow_sdk/models/container_reference.py +90 -0
  13. dockflow_sdk/models/create_tradeflows202_response.py +104 -0
  14. dockflow_sdk/models/create_tradeflows202_response_tradeflows_inner.py +90 -0
  15. dockflow_sdk/models/document_update.py +92 -0
  16. dockflow_sdk/models/document_upload.py +105 -0
  17. dockflow_sdk/models/downstream_tradeflow.py +189 -0
  18. dockflow_sdk/models/downstream_tradeflow_bill_of_lading_reference.py +138 -0
  19. dockflow_sdk/models/downstream_tradeflow_booking_reference.py +138 -0
  20. dockflow_sdk/models/downstream_tradeflow_events_inner.py +97 -0
  21. dockflow_sdk/models/downstream_tradeflow_free_time_overrides_inner.py +101 -0
  22. dockflow_sdk/models/downstream_tradeflow_mock_tracking.py +88 -0
  23. dockflow_sdk/models/downstream_tradeflow_partners_inner.py +94 -0
  24. dockflow_sdk/models/downstream_tradeflow_references.py +92 -0
  25. dockflow_sdk/models/get_document200_response.py +100 -0
  26. dockflow_sdk/models/get_document200_response_data_inner.py +133 -0
  27. dockflow_sdk/models/get_document200_response_data_inner_document_type.py +90 -0
  28. dockflow_sdk/models/get_upstream200_response.py +102 -0
  29. dockflow_sdk/models/get_upstream400_response.py +172 -0
  30. dockflow_sdk/models/inline_object.py +90 -0
  31. dockflow_sdk/models/list_document_types200_response_inner.py +90 -0
  32. dockflow_sdk/models/upload_document202_response.py +120 -0
  33. dockflow_sdk/models/upload_document400_response.py +155 -0
  34. dockflow_sdk/models/upstream_record.py +132 -0
  35. dockflow_sdk/models/upstream_record_additional_references.py +90 -0
  36. dockflow_sdk/models/upstream_record_data_quality.py +96 -0
  37. dockflow_sdk/models/upstream_record_metadata.py +105 -0
  38. dockflow_sdk/models/widget_container.py +120 -0
  39. dockflow_sdk/models/widget_country.py +100 -0
  40. dockflow_sdk/models/widget_leg.py +113 -0
  41. dockflow_sdk/models/widget_location.py +129 -0
  42. dockflow_sdk/models/widget_milestone.py +118 -0
  43. dockflow_sdk/models/widget_point.py +90 -0
  44. dockflow_sdk/models/widget_search_result.py +155 -0
  45. dockflow_sdk/models/widget_track.py +102 -0
  46. dockflow_sdk/models/widget_track_reading.py +92 -0
  47. dockflow_sdk/py.typed +0 -0
  48. dockflow_sdk/rest.py +334 -0
  49. dockflow_sdk-0.3.0.dist-info/METADATA +212 -0
  50. dockflow_sdk-0.3.0.dist-info/RECORD +52 -0
  51. dockflow_sdk-0.3.0.dist-info/WHEEL +5 -0
  52. dockflow_sdk-0.3.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,218 @@
1
+ """
2
+ Dockflow v3 API
3
+
4
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 3.0.0
7
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
8
+
9
+ Do not edit the class manually.
10
+ """ # noqa: E501
11
+
12
+
13
+ from typing import Any, Optional
14
+ from typing_extensions import Self
15
+
16
+ class OpenApiException(Exception):
17
+ """The base exception class for all OpenAPIExceptions"""
18
+
19
+
20
+ class ApiTypeError(OpenApiException, TypeError):
21
+ def __init__(self, msg, path_to_item=None, valid_classes=None,
22
+ key_type=None) -> None:
23
+ """ Raises an exception for TypeErrors
24
+
25
+ Args:
26
+ msg (str): the exception message
27
+
28
+ Keyword Args:
29
+ path_to_item (list): a list of keys an indices to get to the
30
+ current_item
31
+ None if unset
32
+ valid_classes (tuple): the primitive classes that current item
33
+ should be an instance of
34
+ None if unset
35
+ key_type (bool): False if our value is a value in a dict
36
+ True if it is a key in a dict
37
+ False if our item is an item in a list
38
+ None if unset
39
+ """
40
+ self.path_to_item = path_to_item
41
+ self.valid_classes = valid_classes
42
+ self.key_type = key_type
43
+ full_msg = msg
44
+ if path_to_item:
45
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
46
+ super(ApiTypeError, self).__init__(full_msg)
47
+
48
+
49
+ class ApiValueError(OpenApiException, ValueError):
50
+ def __init__(self, msg, path_to_item=None) -> None:
51
+ """
52
+ Args:
53
+ msg (str): the exception message
54
+
55
+ Keyword Args:
56
+ path_to_item (list) the path to the exception in the
57
+ received_data dict. None if unset
58
+ """
59
+
60
+ self.path_to_item = path_to_item
61
+ full_msg = msg
62
+ if path_to_item:
63
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
64
+ super(ApiValueError, self).__init__(full_msg)
65
+
66
+
67
+ class ApiAttributeError(OpenApiException, AttributeError):
68
+ def __init__(self, msg, path_to_item=None) -> None:
69
+ """
70
+ Raised when an attribute reference or assignment fails.
71
+
72
+ Args:
73
+ msg (str): the exception message
74
+
75
+ Keyword Args:
76
+ path_to_item (None/list) the path to the exception in the
77
+ received_data dict
78
+ """
79
+ self.path_to_item = path_to_item
80
+ full_msg = msg
81
+ if path_to_item:
82
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
83
+ super(ApiAttributeError, self).__init__(full_msg)
84
+
85
+
86
+ class ApiKeyError(OpenApiException, KeyError):
87
+ def __init__(self, msg, path_to_item=None) -> None:
88
+ """
89
+ Args:
90
+ msg (str): the exception message
91
+
92
+ Keyword Args:
93
+ path_to_item (None/list) the path to the exception in the
94
+ received_data dict
95
+ """
96
+ self.path_to_item = path_to_item
97
+ full_msg = msg
98
+ if path_to_item:
99
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
100
+ super(ApiKeyError, self).__init__(full_msg)
101
+
102
+
103
+ class ApiException(OpenApiException):
104
+
105
+ def __init__(
106
+ self,
107
+ status=None,
108
+ reason=None,
109
+ http_resp=None,
110
+ *,
111
+ body: Optional[str] = None,
112
+ data: Optional[Any] = None,
113
+ ) -> None:
114
+ self.status = status
115
+ self.reason = reason
116
+ self.body = body
117
+ self.data = data
118
+ self.headers = None
119
+
120
+ if http_resp:
121
+ if self.status is None:
122
+ self.status = http_resp.status
123
+ if self.reason is None:
124
+ self.reason = http_resp.reason
125
+ if self.body is None:
126
+ try:
127
+ self.body = http_resp.data.decode('utf-8')
128
+ except Exception:
129
+ pass
130
+ self.headers = http_resp.headers
131
+
132
+ @classmethod
133
+ def from_response(
134
+ cls,
135
+ *,
136
+ http_resp,
137
+ body: Optional[str],
138
+ data: Optional[Any],
139
+ ) -> Self:
140
+ if http_resp.status == 400:
141
+ raise BadRequestException(http_resp=http_resp, body=body, data=data)
142
+
143
+ if http_resp.status == 401:
144
+ raise UnauthorizedException(http_resp=http_resp, body=body, data=data)
145
+
146
+ if http_resp.status == 403:
147
+ raise ForbiddenException(http_resp=http_resp, body=body, data=data)
148
+
149
+ if http_resp.status == 404:
150
+ raise NotFoundException(http_resp=http_resp, body=body, data=data)
151
+
152
+ # Added new conditions for 409 and 422
153
+ if http_resp.status == 409:
154
+ raise ConflictException(http_resp=http_resp, body=body, data=data)
155
+
156
+ if http_resp.status == 422:
157
+ raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data)
158
+
159
+ if 500 <= http_resp.status <= 599:
160
+ raise ServiceException(http_resp=http_resp, body=body, data=data)
161
+ raise ApiException(http_resp=http_resp, body=body, data=data)
162
+
163
+ def __str__(self):
164
+ """Custom error messages for exception"""
165
+ error_message = "({0})\n"\
166
+ "Reason: {1}\n".format(self.status, self.reason)
167
+ if self.headers:
168
+ error_message += "HTTP response headers: {0}\n".format(
169
+ self.headers)
170
+
171
+ if self.body:
172
+ error_message += "HTTP response body: {0}\n".format(self.body)
173
+
174
+ if self.data:
175
+ error_message += "HTTP response data: {0}\n".format(self.data)
176
+
177
+ return error_message
178
+
179
+
180
+ class BadRequestException(ApiException):
181
+ pass
182
+
183
+
184
+ class NotFoundException(ApiException):
185
+ pass
186
+
187
+
188
+ class UnauthorizedException(ApiException):
189
+ pass
190
+
191
+
192
+ class ForbiddenException(ApiException):
193
+ pass
194
+
195
+
196
+ class ServiceException(ApiException):
197
+ pass
198
+
199
+
200
+ class ConflictException(ApiException):
201
+ """Exception for HTTP 409 Conflict."""
202
+ pass
203
+
204
+
205
+ class UnprocessableEntityException(ApiException):
206
+ """Exception for HTTP 422 Unprocessable Entity."""
207
+ pass
208
+
209
+
210
+ def render_path(path_to_item):
211
+ """Returns a string representation of a path"""
212
+ result = ""
213
+ for pth in path_to_item:
214
+ if isinstance(pth, int):
215
+ result += "[{0}]".format(pth)
216
+ else:
217
+ result += "['{0}']".format(pth)
218
+ return result
@@ -0,0 +1,51 @@
1
+ # coding: utf-8
2
+
3
+ # flake8: noqa
4
+ """
5
+ Dockflow v3 API
6
+
7
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
8
+
9
+ The version of the OpenAPI document: 3.0.0
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+ # import models into model package
16
+ from dockflow_sdk.models.container_reference import ContainerReference
17
+ from dockflow_sdk.models.create_tradeflows202_response import CreateTradeflows202Response
18
+ from dockflow_sdk.models.create_tradeflows202_response_tradeflows_inner import CreateTradeflows202ResponseTradeflowsInner
19
+ from dockflow_sdk.models.document_update import DocumentUpdate
20
+ from dockflow_sdk.models.document_upload import DocumentUpload
21
+ from dockflow_sdk.models.downstream_tradeflow import DownstreamTradeflow
22
+ from dockflow_sdk.models.downstream_tradeflow_bill_of_lading_reference import DownstreamTradeflowBillOfLadingReference
23
+ from dockflow_sdk.models.downstream_tradeflow_booking_reference import DownstreamTradeflowBookingReference
24
+ from dockflow_sdk.models.downstream_tradeflow_events_inner import DownstreamTradeflowEventsInner
25
+ from dockflow_sdk.models.downstream_tradeflow_free_time_overrides_inner import DownstreamTradeflowFreeTimeOverridesInner
26
+ from dockflow_sdk.models.downstream_tradeflow_mock_tracking import DownstreamTradeflowMockTracking
27
+ from dockflow_sdk.models.downstream_tradeflow_partners_inner import DownstreamTradeflowPartnersInner
28
+ from dockflow_sdk.models.downstream_tradeflow_references import DownstreamTradeflowReferences
29
+ from dockflow_sdk.models.get_document200_response import GetDocument200Response
30
+ from dockflow_sdk.models.get_document200_response_data_inner import GetDocument200ResponseDataInner
31
+ from dockflow_sdk.models.get_document200_response_data_inner_document_type import GetDocument200ResponseDataInnerDocumentType
32
+ from dockflow_sdk.models.get_upstream200_response import GetUpstream200Response
33
+ from dockflow_sdk.models.get_upstream400_response import GetUpstream400Response
34
+ from dockflow_sdk.models.inline_object import InlineObject
35
+ from dockflow_sdk.models.list_document_types200_response_inner import ListDocumentTypes200ResponseInner
36
+ from dockflow_sdk.models.upload_document202_response import UploadDocument202Response
37
+ from dockflow_sdk.models.upload_document400_response import UploadDocument400Response
38
+ from dockflow_sdk.models.upstream_record import UpstreamRecord
39
+ from dockflow_sdk.models.upstream_record_additional_references import UpstreamRecordAdditionalReferences
40
+ from dockflow_sdk.models.upstream_record_data_quality import UpstreamRecordDataQuality
41
+ from dockflow_sdk.models.upstream_record_metadata import UpstreamRecordMetadata
42
+ from dockflow_sdk.models.widget_container import WidgetContainer
43
+ from dockflow_sdk.models.widget_country import WidgetCountry
44
+ from dockflow_sdk.models.widget_leg import WidgetLeg
45
+ from dockflow_sdk.models.widget_location import WidgetLocation
46
+ from dockflow_sdk.models.widget_milestone import WidgetMilestone
47
+ from dockflow_sdk.models.widget_point import WidgetPoint
48
+ from dockflow_sdk.models.widget_search_result import WidgetSearchResult
49
+ from dockflow_sdk.models.widget_track import WidgetTrack
50
+ from dockflow_sdk.models.widget_track_reading import WidgetTrackReading
51
+
@@ -0,0 +1,90 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Dockflow v3 API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 3.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+ from pydantic_core import to_jsonable_python
25
+
26
+ class ContainerReference(BaseModel):
27
+ """
28
+ ContainerReference
29
+ """ # noqa: E501
30
+ reference: StrictStr
31
+ custom_properties: Optional[Dict[str, Any]] = Field(default=None, description="Free-form key-value pairs stored on the container.")
32
+ __properties: ClassVar[List[str]] = ["reference", "custom_properties"]
33
+
34
+ model_config = ConfigDict(
35
+ validate_by_name=True,
36
+ validate_by_alias=True,
37
+ validate_assignment=True,
38
+ protected_namespaces=(),
39
+ )
40
+
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.model_dump(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ return json.dumps(to_jsonable_python(self.to_dict()))
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> Optional[Self]:
52
+ """Create an instance of ContainerReference 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 ContainerReference 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
+ "reference": obj.get("reference"),
86
+ "custom_properties": obj.get("custom_properties")
87
+ })
88
+ return _obj
89
+
90
+
@@ -0,0 +1,104 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Dockflow v3 API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 3.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, StrictStr, field_validator
21
+ from typing import Any, ClassVar, Dict, List
22
+ from dockflow_sdk.models.create_tradeflows202_response_tradeflows_inner import CreateTradeflows202ResponseTradeflowsInner
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+ from pydantic_core import to_jsonable_python
26
+
27
+ class CreateTradeflows202Response(BaseModel):
28
+ """
29
+ CreateTradeflows202Response
30
+ """ # noqa: E501
31
+ status: StrictStr
32
+ tradeflows: List[CreateTradeflows202ResponseTradeflowsInner]
33
+ __properties: ClassVar[List[str]] = ["status", "tradeflows"]
34
+
35
+ @field_validator('status')
36
+ def status_validate_enum(cls, value):
37
+ """Validates the enum"""
38
+ if value not in set(['queued']):
39
+ raise ValueError("must be one of enum values ('queued')")
40
+ return value
41
+
42
+ model_config = ConfigDict(
43
+ validate_by_name=True,
44
+ validate_by_alias=True,
45
+ validate_assignment=True,
46
+ protected_namespaces=(),
47
+ )
48
+
49
+
50
+ def to_str(self) -> str:
51
+ """Returns the string representation of the model using alias"""
52
+ return pprint.pformat(self.model_dump(by_alias=True))
53
+
54
+ def to_json(self) -> str:
55
+ """Returns the JSON representation of the model using alias"""
56
+ return json.dumps(to_jsonable_python(self.to_dict()))
57
+
58
+ @classmethod
59
+ def from_json(cls, json_str: str) -> Optional[Self]:
60
+ """Create an instance of CreateTradeflows202Response from a JSON string"""
61
+ return cls.from_dict(json.loads(json_str))
62
+
63
+ def to_dict(self) -> Dict[str, Any]:
64
+ """Return the dictionary representation of the model using alias.
65
+
66
+ This has the following differences from calling pydantic's
67
+ `self.model_dump(by_alias=True)`:
68
+
69
+ * `None` is only added to the output dict for nullable fields that
70
+ were set at model initialization. Other fields with value `None`
71
+ are ignored.
72
+ """
73
+ excluded_fields: Set[str] = set([
74
+ ])
75
+
76
+ _dict = self.model_dump(
77
+ by_alias=True,
78
+ exclude=excluded_fields,
79
+ exclude_none=True,
80
+ )
81
+ # override the default output from pydantic by calling `to_dict()` of each item in tradeflows (list)
82
+ _items = []
83
+ if self.tradeflows:
84
+ for _item_tradeflows in self.tradeflows:
85
+ _items.append(_item_tradeflows.to_dict() if _item_tradeflows is not None else None)
86
+ _dict['tradeflows'] = _items
87
+ return _dict
88
+
89
+ @classmethod
90
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
91
+ """Create an instance of CreateTradeflows202Response from a dict"""
92
+ if obj is None:
93
+ return None
94
+
95
+ if not isinstance(obj, dict):
96
+ return cls.model_validate(obj)
97
+
98
+ _obj = cls.model_validate({
99
+ "status": obj.get("status"),
100
+ "tradeflows": [CreateTradeflows202ResponseTradeflowsInner.from_dict(_item) for _item in obj["tradeflows"]] if obj.get("tradeflows") is not None else None
101
+ })
102
+ return _obj
103
+
104
+
@@ -0,0 +1,90 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Dockflow v3 API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 3.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, StrictStr
21
+ from typing import Any, ClassVar, Dict, List
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+ from pydantic_core import to_jsonable_python
25
+
26
+ class CreateTradeflows202ResponseTradeflowsInner(BaseModel):
27
+ """
28
+ CreateTradeflows202ResponseTradeflowsInner
29
+ """ # noqa: E501
30
+ tradeflow_reference: StrictStr
31
+ warnings: List[StrictStr]
32
+ __properties: ClassVar[List[str]] = ["tradeflow_reference", "warnings"]
33
+
34
+ model_config = ConfigDict(
35
+ validate_by_name=True,
36
+ validate_by_alias=True,
37
+ validate_assignment=True,
38
+ protected_namespaces=(),
39
+ )
40
+
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.model_dump(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ return json.dumps(to_jsonable_python(self.to_dict()))
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> Optional[Self]:
52
+ """Create an instance of CreateTradeflows202ResponseTradeflowsInner 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 CreateTradeflows202ResponseTradeflowsInner 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
+ "tradeflow_reference": obj.get("tradeflow_reference"),
86
+ "warnings": obj.get("warnings")
87
+ })
88
+ return _obj
89
+
90
+
@@ -0,0 +1,92 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Dockflow v3 API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 3.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+ from pydantic_core import to_jsonable_python
25
+
26
+ class DocumentUpdate(BaseModel):
27
+ """
28
+ Only the fields sent are changed.
29
+ """ # noqa: E501
30
+ document_filename: Optional[StrictStr] = None
31
+ document_type: Optional[StrictStr] = Field(default=None, description="A type name from GET /v3/downstream/documents/types. An unknown name leaves the type unchanged.")
32
+ container_reference: Optional[StrictStr] = Field(default=None, description="Links the document to this container; an unknown reference unlinks it.")
33
+ __properties: ClassVar[List[str]] = ["document_filename", "document_type", "container_reference"]
34
+
35
+ model_config = ConfigDict(
36
+ validate_by_name=True,
37
+ validate_by_alias=True,
38
+ validate_assignment=True,
39
+ protected_namespaces=(),
40
+ )
41
+
42
+
43
+ def to_str(self) -> str:
44
+ """Returns the string representation of the model using alias"""
45
+ return pprint.pformat(self.model_dump(by_alias=True))
46
+
47
+ def to_json(self) -> str:
48
+ """Returns the JSON representation of the model using alias"""
49
+ return json.dumps(to_jsonable_python(self.to_dict()))
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
+ """Create an instance of DocumentUpdate from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ """
66
+ excluded_fields: Set[str] = set([
67
+ ])
68
+
69
+ _dict = self.model_dump(
70
+ by_alias=True,
71
+ exclude=excluded_fields,
72
+ exclude_none=True,
73
+ )
74
+ return _dict
75
+
76
+ @classmethod
77
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
78
+ """Create an instance of DocumentUpdate from a dict"""
79
+ if obj is None:
80
+ return None
81
+
82
+ if not isinstance(obj, dict):
83
+ return cls.model_validate(obj)
84
+
85
+ _obj = cls.model_validate({
86
+ "document_filename": obj.get("document_filename"),
87
+ "document_type": obj.get("document_type"),
88
+ "container_reference": obj.get("container_reference")
89
+ })
90
+ return _obj
91
+
92
+