# coding: utf-8

"""
    Conekta API

    Conekta sdk

    The version of the OpenAPI document: 2.2.0
    Contact: engineering@conekta.com
    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, StrictBytes, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List, Optional, Union
from typing import Optional, Set
from typing_extensions import Self

class CompanyDocumentRequest(BaseModel):
    """
    Request body for uploading a company document.
    """ # noqa: E501
    file_classification: StrictStr = Field(description="Classification of the document.  | Tipo de archivo              | Descripción                                               | | :--------------------------- | :-------------------------------------------------------- | | `id_legal_representative`      | identificación oficial frente                             | | `id_legal_representative_back` | identificación oficial atrás                              | | `cfdi`                         | Prueba de situación fiscal                                | | `constitutive_act_basic`       | Acta constitutiva                                         | | `proof_of_address`             | Comprobante de domicilio del negocio                      | | `power_of_attonery`            | Poderes de representación                                 | | `deposit_account_cover`        | Carátula de la cuenta de depósito                         | | `permit_casino`                | Permiso ante SEGOB                                        | | `license_sanitation`           | Licencia sanitaria de COFEPRIS                            | | `registration_tourism`         | Inscripción ante el Registro Nacional de Turismo (SECTUR) | ")
    content_type: StrictStr = Field(description="MIME type of the file. Allowed values depend on the `file_classification`. - `image/jpeg` - `image/png` - `application/pdf` ")
    international: Optional[StrictBool] = Field(default=None, description="Indicates if the document is international. Defaults to false.")
    file_name: StrictStr = Field(description="Name of the file being uploaded.")
    file_data: Union[StrictBytes, StrictStr] = Field(description="Base64 encoded content of the file.")
    __properties: ClassVar[List[str]] = ["file_classification", "content_type", "international", "file_name", "file_data"]

    @field_validator('file_classification')
    def file_classification_validate_enum(cls, value):
        """Validates the enum"""
        if value not in set(['id_legal_representative', 'id_legal_representative_back', 'cfdi', 'constitutive_act_basic', 'proof_of_address', 'power_of_attonery', 'deposit_account_cover', 'permit_casino', 'license_sanitation', 'registration_tourism']):
            raise ValueError("must be one of enum values ('id_legal_representative', 'id_legal_representative_back', 'cfdi', 'constitutive_act_basic', 'proof_of_address', 'power_of_attonery', 'deposit_account_cover', 'permit_casino', 'license_sanitation', 'registration_tourism')")
        return value

    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 CompanyDocumentRequest 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 CompanyDocumentRequest from a dict"""
        if obj is None:
            return None

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

        _obj = cls.model_validate({
            "file_classification": obj.get("file_classification"),
            "content_type": obj.get("content_type"),
            "international": obj.get("international"),
            "file_name": obj.get("file_name"),
            "file_data": obj.get("file_data")
        })
        return _obj


