"""visaacceptancemergedspec.

This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
"""

# ruff: noqa: E501
from visaacceptancemergedspec.api_helper import (
    APIHelper,
)


class Company5(object):
    """Implementation of the 'Company5' model.

    Attributes:
        name (str): Name of the customer’s company.
        address_1 (str): Payment card billing street address as it appears on the
            credit card issuer’s records.
        address_2 (str): Used for additional address information. For example:
            _Attention: Accounts Payable_ Optional field.
        address_3 (str): Additional address information (third line of the billing
            address)
        address_4 (str): Additional address information (fourth line of the billing
            address)
        administrative_area (str): State or province of the billing address. Use the
            [State, Province, and Territory Codes for the United States and Canada](
        building_number (str): Building number in the street address.
        country (str): Payment card billing country. Use the two-character [ISO
            Standard Country Codes](
        district (str): Customer’s neighborhood, community, or region (a barrio in
            Brazil) within the city or municipality
        locality (str): Payment card billing city.
        postal_code (str): Postal code for the billing address. The postal code must
            consist of 5 to 9 digits.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "name": "name",
        "address_1": "address1",
        "address_2": "address2",
        "address_3": "address3",
        "address_4": "address4",
        "administrative_area": "administrativeArea",
        "building_number": "buildingNumber",
        "country": "country",
        "district": "district",
        "locality": "locality",
        "postal_code": "postalCode",
    }

    _optionals = [
        "name",
        "address_1",
        "address_2",
        "address_3",
        "address_4",
        "administrative_area",
        "building_number",
        "country",
        "district",
        "locality",
        "postal_code",
    ]

    def __init__(
        self,
        name=APIHelper.SKIP,
        address_1=APIHelper.SKIP,
        address_2=APIHelper.SKIP,
        address_3=APIHelper.SKIP,
        address_4=APIHelper.SKIP,
        administrative_area=APIHelper.SKIP,
        building_number=APIHelper.SKIP,
        country=APIHelper.SKIP,
        district=APIHelper.SKIP,
        locality=APIHelper.SKIP,
        postal_code=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a Company5 instance."""
        # Initialize members of the class
        if name is not APIHelper.SKIP:
            self.name = name
        if address_1 is not APIHelper.SKIP:
            self.address_1 = address_1
        if address_2 is not APIHelper.SKIP:
            self.address_2 = address_2
        if address_3 is not APIHelper.SKIP:
            self.address_3 = address_3
        if address_4 is not APIHelper.SKIP:
            self.address_4 = address_4
        if administrative_area is not APIHelper.SKIP:
            self.administrative_area = administrative_area
        if building_number is not APIHelper.SKIP:
            self.building_number = building_number
        if country is not APIHelper.SKIP:
            self.country = country
        if district is not APIHelper.SKIP:
            self.district = district
        if locality is not APIHelper.SKIP:
            self.locality = locality
        if postal_code is not APIHelper.SKIP:
            self.postal_code = postal_code

        # Add additional model properties to the instance
        if additional_properties is None:
            additional_properties = {}
        self.additional_properties = additional_properties

    @classmethod
    def from_dictionary(cls,
                        dictionary):
        """Create an instance of this model from a dictionary

        Args:
            dictionary (dictionary): A dictionary representation of the object
            as obtained from the deserialization of the server's response. The
            keys MUST match property names in the API description.

        Returns:
            object: An instance of this structure class.

        """
        if not isinstance(dictionary, dict) or dictionary is None:
            return None

        # Extract variables from the dictionary
        name =\
            dictionary.get("name")\
            if dictionary.get("name")\
                else APIHelper.SKIP
        address_1 =\
            dictionary.get("address1")\
            if dictionary.get("address1")\
                else APIHelper.SKIP
        address_2 =\
            dictionary.get("address2")\
            if dictionary.get("address2")\
                else APIHelper.SKIP
        address_3 =\
            dictionary.get("address3")\
            if dictionary.get("address3")\
                else APIHelper.SKIP
        address_4 =\
            dictionary.get("address4")\
            if dictionary.get("address4")\
                else APIHelper.SKIP
        administrative_area =\
            dictionary.get("administrativeArea")\
            if dictionary.get("administrativeArea")\
                else APIHelper.SKIP
        building_number =\
            dictionary.get("buildingNumber")\
            if dictionary.get("buildingNumber")\
                else APIHelper.SKIP
        country =\
            dictionary.get("country")\
            if dictionary.get("country")\
                else APIHelper.SKIP
        district =\
            dictionary.get("district")\
            if dictionary.get("district")\
                else APIHelper.SKIP
        locality =\
            dictionary.get("locality")\
            if dictionary.get("locality")\
                else APIHelper.SKIP
        postal_code =\
            dictionary.get("postalCode")\
            if dictionary.get("postalCode")\
                else APIHelper.SKIP

        additional_properties = APIHelper.get_additional_properties(
            dictionary={k: v for k, v in dictionary.items()
                        if k not in cls._names.values()},
            unboxing_function=lambda value: value)

        # Return an object of this model
        return cls(name,
                   address_1,
                   address_2,
                   address_3,
                   address_4,
                   administrative_area,
                   building_number,
                   country,
                   district,
                   locality,
                   postal_code,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _name=(
            self.name
            if hasattr(self, "name")
            else None
        )
        _address_1=(
            self.address_1
            if hasattr(self, "address_1")
            else None
        )
        _address_2=(
            self.address_2
            if hasattr(self, "address_2")
            else None
        )
        _address_3=(
            self.address_3
            if hasattr(self, "address_3")
            else None
        )
        _address_4=(
            self.address_4
            if hasattr(self, "address_4")
            else None
        )
        _administrative_area=(
            self.administrative_area
            if hasattr(self, "administrative_area")
            else None
        )
        _building_number=(
            self.building_number
            if hasattr(self, "building_number")
            else None
        )
        _country=(
            self.country
            if hasattr(self, "country")
            else None
        )
        _district=(
            self.district
            if hasattr(self, "district")
            else None
        )
        _locality=(
            self.locality
            if hasattr(self, "locality")
            else None
        )
        _postal_code=(
            self.postal_code
            if hasattr(self, "postal_code")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"name={_name!r}, "
            f"address_1={_address_1!r}, "
            f"address_2={_address_2!r}, "
            f"address_3={_address_3!r}, "
            f"address_4={_address_4!r}, "
            f"administrative_area={_administrative_area!r}, "
            f"building_number={_building_number!r}, "
            f"country={_country!r}, "
            f"district={_district!r}, "
            f"locality={_locality!r}, "
            f"postal_code={_postal_code!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _name=(
            self.name
            if hasattr(self, "name")
            else None
        )
        _address_1=(
            self.address_1
            if hasattr(self, "address_1")
            else None
        )
        _address_2=(
            self.address_2
            if hasattr(self, "address_2")
            else None
        )
        _address_3=(
            self.address_3
            if hasattr(self, "address_3")
            else None
        )
        _address_4=(
            self.address_4
            if hasattr(self, "address_4")
            else None
        )
        _administrative_area=(
            self.administrative_area
            if hasattr(self, "administrative_area")
            else None
        )
        _building_number=(
            self.building_number
            if hasattr(self, "building_number")
            else None
        )
        _country=(
            self.country
            if hasattr(self, "country")
            else None
        )
        _district=(
            self.district
            if hasattr(self, "district")
            else None
        )
        _locality=(
            self.locality
            if hasattr(self, "locality")
            else None
        )
        _postal_code=(
            self.postal_code
            if hasattr(self, "postal_code")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"name={_name!s}, "
            f"address_1={_address_1!s}, "
            f"address_2={_address_2!s}, "
            f"address_3={_address_3!s}, "
            f"address_4={_address_4!s}, "
            f"administrative_area={_administrative_area!s}, "
            f"building_number={_building_number!s}, "
            f"country={_country!s}, "
            f"district={_district!s}, "
            f"locality={_locality!s}, "
            f"postal_code={_postal_code!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
