"""visaacceptancemergedspec.

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

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


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

    Attributes:
        address_1 (str): Payment card billing street address as it appears on the
            credit card issuer’s records.  #### SEPA Required for Create Mandate and
            Import Mandate  #### Atos This field must not contain colons (:).  ####
            Visa Acceptance through VisaNet **Important** When you populate
            orderInformation.billTo.address1 and orderInformation.billTo.address2,
            Visa Acceptance through VisaNet concatenates the two values. If the
            concatenated value exceeds 40 characters, Visa Acceptance through VisaNet
            truncates the value at 40 characters before sending it to Visa and the
            issuing bank. Truncating this value affects AVS results and therefore
            might also affect risk decisions and chargebacks. 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.  #### FDMS Nashville When the street name is
            numeric, it must be sent in numeric format. For example, if the address
            is _One First Street_, it must be sent as _1 1st Street_.  Required if
            keyed; not used if swiped.  String (20)  #### TSYS Acquiring Solutions
            Required when `processingInformation.billPaymentOptions.billPayment=true`
            and `pointOfSaleInformation.entryMode=keyed`.  #### All other processors:
            Optional. String (60)  #### For Payouts This field may be sent only for
            FDC Compass.  **Important** It is your responsibility to determine
            whether a field is required for the transaction you are requesting.
        address_2 (str): Used for additional address information. For example:
            _Attention: Accounts Payable_ Optional field.  For Payouts: This field
            may be sent only for FDC Compass.  #### Atos This field must not contain
            colons (:).  #### Visa Acceptance through VisaNet **Important** When you
            populate `orderInformation.billTo.address1` and
            `orderInformation.billTo.address2`, Visa Acceptance through VisaNet
            concatenates the two values. If the concatenated value exceeds 40
            characters, Visa Acceptance through VisaNet truncates the value at 40
            characters before sending it to Visa and the issuing bank. Truncating
            this value affects AVS results and therefore might also affect risk
            decisions and chargebacks. 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.  ####
            Chase Paymentech Solutions, FDC Compass, and TSYS Acquiring Solutions
            This value is used for AVS.  #### FDMS Nashville
            `orderInformation.billTo.address1` and `orderInformation.billTo.address2`
            together cannot exceed 20 characters. String (20)  #### All Other
            Processors String (60)
        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.  For example,
            if the street address is: Rua da Quitanda 187 then the building number is
            187.  This field is supported only for:  - Cielo transactions.  -
            Redecard customer validation with Visa Acceptance Latin American
            Processing.
        company (str): Company's Name, e.g. VISA
        country (str): Payment card billing country. Use the two-character [ISO
            Standard Country Codes](  #### SEPA/BACS Required for Create Mandate and
            Import Mandate  #### 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.  **Important** It is your responsibility to
            determine whether a field is required for the transaction you are
            requesting.  #### Chase Paymentech Solutions Optional field.  ####
            Credit Mutuel-CIC Optional field.  #### OmniPay Direct Optional field.
            #### SIX Optional field.  #### TSYS Acquiring Solutions Required when
            `processingInformation.billPaymentOptions.billPayment=true` and
            `pointOfSaleInformation.entryMode=keyed`.  #### Worldpay VAP Optional
            field.  #### All other processors Not used.
        county (str): U.S. county if available.
        district (str): Customer’s neighborhood, community, or region within the city
            or municipality.  #### SEPA/BACS When you include this field in a
            request, the value for this field must be the same as the value for the
            billTo_state field.
        email (str): Customer's email address, including the full domain name.  ####
            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.
            **Important** It is your responsibility to determine whether a field is
            required for the transaction you are requesting.  #### Invoicing Email
            address for the customer for sending the invoice. If the invoice is in
            SENT status and email is updated, the old email customer payment link
            won't work and you must resend the invoice with the new payment link.
            #### Chase Paymentech Solutions Optional field.  ####  Credit Mutuel-CIC
            Optional field.  #### OmniPay Direct Optional field.  #### SIX Optional
            field.  #### TSYS Acquiring Solutions Required when
            `processingInformation.billPaymentOptions.billPayment=true` and
            `pointOfSaleInformation.entryMode=keyed`.  #### Worldpay VAP Optional
            field.  #### All other processors Not used.
        first_name (str): Customer’s first name. This name must be the same as the
            name on the card.  **Important** It is your responsibility to determine
            whether a field is required for the transaction you are requesting.  ####
            SEPA Required for Create Mandate and Import Mandate #### BACS Required
            for Import Mandate  #### Visa Acceptance Latin American Processing
            **Important** For an authorization request, Visa Acceptance Latin
            American Processing concatenates `orderInformation.billTo.firstName` and
            `orderInformation.billTo.lastName`. If the concatenated value exceeds 30
            characters, Visa Acceptance Latin American Processing declines the
            authorization request.\ **Note** Visa Acceptance Latin American
            Processing is the name of a specific processing connection that Visa
            Acceptance supports. In the Visa Acceptance API documentation, Visa
            Acceptance Latin American Processing does not refer to the general topic
            of processing in Latin America. The information in this field description
            is for the specific processing connection called _Visa Acceptance Latin
            American Processing_. It is not for any other Latin American processors
            that Visa Acceptance supports.  #### 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.  #### Chase Paymentech Solutions Optional field.  ####
            Credit Mutuel-CIC Optional field.  #### OmniPay Direct Optional field.
            #### SIX Optional field.  #### TSYS Acquiring Solutions Required when
            `processingInformation.billPaymentOptions.billPayment=true` and
            `pointOfSaleInformation.entryMode=keyed`.  #### Worldpay VAP Optional
            field.  #### All other processors Not used.
        middle_name (str): Customer’s middle name.
        last_name (str): Customer’s last name. This name must be the same as the name
            on the card.  **Important** It is your responsibility to determine
            whether a field is required for the transaction you are requesting.  ####
            SEPA Required for Create Mandate and Import Mandate #### BACS Required
            for Import Mandate #### Chase Paymentech Solutions Optional field.  ####
            Credit Mutuel-CIC Optional field.  #### Visa Acceptance Latin American
            Processing **Important** For an authorization request, Visa Acceptance
            Latin American Processing concatenates
            `orderInformation.billTo.firstName` and
            `orderInformation.billTo.lastName`. If the concatenated value exceeds 30
            characters, Visa Acceptance Latin American Processing declines the
            authorization request.\ **Note** Visa Acceptance Latin American
            Processing is the name of a specific processing connection that Visa
            Acceptance supports. In the Visa Acceptance API documentation, Visa
            Acceptance Latin American Processing does not refer to the general topic
            of processing in Latin America. The information in this field description
            is for the specific processing connection called Visa Acceptance Latin
            American Processing. It is not for any other Latin American processors
            that Visa Acceptance supports.  #### 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.  #### RBS WorldPay
            Atlanta Optional field.  #### SIX Optional field.  #### TSYS Acquiring
            Solutions Required when
            `processingInformation.billPaymentOptions.billPayment=true` and
            `pointOfSaleInformation.entryMode=keyed`.  #### Worldpay VAP Optional
            field.  #### All other processors Not used.
        locality (str): Payment card billing city.  #### SEPA Required for Create
            Mandate and Import Mandate  #### Atos This field must not contain colons
            (:).  #### 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.
            #### Chase Paymentech Solutions Optional field.  ####  Credit Mutuel-CIC
            Optional field.  #### OmniPay Direct Optional field.  #### SIX Optional
            field.  #### TSYS Acquiring Solutions Required when
            `processingInformation.billPaymentOptions.billPayment=true` and
            `pointOfSaleInformation.entryMode=keyed`.  #### Worldpay VAP Optional
            field.  #### All other processors Not used.
        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.
        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`  **Important** It is your responsibility to determine whether a
            field is required for the transaction you are requesting.  #### SEPA
            Required for Create Mandate and Import Mandate  #### For Payouts:  This
            field may be sent only for FDC Compass.  #### American Express Direct
            Before sending the postal code to the processor, Visa Acceptance removes
            all nonalphanumeric characters and, if the remaining value is longer than
            nine characters, truncates the value starting from the right side.  ####
            Atos This field must not contain colons (:).  #### 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.  #### FDMS Nashville Required
            if `pointOfSaleInformation.entryMode=keyed` and the address is in the
            U.S. or Canada. Optional if `pointOfSaleInformation.entryMode=keyed` and
            the address is **not** in the U.S. or Canada. Not used if swiped.  ####
            RBS WorldPay Atlanta: For best card-present keyed rates, send the postal
            code if `pointOfSaleInformation.entryMode=keyed`.  #### TSYS Acquiring
            Solutions Required when
            `processingInformation.billPaymentOptions.billPayment=true` and
            `pointOfSaleInformation.entryMode=keyed`.  #### All other processors:
            Optional field.
        title (str): The model property of type str.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "address_1": "address1",
        "address_2": "address2",
        "administrative_area": "administrativeArea",
        "building_number": "buildingNumber",
        "company": "company",
        "country": "country",
        "county": "county",
        "district": "district",
        "email": "email",
        "first_name": "firstName",
        "middle_name": "middleName",
        "last_name": "lastName",
        "locality": "locality",
        "phone_number": "phoneNumber",
        "postal_code": "postalCode",
        "title": "title",
    }

    _optionals = [
        "address_1",
        "address_2",
        "administrative_area",
        "building_number",
        "company",
        "country",
        "county",
        "district",
        "email",
        "first_name",
        "middle_name",
        "last_name",
        "locality",
        "phone_number",
        "postal_code",
        "title",
    ]

    def __init__(
        self,
        address_1=APIHelper.SKIP,
        address_2=APIHelper.SKIP,
        administrative_area=APIHelper.SKIP,
        building_number=APIHelper.SKIP,
        company=APIHelper.SKIP,
        country=APIHelper.SKIP,
        county=APIHelper.SKIP,
        district=APIHelper.SKIP,
        email=APIHelper.SKIP,
        first_name=APIHelper.SKIP,
        middle_name=APIHelper.SKIP,
        last_name=APIHelper.SKIP,
        locality=APIHelper.SKIP,
        phone_number=APIHelper.SKIP,
        postal_code=APIHelper.SKIP,
        title=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a BillTo7 instance."""
        # Initialize members of the class
        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 administrative_area is not APIHelper.SKIP:
            self.administrative_area = administrative_area
        if building_number is not APIHelper.SKIP:
            self.building_number = building_number
        if company is not APIHelper.SKIP:
            self.company = company
        if country is not APIHelper.SKIP:
            self.country = country
        if county is not APIHelper.SKIP:
            self.county = county
        if district is not APIHelper.SKIP:
            self.district = district
        if email is not APIHelper.SKIP:
            self.email = email
        if first_name is not APIHelper.SKIP:
            self.first_name = first_name
        if middle_name is not APIHelper.SKIP:
            self.middle_name = middle_name
        if last_name is not APIHelper.SKIP:
            self.last_name = last_name
        if locality is not APIHelper.SKIP:
            self.locality = locality
        if phone_number is not APIHelper.SKIP:
            self.phone_number = phone_number
        if postal_code is not APIHelper.SKIP:
            self.postal_code = postal_code
        if title is not APIHelper.SKIP:
            self.title = title

        # 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
        address_1 =\
            dictionary.get("address1")\
            if dictionary.get("address1")\
                else APIHelper.SKIP
        address_2 =\
            dictionary.get("address2")\
            if dictionary.get("address2")\
                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
        company =\
            dictionary.get("company")\
            if dictionary.get("company")\
                else APIHelper.SKIP
        country =\
            dictionary.get("country")\
            if dictionary.get("country")\
                else APIHelper.SKIP
        county =\
            dictionary.get("county")\
            if dictionary.get("county")\
                else APIHelper.SKIP
        district =\
            dictionary.get("district")\
            if dictionary.get("district")\
                else APIHelper.SKIP
        email =\
            dictionary.get("email")\
            if dictionary.get("email")\
                else APIHelper.SKIP
        first_name =\
            dictionary.get("firstName")\
            if dictionary.get("firstName")\
                else APIHelper.SKIP
        middle_name =\
            dictionary.get("middleName")\
            if dictionary.get("middleName")\
                else APIHelper.SKIP
        last_name =\
            dictionary.get("lastName")\
            if dictionary.get("lastName")\
                else APIHelper.SKIP
        locality =\
            dictionary.get("locality")\
            if dictionary.get("locality")\
                else APIHelper.SKIP
        phone_number =\
            dictionary.get("phoneNumber")\
            if dictionary.get("phoneNumber")\
                else APIHelper.SKIP
        postal_code =\
            dictionary.get("postalCode")\
            if dictionary.get("postalCode")\
                else APIHelper.SKIP
        title =\
            dictionary.get("title")\
            if dictionary.get("title")\
                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(address_1,
                   address_2,
                   administrative_area,
                   building_number,
                   company,
                   country,
                   county,
                   district,
                   email,
                   first_name,
                   middle_name,
                   last_name,
                   locality,
                   phone_number,
                   postal_code,
                   title,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _address_1=(
            self.address_1
            if hasattr(self, "address_1")
            else None
        )
        _address_2=(
            self.address_2
            if hasattr(self, "address_2")
            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
        )
        _company=(
            self.company
            if hasattr(self, "company")
            else None
        )
        _country=(
            self.country
            if hasattr(self, "country")
            else None
        )
        _county=(
            self.county
            if hasattr(self, "county")
            else None
        )
        _district=(
            self.district
            if hasattr(self, "district")
            else None
        )
        _email=(
            self.email
            if hasattr(self, "email")
            else None
        )
        _first_name=(
            self.first_name
            if hasattr(self, "first_name")
            else None
        )
        _middle_name=(
            self.middle_name
            if hasattr(self, "middle_name")
            else None
        )
        _last_name=(
            self.last_name
            if hasattr(self, "last_name")
            else None
        )
        _locality=(
            self.locality
            if hasattr(self, "locality")
            else None
        )
        _phone_number=(
            self.phone_number
            if hasattr(self, "phone_number")
            else None
        )
        _postal_code=(
            self.postal_code
            if hasattr(self, "postal_code")
            else None
        )
        _title=(
            self.title
            if hasattr(self, "title")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"address_1={_address_1!r}, "
            f"address_2={_address_2!r}, "
            f"administrative_area={_administrative_area!r}, "
            f"building_number={_building_number!r}, "
            f"company={_company!r}, "
            f"country={_country!r}, "
            f"county={_county!r}, "
            f"district={_district!r}, "
            f"email={_email!r}, "
            f"first_name={_first_name!r}, "
            f"middle_name={_middle_name!r}, "
            f"last_name={_last_name!r}, "
            f"locality={_locality!r}, "
            f"phone_number={_phone_number!r}, "
            f"postal_code={_postal_code!r}, "
            f"title={_title!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _address_1=(
            self.address_1
            if hasattr(self, "address_1")
            else None
        )
        _address_2=(
            self.address_2
            if hasattr(self, "address_2")
            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
        )
        _company=(
            self.company
            if hasattr(self, "company")
            else None
        )
        _country=(
            self.country
            if hasattr(self, "country")
            else None
        )
        _county=(
            self.county
            if hasattr(self, "county")
            else None
        )
        _district=(
            self.district
            if hasattr(self, "district")
            else None
        )
        _email=(
            self.email
            if hasattr(self, "email")
            else None
        )
        _first_name=(
            self.first_name
            if hasattr(self, "first_name")
            else None
        )
        _middle_name=(
            self.middle_name
            if hasattr(self, "middle_name")
            else None
        )
        _last_name=(
            self.last_name
            if hasattr(self, "last_name")
            else None
        )
        _locality=(
            self.locality
            if hasattr(self, "locality")
            else None
        )
        _phone_number=(
            self.phone_number
            if hasattr(self, "phone_number")
            else None
        )
        _postal_code=(
            self.postal_code
            if hasattr(self, "postal_code")
            else None
        )
        _title=(
            self.title
            if hasattr(self, "title")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"address_1={_address_1!s}, "
            f"address_2={_address_2!s}, "
            f"administrative_area={_administrative_area!s}, "
            f"building_number={_building_number!s}, "
            f"company={_company!s}, "
            f"country={_country!s}, "
            f"county={_county!s}, "
            f"district={_district!s}, "
            f"email={_email!s}, "
            f"first_name={_first_name!s}, "
            f"middle_name={_middle_name!s}, "
            f"last_name={_last_name!s}, "
            f"locality={_locality!s}, "
            f"phone_number={_phone_number!s}, "
            f"postal_code={_postal_code!s}, "
            f"title={_title!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
