"""visaacceptancemergedspec.

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

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


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

    Attributes:
        first_name (str): The model property of type str.
        last_name (str): The model property of type str.
        address_1 (str): First line of the billing street address.
        address_2 (str): Second line of the billing street address.
        locality (str): City of the billing address.
        postal_code (str): Postal code for the billing address. The postal code must
            consist of 5 to 9 digits.  When the billing country is the U.S., the
            9-digit postal code must follow this format: [5 digits][dash][4 digits]
            Example: 12345-6789 When the billing country is Canada, the 6-digit
            postal code must follow this format: [alpha][numeric][alpha][space]
            [numeric][alpha][numeric] Example: A1B 2C3
        administrative_area (str): State or province of the billing address. Use the
            State, Province, and Territory Codes for the United States and Canada.
        country (str): Country of the billing address. Use the two-character ISO
            Standard Country Codes.
        email (str): Email address of the customer.
        alternate_phone_number_verification_status (str): #### Visa Platform Connect
            Contains one of the following values that will identify the phone number
            result code in the account verification response message:  'VERIFIED' -
            Customer verified  'UNVERIFIED' - Customer not verified  'FAILED' -
            Customer verification failed
        alternate_email_verification_status (str): #### Visa Platform Connect
            Contains one of the following values that will identify the phone number
            result code in the account verification response message:  'VERIFIED' -
            Customer verified  'UNVERIFIED' - Customer not verified  'FAILED' -
            Customer verification failed
        phone_number (str): Customer’s phone number.  It is recommended that you
            include the country code when the order is from outside the U.S.  ####
            Chase Paymentech Solutions Optional field.  ####  Credit Mutuel-CIC
            Optional field.  #### Visa Acceptance through VisaNet Credit card
            networks cannot process transactions that contain non-ASCII characters.
            Visa Acceptance through VisaNet accepts and stores non-ASCII characters
            correctly and displays them correctly in reports. However, the
            limitations of the credit card networks prevent Visa Acceptance through
            VisaNet from transmitting non-ASCII characters to the credit card
            networks. Therefore, Visa Acceptance through VisaNet replaces non-ASCII
            characters with meaningless ASCII characters for transmission to the
            credit card networks.  #### For Payouts: This field may be sent only for
            FDC Compass.  #### OmniPay Direct Optional field.  #### SIX Optional
            field.  #### TSYS Acquiring Solutions Optional field.  #### Worldpay VAP
            Optional field.  #### All other processors Not used.
        name_suffix (str): Customer’s name suffix.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "first_name": "firstName",
        "last_name": "lastName",
        "address_1": "address1",
        "address_2": "address2",
        "locality": "locality",
        "postal_code": "postalCode",
        "administrative_area": "administrativeArea",
        "country": "country",
        "email": "email",
        "alternate_phone_number_verification_status":
            "alternatePhoneNumberVerificationStatus",
        "alternate_email_verification_status": "alternateEmailVerificationStatus",
        "phone_number": "phoneNumber",
        "name_suffix": "nameSuffix",
    }

    _optionals = [
        "first_name",
        "last_name",
        "address_1",
        "address_2",
        "locality",
        "postal_code",
        "administrative_area",
        "country",
        "email",
        "alternate_phone_number_verification_status",
        "alternate_email_verification_status",
        "phone_number",
        "name_suffix",
    ]

    def __init__(
        self,
        first_name=APIHelper.SKIP,
        last_name=APIHelper.SKIP,
        address_1=APIHelper.SKIP,
        address_2=APIHelper.SKIP,
        locality=APIHelper.SKIP,
        postal_code=APIHelper.SKIP,
        administrative_area=APIHelper.SKIP,
        country=APIHelper.SKIP,
        email=APIHelper.SKIP,
        alternate_phone_number_verification_status=APIHelper.SKIP,
        alternate_email_verification_status=APIHelper.SKIP,
        phone_number=APIHelper.SKIP,
        name_suffix=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a BillTo1 instance."""
        # Initialize members of the class
        if first_name is not APIHelper.SKIP:
            self.first_name = first_name
        if last_name is not APIHelper.SKIP:
            self.last_name = last_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 locality is not APIHelper.SKIP:
            self.locality = locality
        if postal_code is not APIHelper.SKIP:
            self.postal_code = postal_code
        if administrative_area is not APIHelper.SKIP:
            self.administrative_area = administrative_area
        if country is not APIHelper.SKIP:
            self.country = country
        if email is not APIHelper.SKIP:
            self.email = email
        if alternate_phone_number_verification_status is not APIHelper.SKIP:
            self.alternate_phone_number_verification_status =\
                 alternate_phone_number_verification_status
        if alternate_email_verification_status is not APIHelper.SKIP:
            self.alternate_email_verification_status =\
                 alternate_email_verification_status
        if phone_number is not APIHelper.SKIP:
            self.phone_number = phone_number
        if name_suffix is not APIHelper.SKIP:
            self.name_suffix = name_suffix

        # 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
        first_name =\
            dictionary.get("firstName")\
            if dictionary.get("firstName")\
                else APIHelper.SKIP
        last_name =\
            dictionary.get("lastName")\
            if dictionary.get("lastName")\
                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
        locality =\
            dictionary.get("locality")\
            if dictionary.get("locality")\
                else APIHelper.SKIP
        postal_code =\
            dictionary.get("postalCode")\
            if dictionary.get("postalCode")\
                else APIHelper.SKIP
        administrative_area =\
            dictionary.get("administrativeArea")\
            if dictionary.get("administrativeArea")\
                else APIHelper.SKIP
        country =\
            dictionary.get("country")\
            if dictionary.get("country")\
                else APIHelper.SKIP
        email =\
            dictionary.get("email")\
            if dictionary.get("email")\
                else APIHelper.SKIP
        alternate_phone_number_verification_status =\
            dictionary.get("alternatePhoneNumberVerificationStatus")\
            if dictionary.get("alternatePhoneNumberVerificationStatus")\
                else APIHelper.SKIP
        alternate_email_verification_status =\
            dictionary.get("alternateEmailVerificationStatus")\
            if dictionary.get("alternateEmailVerificationStatus")\
                else APIHelper.SKIP
        phone_number =\
            dictionary.get("phoneNumber")\
            if dictionary.get("phoneNumber")\
                else APIHelper.SKIP
        name_suffix =\
            dictionary.get("nameSuffix")\
            if dictionary.get("nameSuffix")\
                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(first_name,
                   last_name,
                   address_1,
                   address_2,
                   locality,
                   postal_code,
                   administrative_area,
                   country,
                   email,
                   alternate_phone_number_verification_status,
                   alternate_email_verification_status,
                   phone_number,
                   name_suffix,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _first_name=(
            self.first_name
            if hasattr(self, "first_name")
            else None
        )
        _last_name=(
            self.last_name
            if hasattr(self, "last_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
        )
        _locality=(
            self.locality
            if hasattr(self, "locality")
            else None
        )
        _postal_code=(
            self.postal_code
            if hasattr(self, "postal_code")
            else None
        )
        _administrative_area=(
            self.administrative_area
            if hasattr(self, "administrative_area")
            else None
        )
        _country=(
            self.country
            if hasattr(self, "country")
            else None
        )
        _email=(
            self.email
            if hasattr(self, "email")
            else None
        )
        _alternate_phone_number_verification_status=(
            self.alternate_phone_number_verification_status
            if hasattr(self, "alternate_phone_number_verification_status")
            else None
        )
        _alternate_email_verification_status=(
            self.alternate_email_verification_status
            if hasattr(self, "alternate_email_verification_status")
            else None
        )
        _phone_number=(
            self.phone_number
            if hasattr(self, "phone_number")
            else None
        )
        _name_suffix=(
            self.name_suffix
            if hasattr(self, "name_suffix")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"first_name={_first_name!r}, "
            f"last_name={_last_name!r}, "
            f"address_1={_address_1!r}, "
            f"address_2={_address_2!r}, "
            f"locality={_locality!r}, "
            f"postal_code={_postal_code!r}, "
            f"administrative_area={_administrative_area!r}, "
            f"country={_country!r}, "
            f"email={_email!r}, "
            f"alternate_phone_number_verification_status={_alternate_phone_number_verification_status!r}, "
            f"alternate_email_verification_status={_alternate_email_verification_status!r}, "
            f"phone_number={_phone_number!r}, "
            f"name_suffix={_name_suffix!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _first_name=(
            self.first_name
            if hasattr(self, "first_name")
            else None
        )
        _last_name=(
            self.last_name
            if hasattr(self, "last_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
        )
        _locality=(
            self.locality
            if hasattr(self, "locality")
            else None
        )
        _postal_code=(
            self.postal_code
            if hasattr(self, "postal_code")
            else None
        )
        _administrative_area=(
            self.administrative_area
            if hasattr(self, "administrative_area")
            else None
        )
        _country=(
            self.country
            if hasattr(self, "country")
            else None
        )
        _email=(
            self.email
            if hasattr(self, "email")
            else None
        )
        _alternate_phone_number_verification_status=(
            self.alternate_phone_number_verification_status
            if hasattr(self, "alternate_phone_number_verification_status")
            else None
        )
        _alternate_email_verification_status=(
            self.alternate_email_verification_status
            if hasattr(self, "alternate_email_verification_status")
            else None
        )
        _phone_number=(
            self.phone_number
            if hasattr(self, "phone_number")
            else None
        )
        _name_suffix=(
            self.name_suffix
            if hasattr(self, "name_suffix")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"first_name={_first_name!s}, "
            f"last_name={_last_name!s}, "
            f"address_1={_address_1!s}, "
            f"address_2={_address_2!s}, "
            f"locality={_locality!s}, "
            f"postal_code={_postal_code!s}, "
            f"administrative_area={_administrative_area!s}, "
            f"country={_country!s}, "
            f"email={_email!s}, "
            f"alternate_phone_number_verification_status={_alternate_phone_number_verification_status!s}, "
            f"alternate_email_verification_status={_alternate_email_verification_status!s}, "
            f"phone_number={_phone_number!s}, "
            f"name_suffix={_name_suffix!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
