cloudbeds-fiscal-document 1.9.1__py3-none-any.whl → 1.10.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cloudbeds_fiscal_document/__init__.py +7 -1
- cloudbeds_fiscal_document/api/configs_api.py +941 -92
- cloudbeds_fiscal_document/api/fiscal_documents_api.py +1160 -160
- cloudbeds_fiscal_document/api_client.py +1 -1
- cloudbeds_fiscal_document/configuration.py +1 -1
- cloudbeds_fiscal_document/models/__init__.py +6 -0
- cloudbeds_fiscal_document/models/allocations_data.py +104 -0
- cloudbeds_fiscal_document/models/configs_response.py +13 -2
- cloudbeds_fiscal_document/models/configs_update_request.py +3 -1
- cloudbeds_fiscal_document/models/create_invoice_request.py +5 -3
- cloudbeds_fiscal_document/models/document_action.py +2 -0
- cloudbeds_fiscal_document/models/fiscal_document_detailed_response.py +5 -3
- cloudbeds_fiscal_document/models/fiscal_document_kind.py +1 -0
- cloudbeds_fiscal_document/models/fiscal_document_transaction_allocation.py +87 -0
- cloudbeds_fiscal_document/models/fiscal_document_transaction_response.py +13 -12
- cloudbeds_fiscal_document/models/get_invoice_preview_request.py +5 -3
- cloudbeds_fiscal_document/models/get_logo_response.py +87 -0
- cloudbeds_fiscal_document/models/preview_request.py +102 -0
- cloudbeds_fiscal_document/models/property_configs_response.py +100 -0
- cloudbeds_fiscal_document/models/single_allocation.py +89 -0
- cloudbeds_fiscal_document/test/test_allocations_data.py +59 -0
- cloudbeds_fiscal_document/test/test_fiscal_document_transaction_allocation.py +51 -0
- cloudbeds_fiscal_document/test/test_get_logo_response.py +51 -0
- cloudbeds_fiscal_document/test/test_preview_request.py +57 -0
- cloudbeds_fiscal_document/test/test_property_configs_response.py +84 -0
- cloudbeds_fiscal_document/test/test_single_allocation.py +52 -0
- {cloudbeds_fiscal_document-1.9.1.dist-info → cloudbeds_fiscal_document-1.10.0.dist-info}/METADATA +17 -7
- {cloudbeds_fiscal_document-1.9.1.dist-info → cloudbeds_fiscal_document-1.10.0.dist-info}/RECORD +31 -19
- {cloudbeds_fiscal_document-1.9.1.dist-info → cloudbeds_fiscal_document-1.10.0.dist-info}/WHEEL +0 -0
- {cloudbeds_fiscal_document-1.9.1.dist-info → cloudbeds_fiscal_document-1.10.0.dist-info}/licenses/LICENSE +0 -0
- {cloudbeds_fiscal_document-1.9.1.dist-info → cloudbeds_fiscal_document-1.10.0.dist-info}/top_level.txt +0 -0
|
@@ -90,7 +90,7 @@ class ApiClient:
|
|
|
90
90
|
self.default_headers[header_name] = header_value
|
|
91
91
|
self.cookie = cookie
|
|
92
92
|
# Set default User-Agent.
|
|
93
|
-
self.user_agent = 'OpenAPI-Generator/1.
|
|
93
|
+
self.user_agent = 'OpenAPI-Generator/1.10.0/python'
|
|
94
94
|
self.client_side_validation = configuration.client_side_validation
|
|
95
95
|
|
|
96
96
|
def __enter__(self):
|
|
@@ -504,7 +504,7 @@ class Configuration:
|
|
|
504
504
|
"OS: {env}\n"\
|
|
505
505
|
"Python Version: {pyversion}\n"\
|
|
506
506
|
"Version of the API: v1\n"\
|
|
507
|
-
"SDK Package Version: 1.
|
|
507
|
+
"SDK Package Version: 1.10.0".\
|
|
508
508
|
format(env=sys.platform, pyversion=sys.version)
|
|
509
509
|
|
|
510
510
|
def get_host_settings(self) -> List[HostSetting]:
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
# import models into model package
|
|
17
17
|
from cloudbeds_fiscal_document.models.action import Action
|
|
18
18
|
from cloudbeds_fiscal_document.models.allocate_receipt_payment_request import AllocateReceiptPaymentRequest
|
|
19
|
+
from cloudbeds_fiscal_document.models.allocations_data import AllocationsData
|
|
19
20
|
from cloudbeds_fiscal_document.models.allocations_summary import AllocationsSummary
|
|
20
21
|
from cloudbeds_fiscal_document.models.api_error import ApiError
|
|
21
22
|
from cloudbeds_fiscal_document.models.configs_response import ConfigsResponse
|
|
@@ -36,6 +37,7 @@ from cloudbeds_fiscal_document.models.fiscal_document_patch_request import Fisca
|
|
|
36
37
|
from cloudbeds_fiscal_document.models.fiscal_document_recipient import FiscalDocumentRecipient
|
|
37
38
|
from cloudbeds_fiscal_document.models.fiscal_document_status import FiscalDocumentStatus
|
|
38
39
|
from cloudbeds_fiscal_document.models.fiscal_document_summary_response import FiscalDocumentSummaryResponse
|
|
40
|
+
from cloudbeds_fiscal_document.models.fiscal_document_transaction_allocation import FiscalDocumentTransactionAllocation
|
|
39
41
|
from cloudbeds_fiscal_document.models.fiscal_document_transaction_response import FiscalDocumentTransactionResponse
|
|
40
42
|
from cloudbeds_fiscal_document.models.fiscal_document_transactions_for_allocation_paginated import FiscalDocumentTransactionsForAllocationPaginated
|
|
41
43
|
from cloudbeds_fiscal_document.models.fiscal_document_transactions_paginated import FiscalDocumentTransactionsPaginated
|
|
@@ -43,14 +45,17 @@ from cloudbeds_fiscal_document.models.fiscal_document_transactions_summary impor
|
|
|
43
45
|
from cloudbeds_fiscal_document.models.fiscal_document_transactions_summary_taxes_inner import FiscalDocumentTransactionsSummaryTaxesInner
|
|
44
46
|
from cloudbeds_fiscal_document.models.get_credit_note_preview_request import GetCreditNotePreviewRequest
|
|
45
47
|
from cloudbeds_fiscal_document.models.get_invoice_preview_request import GetInvoicePreviewRequest
|
|
48
|
+
from cloudbeds_fiscal_document.models.get_logo_response import GetLogoResponse
|
|
46
49
|
from cloudbeds_fiscal_document.models.get_rectify_invoice_note_preview_request import GetRectifyInvoiceNotePreviewRequest
|
|
47
50
|
from cloudbeds_fiscal_document.models.government_integration import GovernmentIntegration
|
|
48
51
|
from cloudbeds_fiscal_document.models.government_integration_qr import GovernmentIntegrationQr
|
|
49
52
|
from cloudbeds_fiscal_document.models.latest_linked_document import LatestLinkedDocument
|
|
50
53
|
from cloudbeds_fiscal_document.models.linked_document import LinkedDocument
|
|
54
|
+
from cloudbeds_fiscal_document.models.preview_request import PreviewRequest
|
|
51
55
|
from cloudbeds_fiscal_document.models.pro_forma_invoice_preview_request import ProFormaInvoicePreviewRequest
|
|
52
56
|
from cloudbeds_fiscal_document.models.pro_forma_invoice_request import ProFormaInvoiceRequest
|
|
53
57
|
from cloudbeds_fiscal_document.models.pro_forma_status_update_request import ProFormaStatusUpdateRequest
|
|
58
|
+
from cloudbeds_fiscal_document.models.property_configs_response import PropertyConfigsResponse
|
|
54
59
|
from cloudbeds_fiscal_document.models.receipt_transaction_allocation import ReceiptTransactionAllocation
|
|
55
60
|
from cloudbeds_fiscal_document.models.recipient_address import RecipientAddress
|
|
56
61
|
from cloudbeds_fiscal_document.models.recipient_company import RecipientCompany
|
|
@@ -61,5 +66,6 @@ from cloudbeds_fiscal_document.models.recipient_request import RecipientRequest
|
|
|
61
66
|
from cloudbeds_fiscal_document.models.recipient_tax_info import RecipientTaxInfo
|
|
62
67
|
from cloudbeds_fiscal_document.models.recipient_type import RecipientType
|
|
63
68
|
from cloudbeds_fiscal_document.models.rectify_invoice_note_request import RectifyInvoiceNoteRequest
|
|
69
|
+
from cloudbeds_fiscal_document.models.single_allocation import SingleAllocation
|
|
64
70
|
from cloudbeds_fiscal_document.models.source_kind import SourceKind
|
|
65
71
|
from cloudbeds_fiscal_document.models.transaction_for_allocation_response import TransactionForAllocationResponse
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Fiscal document service API
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v1
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from cloudbeds_fiscal_document.models.single_allocation import SingleAllocation
|
|
23
|
+
from cloudbeds_fiscal_document.models.source_kind import SourceKind
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class AllocationsData(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
AllocationsData
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
receipt_id: Optional[StrictInt] = None
|
|
32
|
+
source_id: Optional[StrictInt] = None
|
|
33
|
+
source_identifier: Optional[StrictStr] = None
|
|
34
|
+
source_kind: Optional[SourceKind] = None
|
|
35
|
+
allocations: Optional[List[SingleAllocation]] = None
|
|
36
|
+
__properties: ClassVar[List[str]] = ["receipt_id", "source_id", "source_identifier", "source_kind", "allocations"]
|
|
37
|
+
|
|
38
|
+
model_config = ConfigDict(
|
|
39
|
+
populate_by_name=True,
|
|
40
|
+
validate_assignment=True,
|
|
41
|
+
protected_namespaces=(),
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def to_str(self) -> str:
|
|
46
|
+
"""Returns the string representation of the model using alias"""
|
|
47
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
48
|
+
|
|
49
|
+
def to_json(self) -> str:
|
|
50
|
+
"""Returns the JSON representation of the model using alias"""
|
|
51
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
52
|
+
return json.dumps(self.to_dict())
|
|
53
|
+
|
|
54
|
+
@classmethod
|
|
55
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
56
|
+
"""Create an instance of AllocationsData from a JSON string"""
|
|
57
|
+
return cls.from_dict(json.loads(json_str))
|
|
58
|
+
|
|
59
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
60
|
+
"""Return the dictionary representation of the model using alias.
|
|
61
|
+
|
|
62
|
+
This has the following differences from calling pydantic's
|
|
63
|
+
`self.model_dump(by_alias=True)`:
|
|
64
|
+
|
|
65
|
+
* `None` is only added to the output dict for nullable fields that
|
|
66
|
+
were set at model initialization. Other fields with value `None`
|
|
67
|
+
are ignored.
|
|
68
|
+
"""
|
|
69
|
+
excluded_fields: Set[str] = set([
|
|
70
|
+
])
|
|
71
|
+
|
|
72
|
+
_dict = self.model_dump(
|
|
73
|
+
by_alias=True,
|
|
74
|
+
exclude=excluded_fields,
|
|
75
|
+
exclude_none=True,
|
|
76
|
+
)
|
|
77
|
+
# override the default output from pydantic by calling `to_dict()` of each item in allocations (list)
|
|
78
|
+
_items = []
|
|
79
|
+
if self.allocations:
|
|
80
|
+
for _item_allocations in self.allocations:
|
|
81
|
+
if _item_allocations:
|
|
82
|
+
_items.append(_item_allocations.to_dict())
|
|
83
|
+
_dict['allocations'] = _items
|
|
84
|
+
return _dict
|
|
85
|
+
|
|
86
|
+
@classmethod
|
|
87
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
88
|
+
"""Create an instance of AllocationsData from a dict"""
|
|
89
|
+
if obj is None:
|
|
90
|
+
return None
|
|
91
|
+
|
|
92
|
+
if not isinstance(obj, dict):
|
|
93
|
+
return cls.model_validate(obj)
|
|
94
|
+
|
|
95
|
+
_obj = cls.model_validate({
|
|
96
|
+
"receipt_id": obj.get("receipt_id"),
|
|
97
|
+
"source_id": obj.get("source_id"),
|
|
98
|
+
"source_identifier": obj.get("source_identifier"),
|
|
99
|
+
"source_kind": obj.get("source_kind"),
|
|
100
|
+
"allocations": [SingleAllocation.from_dict(_item) for _item in obj["allocations"]] if obj.get("allocations") is not None else None
|
|
101
|
+
})
|
|
102
|
+
return _obj
|
|
103
|
+
|
|
104
|
+
|
|
@@ -19,6 +19,7 @@ import json
|
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from cloudbeds_fiscal_document.models.document_trigger_event import DocumentTriggerEvent
|
|
22
23
|
from cloudbeds_fiscal_document.models.fiscal_document_kind import FiscalDocumentKind
|
|
23
24
|
from typing import Optional, Set
|
|
24
25
|
from typing_extensions import Self
|
|
@@ -47,7 +48,12 @@ class ConfigsResponse(BaseModel):
|
|
|
47
48
|
tax_id2: Optional[StrictStr] = Field(default=None, alias="taxId2")
|
|
48
49
|
cpf: Optional[StrictStr] = None
|
|
49
50
|
custom_text: Optional[Dict[str, StrictStr]] = Field(default=None, alias="customText")
|
|
50
|
-
|
|
51
|
+
create_invoice_on_allocation: Optional[StrictBool] = Field(default=False, alias="createInvoiceOnAllocation")
|
|
52
|
+
trigger_events: Optional[List[DocumentTriggerEvent]] = Field(default=None, alias="triggerEvents")
|
|
53
|
+
update_invoice_on_link_document: Optional[StrictBool] = Field(default=False, alias="updateInvoiceOnLinkDocument")
|
|
54
|
+
use_invoice_document_settings: Optional[StrictBool] = Field(default=False, alias="useInvoiceDocumentSettings")
|
|
55
|
+
use_invoice_title_and_numbering: Optional[StrictBool] = Field(default=False, alias="useInvoiceTitleAndNumbering")
|
|
56
|
+
__properties: ClassVar[List[str]] = ["propertyId", "documentKind", "showDetailedTaxFee", "showCreditNotesAndReceipts", "chargeBreakdown", "useGuestLang", "dueDays", "lang", "prefix", "suffix", "legalCompanyName", "title", "showLegalCompanyName", "includeRoomNumber", "useDocumentNumber", "isCompact", "taxId1", "taxId2", "cpf", "customText", "createInvoiceOnAllocation", "triggerEvents", "updateInvoiceOnLinkDocument", "useInvoiceDocumentSettings", "useInvoiceTitleAndNumbering"]
|
|
51
57
|
|
|
52
58
|
model_config = ConfigDict(
|
|
53
59
|
populate_by_name=True,
|
|
@@ -119,7 +125,12 @@ class ConfigsResponse(BaseModel):
|
|
|
119
125
|
"taxId1": obj.get("taxId1"),
|
|
120
126
|
"taxId2": obj.get("taxId2"),
|
|
121
127
|
"cpf": obj.get("cpf"),
|
|
122
|
-
"customText": obj.get("customText")
|
|
128
|
+
"customText": obj.get("customText"),
|
|
129
|
+
"createInvoiceOnAllocation": obj.get("createInvoiceOnAllocation") if obj.get("createInvoiceOnAllocation") is not None else False,
|
|
130
|
+
"triggerEvents": obj.get("triggerEvents"),
|
|
131
|
+
"updateInvoiceOnLinkDocument": obj.get("updateInvoiceOnLinkDocument") if obj.get("updateInvoiceOnLinkDocument") is not None else False,
|
|
132
|
+
"useInvoiceDocumentSettings": obj.get("useInvoiceDocumentSettings") if obj.get("useInvoiceDocumentSettings") is not None else False,
|
|
133
|
+
"useInvoiceTitleAndNumbering": obj.get("useInvoiceTitleAndNumbering") if obj.get("useInvoiceTitleAndNumbering") is not None else False
|
|
123
134
|
})
|
|
124
135
|
return _obj
|
|
125
136
|
|
|
@@ -42,6 +42,7 @@ class ConfigsUpdateRequest(BaseModel):
|
|
|
42
42
|
include_room_number: StrictBool = Field(alias="includeRoomNumber")
|
|
43
43
|
use_document_number: StrictBool = Field(alias="useDocumentNumber")
|
|
44
44
|
create_invoice_on_allocation: Optional[StrictBool] = Field(default=False, alias="createInvoiceOnAllocation")
|
|
45
|
+
update_invoice_on_link_document: Optional[StrictBool] = Field(default=False, alias="updateInvoiceOnLinkDocument")
|
|
45
46
|
is_compact: StrictBool = Field(alias="isCompact")
|
|
46
47
|
use_invoice_title_and_numbering: Optional[StrictBool] = Field(default=False, description="Flag to determine if invoice title, sequenceStartNumber, prefix and suffix should be used.", alias="useInvoiceTitleAndNumbering")
|
|
47
48
|
use_invoice_document_settings: Optional[StrictBool] = Field(default=False, description="Flag to determine if invoice document settings should be used.", alias="useInvoiceDocumentSettings")
|
|
@@ -51,7 +52,7 @@ class ConfigsUpdateRequest(BaseModel):
|
|
|
51
52
|
cpf: Optional[StrictStr] = None
|
|
52
53
|
custom_text: Optional[Dict[str, StrictStr]] = Field(default=None, alias="customText")
|
|
53
54
|
logo_id: Optional[StrictInt] = Field(default=None, alias="logoId")
|
|
54
|
-
__properties: ClassVar[List[str]] = ["triggerEvents", "showDetailedTaxFee", "chargeBreakdown", "useGuestLang", "dueDays", "sequenceStartNumber", "lang", "prefix", "suffix", "legalCompanyName", "title", "showLegalCompanyName", "includeRoomNumber", "useDocumentNumber", "createInvoiceOnAllocation", "isCompact", "useInvoiceTitleAndNumbering", "useInvoiceDocumentSettings", "showCreditNotesAndReceipts", "taxId1", "taxId2", "cpf", "customText", "logoId"]
|
|
55
|
+
__properties: ClassVar[List[str]] = ["triggerEvents", "showDetailedTaxFee", "chargeBreakdown", "useGuestLang", "dueDays", "sequenceStartNumber", "lang", "prefix", "suffix", "legalCompanyName", "title", "showLegalCompanyName", "includeRoomNumber", "useDocumentNumber", "createInvoiceOnAllocation", "updateInvoiceOnLinkDocument", "isCompact", "useInvoiceTitleAndNumbering", "useInvoiceDocumentSettings", "showCreditNotesAndReceipts", "taxId1", "taxId2", "cpf", "customText", "logoId"]
|
|
55
56
|
|
|
56
57
|
model_config = ConfigDict(
|
|
57
58
|
populate_by_name=True,
|
|
@@ -169,6 +170,7 @@ class ConfigsUpdateRequest(BaseModel):
|
|
|
169
170
|
"includeRoomNumber": obj.get("includeRoomNumber") if obj.get("includeRoomNumber") is not None else False,
|
|
170
171
|
"useDocumentNumber": obj.get("useDocumentNumber"),
|
|
171
172
|
"createInvoiceOnAllocation": obj.get("createInvoiceOnAllocation") if obj.get("createInvoiceOnAllocation") is not None else False,
|
|
173
|
+
"updateInvoiceOnLinkDocument": obj.get("updateInvoiceOnLinkDocument") if obj.get("updateInvoiceOnLinkDocument") is not None else False,
|
|
172
174
|
"isCompact": obj.get("isCompact") if obj.get("isCompact") is not None else False,
|
|
173
175
|
"useInvoiceTitleAndNumbering": obj.get("useInvoiceTitleAndNumbering") if obj.get("useInvoiceTitleAndNumbering") is not None else False,
|
|
174
176
|
"useInvoiceDocumentSettings": obj.get("useInvoiceDocumentSettings") if obj.get("useInvoiceDocumentSettings") is not None else False,
|
|
@@ -17,7 +17,7 @@ import pprint
|
|
|
17
17
|
import re # noqa: F401
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, Field
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
22
|
from typing_extensions import Annotated
|
|
23
23
|
from cloudbeds_fiscal_document.models.recipient_request import RecipientRequest
|
|
@@ -38,7 +38,8 @@ class CreateInvoiceRequest(BaseModel):
|
|
|
38
38
|
folio_ids: Optional[List[Annotated[int, Field(strict=True, ge=1)]]] = Field(default=None, description="Include all transactions from the specified folio IDs", alias="folioIds")
|
|
39
39
|
exclude_transaction_ids: Optional[List[Annotated[int, Field(strict=True, ge=1)]]] = Field(default=None, description="Exclude transactions with the specified IDs", alias="excludeTransactionIds")
|
|
40
40
|
include_transaction_ids: Optional[List[Annotated[int, Field(strict=True, ge=1)]]] = Field(default=None, description="Include transactions with the specified IDs", alias="includeTransactionIds")
|
|
41
|
-
|
|
41
|
+
simplified: Optional[StrictBool] = False
|
|
42
|
+
__properties: ClassVar[List[str]] = ["transactionIds", "sourceId", "sequenceId", "sourceKind", "userId", "recipient", "folioIds", "excludeTransactionIds", "includeTransactionIds", "simplified"]
|
|
42
43
|
|
|
43
44
|
model_config = ConfigDict(
|
|
44
45
|
populate_by_name=True,
|
|
@@ -112,7 +113,8 @@ class CreateInvoiceRequest(BaseModel):
|
|
|
112
113
|
"recipient": RecipientRequest.from_dict(obj["recipient"]) if obj.get("recipient") is not None else None,
|
|
113
114
|
"folioIds": obj.get("folioIds"),
|
|
114
115
|
"excludeTransactionIds": obj.get("excludeTransactionIds"),
|
|
115
|
-
"includeTransactionIds": obj.get("includeTransactionIds")
|
|
116
|
+
"includeTransactionIds": obj.get("includeTransactionIds"),
|
|
117
|
+
"simplified": obj.get("simplified") if obj.get("simplified") is not None else False
|
|
116
118
|
})
|
|
117
119
|
return _obj
|
|
118
120
|
|
|
@@ -31,7 +31,9 @@ class DocumentAction(str, Enum):
|
|
|
31
31
|
DOWNLOAD = 'DOWNLOAD'
|
|
32
32
|
CREDIT_NOTE = 'CREDIT_NOTE'
|
|
33
33
|
VOID = 'VOID'
|
|
34
|
+
VOID_AND_REFUND = 'VOID_AND_REFUND'
|
|
34
35
|
ADD_PAYMENT = 'ADD_PAYMENT'
|
|
36
|
+
APPLY_TO_INVOICE = 'APPLY_TO_INVOICE'
|
|
35
37
|
|
|
36
38
|
@classmethod
|
|
37
39
|
def from_json(cls, json_str: str) -> Self:
|
|
@@ -18,7 +18,7 @@ import re # noqa: F401
|
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
20
|
from datetime import date, datetime
|
|
21
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr
|
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
23
23
|
from cloudbeds_fiscal_document.models.action import Action
|
|
24
24
|
from cloudbeds_fiscal_document.models.creation_method import CreationMethod
|
|
@@ -66,7 +66,8 @@ class FiscalDocumentDetailedResponse(BaseModel):
|
|
|
66
66
|
linked_documents: Optional[List[LinkedDocument]] = Field(default=None, description="List of documents linked to this fiscal document (both parent and child relationships)", alias="linkedDocuments")
|
|
67
67
|
actions: Optional[List[Action]] = Field(default=None, description="Returns the list of actions available for the transaction")
|
|
68
68
|
source_identifier: Optional[StrictStr] = Field(default=None, description="Reservation Identifier or a group code", alias="sourceIdentifier")
|
|
69
|
-
|
|
69
|
+
simplified: Optional[StrictBool] = Field(default=None, description="Applies to invoices only.")
|
|
70
|
+
__properties: ClassVar[List[str]] = ["id", "number", "propertyId", "userId", "userFullName", "sourceName", "sourceId", "sourceKind", "kind", "invoiceDate", "invoiceDatePropertyTimezone", "fileName", "amount", "balance", "dueDate", "dueDatePropertyTimezone", "recipients", "status", "origin", "externalId", "failReason", "method", "createdAt", "parentId", "updatedAt", "governmentIntegration", "latestLinkedDocument", "linkedDocuments", "actions", "sourceIdentifier", "simplified"]
|
|
70
71
|
|
|
71
72
|
model_config = ConfigDict(
|
|
72
73
|
populate_by_name=True,
|
|
@@ -175,7 +176,8 @@ class FiscalDocumentDetailedResponse(BaseModel):
|
|
|
175
176
|
"latestLinkedDocument": LatestLinkedDocument.from_dict(obj["latestLinkedDocument"]) if obj.get("latestLinkedDocument") is not None else None,
|
|
176
177
|
"linkedDocuments": [LinkedDocument.from_dict(_item) for _item in obj["linkedDocuments"]] if obj.get("linkedDocuments") is not None else None,
|
|
177
178
|
"actions": [Action.from_dict(_item) for _item in obj["actions"]] if obj.get("actions") is not None else None,
|
|
178
|
-
"sourceIdentifier": obj.get("sourceIdentifier")
|
|
179
|
+
"sourceIdentifier": obj.get("sourceIdentifier"),
|
|
180
|
+
"simplified": obj.get("simplified")
|
|
179
181
|
})
|
|
180
182
|
return _obj
|
|
181
183
|
|
|
@@ -32,6 +32,7 @@ class FiscalDocumentKind(str, Enum):
|
|
|
32
32
|
FISCALIZED_RECEIPT = 'FISCALIZED_RECEIPT'
|
|
33
33
|
RECTIFY_INVOICE = 'RECTIFY_INVOICE'
|
|
34
34
|
PRO_FORMA_INVOICE = 'PRO_FORMA_INVOICE'
|
|
35
|
+
REFUND_RECEIPT = 'REFUND_RECEIPT'
|
|
35
36
|
|
|
36
37
|
@classmethod
|
|
37
38
|
def from_json(cls, json_str: str) -> Self:
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Fiscal document service API
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v1
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class FiscalDocumentTransactionAllocation(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
FiscalDocumentTransactionAllocation
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
receipt_number: Optional[StrictStr] = Field(default=None, alias="receiptNumber")
|
|
30
|
+
__properties: ClassVar[List[str]] = ["receiptNumber"]
|
|
31
|
+
|
|
32
|
+
model_config = ConfigDict(
|
|
33
|
+
populate_by_name=True,
|
|
34
|
+
validate_assignment=True,
|
|
35
|
+
protected_namespaces=(),
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def to_str(self) -> str:
|
|
40
|
+
"""Returns the string representation of the model using alias"""
|
|
41
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
42
|
+
|
|
43
|
+
def to_json(self) -> str:
|
|
44
|
+
"""Returns the JSON representation of the model using alias"""
|
|
45
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
46
|
+
return json.dumps(self.to_dict())
|
|
47
|
+
|
|
48
|
+
@classmethod
|
|
49
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
50
|
+
"""Create an instance of FiscalDocumentTransactionAllocation from a JSON string"""
|
|
51
|
+
return cls.from_dict(json.loads(json_str))
|
|
52
|
+
|
|
53
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
54
|
+
"""Return the dictionary representation of the model using alias.
|
|
55
|
+
|
|
56
|
+
This has the following differences from calling pydantic's
|
|
57
|
+
`self.model_dump(by_alias=True)`:
|
|
58
|
+
|
|
59
|
+
* `None` is only added to the output dict for nullable fields that
|
|
60
|
+
were set at model initialization. Other fields with value `None`
|
|
61
|
+
are ignored.
|
|
62
|
+
"""
|
|
63
|
+
excluded_fields: Set[str] = set([
|
|
64
|
+
])
|
|
65
|
+
|
|
66
|
+
_dict = self.model_dump(
|
|
67
|
+
by_alias=True,
|
|
68
|
+
exclude=excluded_fields,
|
|
69
|
+
exclude_none=True,
|
|
70
|
+
)
|
|
71
|
+
return _dict
|
|
72
|
+
|
|
73
|
+
@classmethod
|
|
74
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
75
|
+
"""Create an instance of FiscalDocumentTransactionAllocation from a dict"""
|
|
76
|
+
if obj is None:
|
|
77
|
+
return None
|
|
78
|
+
|
|
79
|
+
if not isinstance(obj, dict):
|
|
80
|
+
return cls.model_validate(obj)
|
|
81
|
+
|
|
82
|
+
_obj = cls.model_validate({
|
|
83
|
+
"receiptNumber": obj.get("receiptNumber")
|
|
84
|
+
})
|
|
85
|
+
return _obj
|
|
86
|
+
|
|
87
|
+
|
|
@@ -20,6 +20,7 @@ import json
|
|
|
20
20
|
from datetime import datetime
|
|
21
21
|
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator
|
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
23
|
+
from cloudbeds_fiscal_document.models.fiscal_document_transaction_allocation import FiscalDocumentTransactionAllocation
|
|
23
24
|
from cloudbeds_fiscal_document.models.source_kind import SourceKind
|
|
24
25
|
from typing import Optional, Set
|
|
25
26
|
from typing_extensions import Self
|
|
@@ -32,7 +33,6 @@ class FiscalDocumentTransactionResponse(BaseModel):
|
|
|
32
33
|
property_id: Optional[StrictStr] = Field(default=None, alias="propertyId")
|
|
33
34
|
source_id: Optional[StrictStr] = Field(default=None, alias="sourceId")
|
|
34
35
|
source_kind: Optional[SourceKind] = Field(default=None, alias="sourceKind")
|
|
35
|
-
allocated_payment_transactions: Optional[List[FiscalDocumentTransactionResponse]] = Field(default=None, alias="allocatedPaymentTransactions")
|
|
36
36
|
transaction_date: Optional[datetime] = Field(default=None, alias="transactionDate")
|
|
37
37
|
guest_name: Optional[StrictStr] = Field(default=None, alias="guestName")
|
|
38
38
|
description: Optional[StrictStr] = None
|
|
@@ -40,7 +40,9 @@ class FiscalDocumentTransactionResponse(BaseModel):
|
|
|
40
40
|
amount: Optional[Union[StrictFloat, StrictInt]] = None
|
|
41
41
|
folio_id: Optional[StrictStr] = Field(default=None, alias="folioId")
|
|
42
42
|
status: Optional[StrictStr] = Field(default=None, description="Status of the transaction - PENDING for unpaid transactions, POSTED for paid transactions")
|
|
43
|
-
|
|
43
|
+
paid_amount: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="paidAmount")
|
|
44
|
+
allocations: Optional[List[FiscalDocumentTransactionAllocation]] = None
|
|
45
|
+
__properties: ClassVar[List[str]] = ["id", "propertyId", "sourceId", "sourceKind", "transactionDate", "guestName", "description", "internalCode", "amount", "folioId", "status", "paidAmount", "allocations"]
|
|
44
46
|
|
|
45
47
|
@field_validator('status')
|
|
46
48
|
def status_validate_enum(cls, value):
|
|
@@ -91,13 +93,13 @@ class FiscalDocumentTransactionResponse(BaseModel):
|
|
|
91
93
|
exclude=excluded_fields,
|
|
92
94
|
exclude_none=True,
|
|
93
95
|
)
|
|
94
|
-
# override the default output from pydantic by calling `to_dict()` of each item in
|
|
96
|
+
# override the default output from pydantic by calling `to_dict()` of each item in allocations (list)
|
|
95
97
|
_items = []
|
|
96
|
-
if self.
|
|
97
|
-
for
|
|
98
|
-
if
|
|
99
|
-
_items.append(
|
|
100
|
-
_dict['
|
|
98
|
+
if self.allocations:
|
|
99
|
+
for _item_allocations in self.allocations:
|
|
100
|
+
if _item_allocations:
|
|
101
|
+
_items.append(_item_allocations.to_dict())
|
|
102
|
+
_dict['allocations'] = _items
|
|
101
103
|
return _dict
|
|
102
104
|
|
|
103
105
|
@classmethod
|
|
@@ -114,17 +116,16 @@ class FiscalDocumentTransactionResponse(BaseModel):
|
|
|
114
116
|
"propertyId": obj.get("propertyId"),
|
|
115
117
|
"sourceId": obj.get("sourceId"),
|
|
116
118
|
"sourceKind": obj.get("sourceKind"),
|
|
117
|
-
"allocatedPaymentTransactions": [FiscalDocumentTransactionResponse.from_dict(_item) for _item in obj["allocatedPaymentTransactions"]] if obj.get("allocatedPaymentTransactions") is not None else None,
|
|
118
119
|
"transactionDate": obj.get("transactionDate"),
|
|
119
120
|
"guestName": obj.get("guestName"),
|
|
120
121
|
"description": obj.get("description"),
|
|
121
122
|
"internalCode": obj.get("internalCode"),
|
|
122
123
|
"amount": obj.get("amount"),
|
|
123
124
|
"folioId": obj.get("folioId"),
|
|
124
|
-
"status": obj.get("status")
|
|
125
|
+
"status": obj.get("status"),
|
|
126
|
+
"paidAmount": obj.get("paidAmount"),
|
|
127
|
+
"allocations": [FiscalDocumentTransactionAllocation.from_dict(_item) for _item in obj["allocations"]] if obj.get("allocations") is not None else None
|
|
125
128
|
})
|
|
126
129
|
return _obj
|
|
127
130
|
|
|
128
|
-
# TODO: Rewrite to not use raise_errors
|
|
129
|
-
FiscalDocumentTransactionResponse.model_rebuild(raise_errors=False)
|
|
130
131
|
|
|
@@ -17,7 +17,7 @@ import pprint
|
|
|
17
17
|
import re # noqa: F401
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, Field
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
22
|
from typing_extensions import Annotated
|
|
23
23
|
from cloudbeds_fiscal_document.models.recipient_request import RecipientRequest
|
|
@@ -38,7 +38,8 @@ class GetInvoicePreviewRequest(BaseModel):
|
|
|
38
38
|
folio_ids: Optional[List[Annotated[int, Field(strict=True, ge=1)]]] = Field(default=None, description="Include all transactions from the specified folio IDs", alias="folioIds")
|
|
39
39
|
exclude_transaction_ids: Optional[List[Annotated[int, Field(strict=True, ge=1)]]] = Field(default=None, description="Exclude transactions with the specified IDs", alias="excludeTransactionIds")
|
|
40
40
|
include_transaction_ids: Optional[List[Annotated[int, Field(strict=True, ge=1)]]] = Field(default=None, description="Include transactions with the specified IDs", alias="includeTransactionIds")
|
|
41
|
-
|
|
41
|
+
simplified: Optional[StrictBool] = False
|
|
42
|
+
__properties: ClassVar[List[str]] = ["transactionIds", "sourceId", "sequenceId", "sourceKind", "userId", "recipient", "folioIds", "excludeTransactionIds", "includeTransactionIds", "simplified"]
|
|
42
43
|
|
|
43
44
|
model_config = ConfigDict(
|
|
44
45
|
populate_by_name=True,
|
|
@@ -112,7 +113,8 @@ class GetInvoicePreviewRequest(BaseModel):
|
|
|
112
113
|
"recipient": RecipientRequest.from_dict(obj["recipient"]) if obj.get("recipient") is not None else None,
|
|
113
114
|
"folioIds": obj.get("folioIds"),
|
|
114
115
|
"excludeTransactionIds": obj.get("excludeTransactionIds"),
|
|
115
|
-
"includeTransactionIds": obj.get("includeTransactionIds")
|
|
116
|
+
"includeTransactionIds": obj.get("includeTransactionIds"),
|
|
117
|
+
"simplified": obj.get("simplified") if obj.get("simplified") is not None else False
|
|
116
118
|
})
|
|
117
119
|
return _obj
|
|
118
120
|
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Fiscal document service API
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v1
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class GetLogoResponse(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
GetLogoResponse
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
logo_url: Optional[StrictStr] = Field(default=None, description="Presigned URL to access the logo file", alias="logoUrl")
|
|
30
|
+
__properties: ClassVar[List[str]] = ["logoUrl"]
|
|
31
|
+
|
|
32
|
+
model_config = ConfigDict(
|
|
33
|
+
populate_by_name=True,
|
|
34
|
+
validate_assignment=True,
|
|
35
|
+
protected_namespaces=(),
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def to_str(self) -> str:
|
|
40
|
+
"""Returns the string representation of the model using alias"""
|
|
41
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
42
|
+
|
|
43
|
+
def to_json(self) -> str:
|
|
44
|
+
"""Returns the JSON representation of the model using alias"""
|
|
45
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
46
|
+
return json.dumps(self.to_dict())
|
|
47
|
+
|
|
48
|
+
@classmethod
|
|
49
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
50
|
+
"""Create an instance of GetLogoResponse from a JSON string"""
|
|
51
|
+
return cls.from_dict(json.loads(json_str))
|
|
52
|
+
|
|
53
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
54
|
+
"""Return the dictionary representation of the model using alias.
|
|
55
|
+
|
|
56
|
+
This has the following differences from calling pydantic's
|
|
57
|
+
`self.model_dump(by_alias=True)`:
|
|
58
|
+
|
|
59
|
+
* `None` is only added to the output dict for nullable fields that
|
|
60
|
+
were set at model initialization. Other fields with value `None`
|
|
61
|
+
are ignored.
|
|
62
|
+
"""
|
|
63
|
+
excluded_fields: Set[str] = set([
|
|
64
|
+
])
|
|
65
|
+
|
|
66
|
+
_dict = self.model_dump(
|
|
67
|
+
by_alias=True,
|
|
68
|
+
exclude=excluded_fields,
|
|
69
|
+
exclude_none=True,
|
|
70
|
+
)
|
|
71
|
+
return _dict
|
|
72
|
+
|
|
73
|
+
@classmethod
|
|
74
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
75
|
+
"""Create an instance of GetLogoResponse from a dict"""
|
|
76
|
+
if obj is None:
|
|
77
|
+
return None
|
|
78
|
+
|
|
79
|
+
if not isinstance(obj, dict):
|
|
80
|
+
return cls.model_validate(obj)
|
|
81
|
+
|
|
82
|
+
_obj = cls.model_validate({
|
|
83
|
+
"logoUrl": obj.get("logoUrl")
|
|
84
|
+
})
|
|
85
|
+
return _obj
|
|
86
|
+
|
|
87
|
+
|