# coding: utf-8

"""
    Fiscal document service API

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

    The version of the OpenAPI document: v1
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501


from __future__ import annotations
import pprint
import re  # noqa: F401
import json

from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from cloudbeds_fiscal_document.models.document_trigger_event import DocumentTriggerEvent
from cloudbeds_fiscal_document.models.fiscal_document_kind import FiscalDocumentKind
from typing import Optional, Set
from typing_extensions import Self

class ConfigsResponse(BaseModel):
    """
    ConfigsResponse
    """ # noqa: E501
    property_id: Optional[StrictStr] = Field(default=None, alias="propertyId")
    document_kind: Optional[FiscalDocumentKind] = Field(default=None, alias="documentKind")
    show_detailed_tax_fee: Optional[StrictBool] = Field(default=None, alias="showDetailedTaxFee")
    show_credit_notes_and_receipts: Optional[StrictBool] = Field(default=None, alias="showCreditNotesAndReceipts")
    charge_breakdown: Optional[StrictBool] = Field(default=None, alias="chargeBreakdown")
    use_guest_lang: Optional[StrictBool] = Field(default=None, alias="useGuestLang")
    due_days: Optional[StrictInt] = Field(default=None, alias="dueDays")
    lang: Optional[StrictStr] = None
    prefix: Optional[StrictStr] = None
    suffix: Optional[StrictStr] = None
    legal_company_name: Optional[StrictStr] = Field(default=None, alias="legalCompanyName")
    title: Optional[Dict[str, StrictStr]] = None
    show_legal_company_name: Optional[StrictBool] = Field(default=None, alias="showLegalCompanyName")
    include_room_number: Optional[StrictBool] = Field(default=None, alias="includeRoomNumber")
    use_document_number: Optional[StrictBool] = Field(default=None, alias="useDocumentNumber")
    is_compact: Optional[StrictBool] = Field(default=None, alias="isCompact")
    tax_id1: Optional[StrictStr] = Field(default=None, alias="taxId1")
    tax_id2: Optional[StrictStr] = Field(default=None, alias="taxId2")
    cpf: Optional[StrictStr] = None
    custom_text: Optional[Dict[str, StrictStr]] = Field(default=None, alias="customText")
    trigger_events: Optional[List[DocumentTriggerEvent]] = Field(default=None, alias="triggerEvents")
    update_invoice_on_link_document: Optional[StrictBool] = Field(default=False, alias="updateInvoiceOnLinkDocument")
    use_invoice_document_settings: Optional[StrictBool] = Field(default=False, alias="useInvoiceDocumentSettings")
    use_invoice_title_and_numbering: Optional[StrictBool] = Field(default=False, alias="useInvoiceTitleAndNumbering")
    __properties: ClassVar[List[str]] = ["propertyId", "documentKind", "showDetailedTaxFee", "showCreditNotesAndReceipts", "chargeBreakdown", "useGuestLang", "dueDays", "lang", "prefix", "suffix", "legalCompanyName", "title", "showLegalCompanyName", "includeRoomNumber", "useDocumentNumber", "isCompact", "taxId1", "taxId2", "cpf", "customText", "triggerEvents", "updateInvoiceOnLinkDocument", "useInvoiceDocumentSettings", "useInvoiceTitleAndNumbering"]

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of ConfigsResponse from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of ConfigsResponse from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "propertyId": obj.get("propertyId"),
            "documentKind": obj.get("documentKind"),
            "showDetailedTaxFee": obj.get("showDetailedTaxFee"),
            "showCreditNotesAndReceipts": obj.get("showCreditNotesAndReceipts"),
            "chargeBreakdown": obj.get("chargeBreakdown"),
            "useGuestLang": obj.get("useGuestLang"),
            "dueDays": obj.get("dueDays"),
            "lang": obj.get("lang"),
            "prefix": obj.get("prefix"),
            "suffix": obj.get("suffix"),
            "legalCompanyName": obj.get("legalCompanyName"),
            "title": obj.get("title"),
            "showLegalCompanyName": obj.get("showLegalCompanyName"),
            "includeRoomNumber": obj.get("includeRoomNumber"),
            "useDocumentNumber": obj.get("useDocumentNumber"),
            "isCompact": obj.get("isCompact"),
            "taxId1": obj.get("taxId1"),
            "taxId2": obj.get("taxId2"),
            "cpf": obj.get("cpf"),
            "customText": obj.get("customText"),
            "triggerEvents": obj.get("triggerEvents"),
            "updateInvoiceOnLinkDocument": obj.get("updateInvoiceOnLinkDocument") if obj.get("updateInvoiceOnLinkDocument") is not None else False,
            "useInvoiceDocumentSettings": obj.get("useInvoiceDocumentSettings") if obj.get("useInvoiceDocumentSettings") is not None else False,
            "useInvoiceTitleAndNumbering": obj.get("useInvoiceTitleAndNumbering") if obj.get("useInvoiceTitleAndNumbering") is not None else False
        })
        return _obj


