cloudbeds-fiscal-document 1.9.2__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 +4 -1
- cloudbeds_fiscal_document/api/configs_api.py +941 -92
- cloudbeds_fiscal_document/api/fiscal_documents_api.py +667 -0
- cloudbeds_fiscal_document/api_client.py +1 -1
- cloudbeds_fiscal_document/configuration.py +1 -1
- cloudbeds_fiscal_document/models/__init__.py +3 -0
- cloudbeds_fiscal_document/models/configs_response.py +13 -2
- cloudbeds_fiscal_document/models/create_invoice_request.py +5 -3
- cloudbeds_fiscal_document/models/document_action.py +1 -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/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/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-1.9.2.dist-info → cloudbeds_fiscal_document-1.10.0.dist-info}/METADATA +13 -7
- {cloudbeds_fiscal_document-1.9.2.dist-info → cloudbeds_fiscal_document-1.10.0.dist-info}/RECORD +23 -17
- {cloudbeds_fiscal_document-1.9.2.dist-info → cloudbeds_fiscal_document-1.10.0.dist-info}/WHEEL +0 -0
- {cloudbeds_fiscal_document-1.9.2.dist-info → cloudbeds_fiscal_document-1.10.0.dist-info}/licenses/LICENSE +0 -0
- {cloudbeds_fiscal_document-1.9.2.dist-info → cloudbeds_fiscal_document-1.10.0.dist-info}/top_level.txt +0 -0
|
@@ -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]:
|
|
@@ -45,14 +45,17 @@ from cloudbeds_fiscal_document.models.fiscal_document_transactions_summary impor
|
|
|
45
45
|
from cloudbeds_fiscal_document.models.fiscal_document_transactions_summary_taxes_inner import FiscalDocumentTransactionsSummaryTaxesInner
|
|
46
46
|
from cloudbeds_fiscal_document.models.get_credit_note_preview_request import GetCreditNotePreviewRequest
|
|
47
47
|
from cloudbeds_fiscal_document.models.get_invoice_preview_request import GetInvoicePreviewRequest
|
|
48
|
+
from cloudbeds_fiscal_document.models.get_logo_response import GetLogoResponse
|
|
48
49
|
from cloudbeds_fiscal_document.models.get_rectify_invoice_note_preview_request import GetRectifyInvoiceNotePreviewRequest
|
|
49
50
|
from cloudbeds_fiscal_document.models.government_integration import GovernmentIntegration
|
|
50
51
|
from cloudbeds_fiscal_document.models.government_integration_qr import GovernmentIntegrationQr
|
|
51
52
|
from cloudbeds_fiscal_document.models.latest_linked_document import LatestLinkedDocument
|
|
52
53
|
from cloudbeds_fiscal_document.models.linked_document import LinkedDocument
|
|
54
|
+
from cloudbeds_fiscal_document.models.preview_request import PreviewRequest
|
|
53
55
|
from cloudbeds_fiscal_document.models.pro_forma_invoice_preview_request import ProFormaInvoicePreviewRequest
|
|
54
56
|
from cloudbeds_fiscal_document.models.pro_forma_invoice_request import ProFormaInvoiceRequest
|
|
55
57
|
from cloudbeds_fiscal_document.models.pro_forma_status_update_request import ProFormaStatusUpdateRequest
|
|
58
|
+
from cloudbeds_fiscal_document.models.property_configs_response import PropertyConfigsResponse
|
|
56
59
|
from cloudbeds_fiscal_document.models.receipt_transaction_allocation import ReceiptTransactionAllocation
|
|
57
60
|
from cloudbeds_fiscal_document.models.recipient_address import RecipientAddress
|
|
58
61
|
from cloudbeds_fiscal_document.models.recipient_company import RecipientCompany
|
|
@@ -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
|
|
|
@@ -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
|
|
|
@@ -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:
|
|
@@ -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
|
+
|
|
@@ -0,0 +1,102 @@
|
|
|
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, StrictBool
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from cloudbeds_fiscal_document.models.fiscal_document_kind import FiscalDocumentKind
|
|
23
|
+
from cloudbeds_fiscal_document.models.recipient_type import RecipientType
|
|
24
|
+
from cloudbeds_fiscal_document.models.source_kind import SourceKind
|
|
25
|
+
from typing import Optional, Set
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
|
|
28
|
+
class PreviewRequest(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
PreviewRequest
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
document_kind: Optional[FiscalDocumentKind] = Field(default=None, alias="documentKind")
|
|
33
|
+
source_kind: Optional[SourceKind] = Field(default=None, alias="sourceKind")
|
|
34
|
+
recipient_type: Optional[RecipientType] = Field(default=None, alias="recipientType")
|
|
35
|
+
include_vat: Optional[StrictBool] = Field(default=False, description="Include VAT tax breakdown section in preview", alias="includeVat")
|
|
36
|
+
include_payments: Optional[StrictBool] = Field(default=True, description="Include payment transactions section in preview", alias="includePayments")
|
|
37
|
+
include_room_number: Optional[StrictBool] = Field(default=True, description="Include room number column in reservation previews", alias="includeRoomNumber")
|
|
38
|
+
preview_watermark: Optional[StrictBool] = Field(default=True, description="Show preview watermark on the document", alias="previewWatermark")
|
|
39
|
+
__properties: ClassVar[List[str]] = ["documentKind", "sourceKind", "recipientType", "includeVat", "includePayments", "includeRoomNumber", "previewWatermark"]
|
|
40
|
+
|
|
41
|
+
model_config = ConfigDict(
|
|
42
|
+
populate_by_name=True,
|
|
43
|
+
validate_assignment=True,
|
|
44
|
+
protected_namespaces=(),
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def to_str(self) -> str:
|
|
49
|
+
"""Returns the string representation of the model using alias"""
|
|
50
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
51
|
+
|
|
52
|
+
def to_json(self) -> str:
|
|
53
|
+
"""Returns the JSON representation of the model using alias"""
|
|
54
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
55
|
+
return json.dumps(self.to_dict())
|
|
56
|
+
|
|
57
|
+
@classmethod
|
|
58
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
59
|
+
"""Create an instance of PreviewRequest from a JSON string"""
|
|
60
|
+
return cls.from_dict(json.loads(json_str))
|
|
61
|
+
|
|
62
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
63
|
+
"""Return the dictionary representation of the model using alias.
|
|
64
|
+
|
|
65
|
+
This has the following differences from calling pydantic's
|
|
66
|
+
`self.model_dump(by_alias=True)`:
|
|
67
|
+
|
|
68
|
+
* `None` is only added to the output dict for nullable fields that
|
|
69
|
+
were set at model initialization. Other fields with value `None`
|
|
70
|
+
are ignored.
|
|
71
|
+
"""
|
|
72
|
+
excluded_fields: Set[str] = set([
|
|
73
|
+
])
|
|
74
|
+
|
|
75
|
+
_dict = self.model_dump(
|
|
76
|
+
by_alias=True,
|
|
77
|
+
exclude=excluded_fields,
|
|
78
|
+
exclude_none=True,
|
|
79
|
+
)
|
|
80
|
+
return _dict
|
|
81
|
+
|
|
82
|
+
@classmethod
|
|
83
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
84
|
+
"""Create an instance of PreviewRequest from a dict"""
|
|
85
|
+
if obj is None:
|
|
86
|
+
return None
|
|
87
|
+
|
|
88
|
+
if not isinstance(obj, dict):
|
|
89
|
+
return cls.model_validate(obj)
|
|
90
|
+
|
|
91
|
+
_obj = cls.model_validate({
|
|
92
|
+
"documentKind": obj.get("documentKind"),
|
|
93
|
+
"sourceKind": obj.get("sourceKind"),
|
|
94
|
+
"recipientType": obj.get("recipientType"),
|
|
95
|
+
"includeVat": obj.get("includeVat") if obj.get("includeVat") is not None else False,
|
|
96
|
+
"includePayments": obj.get("includePayments") if obj.get("includePayments") is not None else True,
|
|
97
|
+
"includeRoomNumber": obj.get("includeRoomNumber") if obj.get("includeRoomNumber") is not None else True,
|
|
98
|
+
"previewWatermark": obj.get("previewWatermark") if obj.get("previewWatermark") is not None else True
|
|
99
|
+
})
|
|
100
|
+
return _obj
|
|
101
|
+
|
|
102
|
+
|
|
@@ -0,0 +1,100 @@
|
|
|
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
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from cloudbeds_fiscal_document.models.configs_response import ConfigsResponse
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class PropertyConfigsResponse(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
PropertyConfigsResponse
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
configs: Optional[Dict[str, ConfigsResponse]] = Field(default=None, description="Map of document kind to fiscal document configuration")
|
|
31
|
+
__properties: ClassVar[List[str]] = ["configs"]
|
|
32
|
+
|
|
33
|
+
model_config = ConfigDict(
|
|
34
|
+
populate_by_name=True,
|
|
35
|
+
validate_assignment=True,
|
|
36
|
+
protected_namespaces=(),
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def to_str(self) -> str:
|
|
41
|
+
"""Returns the string representation of the model using alias"""
|
|
42
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
43
|
+
|
|
44
|
+
def to_json(self) -> str:
|
|
45
|
+
"""Returns the JSON representation of the model using alias"""
|
|
46
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
47
|
+
return json.dumps(self.to_dict())
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
51
|
+
"""Create an instance of PropertyConfigsResponse from a JSON string"""
|
|
52
|
+
return cls.from_dict(json.loads(json_str))
|
|
53
|
+
|
|
54
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
55
|
+
"""Return the dictionary representation of the model using alias.
|
|
56
|
+
|
|
57
|
+
This has the following differences from calling pydantic's
|
|
58
|
+
`self.model_dump(by_alias=True)`:
|
|
59
|
+
|
|
60
|
+
* `None` is only added to the output dict for nullable fields that
|
|
61
|
+
were set at model initialization. Other fields with value `None`
|
|
62
|
+
are ignored.
|
|
63
|
+
"""
|
|
64
|
+
excluded_fields: Set[str] = set([
|
|
65
|
+
])
|
|
66
|
+
|
|
67
|
+
_dict = self.model_dump(
|
|
68
|
+
by_alias=True,
|
|
69
|
+
exclude=excluded_fields,
|
|
70
|
+
exclude_none=True,
|
|
71
|
+
)
|
|
72
|
+
# override the default output from pydantic by calling `to_dict()` of each value in configs (dict)
|
|
73
|
+
_field_dict = {}
|
|
74
|
+
if self.configs:
|
|
75
|
+
for _key_configs in self.configs:
|
|
76
|
+
if self.configs[_key_configs]:
|
|
77
|
+
_field_dict[_key_configs] = self.configs[_key_configs].to_dict()
|
|
78
|
+
_dict['configs'] = _field_dict
|
|
79
|
+
return _dict
|
|
80
|
+
|
|
81
|
+
@classmethod
|
|
82
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
83
|
+
"""Create an instance of PropertyConfigsResponse from a dict"""
|
|
84
|
+
if obj is None:
|
|
85
|
+
return None
|
|
86
|
+
|
|
87
|
+
if not isinstance(obj, dict):
|
|
88
|
+
return cls.model_validate(obj)
|
|
89
|
+
|
|
90
|
+
_obj = cls.model_validate({
|
|
91
|
+
"configs": dict(
|
|
92
|
+
(_k, ConfigsResponse.from_dict(_v))
|
|
93
|
+
for _k, _v in obj["configs"].items()
|
|
94
|
+
)
|
|
95
|
+
if obj.get("configs") is not None
|
|
96
|
+
else None
|
|
97
|
+
})
|
|
98
|
+
return _obj
|
|
99
|
+
|
|
100
|
+
|
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
import unittest
|
|
16
|
+
|
|
17
|
+
from cloudbeds_fiscal_document.models.get_logo_response import GetLogoResponse
|
|
18
|
+
|
|
19
|
+
class TestGetLogoResponse(unittest.TestCase):
|
|
20
|
+
"""GetLogoResponse unit test stubs"""
|
|
21
|
+
|
|
22
|
+
def setUp(self):
|
|
23
|
+
pass
|
|
24
|
+
|
|
25
|
+
def tearDown(self):
|
|
26
|
+
pass
|
|
27
|
+
|
|
28
|
+
def make_instance(self, include_optional) -> GetLogoResponse:
|
|
29
|
+
"""Test GetLogoResponse
|
|
30
|
+
include_optional is a boolean, when False only required
|
|
31
|
+
params are included, when True both required and
|
|
32
|
+
optional params are included """
|
|
33
|
+
# uncomment below to create an instance of `GetLogoResponse`
|
|
34
|
+
"""
|
|
35
|
+
model = GetLogoResponse()
|
|
36
|
+
if include_optional:
|
|
37
|
+
return GetLogoResponse(
|
|
38
|
+
logo_url = ''
|
|
39
|
+
)
|
|
40
|
+
else:
|
|
41
|
+
return GetLogoResponse(
|
|
42
|
+
)
|
|
43
|
+
"""
|
|
44
|
+
|
|
45
|
+
def testGetLogoResponse(self):
|
|
46
|
+
"""Test GetLogoResponse"""
|
|
47
|
+
# inst_req_only = self.make_instance(include_optional=False)
|
|
48
|
+
# inst_req_and_optional = self.make_instance(include_optional=True)
|
|
49
|
+
|
|
50
|
+
if __name__ == '__main__':
|
|
51
|
+
unittest.main()
|
|
@@ -0,0 +1,57 @@
|
|
|
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
|
+
import unittest
|
|
16
|
+
|
|
17
|
+
from cloudbeds_fiscal_document.models.preview_request import PreviewRequest
|
|
18
|
+
|
|
19
|
+
class TestPreviewRequest(unittest.TestCase):
|
|
20
|
+
"""PreviewRequest unit test stubs"""
|
|
21
|
+
|
|
22
|
+
def setUp(self):
|
|
23
|
+
pass
|
|
24
|
+
|
|
25
|
+
def tearDown(self):
|
|
26
|
+
pass
|
|
27
|
+
|
|
28
|
+
def make_instance(self, include_optional) -> PreviewRequest:
|
|
29
|
+
"""Test PreviewRequest
|
|
30
|
+
include_optional is a boolean, when False only required
|
|
31
|
+
params are included, when True both required and
|
|
32
|
+
optional params are included """
|
|
33
|
+
# uncomment below to create an instance of `PreviewRequest`
|
|
34
|
+
"""
|
|
35
|
+
model = PreviewRequest()
|
|
36
|
+
if include_optional:
|
|
37
|
+
return PreviewRequest(
|
|
38
|
+
document_kind = 'INVOICE',
|
|
39
|
+
source_kind = 'GROUP_PROFILE',
|
|
40
|
+
recipient_type = 'COMPANY',
|
|
41
|
+
include_vat = True,
|
|
42
|
+
include_payments = True,
|
|
43
|
+
include_room_number = True,
|
|
44
|
+
preview_watermark = True
|
|
45
|
+
)
|
|
46
|
+
else:
|
|
47
|
+
return PreviewRequest(
|
|
48
|
+
)
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
def testPreviewRequest(self):
|
|
52
|
+
"""Test PreviewRequest"""
|
|
53
|
+
# inst_req_only = self.make_instance(include_optional=False)
|
|
54
|
+
# inst_req_and_optional = self.make_instance(include_optional=True)
|
|
55
|
+
|
|
56
|
+
if __name__ == '__main__':
|
|
57
|
+
unittest.main()
|
|
@@ -0,0 +1,84 @@
|
|
|
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
|
+
import unittest
|
|
16
|
+
|
|
17
|
+
from cloudbeds_fiscal_document.models.property_configs_response import PropertyConfigsResponse
|
|
18
|
+
|
|
19
|
+
class TestPropertyConfigsResponse(unittest.TestCase):
|
|
20
|
+
"""PropertyConfigsResponse unit test stubs"""
|
|
21
|
+
|
|
22
|
+
def setUp(self):
|
|
23
|
+
pass
|
|
24
|
+
|
|
25
|
+
def tearDown(self):
|
|
26
|
+
pass
|
|
27
|
+
|
|
28
|
+
def make_instance(self, include_optional) -> PropertyConfigsResponse:
|
|
29
|
+
"""Test PropertyConfigsResponse
|
|
30
|
+
include_optional is a boolean, when False only required
|
|
31
|
+
params are included, when True both required and
|
|
32
|
+
optional params are included """
|
|
33
|
+
# uncomment below to create an instance of `PropertyConfigsResponse`
|
|
34
|
+
"""
|
|
35
|
+
model = PropertyConfigsResponse()
|
|
36
|
+
if include_optional:
|
|
37
|
+
return PropertyConfigsResponse(
|
|
38
|
+
configs = {
|
|
39
|
+
'key' : cloudbeds_fiscal_document.models.configs_response.ConfigsResponse(
|
|
40
|
+
property_id = '',
|
|
41
|
+
document_kind = 'INVOICE',
|
|
42
|
+
show_detailed_tax_fee = True,
|
|
43
|
+
show_credit_notes_and_receipts = True,
|
|
44
|
+
charge_breakdown = True,
|
|
45
|
+
use_guest_lang = True,
|
|
46
|
+
due_days = 56,
|
|
47
|
+
lang = '',
|
|
48
|
+
prefix = '',
|
|
49
|
+
suffix = '',
|
|
50
|
+
legal_company_name = '',
|
|
51
|
+
title = {
|
|
52
|
+
'key' : ''
|
|
53
|
+
},
|
|
54
|
+
show_legal_company_name = True,
|
|
55
|
+
include_room_number = True,
|
|
56
|
+
use_document_number = True,
|
|
57
|
+
is_compact = True,
|
|
58
|
+
tax_id1 = '',
|
|
59
|
+
tax_id2 = '',
|
|
60
|
+
cpf = '',
|
|
61
|
+
custom_text = {
|
|
62
|
+
'key' : ''
|
|
63
|
+
},
|
|
64
|
+
create_invoice_on_allocation = True,
|
|
65
|
+
trigger_events = [
|
|
66
|
+
'manual'
|
|
67
|
+
],
|
|
68
|
+
update_invoice_on_link_document = True,
|
|
69
|
+
use_invoice_document_settings = True,
|
|
70
|
+
use_invoice_title_and_numbering = True, )
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
else:
|
|
74
|
+
return PropertyConfigsResponse(
|
|
75
|
+
)
|
|
76
|
+
"""
|
|
77
|
+
|
|
78
|
+
def testPropertyConfigsResponse(self):
|
|
79
|
+
"""Test PropertyConfigsResponse"""
|
|
80
|
+
# inst_req_only = self.make_instance(include_optional=False)
|
|
81
|
+
# inst_req_and_optional = self.make_instance(include_optional=True)
|
|
82
|
+
|
|
83
|
+
if __name__ == '__main__':
|
|
84
|
+
unittest.main()
|