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