python-moloni-fix 0.3.16__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.
- moloni/__init__.py +0 -0
- moloni/__version__.py +1 -0
- moloni/api/__init__.py +701 -0
- moloni/api/bankaccounts_client.py +372 -0
- moloni/api/billsoflading_client.py +693 -0
- moloni/api/companies_client.py +322 -0
- moloni/api/countries_client.py +171 -0
- moloni/api/creditnotes_client.py +615 -0
- moloni/api/currencies_client.py +171 -0
- moloni/api/customeralternateaddresses_client.py +519 -0
- moloni/api/customerreturnnotes_client.py +701 -0
- moloni/api/customers_client.py +1413 -0
- moloni/api/debitnotes_client.py +597 -0
- moloni/api/deductions_client.py +435 -0
- moloni/api/deliverymethods_client.py +431 -0
- moloni/api/deliverynotes_client.py +714 -0
- moloni/api/documentmodels_client.py +171 -0
- moloni/api/documents_client.py +472 -0
- moloni/api/documentsets_client.py +447 -0
- moloni/api/estimates_client.py +663 -0
- moloni/api/fiscalzones_client.py +219 -0
- moloni/api/identificationtemplates_client.py +513 -0
- moloni/api/invoicereceipts_client.py +705 -0
- moloni/api/invoices_client.py +705 -0
- moloni/api/languages_client.py +171 -0
- moloni/api/maturitydates_client.py +441 -0
- moloni/api/measurementunits_client.py +437 -0
- moloni/api/ownassetsmovementguides_client.py +683 -0
- moloni/api/paymentmethods_client.py +429 -0
- moloni/api/productcategories_client.py +400 -0
- moloni/api/products_client.py +1252 -0
- moloni/api/receipts_client.py +591 -0
- moloni/api/salesmen_client.py +580 -0
- moloni/api/simplifiedinvoices_client.py +705 -0
- moloni/api/subscription_client.py +104 -0
- moloni/api/suppliers_client.py +1264 -0
- moloni/api/taxes_client.py +477 -0
- moloni/api/taxexemptions_client.py +171 -0
- moloni/api/users_client.py +104 -0
- moloni/api/vehicles_client.py +435 -0
- moloni/api/warehouses_client.py +506 -0
- moloni/api/waybills_client.py +699 -0
- moloni/base/__init__.py +24 -0
- moloni/base/client.py +164 -0
- moloni/base/config.py +6 -0
- moloni/base/helpers.py +150 -0
- moloni/base/logger_config.py +49 -0
- python_moloni_fix-0.3.16.dist-info/METADATA +231 -0
- python_moloni_fix-0.3.16.dist-info/RECORD +52 -0
- python_moloni_fix-0.3.16.dist-info/WHEEL +5 -0
- python_moloni_fix-0.3.16.dist-info/licenses/LICENSE +21 -0
- python_moloni_fix-0.3.16.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,699 @@
|
|
|
1
|
+
from pydantic import BaseModel, ValidationError
|
|
2
|
+
from typing import Union, Optional, List, Any
|
|
3
|
+
|
|
4
|
+
from moloni.base.client import MoloniBaseClient
|
|
5
|
+
from moloni.base.helpers import endpoint, fill_query_params, validate_data
|
|
6
|
+
from moloni.base import ApiResponse
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class ApiRequestModel(BaseModel):
|
|
10
|
+
_api_client: Any = None
|
|
11
|
+
|
|
12
|
+
def connect(self, *args, **kwargs):
|
|
13
|
+
self._api_client = WaybillsClient(*args, **kwargs)
|
|
14
|
+
return self
|
|
15
|
+
|
|
16
|
+
def __enter__(self):
|
|
17
|
+
return self.connect()
|
|
18
|
+
|
|
19
|
+
def __exit__(self, exc_type, exc_value, traceback):
|
|
20
|
+
pass
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class Associated_documents(BaseModel):
|
|
24
|
+
associated_id: Optional[Any] = None
|
|
25
|
+
value: Optional[Any] = None
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class Payments(BaseModel):
|
|
29
|
+
date: Optional[Any] = None
|
|
30
|
+
notes: Optional[Any] = None
|
|
31
|
+
payment_method_id: Optional[Any] = None
|
|
32
|
+
value: Optional[Any] = None
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class Products(BaseModel):
|
|
36
|
+
discount: Optional[Any] = None
|
|
37
|
+
exemption_reason: Optional[Any] = None
|
|
38
|
+
name: Optional[Any] = None
|
|
39
|
+
order: Optional[Any] = None
|
|
40
|
+
price: Optional[Any] = None
|
|
41
|
+
product_id: Optional[Any] = None
|
|
42
|
+
qty: Optional[Any] = None
|
|
43
|
+
summary: Optional[Any] = None
|
|
44
|
+
taxes: Optional[Any] = None
|
|
45
|
+
warehouse_id: Optional[Any] = None
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class WaybillsCountModel(ApiRequestModel):
|
|
49
|
+
company_id: Union[str, int]
|
|
50
|
+
customer_id: Optional[Union[str, int]] = None
|
|
51
|
+
date: Optional[str] = None
|
|
52
|
+
document_set_id: Optional[Union[str, int]] = None
|
|
53
|
+
number: Optional[str] = None
|
|
54
|
+
year: Optional[str] = None
|
|
55
|
+
your_reference: Optional[str] = None
|
|
56
|
+
|
|
57
|
+
def request(self) -> ApiResponse:
|
|
58
|
+
"""
|
|
59
|
+
request(self) -> ApiResponse
|
|
60
|
+
|
|
61
|
+
Make an API request using the initialized client.
|
|
62
|
+
|
|
63
|
+
This method checks if the `_api_client` attribute is set (i.e., if the client has been initialized via the `connect` method).
|
|
64
|
+
If the client is initialized, it will make an API request using the provided method name and the model's data,
|
|
65
|
+
excluding the `_api_client` attribute itself from the request payload. If the client is not initialized, it will raise a `ValueError`.
|
|
66
|
+
|
|
67
|
+
Returns:
|
|
68
|
+
The response from the API.
|
|
69
|
+
|
|
70
|
+
Raises:
|
|
71
|
+
ValueError: If the client is not initialized via the `connect` method.
|
|
72
|
+
|
|
73
|
+
Example:
|
|
74
|
+
|
|
75
|
+
# Assuming you have a model instance `request_model` and an API client `api_client`
|
|
76
|
+
|
|
77
|
+
..code-block:: python
|
|
78
|
+
|
|
79
|
+
with request_model.connect(auth_config=auth_config) as api:
|
|
80
|
+
response = api.request()
|
|
81
|
+
|
|
82
|
+
# The above example assumes that the `connect` method has been used to initialize the client.
|
|
83
|
+
# The request method then sends the model's data to the API and returns the API's response.
|
|
84
|
+
|
|
85
|
+
"""
|
|
86
|
+
if hasattr(self, "_api_client"):
|
|
87
|
+
response = self._api_client.count(
|
|
88
|
+
self.model_dump(exclude={"_api_client"}, exclude_unset=True)
|
|
89
|
+
)
|
|
90
|
+
return response
|
|
91
|
+
else:
|
|
92
|
+
raise ValueError("Client not initialized. Use the 'connect' method.")
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
class WaybillsDeleteModel(ApiRequestModel):
|
|
96
|
+
company_id: Union[str, int]
|
|
97
|
+
document_id: Optional[Union[str, int]] = None
|
|
98
|
+
|
|
99
|
+
def request(self) -> ApiResponse:
|
|
100
|
+
"""
|
|
101
|
+
request(self) -> ApiResponse
|
|
102
|
+
|
|
103
|
+
Make an API request using the initialized client.
|
|
104
|
+
|
|
105
|
+
This method checks if the `_api_client` attribute is set (i.e., if the client has been initialized via the `connect` method).
|
|
106
|
+
If the client is initialized, it will make an API request using the provided method name and the model's data,
|
|
107
|
+
excluding the `_api_client` attribute itself from the request payload. If the client is not initialized, it will raise a `ValueError`.
|
|
108
|
+
|
|
109
|
+
Returns:
|
|
110
|
+
The response from the API.
|
|
111
|
+
|
|
112
|
+
Raises:
|
|
113
|
+
ValueError: If the client is not initialized via the `connect` method.
|
|
114
|
+
|
|
115
|
+
Example:
|
|
116
|
+
|
|
117
|
+
# Assuming you have a model instance `request_model` and an API client `api_client`
|
|
118
|
+
|
|
119
|
+
..code-block:: python
|
|
120
|
+
|
|
121
|
+
with request_model.connect(auth_config=auth_config) as api:
|
|
122
|
+
response = api.request()
|
|
123
|
+
|
|
124
|
+
# The above example assumes that the `connect` method has been used to initialize the client.
|
|
125
|
+
# The request method then sends the model's data to the API and returns the API's response.
|
|
126
|
+
|
|
127
|
+
"""
|
|
128
|
+
if hasattr(self, "_api_client"):
|
|
129
|
+
response = self._api_client.delete(
|
|
130
|
+
self.model_dump(exclude={"_api_client"}, exclude_unset=True)
|
|
131
|
+
)
|
|
132
|
+
return response
|
|
133
|
+
else:
|
|
134
|
+
raise ValueError("Client not initialized. Use the 'connect' method.")
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
class WaybillsGetAllModel(ApiRequestModel):
|
|
138
|
+
company_id: Union[str, int]
|
|
139
|
+
customer_id: Optional[Union[str, int]] = None
|
|
140
|
+
date: Optional[str] = None
|
|
141
|
+
document_set_id: Optional[Union[str, int]] = None
|
|
142
|
+
number: Optional[str] = None
|
|
143
|
+
offset: Optional[Union[str, int]] = 0
|
|
144
|
+
qty: Optional[Union[str, int]] = 25
|
|
145
|
+
year: Optional[str] = None
|
|
146
|
+
your_reference: Optional[str] = None
|
|
147
|
+
|
|
148
|
+
def request(self) -> ApiResponse:
|
|
149
|
+
"""
|
|
150
|
+
request(self) -> ApiResponse
|
|
151
|
+
|
|
152
|
+
Make an API request using the initialized client.
|
|
153
|
+
|
|
154
|
+
This method checks if the `_api_client` attribute is set (i.e., if the client has been initialized via the `connect` method).
|
|
155
|
+
If the client is initialized, it will make an API request using the provided method name and the model's data,
|
|
156
|
+
excluding the `_api_client` attribute itself from the request payload. If the client is not initialized, it will raise a `ValueError`.
|
|
157
|
+
|
|
158
|
+
Returns:
|
|
159
|
+
The response from the API.
|
|
160
|
+
|
|
161
|
+
Raises:
|
|
162
|
+
ValueError: If the client is not initialized via the `connect` method.
|
|
163
|
+
|
|
164
|
+
Example:
|
|
165
|
+
|
|
166
|
+
# Assuming you have a model instance `request_model` and an API client `api_client`
|
|
167
|
+
|
|
168
|
+
..code-block:: python
|
|
169
|
+
|
|
170
|
+
with request_model.connect(auth_config=auth_config) as api:
|
|
171
|
+
response = api.request()
|
|
172
|
+
|
|
173
|
+
# The above example assumes that the `connect` method has been used to initialize the client.
|
|
174
|
+
# The request method then sends the model's data to the API and returns the API's response.
|
|
175
|
+
|
|
176
|
+
"""
|
|
177
|
+
if hasattr(self, "_api_client"):
|
|
178
|
+
response = self._api_client.get_all(
|
|
179
|
+
self.model_dump(exclude={"_api_client"}, exclude_unset=True)
|
|
180
|
+
)
|
|
181
|
+
return response
|
|
182
|
+
else:
|
|
183
|
+
raise ValueError("Client not initialized. Use the 'connect' method.")
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
class WaybillsGetOneModel(ApiRequestModel):
|
|
187
|
+
company_id: Union[str, int]
|
|
188
|
+
customer_id: Optional[Union[str, int]] = None
|
|
189
|
+
date: Optional[str] = None
|
|
190
|
+
document_id: Optional[Union[str, int]] = None
|
|
191
|
+
document_set_id: Optional[Union[str, int]] = None
|
|
192
|
+
number: Optional[str] = None
|
|
193
|
+
year: Optional[str] = None
|
|
194
|
+
your_reference: Optional[str] = None
|
|
195
|
+
|
|
196
|
+
def request(self) -> ApiResponse:
|
|
197
|
+
"""
|
|
198
|
+
request(self) -> ApiResponse
|
|
199
|
+
|
|
200
|
+
Make an API request using the initialized client.
|
|
201
|
+
|
|
202
|
+
This method checks if the `_api_client` attribute is set (i.e., if the client has been initialized via the `connect` method).
|
|
203
|
+
If the client is initialized, it will make an API request using the provided method name and the model's data,
|
|
204
|
+
excluding the `_api_client` attribute itself from the request payload. If the client is not initialized, it will raise a `ValueError`.
|
|
205
|
+
|
|
206
|
+
Returns:
|
|
207
|
+
The response from the API.
|
|
208
|
+
|
|
209
|
+
Raises:
|
|
210
|
+
ValueError: If the client is not initialized via the `connect` method.
|
|
211
|
+
|
|
212
|
+
Example:
|
|
213
|
+
|
|
214
|
+
# Assuming you have a model instance `request_model` and an API client `api_client`
|
|
215
|
+
|
|
216
|
+
..code-block:: python
|
|
217
|
+
|
|
218
|
+
with request_model.connect(auth_config=auth_config) as api:
|
|
219
|
+
response = api.request()
|
|
220
|
+
|
|
221
|
+
# The above example assumes that the `connect` method has been used to initialize the client.
|
|
222
|
+
# The request method then sends the model's data to the API and returns the API's response.
|
|
223
|
+
|
|
224
|
+
"""
|
|
225
|
+
if hasattr(self, "_api_client"):
|
|
226
|
+
response = self._api_client.get_one(
|
|
227
|
+
self.model_dump(exclude={"_api_client"}, exclude_unset=True)
|
|
228
|
+
)
|
|
229
|
+
return response
|
|
230
|
+
else:
|
|
231
|
+
raise ValueError("Client not initialized. Use the 'connect' method.")
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
class WaybillsInsertModel(ApiRequestModel):
|
|
235
|
+
company_id: Union[str, int]
|
|
236
|
+
associated_documents: Optional[List[Associated_documents]] = None
|
|
237
|
+
customer_id: Optional[Union[str, int]] = None
|
|
238
|
+
date: Optional[str] = None
|
|
239
|
+
delivery_datetime: Optional[str] = None
|
|
240
|
+
delivery_departure_address: Optional[str] = None
|
|
241
|
+
delivery_departure_city: Optional[str] = None
|
|
242
|
+
delivery_departure_country: Optional[str] = None
|
|
243
|
+
delivery_departure_zip_code: Optional[str] = None
|
|
244
|
+
delivery_destination_address: Optional[str] = None
|
|
245
|
+
delivery_destination_city: Optional[str] = None
|
|
246
|
+
delivery_destination_country: Optional[str] = None
|
|
247
|
+
delivery_destination_zip_code: Optional[str] = None
|
|
248
|
+
delivery_method_id: Optional[Union[str, int]] = None
|
|
249
|
+
document_set_id: Optional[Union[str, int]] = None
|
|
250
|
+
financial_discount: Optional[str] = None
|
|
251
|
+
notes: Optional[str] = None
|
|
252
|
+
products: Optional[List[Products]] = None
|
|
253
|
+
related_documents_notes: Optional[str] = None
|
|
254
|
+
status: Optional[str] = None
|
|
255
|
+
vehicle_id: Optional[Union[str, int]] = None
|
|
256
|
+
your_reference: Optional[str] = None
|
|
257
|
+
|
|
258
|
+
def request(self) -> ApiResponse:
|
|
259
|
+
"""
|
|
260
|
+
request(self) -> ApiResponse
|
|
261
|
+
|
|
262
|
+
Make an API request using the initialized client.
|
|
263
|
+
|
|
264
|
+
This method checks if the `_api_client` attribute is set (i.e., if the client has been initialized via the `connect` method).
|
|
265
|
+
If the client is initialized, it will make an API request using the provided method name and the model's data,
|
|
266
|
+
excluding the `_api_client` attribute itself from the request payload. If the client is not initialized, it will raise a `ValueError`.
|
|
267
|
+
|
|
268
|
+
Returns:
|
|
269
|
+
The response from the API.
|
|
270
|
+
|
|
271
|
+
Raises:
|
|
272
|
+
ValueError: If the client is not initialized via the `connect` method.
|
|
273
|
+
|
|
274
|
+
Example:
|
|
275
|
+
|
|
276
|
+
# Assuming you have a model instance `request_model` and an API client `api_client`
|
|
277
|
+
|
|
278
|
+
..code-block:: python
|
|
279
|
+
|
|
280
|
+
with request_model.connect(auth_config=auth_config) as api:
|
|
281
|
+
response = api.request()
|
|
282
|
+
|
|
283
|
+
# The above example assumes that the `connect` method has been used to initialize the client.
|
|
284
|
+
# The request method then sends the model's data to the API and returns the API's response.
|
|
285
|
+
|
|
286
|
+
"""
|
|
287
|
+
if hasattr(self, "_api_client"):
|
|
288
|
+
response = self._api_client.insert(
|
|
289
|
+
self.model_dump(exclude={"_api_client"}, exclude_unset=True)
|
|
290
|
+
)
|
|
291
|
+
return response
|
|
292
|
+
else:
|
|
293
|
+
raise ValueError("Client not initialized. Use the 'connect' method.")
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
class WaybillsSetTransportCodeModel(ApiRequestModel):
|
|
297
|
+
company_id: Union[str, int]
|
|
298
|
+
document_id: Optional[Union[str, int]] = None
|
|
299
|
+
transport_code: Optional[str] = None
|
|
300
|
+
|
|
301
|
+
def request(self) -> ApiResponse:
|
|
302
|
+
"""
|
|
303
|
+
request(self) -> ApiResponse
|
|
304
|
+
|
|
305
|
+
Make an API request using the initialized client.
|
|
306
|
+
|
|
307
|
+
This method checks if the `_api_client` attribute is set (i.e., if the client has been initialized via the `connect` method).
|
|
308
|
+
If the client is initialized, it will make an API request using the provided method name and the model's data,
|
|
309
|
+
excluding the `_api_client` attribute itself from the request payload. If the client is not initialized, it will raise a `ValueError`.
|
|
310
|
+
|
|
311
|
+
Returns:
|
|
312
|
+
The response from the API.
|
|
313
|
+
|
|
314
|
+
Raises:
|
|
315
|
+
ValueError: If the client is not initialized via the `connect` method.
|
|
316
|
+
|
|
317
|
+
Example:
|
|
318
|
+
|
|
319
|
+
# Assuming you have a model instance `request_model` and an API client `api_client`
|
|
320
|
+
|
|
321
|
+
..code-block:: python
|
|
322
|
+
|
|
323
|
+
with request_model.connect(auth_config=auth_config) as api:
|
|
324
|
+
response = api.request()
|
|
325
|
+
|
|
326
|
+
# The above example assumes that the `connect` method has been used to initialize the client.
|
|
327
|
+
# The request method then sends the model's data to the API and returns the API's response.
|
|
328
|
+
|
|
329
|
+
"""
|
|
330
|
+
if hasattr(self, "_api_client"):
|
|
331
|
+
response = self._api_client.set_transport_code(
|
|
332
|
+
self.model_dump(exclude={"_api_client"}, exclude_unset=True)
|
|
333
|
+
)
|
|
334
|
+
return response
|
|
335
|
+
else:
|
|
336
|
+
raise ValueError("Client not initialized. Use the 'connect' method.")
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
class WaybillsUpdateModel(ApiRequestModel):
|
|
340
|
+
company_id: Union[str, int]
|
|
341
|
+
associated_documents: Optional[List[Associated_documents]] = None
|
|
342
|
+
customer_id: Optional[Union[str, int]] = None
|
|
343
|
+
date: Optional[str] = None
|
|
344
|
+
delivery_datetime: Optional[str] = None
|
|
345
|
+
delivery_departure_address: Optional[str] = None
|
|
346
|
+
delivery_departure_city: Optional[str] = None
|
|
347
|
+
delivery_departure_country: Optional[str] = None
|
|
348
|
+
delivery_departure_zip_code: Optional[str] = None
|
|
349
|
+
delivery_destination_address: Optional[str] = None
|
|
350
|
+
delivery_destination_city: Optional[str] = None
|
|
351
|
+
delivery_destination_country: Optional[str] = None
|
|
352
|
+
delivery_destination_zip_code: Optional[str] = None
|
|
353
|
+
delivery_method_id: Optional[Union[str, int]] = None
|
|
354
|
+
document_id: Optional[Union[str, int]] = None
|
|
355
|
+
document_set_id: Optional[Union[str, int]] = None
|
|
356
|
+
financial_discount: Optional[str] = None
|
|
357
|
+
notes: Optional[str] = None
|
|
358
|
+
products: Optional[List[Products]] = None
|
|
359
|
+
related_documents_notes: Optional[str] = None
|
|
360
|
+
status: Optional[str] = None
|
|
361
|
+
vehicle_id: Optional[Union[str, int]] = None
|
|
362
|
+
your_reference: Optional[str] = None
|
|
363
|
+
|
|
364
|
+
def request(self) -> ApiResponse:
|
|
365
|
+
"""
|
|
366
|
+
request(self) -> ApiResponse
|
|
367
|
+
|
|
368
|
+
Make an API request using the initialized client.
|
|
369
|
+
|
|
370
|
+
This method checks if the `_api_client` attribute is set (i.e., if the client has been initialized via the `connect` method).
|
|
371
|
+
If the client is initialized, it will make an API request using the provided method name and the model's data,
|
|
372
|
+
excluding the `_api_client` attribute itself from the request payload. If the client is not initialized, it will raise a `ValueError`.
|
|
373
|
+
|
|
374
|
+
Returns:
|
|
375
|
+
The response from the API.
|
|
376
|
+
|
|
377
|
+
Raises:
|
|
378
|
+
ValueError: If the client is not initialized via the `connect` method.
|
|
379
|
+
|
|
380
|
+
Example:
|
|
381
|
+
|
|
382
|
+
# Assuming you have a model instance `request_model` and an API client `api_client`
|
|
383
|
+
|
|
384
|
+
..code-block:: python
|
|
385
|
+
|
|
386
|
+
with request_model.connect(auth_config=auth_config) as api:
|
|
387
|
+
response = api.request()
|
|
388
|
+
|
|
389
|
+
# The above example assumes that the `connect` method has been used to initialize the client.
|
|
390
|
+
# The request method then sends the model's data to the API and returns the API's response.
|
|
391
|
+
|
|
392
|
+
"""
|
|
393
|
+
if hasattr(self, "_api_client"):
|
|
394
|
+
response = self._api_client.update(
|
|
395
|
+
self.model_dump(exclude={"_api_client"}, exclude_unset=True)
|
|
396
|
+
)
|
|
397
|
+
return response
|
|
398
|
+
else:
|
|
399
|
+
raise ValueError("Client not initialized. Use the 'connect' method.")
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
class WaybillsClient(MoloniBaseClient):
|
|
403
|
+
|
|
404
|
+
@endpoint("/<version>/waybills/count/", method="post")
|
|
405
|
+
def count(self, data: Union[WaybillsCountModel, dict], **kwargs):
|
|
406
|
+
"""
|
|
407
|
+
count(self, data: Union[WaybillsCountModel, dict], **kwargs)
|
|
408
|
+
|
|
409
|
+
Args:
|
|
410
|
+
|
|
411
|
+
data (Union[WaybillsCountModel, dict]): A model instance or dictionary containing the following fields:
|
|
412
|
+
|
|
413
|
+
- company_id (Union[str, int]): company_id of the WaybillsCountModel.
|
|
414
|
+
|
|
415
|
+
- customer_id (Union[str, int]): customer_id of the WaybillsCountModel.
|
|
416
|
+
|
|
417
|
+
- date (str): date of the WaybillsCountModel.
|
|
418
|
+
|
|
419
|
+
- document_set_id (Union[str, int]): document_set_id of the WaybillsCountModel.
|
|
420
|
+
|
|
421
|
+
- number (str): number of the WaybillsCountModel.
|
|
422
|
+
|
|
423
|
+
- year (str): year of the WaybillsCountModel.
|
|
424
|
+
|
|
425
|
+
- your_reference (str): your_reference of the WaybillsCountModel.
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
Returns:
|
|
430
|
+
ApiResponse: The response from the API.
|
|
431
|
+
"""
|
|
432
|
+
|
|
433
|
+
data = validate_data(data, self.validate, WaybillsCountModel)
|
|
434
|
+
|
|
435
|
+
return self._request(
|
|
436
|
+
fill_query_params(kwargs.pop("path"), self.version), data={**data, **kwargs}
|
|
437
|
+
)
|
|
438
|
+
|
|
439
|
+
@endpoint("/<version>/waybills/delete/", method="post")
|
|
440
|
+
def delete(self, data: Union[WaybillsDeleteModel, dict], **kwargs):
|
|
441
|
+
"""
|
|
442
|
+
delete(self, data: Union[WaybillsDeleteModel, dict], **kwargs)
|
|
443
|
+
|
|
444
|
+
Args:
|
|
445
|
+
|
|
446
|
+
data (Union[WaybillsDeleteModel, dict]): A model instance or dictionary containing the following fields:
|
|
447
|
+
|
|
448
|
+
- company_id (Union[str, int]): company_id of the WaybillsDeleteModel.
|
|
449
|
+
|
|
450
|
+
- document_id (Union[str, int]): document_id of the WaybillsDeleteModel.
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
Returns:
|
|
455
|
+
ApiResponse: The response from the API.
|
|
456
|
+
"""
|
|
457
|
+
|
|
458
|
+
data = validate_data(data, self.validate, WaybillsDeleteModel)
|
|
459
|
+
|
|
460
|
+
return self._request(
|
|
461
|
+
fill_query_params(kwargs.pop("path"), self.version), data={**data, **kwargs}
|
|
462
|
+
)
|
|
463
|
+
|
|
464
|
+
@endpoint("/<version>/waybills/getAll/", method="post")
|
|
465
|
+
def get_all(self, data: Union[WaybillsGetAllModel, dict], **kwargs):
|
|
466
|
+
"""
|
|
467
|
+
get_all(self, data: Union[WaybillsGetAllModel, dict], **kwargs)
|
|
468
|
+
|
|
469
|
+
Args:
|
|
470
|
+
|
|
471
|
+
data (Union[WaybillsGetAllModel, dict]): A model instance or dictionary containing the following fields:
|
|
472
|
+
|
|
473
|
+
- company_id (Union[str, int]): company_id of the WaybillsGetAllModel.
|
|
474
|
+
|
|
475
|
+
- customer_id (Union[str, int]): customer_id of the WaybillsGetAllModel.
|
|
476
|
+
|
|
477
|
+
- date (str): date of the WaybillsGetAllModel.
|
|
478
|
+
|
|
479
|
+
- document_set_id (Union[str, int]): document_set_id of the WaybillsGetAllModel.
|
|
480
|
+
|
|
481
|
+
- number (str): number of the WaybillsGetAllModel.
|
|
482
|
+
|
|
483
|
+
- offset (str): offset of the WaybillsGetAllModel.
|
|
484
|
+
|
|
485
|
+
- qty (str): qty of the WaybillsGetAllModel.
|
|
486
|
+
|
|
487
|
+
- year (str): year of the WaybillsGetAllModel.
|
|
488
|
+
|
|
489
|
+
- your_reference (str): your_reference of the WaybillsGetAllModel.
|
|
490
|
+
|
|
491
|
+
|
|
492
|
+
|
|
493
|
+
Returns:
|
|
494
|
+
ApiResponse: The response from the API.
|
|
495
|
+
"""
|
|
496
|
+
|
|
497
|
+
data = validate_data(data, self.validate, WaybillsGetAllModel)
|
|
498
|
+
|
|
499
|
+
return self._request(
|
|
500
|
+
fill_query_params(kwargs.pop("path"), self.version), data={**data, **kwargs}
|
|
501
|
+
)
|
|
502
|
+
|
|
503
|
+
@endpoint("/<version>/waybills/getOne/", method="post")
|
|
504
|
+
def get_one(self, data: Union[WaybillsGetOneModel, dict], **kwargs):
|
|
505
|
+
"""
|
|
506
|
+
get_one(self, data: Union[WaybillsGetOneModel, dict], **kwargs)
|
|
507
|
+
|
|
508
|
+
Args:
|
|
509
|
+
|
|
510
|
+
data (Union[WaybillsGetOneModel, dict]): A model instance or dictionary containing the following fields:
|
|
511
|
+
|
|
512
|
+
- company_id (Union[str, int]): company_id of the WaybillsGetOneModel.
|
|
513
|
+
|
|
514
|
+
- customer_id (Union[str, int]): customer_id of the WaybillsGetOneModel.
|
|
515
|
+
|
|
516
|
+
- date (str): date of the WaybillsGetOneModel.
|
|
517
|
+
|
|
518
|
+
- document_id (Union[str, int]): document_id of the WaybillsGetOneModel.
|
|
519
|
+
|
|
520
|
+
- document_set_id (Union[str, int]): document_set_id of the WaybillsGetOneModel.
|
|
521
|
+
|
|
522
|
+
- number (str): number of the WaybillsGetOneModel.
|
|
523
|
+
|
|
524
|
+
- year (str): year of the WaybillsGetOneModel.
|
|
525
|
+
|
|
526
|
+
- your_reference (str): your_reference of the WaybillsGetOneModel.
|
|
527
|
+
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
Returns:
|
|
531
|
+
ApiResponse: The response from the API.
|
|
532
|
+
"""
|
|
533
|
+
|
|
534
|
+
data = validate_data(data, self.validate, WaybillsGetOneModel)
|
|
535
|
+
|
|
536
|
+
return self._request(
|
|
537
|
+
fill_query_params(kwargs.pop("path"), self.version), data={**data, **kwargs}
|
|
538
|
+
)
|
|
539
|
+
|
|
540
|
+
@endpoint("/<version>/waybills/insert/", method="post")
|
|
541
|
+
def insert(self, data: Union[WaybillsInsertModel, dict], **kwargs):
|
|
542
|
+
"""
|
|
543
|
+
insert(self, data: Union[WaybillsInsertModel, dict], **kwargs)
|
|
544
|
+
|
|
545
|
+
Args:
|
|
546
|
+
|
|
547
|
+
data (Union[WaybillsInsertModel, dict]): A model instance or dictionary containing the following fields:
|
|
548
|
+
|
|
549
|
+
- associated_documents (str): associated_documents of the WaybillsInsertModel.
|
|
550
|
+
|
|
551
|
+
- company_id (Union[str, int]): company_id of the WaybillsInsertModel.
|
|
552
|
+
|
|
553
|
+
- customer_id (Union[str, int]): customer_id of the WaybillsInsertModel.
|
|
554
|
+
|
|
555
|
+
- date (str): date of the WaybillsInsertModel.
|
|
556
|
+
|
|
557
|
+
- delivery_datetime (str): delivery_datetime of the WaybillsInsertModel.
|
|
558
|
+
|
|
559
|
+
- delivery_departure_address (str): delivery_departure_address of the WaybillsInsertModel.
|
|
560
|
+
|
|
561
|
+
- delivery_departure_city (str): delivery_departure_city of the WaybillsInsertModel.
|
|
562
|
+
|
|
563
|
+
- delivery_departure_country (str): delivery_departure_country of the WaybillsInsertModel.
|
|
564
|
+
|
|
565
|
+
- delivery_departure_zip_code (str): delivery_departure_zip_code of the WaybillsInsertModel.
|
|
566
|
+
|
|
567
|
+
- delivery_destination_address (str): delivery_destination_address of the WaybillsInsertModel.
|
|
568
|
+
|
|
569
|
+
- delivery_destination_city (str): delivery_destination_city of the WaybillsInsertModel.
|
|
570
|
+
|
|
571
|
+
- delivery_destination_country (str): delivery_destination_country of the WaybillsInsertModel.
|
|
572
|
+
|
|
573
|
+
- delivery_destination_zip_code (str): delivery_destination_zip_code of the WaybillsInsertModel.
|
|
574
|
+
|
|
575
|
+
- delivery_method_id (Union[str, int]): delivery_method_id of the WaybillsInsertModel.
|
|
576
|
+
|
|
577
|
+
- document_set_id (Union[str, int]): document_set_id of the WaybillsInsertModel.
|
|
578
|
+
|
|
579
|
+
- financial_discount (str): financial_discount of the WaybillsInsertModel.
|
|
580
|
+
|
|
581
|
+
- notes (str): notes of the WaybillsInsertModel.
|
|
582
|
+
|
|
583
|
+
- products (str): products of the WaybillsInsertModel.
|
|
584
|
+
|
|
585
|
+
- related_documents_notes (str): related_documents_notes of the WaybillsInsertModel.
|
|
586
|
+
|
|
587
|
+
- status (str): status of the WaybillsInsertModel.
|
|
588
|
+
|
|
589
|
+
- vehicle_id (Union[str, int]): vehicle_id of the WaybillsInsertModel.
|
|
590
|
+
|
|
591
|
+
- your_reference (str): your_reference of the WaybillsInsertModel.
|
|
592
|
+
|
|
593
|
+
|
|
594
|
+
|
|
595
|
+
Returns:
|
|
596
|
+
ApiResponse: The response from the API.
|
|
597
|
+
"""
|
|
598
|
+
|
|
599
|
+
data = validate_data(data, self.validate, WaybillsInsertModel)
|
|
600
|
+
|
|
601
|
+
return self._request(
|
|
602
|
+
fill_query_params(kwargs.pop("path"), self.version), data={**data, **kwargs}
|
|
603
|
+
)
|
|
604
|
+
|
|
605
|
+
@endpoint("/<version>/waybills/setTransportCode/", method="post")
|
|
606
|
+
def set_transport_code(
|
|
607
|
+
self, data: Union[WaybillsSetTransportCodeModel, dict], **kwargs
|
|
608
|
+
):
|
|
609
|
+
"""
|
|
610
|
+
set_transport_code(self, data: Union[WaybillsSetTransportCodeModel, dict], **kwargs)
|
|
611
|
+
|
|
612
|
+
Args:
|
|
613
|
+
|
|
614
|
+
data (Union[WaybillsSetTransportCodeModel, dict]): A model instance or dictionary containing the following fields:
|
|
615
|
+
|
|
616
|
+
- company_id (Union[str, int]): company_id of the WaybillsSetTransportCodeModel.
|
|
617
|
+
|
|
618
|
+
- document_id (Union[str, int]): document_id of the WaybillsSetTransportCodeModel.
|
|
619
|
+
|
|
620
|
+
- transport_code (str): transport_code of the WaybillsSetTransportCodeModel.
|
|
621
|
+
|
|
622
|
+
|
|
623
|
+
|
|
624
|
+
Returns:
|
|
625
|
+
ApiResponse: The response from the API.
|
|
626
|
+
"""
|
|
627
|
+
|
|
628
|
+
data = validate_data(data, self.validate, WaybillsSetTransportCodeModel)
|
|
629
|
+
|
|
630
|
+
return self._request(
|
|
631
|
+
fill_query_params(kwargs.pop("path"), self.version), data={**data, **kwargs}
|
|
632
|
+
)
|
|
633
|
+
|
|
634
|
+
@endpoint("/<version>/waybills/update/", method="post")
|
|
635
|
+
def update(self, data: Union[WaybillsUpdateModel, dict], **kwargs):
|
|
636
|
+
"""
|
|
637
|
+
update(self, data: Union[WaybillsUpdateModel, dict], **kwargs)
|
|
638
|
+
|
|
639
|
+
Args:
|
|
640
|
+
|
|
641
|
+
data (Union[WaybillsUpdateModel, dict]): A model instance or dictionary containing the following fields:
|
|
642
|
+
|
|
643
|
+
- associated_documents (str): associated_documents of the WaybillsUpdateModel.
|
|
644
|
+
|
|
645
|
+
- company_id (Union[str, int]): company_id of the WaybillsUpdateModel.
|
|
646
|
+
|
|
647
|
+
- customer_id (Union[str, int]): customer_id of the WaybillsUpdateModel.
|
|
648
|
+
|
|
649
|
+
- date (str): date of the WaybillsUpdateModel.
|
|
650
|
+
|
|
651
|
+
- delivery_datetime (str): delivery_datetime of the WaybillsUpdateModel.
|
|
652
|
+
|
|
653
|
+
- delivery_departure_address (str): delivery_departure_address of the WaybillsUpdateModel.
|
|
654
|
+
|
|
655
|
+
- delivery_departure_city (str): delivery_departure_city of the WaybillsUpdateModel.
|
|
656
|
+
|
|
657
|
+
- delivery_departure_country (str): delivery_departure_country of the WaybillsUpdateModel.
|
|
658
|
+
|
|
659
|
+
- delivery_departure_zip_code (str): delivery_departure_zip_code of the WaybillsUpdateModel.
|
|
660
|
+
|
|
661
|
+
- delivery_destination_address (str): delivery_destination_address of the WaybillsUpdateModel.
|
|
662
|
+
|
|
663
|
+
- delivery_destination_city (str): delivery_destination_city of the WaybillsUpdateModel.
|
|
664
|
+
|
|
665
|
+
- delivery_destination_country (str): delivery_destination_country of the WaybillsUpdateModel.
|
|
666
|
+
|
|
667
|
+
- delivery_destination_zip_code (str): delivery_destination_zip_code of the WaybillsUpdateModel.
|
|
668
|
+
|
|
669
|
+
- delivery_method_id (Union[str, int]): delivery_method_id of the WaybillsUpdateModel.
|
|
670
|
+
|
|
671
|
+
- document_id (Union[str, int]): document_id of the WaybillsUpdateModel.
|
|
672
|
+
|
|
673
|
+
- document_set_id (Union[str, int]): document_set_id of the WaybillsUpdateModel.
|
|
674
|
+
|
|
675
|
+
- financial_discount (str): financial_discount of the WaybillsUpdateModel.
|
|
676
|
+
|
|
677
|
+
- notes (str): notes of the WaybillsUpdateModel.
|
|
678
|
+
|
|
679
|
+
- products (str): products of the WaybillsUpdateModel.
|
|
680
|
+
|
|
681
|
+
- related_documents_notes (str): related_documents_notes of the WaybillsUpdateModel.
|
|
682
|
+
|
|
683
|
+
- status (str): status of the WaybillsUpdateModel.
|
|
684
|
+
|
|
685
|
+
- vehicle_id (Union[str, int]): vehicle_id of the WaybillsUpdateModel.
|
|
686
|
+
|
|
687
|
+
- your_reference (str): your_reference of the WaybillsUpdateModel.
|
|
688
|
+
|
|
689
|
+
|
|
690
|
+
|
|
691
|
+
Returns:
|
|
692
|
+
ApiResponse: The response from the API.
|
|
693
|
+
"""
|
|
694
|
+
|
|
695
|
+
data = validate_data(data, self.validate, WaybillsUpdateModel)
|
|
696
|
+
|
|
697
|
+
return self._request(
|
|
698
|
+
fill_query_params(kwargs.pop("path"), self.version), data={**data, **kwargs}
|
|
699
|
+
)
|