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,1264 @@
|
|
|
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 = SuppliersClient(*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 SuppliersCountModel(ApiRequestModel):
|
|
24
|
+
company_id: Union[str, int]
|
|
25
|
+
|
|
26
|
+
def request(self) -> ApiResponse:
|
|
27
|
+
"""
|
|
28
|
+
request(self) -> ApiResponse
|
|
29
|
+
|
|
30
|
+
Make an API request using the initialized client.
|
|
31
|
+
|
|
32
|
+
This method checks if the `_api_client` attribute is set (i.e., if the client has been initialized via the `connect` method).
|
|
33
|
+
If the client is initialized, it will make an API request using the provided method name and the model's data,
|
|
34
|
+
excluding the `_api_client` attribute itself from the request payload. If the client is not initialized, it will raise a `ValueError`.
|
|
35
|
+
|
|
36
|
+
Returns:
|
|
37
|
+
The response from the API.
|
|
38
|
+
|
|
39
|
+
Raises:
|
|
40
|
+
ValueError: If the client is not initialized via the `connect` method.
|
|
41
|
+
|
|
42
|
+
Example:
|
|
43
|
+
|
|
44
|
+
# Assuming you have a model instance `request_model` and an API client `api_client`
|
|
45
|
+
|
|
46
|
+
..code-block:: python
|
|
47
|
+
|
|
48
|
+
with request_model.connect(auth_config=auth_config) as api:
|
|
49
|
+
response = api.request()
|
|
50
|
+
|
|
51
|
+
# The above example assumes that the `connect` method has been used to initialize the client.
|
|
52
|
+
# The request method then sends the model's data to the API and returns the API's response.
|
|
53
|
+
|
|
54
|
+
"""
|
|
55
|
+
if hasattr(self, "_api_client"):
|
|
56
|
+
response = self._api_client.count(
|
|
57
|
+
self.model_dump(exclude={"_api_client"}, exclude_unset=True)
|
|
58
|
+
)
|
|
59
|
+
return response
|
|
60
|
+
else:
|
|
61
|
+
raise ValueError("Client not initialized. Use the 'connect' method.")
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
class SuppliersCountByNameModel(ApiRequestModel):
|
|
65
|
+
company_id: Union[str, int]
|
|
66
|
+
name: Optional[str] = None
|
|
67
|
+
|
|
68
|
+
def request(self) -> ApiResponse:
|
|
69
|
+
"""
|
|
70
|
+
request(self) -> ApiResponse
|
|
71
|
+
|
|
72
|
+
Make an API request using the initialized client.
|
|
73
|
+
|
|
74
|
+
This method checks if the `_api_client` attribute is set (i.e., if the client has been initialized via the `connect` method).
|
|
75
|
+
If the client is initialized, it will make an API request using the provided method name and the model's data,
|
|
76
|
+
excluding the `_api_client` attribute itself from the request payload. If the client is not initialized, it will raise a `ValueError`.
|
|
77
|
+
|
|
78
|
+
Returns:
|
|
79
|
+
The response from the API.
|
|
80
|
+
|
|
81
|
+
Raises:
|
|
82
|
+
ValueError: If the client is not initialized via the `connect` method.
|
|
83
|
+
|
|
84
|
+
Example:
|
|
85
|
+
|
|
86
|
+
# Assuming you have a model instance `request_model` and an API client `api_client`
|
|
87
|
+
|
|
88
|
+
..code-block:: python
|
|
89
|
+
|
|
90
|
+
with request_model.connect(auth_config=auth_config) as api:
|
|
91
|
+
response = api.request()
|
|
92
|
+
|
|
93
|
+
# The above example assumes that the `connect` method has been used to initialize the client.
|
|
94
|
+
# The request method then sends the model's data to the API and returns the API's response.
|
|
95
|
+
|
|
96
|
+
"""
|
|
97
|
+
if hasattr(self, "_api_client"):
|
|
98
|
+
response = self._api_client.count_by_name(
|
|
99
|
+
self.model_dump(exclude={"_api_client"}, exclude_unset=True)
|
|
100
|
+
)
|
|
101
|
+
return response
|
|
102
|
+
else:
|
|
103
|
+
raise ValueError("Client not initialized. Use the 'connect' method.")
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
class SuppliersCountByNumberModel(ApiRequestModel):
|
|
107
|
+
company_id: Union[str, int]
|
|
108
|
+
number: Optional[str] = None
|
|
109
|
+
|
|
110
|
+
def request(self) -> ApiResponse:
|
|
111
|
+
"""
|
|
112
|
+
request(self) -> ApiResponse
|
|
113
|
+
|
|
114
|
+
Make an API request using the initialized client.
|
|
115
|
+
|
|
116
|
+
This method checks if the `_api_client` attribute is set (i.e., if the client has been initialized via the `connect` method).
|
|
117
|
+
If the client is initialized, it will make an API request using the provided method name and the model's data,
|
|
118
|
+
excluding the `_api_client` attribute itself from the request payload. If the client is not initialized, it will raise a `ValueError`.
|
|
119
|
+
|
|
120
|
+
Returns:
|
|
121
|
+
The response from the API.
|
|
122
|
+
|
|
123
|
+
Raises:
|
|
124
|
+
ValueError: If the client is not initialized via the `connect` method.
|
|
125
|
+
|
|
126
|
+
Example:
|
|
127
|
+
|
|
128
|
+
# Assuming you have a model instance `request_model` and an API client `api_client`
|
|
129
|
+
|
|
130
|
+
..code-block:: python
|
|
131
|
+
|
|
132
|
+
with request_model.connect(auth_config=auth_config) as api:
|
|
133
|
+
response = api.request()
|
|
134
|
+
|
|
135
|
+
# The above example assumes that the `connect` method has been used to initialize the client.
|
|
136
|
+
# The request method then sends the model's data to the API and returns the API's response.
|
|
137
|
+
|
|
138
|
+
"""
|
|
139
|
+
if hasattr(self, "_api_client"):
|
|
140
|
+
response = self._api_client.count_by_number(
|
|
141
|
+
self.model_dump(exclude={"_api_client"}, exclude_unset=True)
|
|
142
|
+
)
|
|
143
|
+
return response
|
|
144
|
+
else:
|
|
145
|
+
raise ValueError("Client not initialized. Use the 'connect' method.")
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
class SuppliersCountBySearchModel(ApiRequestModel):
|
|
149
|
+
company_id: Union[str, int]
|
|
150
|
+
search: Optional[str] = None
|
|
151
|
+
|
|
152
|
+
def request(self) -> ApiResponse:
|
|
153
|
+
"""
|
|
154
|
+
request(self) -> ApiResponse
|
|
155
|
+
|
|
156
|
+
Make an API request using the initialized client.
|
|
157
|
+
|
|
158
|
+
This method checks if the `_api_client` attribute is set (i.e., if the client has been initialized via the `connect` method).
|
|
159
|
+
If the client is initialized, it will make an API request using the provided method name and the model's data,
|
|
160
|
+
excluding the `_api_client` attribute itself from the request payload. If the client is not initialized, it will raise a `ValueError`.
|
|
161
|
+
|
|
162
|
+
Returns:
|
|
163
|
+
The response from the API.
|
|
164
|
+
|
|
165
|
+
Raises:
|
|
166
|
+
ValueError: If the client is not initialized via the `connect` method.
|
|
167
|
+
|
|
168
|
+
Example:
|
|
169
|
+
|
|
170
|
+
# Assuming you have a model instance `request_model` and an API client `api_client`
|
|
171
|
+
|
|
172
|
+
..code-block:: python
|
|
173
|
+
|
|
174
|
+
with request_model.connect(auth_config=auth_config) as api:
|
|
175
|
+
response = api.request()
|
|
176
|
+
|
|
177
|
+
# The above example assumes that the `connect` method has been used to initialize the client.
|
|
178
|
+
# The request method then sends the model's data to the API and returns the API's response.
|
|
179
|
+
|
|
180
|
+
"""
|
|
181
|
+
if hasattr(self, "_api_client"):
|
|
182
|
+
response = self._api_client.count_by_search(
|
|
183
|
+
self.model_dump(exclude={"_api_client"}, exclude_unset=True)
|
|
184
|
+
)
|
|
185
|
+
return response
|
|
186
|
+
else:
|
|
187
|
+
raise ValueError("Client not initialized. Use the 'connect' method.")
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
class SuppliersCountByVatModel(ApiRequestModel):
|
|
191
|
+
company_id: Union[str, int]
|
|
192
|
+
vat: Optional[str] = None
|
|
193
|
+
|
|
194
|
+
def request(self) -> ApiResponse:
|
|
195
|
+
"""
|
|
196
|
+
request(self) -> ApiResponse
|
|
197
|
+
|
|
198
|
+
Make an API request using the initialized client.
|
|
199
|
+
|
|
200
|
+
This method checks if the `_api_client` attribute is set (i.e., if the client has been initialized via the `connect` method).
|
|
201
|
+
If the client is initialized, it will make an API request using the provided method name and the model's data,
|
|
202
|
+
excluding the `_api_client` attribute itself from the request payload. If the client is not initialized, it will raise a `ValueError`.
|
|
203
|
+
|
|
204
|
+
Returns:
|
|
205
|
+
The response from the API.
|
|
206
|
+
|
|
207
|
+
Raises:
|
|
208
|
+
ValueError: If the client is not initialized via the `connect` method.
|
|
209
|
+
|
|
210
|
+
Example:
|
|
211
|
+
|
|
212
|
+
# Assuming you have a model instance `request_model` and an API client `api_client`
|
|
213
|
+
|
|
214
|
+
..code-block:: python
|
|
215
|
+
|
|
216
|
+
with request_model.connect(auth_config=auth_config) as api:
|
|
217
|
+
response = api.request()
|
|
218
|
+
|
|
219
|
+
# The above example assumes that the `connect` method has been used to initialize the client.
|
|
220
|
+
# The request method then sends the model's data to the API and returns the API's response.
|
|
221
|
+
|
|
222
|
+
"""
|
|
223
|
+
if hasattr(self, "_api_client"):
|
|
224
|
+
response = self._api_client.count_by_vat(
|
|
225
|
+
self.model_dump(exclude={"_api_client"}, exclude_unset=True)
|
|
226
|
+
)
|
|
227
|
+
return response
|
|
228
|
+
else:
|
|
229
|
+
raise ValueError("Client not initialized. Use the 'connect' method.")
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
class SuppliersCountModifiedSinceModel(ApiRequestModel):
|
|
233
|
+
company_id: Union[str, int]
|
|
234
|
+
lastmodified: Optional[str] = None
|
|
235
|
+
|
|
236
|
+
def request(self) -> ApiResponse:
|
|
237
|
+
"""
|
|
238
|
+
request(self) -> ApiResponse
|
|
239
|
+
|
|
240
|
+
Make an API request using the initialized client.
|
|
241
|
+
|
|
242
|
+
This method checks if the `_api_client` attribute is set (i.e., if the client has been initialized via the `connect` method).
|
|
243
|
+
If the client is initialized, it will make an API request using the provided method name and the model's data,
|
|
244
|
+
excluding the `_api_client` attribute itself from the request payload. If the client is not initialized, it will raise a `ValueError`.
|
|
245
|
+
|
|
246
|
+
Returns:
|
|
247
|
+
The response from the API.
|
|
248
|
+
|
|
249
|
+
Raises:
|
|
250
|
+
ValueError: If the client is not initialized via the `connect` method.
|
|
251
|
+
|
|
252
|
+
Example:
|
|
253
|
+
|
|
254
|
+
# Assuming you have a model instance `request_model` and an API client `api_client`
|
|
255
|
+
|
|
256
|
+
..code-block:: python
|
|
257
|
+
|
|
258
|
+
with request_model.connect(auth_config=auth_config) as api:
|
|
259
|
+
response = api.request()
|
|
260
|
+
|
|
261
|
+
# The above example assumes that the `connect` method has been used to initialize the client.
|
|
262
|
+
# The request method then sends the model's data to the API and returns the API's response.
|
|
263
|
+
|
|
264
|
+
"""
|
|
265
|
+
if hasattr(self, "_api_client"):
|
|
266
|
+
response = self._api_client.count_modified_since(
|
|
267
|
+
self.model_dump(exclude={"_api_client"}, exclude_unset=True)
|
|
268
|
+
)
|
|
269
|
+
return response
|
|
270
|
+
else:
|
|
271
|
+
raise ValueError("Client not initialized. Use the 'connect' method.")
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
class SuppliersDeleteModel(ApiRequestModel):
|
|
275
|
+
company_id: Union[str, int]
|
|
276
|
+
supplier_id: Optional[Union[str, int]] = None
|
|
277
|
+
|
|
278
|
+
def request(self) -> ApiResponse:
|
|
279
|
+
"""
|
|
280
|
+
request(self) -> ApiResponse
|
|
281
|
+
|
|
282
|
+
Make an API request using the initialized client.
|
|
283
|
+
|
|
284
|
+
This method checks if the `_api_client` attribute is set (i.e., if the client has been initialized via the `connect` method).
|
|
285
|
+
If the client is initialized, it will make an API request using the provided method name and the model's data,
|
|
286
|
+
excluding the `_api_client` attribute itself from the request payload. If the client is not initialized, it will raise a `ValueError`.
|
|
287
|
+
|
|
288
|
+
Returns:
|
|
289
|
+
The response from the API.
|
|
290
|
+
|
|
291
|
+
Raises:
|
|
292
|
+
ValueError: If the client is not initialized via the `connect` method.
|
|
293
|
+
|
|
294
|
+
Example:
|
|
295
|
+
|
|
296
|
+
# Assuming you have a model instance `request_model` and an API client `api_client`
|
|
297
|
+
|
|
298
|
+
..code-block:: python
|
|
299
|
+
|
|
300
|
+
with request_model.connect(auth_config=auth_config) as api:
|
|
301
|
+
response = api.request()
|
|
302
|
+
|
|
303
|
+
# The above example assumes that the `connect` method has been used to initialize the client.
|
|
304
|
+
# The request method then sends the model's data to the API and returns the API's response.
|
|
305
|
+
|
|
306
|
+
"""
|
|
307
|
+
if hasattr(self, "_api_client"):
|
|
308
|
+
response = self._api_client.delete(
|
|
309
|
+
self.model_dump(exclude={"_api_client"}, exclude_unset=True)
|
|
310
|
+
)
|
|
311
|
+
return response
|
|
312
|
+
else:
|
|
313
|
+
raise ValueError("Client not initialized. Use the 'connect' method.")
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
class SuppliersGetAllModel(ApiRequestModel):
|
|
317
|
+
company_id: Union[str, int]
|
|
318
|
+
offset: Optional[Union[str, int]] = 0
|
|
319
|
+
qty: Optional[Union[str, int]] = 25
|
|
320
|
+
|
|
321
|
+
def request(self) -> ApiResponse:
|
|
322
|
+
"""
|
|
323
|
+
request(self) -> ApiResponse
|
|
324
|
+
|
|
325
|
+
Make an API request using the initialized client.
|
|
326
|
+
|
|
327
|
+
This method checks if the `_api_client` attribute is set (i.e., if the client has been initialized via the `connect` method).
|
|
328
|
+
If the client is initialized, it will make an API request using the provided method name and the model's data,
|
|
329
|
+
excluding the `_api_client` attribute itself from the request payload. If the client is not initialized, it will raise a `ValueError`.
|
|
330
|
+
|
|
331
|
+
Returns:
|
|
332
|
+
The response from the API.
|
|
333
|
+
|
|
334
|
+
Raises:
|
|
335
|
+
ValueError: If the client is not initialized via the `connect` method.
|
|
336
|
+
|
|
337
|
+
Example:
|
|
338
|
+
|
|
339
|
+
# Assuming you have a model instance `request_model` and an API client `api_client`
|
|
340
|
+
|
|
341
|
+
..code-block:: python
|
|
342
|
+
|
|
343
|
+
with request_model.connect(auth_config=auth_config) as api:
|
|
344
|
+
response = api.request()
|
|
345
|
+
|
|
346
|
+
# The above example assumes that the `connect` method has been used to initialize the client.
|
|
347
|
+
# The request method then sends the model's data to the API and returns the API's response.
|
|
348
|
+
|
|
349
|
+
"""
|
|
350
|
+
if hasattr(self, "_api_client"):
|
|
351
|
+
response = self._api_client.get_all(
|
|
352
|
+
self.model_dump(exclude={"_api_client"}, exclude_unset=True)
|
|
353
|
+
)
|
|
354
|
+
return response
|
|
355
|
+
else:
|
|
356
|
+
raise ValueError("Client not initialized. Use the 'connect' method.")
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
class SuppliersGetByNameModel(ApiRequestModel):
|
|
360
|
+
company_id: Union[str, int]
|
|
361
|
+
name: Optional[str] = None
|
|
362
|
+
offset: Optional[Union[str, int]] = 0
|
|
363
|
+
qty: Optional[Union[str, int]] = 25
|
|
364
|
+
|
|
365
|
+
def request(self) -> ApiResponse:
|
|
366
|
+
"""
|
|
367
|
+
request(self) -> ApiResponse
|
|
368
|
+
|
|
369
|
+
Make an API request using the initialized client.
|
|
370
|
+
|
|
371
|
+
This method checks if the `_api_client` attribute is set (i.e., if the client has been initialized via the `connect` method).
|
|
372
|
+
If the client is initialized, it will make an API request using the provided method name and the model's data,
|
|
373
|
+
excluding the `_api_client` attribute itself from the request payload. If the client is not initialized, it will raise a `ValueError`.
|
|
374
|
+
|
|
375
|
+
Returns:
|
|
376
|
+
The response from the API.
|
|
377
|
+
|
|
378
|
+
Raises:
|
|
379
|
+
ValueError: If the client is not initialized via the `connect` method.
|
|
380
|
+
|
|
381
|
+
Example:
|
|
382
|
+
|
|
383
|
+
# Assuming you have a model instance `request_model` and an API client `api_client`
|
|
384
|
+
|
|
385
|
+
..code-block:: python
|
|
386
|
+
|
|
387
|
+
with request_model.connect(auth_config=auth_config) as api:
|
|
388
|
+
response = api.request()
|
|
389
|
+
|
|
390
|
+
# The above example assumes that the `connect` method has been used to initialize the client.
|
|
391
|
+
# The request method then sends the model's data to the API and returns the API's response.
|
|
392
|
+
|
|
393
|
+
"""
|
|
394
|
+
if hasattr(self, "_api_client"):
|
|
395
|
+
response = self._api_client.get_by_name(
|
|
396
|
+
self.model_dump(exclude={"_api_client"}, exclude_unset=True)
|
|
397
|
+
)
|
|
398
|
+
return response
|
|
399
|
+
else:
|
|
400
|
+
raise ValueError("Client not initialized. Use the 'connect' method.")
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
class SuppliersGetByNumberModel(ApiRequestModel):
|
|
404
|
+
company_id: Union[str, int]
|
|
405
|
+
number: Optional[str] = None
|
|
406
|
+
offset: Optional[Union[str, int]] = 0
|
|
407
|
+
qty: Optional[Union[str, int]] = 25
|
|
408
|
+
|
|
409
|
+
def request(self) -> ApiResponse:
|
|
410
|
+
"""
|
|
411
|
+
request(self) -> ApiResponse
|
|
412
|
+
|
|
413
|
+
Make an API request using the initialized client.
|
|
414
|
+
|
|
415
|
+
This method checks if the `_api_client` attribute is set (i.e., if the client has been initialized via the `connect` method).
|
|
416
|
+
If the client is initialized, it will make an API request using the provided method name and the model's data,
|
|
417
|
+
excluding the `_api_client` attribute itself from the request payload. If the client is not initialized, it will raise a `ValueError`.
|
|
418
|
+
|
|
419
|
+
Returns:
|
|
420
|
+
The response from the API.
|
|
421
|
+
|
|
422
|
+
Raises:
|
|
423
|
+
ValueError: If the client is not initialized via the `connect` method.
|
|
424
|
+
|
|
425
|
+
Example:
|
|
426
|
+
|
|
427
|
+
# Assuming you have a model instance `request_model` and an API client `api_client`
|
|
428
|
+
|
|
429
|
+
..code-block:: python
|
|
430
|
+
|
|
431
|
+
with request_model.connect(auth_config=auth_config) as api:
|
|
432
|
+
response = api.request()
|
|
433
|
+
|
|
434
|
+
# The above example assumes that the `connect` method has been used to initialize the client.
|
|
435
|
+
# The request method then sends the model's data to the API and returns the API's response.
|
|
436
|
+
|
|
437
|
+
"""
|
|
438
|
+
if hasattr(self, "_api_client"):
|
|
439
|
+
response = self._api_client.get_by_number(
|
|
440
|
+
self.model_dump(exclude={"_api_client"}, exclude_unset=True)
|
|
441
|
+
)
|
|
442
|
+
return response
|
|
443
|
+
else:
|
|
444
|
+
raise ValueError("Client not initialized. Use the 'connect' method.")
|
|
445
|
+
|
|
446
|
+
|
|
447
|
+
class SuppliersGetBySearchModel(ApiRequestModel):
|
|
448
|
+
company_id: Union[str, int]
|
|
449
|
+
offset: Optional[Union[str, int]] = 0
|
|
450
|
+
qty: Optional[Union[str, int]] = 25
|
|
451
|
+
search: Optional[str] = None
|
|
452
|
+
|
|
453
|
+
def request(self) -> ApiResponse:
|
|
454
|
+
"""
|
|
455
|
+
request(self) -> ApiResponse
|
|
456
|
+
|
|
457
|
+
Make an API request using the initialized client.
|
|
458
|
+
|
|
459
|
+
This method checks if the `_api_client` attribute is set (i.e., if the client has been initialized via the `connect` method).
|
|
460
|
+
If the client is initialized, it will make an API request using the provided method name and the model's data,
|
|
461
|
+
excluding the `_api_client` attribute itself from the request payload. If the client is not initialized, it will raise a `ValueError`.
|
|
462
|
+
|
|
463
|
+
Returns:
|
|
464
|
+
The response from the API.
|
|
465
|
+
|
|
466
|
+
Raises:
|
|
467
|
+
ValueError: If the client is not initialized via the `connect` method.
|
|
468
|
+
|
|
469
|
+
Example:
|
|
470
|
+
|
|
471
|
+
# Assuming you have a model instance `request_model` and an API client `api_client`
|
|
472
|
+
|
|
473
|
+
..code-block:: python
|
|
474
|
+
|
|
475
|
+
with request_model.connect(auth_config=auth_config) as api:
|
|
476
|
+
response = api.request()
|
|
477
|
+
|
|
478
|
+
# The above example assumes that the `connect` method has been used to initialize the client.
|
|
479
|
+
# The request method then sends the model's data to the API and returns the API's response.
|
|
480
|
+
|
|
481
|
+
"""
|
|
482
|
+
if hasattr(self, "_api_client"):
|
|
483
|
+
response = self._api_client.get_by_search(
|
|
484
|
+
self.model_dump(exclude={"_api_client"}, exclude_unset=True)
|
|
485
|
+
)
|
|
486
|
+
return response
|
|
487
|
+
else:
|
|
488
|
+
raise ValueError("Client not initialized. Use the 'connect' method.")
|
|
489
|
+
|
|
490
|
+
|
|
491
|
+
class SuppliersGetByVatModel(ApiRequestModel):
|
|
492
|
+
company_id: Union[str, int]
|
|
493
|
+
offset: Optional[Union[str, int]] = 0
|
|
494
|
+
qty: Optional[Union[str, int]] = 25
|
|
495
|
+
vat: Optional[str] = None
|
|
496
|
+
|
|
497
|
+
def request(self) -> ApiResponse:
|
|
498
|
+
"""
|
|
499
|
+
request(self) -> ApiResponse
|
|
500
|
+
|
|
501
|
+
Make an API request using the initialized client.
|
|
502
|
+
|
|
503
|
+
This method checks if the `_api_client` attribute is set (i.e., if the client has been initialized via the `connect` method).
|
|
504
|
+
If the client is initialized, it will make an API request using the provided method name and the model's data,
|
|
505
|
+
excluding the `_api_client` attribute itself from the request payload. If the client is not initialized, it will raise a `ValueError`.
|
|
506
|
+
|
|
507
|
+
Returns:
|
|
508
|
+
The response from the API.
|
|
509
|
+
|
|
510
|
+
Raises:
|
|
511
|
+
ValueError: If the client is not initialized via the `connect` method.
|
|
512
|
+
|
|
513
|
+
Example:
|
|
514
|
+
|
|
515
|
+
# Assuming you have a model instance `request_model` and an API client `api_client`
|
|
516
|
+
|
|
517
|
+
..code-block:: python
|
|
518
|
+
|
|
519
|
+
with request_model.connect(auth_config=auth_config) as api:
|
|
520
|
+
response = api.request()
|
|
521
|
+
|
|
522
|
+
# The above example assumes that the `connect` method has been used to initialize the client.
|
|
523
|
+
# The request method then sends the model's data to the API and returns the API's response.
|
|
524
|
+
|
|
525
|
+
"""
|
|
526
|
+
if hasattr(self, "_api_client"):
|
|
527
|
+
response = self._api_client.get_by_vat(
|
|
528
|
+
self.model_dump(exclude={"_api_client"}, exclude_unset=True)
|
|
529
|
+
)
|
|
530
|
+
return response
|
|
531
|
+
else:
|
|
532
|
+
raise ValueError("Client not initialized. Use the 'connect' method.")
|
|
533
|
+
|
|
534
|
+
|
|
535
|
+
class SuppliersGetModifiedSinceModel(ApiRequestModel):
|
|
536
|
+
company_id: Union[str, int]
|
|
537
|
+
lastmodified: Optional[str] = None
|
|
538
|
+
offset: Optional[Union[str, int]] = 0
|
|
539
|
+
qty: Optional[Union[str, int]] = 25
|
|
540
|
+
|
|
541
|
+
def request(self) -> ApiResponse:
|
|
542
|
+
"""
|
|
543
|
+
request(self) -> ApiResponse
|
|
544
|
+
|
|
545
|
+
Make an API request using the initialized client.
|
|
546
|
+
|
|
547
|
+
This method checks if the `_api_client` attribute is set (i.e., if the client has been initialized via the `connect` method).
|
|
548
|
+
If the client is initialized, it will make an API request using the provided method name and the model's data,
|
|
549
|
+
excluding the `_api_client` attribute itself from the request payload. If the client is not initialized, it will raise a `ValueError`.
|
|
550
|
+
|
|
551
|
+
Returns:
|
|
552
|
+
The response from the API.
|
|
553
|
+
|
|
554
|
+
Raises:
|
|
555
|
+
ValueError: If the client is not initialized via the `connect` method.
|
|
556
|
+
|
|
557
|
+
Example:
|
|
558
|
+
|
|
559
|
+
# Assuming you have a model instance `request_model` and an API client `api_client`
|
|
560
|
+
|
|
561
|
+
..code-block:: python
|
|
562
|
+
|
|
563
|
+
with request_model.connect(auth_config=auth_config) as api:
|
|
564
|
+
response = api.request()
|
|
565
|
+
|
|
566
|
+
# The above example assumes that the `connect` method has been used to initialize the client.
|
|
567
|
+
# The request method then sends the model's data to the API and returns the API's response.
|
|
568
|
+
|
|
569
|
+
"""
|
|
570
|
+
if hasattr(self, "_api_client"):
|
|
571
|
+
response = self._api_client.get_modified_since(
|
|
572
|
+
self.model_dump(exclude={"_api_client"}, exclude_unset=True)
|
|
573
|
+
)
|
|
574
|
+
return response
|
|
575
|
+
else:
|
|
576
|
+
raise ValueError("Client not initialized. Use the 'connect' method.")
|
|
577
|
+
|
|
578
|
+
|
|
579
|
+
class SuppliersGetOneModel(ApiRequestModel):
|
|
580
|
+
company_id: Union[str, int]
|
|
581
|
+
supplier_id: Optional[Union[str, int]] = None
|
|
582
|
+
|
|
583
|
+
def request(self) -> ApiResponse:
|
|
584
|
+
"""
|
|
585
|
+
request(self) -> ApiResponse
|
|
586
|
+
|
|
587
|
+
Make an API request using the initialized client.
|
|
588
|
+
|
|
589
|
+
This method checks if the `_api_client` attribute is set (i.e., if the client has been initialized via the `connect` method).
|
|
590
|
+
If the client is initialized, it will make an API request using the provided method name and the model's data,
|
|
591
|
+
excluding the `_api_client` attribute itself from the request payload. If the client is not initialized, it will raise a `ValueError`.
|
|
592
|
+
|
|
593
|
+
Returns:
|
|
594
|
+
The response from the API.
|
|
595
|
+
|
|
596
|
+
Raises:
|
|
597
|
+
ValueError: If the client is not initialized via the `connect` method.
|
|
598
|
+
|
|
599
|
+
Example:
|
|
600
|
+
|
|
601
|
+
# Assuming you have a model instance `request_model` and an API client `api_client`
|
|
602
|
+
|
|
603
|
+
..code-block:: python
|
|
604
|
+
|
|
605
|
+
with request_model.connect(auth_config=auth_config) as api:
|
|
606
|
+
response = api.request()
|
|
607
|
+
|
|
608
|
+
# The above example assumes that the `connect` method has been used to initialize the client.
|
|
609
|
+
# The request method then sends the model's data to the API and returns the API's response.
|
|
610
|
+
|
|
611
|
+
"""
|
|
612
|
+
if hasattr(self, "_api_client"):
|
|
613
|
+
response = self._api_client.get_one(
|
|
614
|
+
self.model_dump(exclude={"_api_client"}, exclude_unset=True)
|
|
615
|
+
)
|
|
616
|
+
return response
|
|
617
|
+
else:
|
|
618
|
+
raise ValueError("Client not initialized. Use the 'connect' method.")
|
|
619
|
+
|
|
620
|
+
|
|
621
|
+
class SuppliersInsertModel(ApiRequestModel):
|
|
622
|
+
company_id: Union[str, int]
|
|
623
|
+
address: Optional[str] = None
|
|
624
|
+
city: Optional[str] = None
|
|
625
|
+
contact_email: Optional[str] = None
|
|
626
|
+
contact_name: Optional[str] = None
|
|
627
|
+
contact_phone: Optional[str] = None
|
|
628
|
+
country_id: Optional[Union[str, int]] = None
|
|
629
|
+
credit_limit: Optional[str] = None
|
|
630
|
+
delivery_method_id: Optional[Union[str, int]] = None
|
|
631
|
+
discount: Optional[str] = None
|
|
632
|
+
email: Optional[str] = None
|
|
633
|
+
fax: Optional[str] = None
|
|
634
|
+
field_notes: Optional[str] = None
|
|
635
|
+
language_id: Optional[Union[str, int]] = None
|
|
636
|
+
maturity_date_id: Optional[Union[str, int]] = None
|
|
637
|
+
name: Optional[str] = None
|
|
638
|
+
notes: Optional[str] = None
|
|
639
|
+
number: Optional[str] = None
|
|
640
|
+
payment_method_id: Optional[Union[str, int]] = None
|
|
641
|
+
phone: Optional[str] = None
|
|
642
|
+
qty_copies_document: Optional[str] = None
|
|
643
|
+
vat: Optional[str] = None
|
|
644
|
+
website: Optional[str] = None
|
|
645
|
+
zip_code: Optional[str] = None
|
|
646
|
+
|
|
647
|
+
def request(self) -> ApiResponse:
|
|
648
|
+
"""
|
|
649
|
+
request(self) -> ApiResponse
|
|
650
|
+
|
|
651
|
+
Make an API request using the initialized client.
|
|
652
|
+
|
|
653
|
+
This method checks if the `_api_client` attribute is set (i.e., if the client has been initialized via the `connect` method).
|
|
654
|
+
If the client is initialized, it will make an API request using the provided method name and the model's data,
|
|
655
|
+
excluding the `_api_client` attribute itself from the request payload. If the client is not initialized, it will raise a `ValueError`.
|
|
656
|
+
|
|
657
|
+
Returns:
|
|
658
|
+
The response from the API.
|
|
659
|
+
|
|
660
|
+
Raises:
|
|
661
|
+
ValueError: If the client is not initialized via the `connect` method.
|
|
662
|
+
|
|
663
|
+
Example:
|
|
664
|
+
|
|
665
|
+
# Assuming you have a model instance `request_model` and an API client `api_client`
|
|
666
|
+
|
|
667
|
+
..code-block:: python
|
|
668
|
+
|
|
669
|
+
with request_model.connect(auth_config=auth_config) as api:
|
|
670
|
+
response = api.request()
|
|
671
|
+
|
|
672
|
+
# The above example assumes that the `connect` method has been used to initialize the client.
|
|
673
|
+
# The request method then sends the model's data to the API and returns the API's response.
|
|
674
|
+
|
|
675
|
+
"""
|
|
676
|
+
if hasattr(self, "_api_client"):
|
|
677
|
+
response = self._api_client.insert(
|
|
678
|
+
self.model_dump(exclude={"_api_client"}, exclude_unset=True)
|
|
679
|
+
)
|
|
680
|
+
return response
|
|
681
|
+
else:
|
|
682
|
+
raise ValueError("Client not initialized. Use the 'connect' method.")
|
|
683
|
+
|
|
684
|
+
|
|
685
|
+
class SuppliersUpdateModel(ApiRequestModel):
|
|
686
|
+
company_id: Union[str, int]
|
|
687
|
+
address: Optional[str] = None
|
|
688
|
+
city: Optional[str] = None
|
|
689
|
+
contact_email: Optional[str] = None
|
|
690
|
+
contact_name: Optional[str] = None
|
|
691
|
+
contact_phone: Optional[str] = None
|
|
692
|
+
country_id: Optional[Union[str, int]] = None
|
|
693
|
+
credit_limit: Optional[str] = None
|
|
694
|
+
delivery_method_id: Optional[Union[str, int]] = None
|
|
695
|
+
discount: Optional[str] = None
|
|
696
|
+
email: Optional[str] = None
|
|
697
|
+
fax: Optional[str] = None
|
|
698
|
+
field_notes: Optional[str] = None
|
|
699
|
+
language_id: Optional[Union[str, int]] = None
|
|
700
|
+
maturity_date_id: Optional[Union[str, int]] = None
|
|
701
|
+
name: Optional[str] = None
|
|
702
|
+
notes: Optional[str] = None
|
|
703
|
+
number: Optional[str] = None
|
|
704
|
+
payment_method_id: Optional[Union[str, int]] = None
|
|
705
|
+
phone: Optional[str] = None
|
|
706
|
+
qty_copies_document: Optional[str] = None
|
|
707
|
+
supplier_id: Optional[Union[str, int]] = None
|
|
708
|
+
vat: Optional[str] = None
|
|
709
|
+
website: Optional[str] = None
|
|
710
|
+
zip_code: Optional[str] = None
|
|
711
|
+
|
|
712
|
+
def request(self) -> ApiResponse:
|
|
713
|
+
"""
|
|
714
|
+
request(self) -> ApiResponse
|
|
715
|
+
|
|
716
|
+
Make an API request using the initialized client.
|
|
717
|
+
|
|
718
|
+
This method checks if the `_api_client` attribute is set (i.e., if the client has been initialized via the `connect` method).
|
|
719
|
+
If the client is initialized, it will make an API request using the provided method name and the model's data,
|
|
720
|
+
excluding the `_api_client` attribute itself from the request payload. If the client is not initialized, it will raise a `ValueError`.
|
|
721
|
+
|
|
722
|
+
Returns:
|
|
723
|
+
The response from the API.
|
|
724
|
+
|
|
725
|
+
Raises:
|
|
726
|
+
ValueError: If the client is not initialized via the `connect` method.
|
|
727
|
+
|
|
728
|
+
Example:
|
|
729
|
+
|
|
730
|
+
# Assuming you have a model instance `request_model` and an API client `api_client`
|
|
731
|
+
|
|
732
|
+
..code-block:: python
|
|
733
|
+
|
|
734
|
+
with request_model.connect(auth_config=auth_config) as api:
|
|
735
|
+
response = api.request()
|
|
736
|
+
|
|
737
|
+
# The above example assumes that the `connect` method has been used to initialize the client.
|
|
738
|
+
# The request method then sends the model's data to the API and returns the API's response.
|
|
739
|
+
|
|
740
|
+
"""
|
|
741
|
+
if hasattr(self, "_api_client"):
|
|
742
|
+
response = self._api_client.update(
|
|
743
|
+
self.model_dump(exclude={"_api_client"}, exclude_unset=True)
|
|
744
|
+
)
|
|
745
|
+
return response
|
|
746
|
+
else:
|
|
747
|
+
raise ValueError("Client not initialized. Use the 'connect' method.")
|
|
748
|
+
|
|
749
|
+
|
|
750
|
+
class SuppliersClient(MoloniBaseClient):
|
|
751
|
+
|
|
752
|
+
@endpoint("/<version>/suppliers/count/", method="post")
|
|
753
|
+
def count(self, data: Union[SuppliersCountModel, dict], **kwargs):
|
|
754
|
+
"""
|
|
755
|
+
count(self, data: Union[SuppliersCountModel, dict], **kwargs)
|
|
756
|
+
|
|
757
|
+
Args:
|
|
758
|
+
|
|
759
|
+
data (Union[SuppliersCountModel, dict]): A model instance or dictionary containing the following fields:
|
|
760
|
+
|
|
761
|
+
- company_id (Union[str, int]): company_id of the SuppliersCountModel.
|
|
762
|
+
|
|
763
|
+
|
|
764
|
+
|
|
765
|
+
Returns:
|
|
766
|
+
ApiResponse: The response from the API.
|
|
767
|
+
"""
|
|
768
|
+
|
|
769
|
+
data = validate_data(data, self.validate, SuppliersCountModel)
|
|
770
|
+
|
|
771
|
+
return self._request(
|
|
772
|
+
fill_query_params(kwargs.pop("path"), self.version), data={**data, **kwargs}
|
|
773
|
+
)
|
|
774
|
+
|
|
775
|
+
@endpoint("/<version>/suppliers/countByName/", method="post")
|
|
776
|
+
def count_by_name(self, data: Union[SuppliersCountByNameModel, dict], **kwargs):
|
|
777
|
+
"""
|
|
778
|
+
count_by_name(self, data: Union[SuppliersCountByNameModel, dict], **kwargs)
|
|
779
|
+
|
|
780
|
+
Args:
|
|
781
|
+
|
|
782
|
+
data (Union[SuppliersCountByNameModel, dict]): A model instance or dictionary containing the following fields:
|
|
783
|
+
|
|
784
|
+
- company_id (Union[str, int]): company_id of the SuppliersCountByNameModel.
|
|
785
|
+
|
|
786
|
+
- name (str): name of the SuppliersCountByNameModel.
|
|
787
|
+
|
|
788
|
+
|
|
789
|
+
|
|
790
|
+
Returns:
|
|
791
|
+
ApiResponse: The response from the API.
|
|
792
|
+
"""
|
|
793
|
+
|
|
794
|
+
data = validate_data(data, self.validate, SuppliersCountByNameModel)
|
|
795
|
+
|
|
796
|
+
return self._request(
|
|
797
|
+
fill_query_params(kwargs.pop("path"), self.version), data={**data, **kwargs}
|
|
798
|
+
)
|
|
799
|
+
|
|
800
|
+
@endpoint("/<version>/suppliers/countByNumber/", method="post")
|
|
801
|
+
def count_by_number(self, data: Union[SuppliersCountByNumberModel, dict], **kwargs):
|
|
802
|
+
"""
|
|
803
|
+
count_by_number(self, data: Union[SuppliersCountByNumberModel, dict], **kwargs)
|
|
804
|
+
|
|
805
|
+
Args:
|
|
806
|
+
|
|
807
|
+
data (Union[SuppliersCountByNumberModel, dict]): A model instance or dictionary containing the following fields:
|
|
808
|
+
|
|
809
|
+
- company_id (Union[str, int]): company_id of the SuppliersCountByNumberModel.
|
|
810
|
+
|
|
811
|
+
- number (str): number of the SuppliersCountByNumberModel.
|
|
812
|
+
|
|
813
|
+
|
|
814
|
+
|
|
815
|
+
Returns:
|
|
816
|
+
ApiResponse: The response from the API.
|
|
817
|
+
"""
|
|
818
|
+
|
|
819
|
+
data = validate_data(data, self.validate, SuppliersCountByNumberModel)
|
|
820
|
+
|
|
821
|
+
return self._request(
|
|
822
|
+
fill_query_params(kwargs.pop("path"), self.version), data={**data, **kwargs}
|
|
823
|
+
)
|
|
824
|
+
|
|
825
|
+
@endpoint("/<version>/suppliers/countBySearch/", method="post")
|
|
826
|
+
def count_by_search(self, data: Union[SuppliersCountBySearchModel, dict], **kwargs):
|
|
827
|
+
"""
|
|
828
|
+
count_by_search(self, data: Union[SuppliersCountBySearchModel, dict], **kwargs)
|
|
829
|
+
|
|
830
|
+
Args:
|
|
831
|
+
|
|
832
|
+
data (Union[SuppliersCountBySearchModel, dict]): A model instance or dictionary containing the following fields:
|
|
833
|
+
|
|
834
|
+
- company_id (Union[str, int]): company_id of the SuppliersCountBySearchModel.
|
|
835
|
+
|
|
836
|
+
- search (str): search of the SuppliersCountBySearchModel.
|
|
837
|
+
|
|
838
|
+
|
|
839
|
+
|
|
840
|
+
Returns:
|
|
841
|
+
ApiResponse: The response from the API.
|
|
842
|
+
"""
|
|
843
|
+
|
|
844
|
+
data = validate_data(data, self.validate, SuppliersCountBySearchModel)
|
|
845
|
+
|
|
846
|
+
return self._request(
|
|
847
|
+
fill_query_params(kwargs.pop("path"), self.version), data={**data, **kwargs}
|
|
848
|
+
)
|
|
849
|
+
|
|
850
|
+
@endpoint("/<version>/suppliers/countByVat/", method="post")
|
|
851
|
+
def count_by_vat(self, data: Union[SuppliersCountByVatModel, dict], **kwargs):
|
|
852
|
+
"""
|
|
853
|
+
count_by_vat(self, data: Union[SuppliersCountByVatModel, dict], **kwargs)
|
|
854
|
+
|
|
855
|
+
Args:
|
|
856
|
+
|
|
857
|
+
data (Union[SuppliersCountByVatModel, dict]): A model instance or dictionary containing the following fields:
|
|
858
|
+
|
|
859
|
+
- company_id (Union[str, int]): company_id of the SuppliersCountByVatModel.
|
|
860
|
+
|
|
861
|
+
- vat (str): vat of the SuppliersCountByVatModel.
|
|
862
|
+
|
|
863
|
+
|
|
864
|
+
|
|
865
|
+
Returns:
|
|
866
|
+
ApiResponse: The response from the API.
|
|
867
|
+
"""
|
|
868
|
+
|
|
869
|
+
data = validate_data(data, self.validate, SuppliersCountByVatModel)
|
|
870
|
+
|
|
871
|
+
return self._request(
|
|
872
|
+
fill_query_params(kwargs.pop("path"), self.version), data={**data, **kwargs}
|
|
873
|
+
)
|
|
874
|
+
|
|
875
|
+
@endpoint("/<version>/suppliers/countModifiedSince/", method="post")
|
|
876
|
+
def count_modified_since(
|
|
877
|
+
self, data: Union[SuppliersCountModifiedSinceModel, dict], **kwargs
|
|
878
|
+
):
|
|
879
|
+
"""
|
|
880
|
+
count_modified_since(self, data: Union[SuppliersCountModifiedSinceModel, dict], **kwargs)
|
|
881
|
+
|
|
882
|
+
Args:
|
|
883
|
+
|
|
884
|
+
data (Union[SuppliersCountModifiedSinceModel, dict]): A model instance or dictionary containing the following fields:
|
|
885
|
+
|
|
886
|
+
- company_id (Union[str, int]): company_id of the SuppliersCountModifiedSinceModel.
|
|
887
|
+
|
|
888
|
+
- lastmodified (str): lastmodified of the SuppliersCountModifiedSinceModel.
|
|
889
|
+
|
|
890
|
+
|
|
891
|
+
|
|
892
|
+
Returns:
|
|
893
|
+
ApiResponse: The response from the API.
|
|
894
|
+
"""
|
|
895
|
+
|
|
896
|
+
data = validate_data(data, self.validate, SuppliersCountModifiedSinceModel)
|
|
897
|
+
|
|
898
|
+
return self._request(
|
|
899
|
+
fill_query_params(kwargs.pop("path"), self.version), data={**data, **kwargs}
|
|
900
|
+
)
|
|
901
|
+
|
|
902
|
+
@endpoint("/<version>/suppliers/delete/", method="post")
|
|
903
|
+
def delete(self, data: Union[SuppliersDeleteModel, dict], **kwargs):
|
|
904
|
+
"""
|
|
905
|
+
delete(self, data: Union[SuppliersDeleteModel, dict], **kwargs)
|
|
906
|
+
|
|
907
|
+
Args:
|
|
908
|
+
|
|
909
|
+
data (Union[SuppliersDeleteModel, dict]): A model instance or dictionary containing the following fields:
|
|
910
|
+
|
|
911
|
+
- company_id (Union[str, int]): company_id of the SuppliersDeleteModel.
|
|
912
|
+
|
|
913
|
+
- supplier_id (Union[str, int]): supplier_id of the SuppliersDeleteModel.
|
|
914
|
+
|
|
915
|
+
|
|
916
|
+
|
|
917
|
+
Returns:
|
|
918
|
+
ApiResponse: The response from the API.
|
|
919
|
+
"""
|
|
920
|
+
|
|
921
|
+
data = validate_data(data, self.validate, SuppliersDeleteModel)
|
|
922
|
+
|
|
923
|
+
return self._request(
|
|
924
|
+
fill_query_params(kwargs.pop("path"), self.version), data={**data, **kwargs}
|
|
925
|
+
)
|
|
926
|
+
|
|
927
|
+
@endpoint("/<version>/suppliers/getAll/", method="post")
|
|
928
|
+
def get_all(self, data: Union[SuppliersGetAllModel, dict], **kwargs):
|
|
929
|
+
"""
|
|
930
|
+
get_all(self, data: Union[SuppliersGetAllModel, dict], **kwargs)
|
|
931
|
+
|
|
932
|
+
Args:
|
|
933
|
+
|
|
934
|
+
data (Union[SuppliersGetAllModel, dict]): A model instance or dictionary containing the following fields:
|
|
935
|
+
|
|
936
|
+
- company_id (Union[str, int]): company_id of the SuppliersGetAllModel.
|
|
937
|
+
|
|
938
|
+
- offset (str): offset of the SuppliersGetAllModel.
|
|
939
|
+
|
|
940
|
+
- qty (str): qty of the SuppliersGetAllModel.
|
|
941
|
+
|
|
942
|
+
|
|
943
|
+
|
|
944
|
+
Returns:
|
|
945
|
+
ApiResponse: The response from the API.
|
|
946
|
+
"""
|
|
947
|
+
|
|
948
|
+
data = validate_data(data, self.validate, SuppliersGetAllModel)
|
|
949
|
+
|
|
950
|
+
return self._request(
|
|
951
|
+
fill_query_params(kwargs.pop("path"), self.version), data={**data, **kwargs}
|
|
952
|
+
)
|
|
953
|
+
|
|
954
|
+
@endpoint("/<version>/suppliers/getByName/", method="post")
|
|
955
|
+
def get_by_name(self, data: Union[SuppliersGetByNameModel, dict], **kwargs):
|
|
956
|
+
"""
|
|
957
|
+
get_by_name(self, data: Union[SuppliersGetByNameModel, dict], **kwargs)
|
|
958
|
+
|
|
959
|
+
Args:
|
|
960
|
+
|
|
961
|
+
data (Union[SuppliersGetByNameModel, dict]): A model instance or dictionary containing the following fields:
|
|
962
|
+
|
|
963
|
+
- company_id (Union[str, int]): company_id of the SuppliersGetByNameModel.
|
|
964
|
+
|
|
965
|
+
- name (str): name of the SuppliersGetByNameModel.
|
|
966
|
+
|
|
967
|
+
- offset (str): offset of the SuppliersGetByNameModel.
|
|
968
|
+
|
|
969
|
+
- qty (str): qty of the SuppliersGetByNameModel.
|
|
970
|
+
|
|
971
|
+
|
|
972
|
+
|
|
973
|
+
Returns:
|
|
974
|
+
ApiResponse: The response from the API.
|
|
975
|
+
"""
|
|
976
|
+
|
|
977
|
+
data = validate_data(data, self.validate, SuppliersGetByNameModel)
|
|
978
|
+
|
|
979
|
+
return self._request(
|
|
980
|
+
fill_query_params(kwargs.pop("path"), self.version), data={**data, **kwargs}
|
|
981
|
+
)
|
|
982
|
+
|
|
983
|
+
@endpoint("/<version>/suppliers/getByNumber/", method="post")
|
|
984
|
+
def get_by_number(self, data: Union[SuppliersGetByNumberModel, dict], **kwargs):
|
|
985
|
+
"""
|
|
986
|
+
get_by_number(self, data: Union[SuppliersGetByNumberModel, dict], **kwargs)
|
|
987
|
+
|
|
988
|
+
Args:
|
|
989
|
+
|
|
990
|
+
data (Union[SuppliersGetByNumberModel, dict]): A model instance or dictionary containing the following fields:
|
|
991
|
+
|
|
992
|
+
- company_id (Union[str, int]): company_id of the SuppliersGetByNumberModel.
|
|
993
|
+
|
|
994
|
+
- number (str): number of the SuppliersGetByNumberModel.
|
|
995
|
+
|
|
996
|
+
- offset (str): offset of the SuppliersGetByNumberModel.
|
|
997
|
+
|
|
998
|
+
- qty (str): qty of the SuppliersGetByNumberModel.
|
|
999
|
+
|
|
1000
|
+
|
|
1001
|
+
|
|
1002
|
+
Returns:
|
|
1003
|
+
ApiResponse: The response from the API.
|
|
1004
|
+
"""
|
|
1005
|
+
|
|
1006
|
+
data = validate_data(data, self.validate, SuppliersGetByNumberModel)
|
|
1007
|
+
|
|
1008
|
+
return self._request(
|
|
1009
|
+
fill_query_params(kwargs.pop("path"), self.version), data={**data, **kwargs}
|
|
1010
|
+
)
|
|
1011
|
+
|
|
1012
|
+
@endpoint("/<version>/suppliers/getBySearch/", method="post")
|
|
1013
|
+
def get_by_search(self, data: Union[SuppliersGetBySearchModel, dict], **kwargs):
|
|
1014
|
+
"""
|
|
1015
|
+
get_by_search(self, data: Union[SuppliersGetBySearchModel, dict], **kwargs)
|
|
1016
|
+
|
|
1017
|
+
Args:
|
|
1018
|
+
|
|
1019
|
+
data (Union[SuppliersGetBySearchModel, dict]): A model instance or dictionary containing the following fields:
|
|
1020
|
+
|
|
1021
|
+
- company_id (Union[str, int]): company_id of the SuppliersGetBySearchModel.
|
|
1022
|
+
|
|
1023
|
+
- offset (str): offset of the SuppliersGetBySearchModel.
|
|
1024
|
+
|
|
1025
|
+
- qty (str): qty of the SuppliersGetBySearchModel.
|
|
1026
|
+
|
|
1027
|
+
- search (str): search of the SuppliersGetBySearchModel.
|
|
1028
|
+
|
|
1029
|
+
|
|
1030
|
+
|
|
1031
|
+
Returns:
|
|
1032
|
+
ApiResponse: The response from the API.
|
|
1033
|
+
"""
|
|
1034
|
+
|
|
1035
|
+
data = validate_data(data, self.validate, SuppliersGetBySearchModel)
|
|
1036
|
+
|
|
1037
|
+
return self._request(
|
|
1038
|
+
fill_query_params(kwargs.pop("path"), self.version), data={**data, **kwargs}
|
|
1039
|
+
)
|
|
1040
|
+
|
|
1041
|
+
@endpoint("/<version>/suppliers/getByVat/", method="post")
|
|
1042
|
+
def get_by_vat(self, data: Union[SuppliersGetByVatModel, dict], **kwargs):
|
|
1043
|
+
"""
|
|
1044
|
+
get_by_vat(self, data: Union[SuppliersGetByVatModel, dict], **kwargs)
|
|
1045
|
+
|
|
1046
|
+
Args:
|
|
1047
|
+
|
|
1048
|
+
data (Union[SuppliersGetByVatModel, dict]): A model instance or dictionary containing the following fields:
|
|
1049
|
+
|
|
1050
|
+
- company_id (Union[str, int]): company_id of the SuppliersGetByVatModel.
|
|
1051
|
+
|
|
1052
|
+
- offset (str): offset of the SuppliersGetByVatModel.
|
|
1053
|
+
|
|
1054
|
+
- qty (str): qty of the SuppliersGetByVatModel.
|
|
1055
|
+
|
|
1056
|
+
- vat (str): vat of the SuppliersGetByVatModel.
|
|
1057
|
+
|
|
1058
|
+
|
|
1059
|
+
|
|
1060
|
+
Returns:
|
|
1061
|
+
ApiResponse: The response from the API.
|
|
1062
|
+
"""
|
|
1063
|
+
|
|
1064
|
+
data = validate_data(data, self.validate, SuppliersGetByVatModel)
|
|
1065
|
+
|
|
1066
|
+
return self._request(
|
|
1067
|
+
fill_query_params(kwargs.pop("path"), self.version), data={**data, **kwargs}
|
|
1068
|
+
)
|
|
1069
|
+
|
|
1070
|
+
@endpoint("/<version>/suppliers/getModifiedSince/", method="post")
|
|
1071
|
+
def get_modified_since(
|
|
1072
|
+
self, data: Union[SuppliersGetModifiedSinceModel, dict], **kwargs
|
|
1073
|
+
):
|
|
1074
|
+
"""
|
|
1075
|
+
get_modified_since(self, data: Union[SuppliersGetModifiedSinceModel, dict], **kwargs)
|
|
1076
|
+
|
|
1077
|
+
Args:
|
|
1078
|
+
|
|
1079
|
+
data (Union[SuppliersGetModifiedSinceModel, dict]): A model instance or dictionary containing the following fields:
|
|
1080
|
+
|
|
1081
|
+
- company_id (Union[str, int]): company_id of the SuppliersGetModifiedSinceModel.
|
|
1082
|
+
|
|
1083
|
+
- lastmodified (str): lastmodified of the SuppliersGetModifiedSinceModel.
|
|
1084
|
+
|
|
1085
|
+
- offset (str): offset of the SuppliersGetModifiedSinceModel.
|
|
1086
|
+
|
|
1087
|
+
- qty (str): qty of the SuppliersGetModifiedSinceModel.
|
|
1088
|
+
|
|
1089
|
+
|
|
1090
|
+
|
|
1091
|
+
Returns:
|
|
1092
|
+
ApiResponse: The response from the API.
|
|
1093
|
+
"""
|
|
1094
|
+
|
|
1095
|
+
data = validate_data(data, self.validate, SuppliersGetModifiedSinceModel)
|
|
1096
|
+
|
|
1097
|
+
return self._request(
|
|
1098
|
+
fill_query_params(kwargs.pop("path"), self.version), data={**data, **kwargs}
|
|
1099
|
+
)
|
|
1100
|
+
|
|
1101
|
+
@endpoint("/<version>/suppliers/getOne/", method="post")
|
|
1102
|
+
def get_one(self, data: Union[SuppliersGetOneModel, dict], **kwargs):
|
|
1103
|
+
"""
|
|
1104
|
+
get_one(self, data: Union[SuppliersGetOneModel, dict], **kwargs)
|
|
1105
|
+
|
|
1106
|
+
Args:
|
|
1107
|
+
|
|
1108
|
+
data (Union[SuppliersGetOneModel, dict]): A model instance or dictionary containing the following fields:
|
|
1109
|
+
|
|
1110
|
+
- company_id (Union[str, int]): company_id of the SuppliersGetOneModel.
|
|
1111
|
+
|
|
1112
|
+
- supplier_id (Union[str, int]): supplier_id of the SuppliersGetOneModel.
|
|
1113
|
+
|
|
1114
|
+
|
|
1115
|
+
|
|
1116
|
+
Returns:
|
|
1117
|
+
ApiResponse: The response from the API.
|
|
1118
|
+
"""
|
|
1119
|
+
|
|
1120
|
+
data = validate_data(data, self.validate, SuppliersGetOneModel)
|
|
1121
|
+
|
|
1122
|
+
return self._request(
|
|
1123
|
+
fill_query_params(kwargs.pop("path"), self.version), data={**data, **kwargs}
|
|
1124
|
+
)
|
|
1125
|
+
|
|
1126
|
+
@endpoint("/<version>/suppliers/insert/", method="post")
|
|
1127
|
+
def insert(self, data: Union[SuppliersInsertModel, dict], **kwargs):
|
|
1128
|
+
"""
|
|
1129
|
+
insert(self, data: Union[SuppliersInsertModel, dict], **kwargs)
|
|
1130
|
+
|
|
1131
|
+
Args:
|
|
1132
|
+
|
|
1133
|
+
data (Union[SuppliersInsertModel, dict]): A model instance or dictionary containing the following fields:
|
|
1134
|
+
|
|
1135
|
+
- address (str): address of the SuppliersInsertModel.
|
|
1136
|
+
|
|
1137
|
+
- city (str): city of the SuppliersInsertModel.
|
|
1138
|
+
|
|
1139
|
+
- company_id (Union[str, int]): company_id of the SuppliersInsertModel.
|
|
1140
|
+
|
|
1141
|
+
- contact_email (str): contact_email of the SuppliersInsertModel.
|
|
1142
|
+
|
|
1143
|
+
- contact_name (str): contact_name of the SuppliersInsertModel.
|
|
1144
|
+
|
|
1145
|
+
- contact_phone (str): contact_phone of the SuppliersInsertModel.
|
|
1146
|
+
|
|
1147
|
+
- country_id (Union[str, int]): country_id of the SuppliersInsertModel.
|
|
1148
|
+
|
|
1149
|
+
- credit_limit (str): credit_limit of the SuppliersInsertModel.
|
|
1150
|
+
|
|
1151
|
+
- delivery_method_id (Union[str, int]): delivery_method_id of the SuppliersInsertModel.
|
|
1152
|
+
|
|
1153
|
+
- discount (str): discount of the SuppliersInsertModel.
|
|
1154
|
+
|
|
1155
|
+
- email (str): email of the SuppliersInsertModel.
|
|
1156
|
+
|
|
1157
|
+
- fax (str): fax of the SuppliersInsertModel.
|
|
1158
|
+
|
|
1159
|
+
- field_notes (str): field_notes of the SuppliersInsertModel.
|
|
1160
|
+
|
|
1161
|
+
- language_id (Union[str, int]): language_id of the SuppliersInsertModel.
|
|
1162
|
+
|
|
1163
|
+
- maturity_date_id (Union[str, int]): maturity_date_id of the SuppliersInsertModel.
|
|
1164
|
+
|
|
1165
|
+
- name (str): name of the SuppliersInsertModel.
|
|
1166
|
+
|
|
1167
|
+
- notes (str): notes of the SuppliersInsertModel.
|
|
1168
|
+
|
|
1169
|
+
- number (str): number of the SuppliersInsertModel.
|
|
1170
|
+
|
|
1171
|
+
- payment_method_id (Union[str, int]): payment_method_id of the SuppliersInsertModel.
|
|
1172
|
+
|
|
1173
|
+
- phone (str): phone of the SuppliersInsertModel.
|
|
1174
|
+
|
|
1175
|
+
- qty_copies_document (str): qty_copies_document of the SuppliersInsertModel.
|
|
1176
|
+
|
|
1177
|
+
- vat (str): vat of the SuppliersInsertModel.
|
|
1178
|
+
|
|
1179
|
+
- website (str): website of the SuppliersInsertModel.
|
|
1180
|
+
|
|
1181
|
+
- zip_code (str): zip_code of the SuppliersInsertModel.
|
|
1182
|
+
|
|
1183
|
+
|
|
1184
|
+
|
|
1185
|
+
Returns:
|
|
1186
|
+
ApiResponse: The response from the API.
|
|
1187
|
+
"""
|
|
1188
|
+
|
|
1189
|
+
data = validate_data(data, self.validate, SuppliersInsertModel)
|
|
1190
|
+
|
|
1191
|
+
return self._request(
|
|
1192
|
+
fill_query_params(kwargs.pop("path"), self.version), data={**data, **kwargs}
|
|
1193
|
+
)
|
|
1194
|
+
|
|
1195
|
+
@endpoint("/<version>/suppliers/update/", method="post")
|
|
1196
|
+
def update(self, data: Union[SuppliersUpdateModel, dict], **kwargs):
|
|
1197
|
+
"""
|
|
1198
|
+
update(self, data: Union[SuppliersUpdateModel, dict], **kwargs)
|
|
1199
|
+
|
|
1200
|
+
Args:
|
|
1201
|
+
|
|
1202
|
+
data (Union[SuppliersUpdateModel, dict]): A model instance or dictionary containing the following fields:
|
|
1203
|
+
|
|
1204
|
+
- address (str): address of the SuppliersUpdateModel.
|
|
1205
|
+
|
|
1206
|
+
- city (str): city of the SuppliersUpdateModel.
|
|
1207
|
+
|
|
1208
|
+
- company_id (Union[str, int]): company_id of the SuppliersUpdateModel.
|
|
1209
|
+
|
|
1210
|
+
- contact_email (str): contact_email of the SuppliersUpdateModel.
|
|
1211
|
+
|
|
1212
|
+
- contact_name (str): contact_name of the SuppliersUpdateModel.
|
|
1213
|
+
|
|
1214
|
+
- contact_phone (str): contact_phone of the SuppliersUpdateModel.
|
|
1215
|
+
|
|
1216
|
+
- country_id (Union[str, int]): country_id of the SuppliersUpdateModel.
|
|
1217
|
+
|
|
1218
|
+
- credit_limit (str): credit_limit of the SuppliersUpdateModel.
|
|
1219
|
+
|
|
1220
|
+
- delivery_method_id (Union[str, int]): delivery_method_id of the SuppliersUpdateModel.
|
|
1221
|
+
|
|
1222
|
+
- discount (str): discount of the SuppliersUpdateModel.
|
|
1223
|
+
|
|
1224
|
+
- email (str): email of the SuppliersUpdateModel.
|
|
1225
|
+
|
|
1226
|
+
- fax (str): fax of the SuppliersUpdateModel.
|
|
1227
|
+
|
|
1228
|
+
- field_notes (str): field_notes of the SuppliersUpdateModel.
|
|
1229
|
+
|
|
1230
|
+
- language_id (Union[str, int]): language_id of the SuppliersUpdateModel.
|
|
1231
|
+
|
|
1232
|
+
- maturity_date_id (Union[str, int]): maturity_date_id of the SuppliersUpdateModel.
|
|
1233
|
+
|
|
1234
|
+
- name (str): name of the SuppliersUpdateModel.
|
|
1235
|
+
|
|
1236
|
+
- notes (str): notes of the SuppliersUpdateModel.
|
|
1237
|
+
|
|
1238
|
+
- number (str): number of the SuppliersUpdateModel.
|
|
1239
|
+
|
|
1240
|
+
- payment_method_id (Union[str, int]): payment_method_id of the SuppliersUpdateModel.
|
|
1241
|
+
|
|
1242
|
+
- phone (str): phone of the SuppliersUpdateModel.
|
|
1243
|
+
|
|
1244
|
+
- qty_copies_document (str): qty_copies_document of the SuppliersUpdateModel.
|
|
1245
|
+
|
|
1246
|
+
- supplier_id (Union[str, int]): supplier_id of the SuppliersUpdateModel.
|
|
1247
|
+
|
|
1248
|
+
- vat (str): vat of the SuppliersUpdateModel.
|
|
1249
|
+
|
|
1250
|
+
- website (str): website of the SuppliersUpdateModel.
|
|
1251
|
+
|
|
1252
|
+
- zip_code (str): zip_code of the SuppliersUpdateModel.
|
|
1253
|
+
|
|
1254
|
+
|
|
1255
|
+
|
|
1256
|
+
Returns:
|
|
1257
|
+
ApiResponse: The response from the API.
|
|
1258
|
+
"""
|
|
1259
|
+
|
|
1260
|
+
data = validate_data(data, self.validate, SuppliersUpdateModel)
|
|
1261
|
+
|
|
1262
|
+
return self._request(
|
|
1263
|
+
fill_query_params(kwargs.pop("path"), self.version), data={**data, **kwargs}
|
|
1264
|
+
)
|