"""visaacceptancemergedspec.

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

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


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

    Attributes:
        name (str): Your merchant name.  **Note** For Paymentech processor using Visa
            Acceptance Payouts, the maximum data length is 22.  #### PIN debit Your
            business name. This name is displayed on the cardholder’s statement. When
            you include more than one consecutive space, extra spaces are removed.
            When you do not include this value in your PIN debit request, the
            merchant name from your account is used. **Important** This value must
            consist of English characters.  Optional field for PIN debit credit or
            PIN debit purchase requests.  #### Airline processing Your merchant name.
            This name is displayed on the cardholder’s statement. When you include
            more than one consecutive space, extra spaces are removed.  **Note** Some
            airline fee programs may require the original ticket number (ticket
            identifier) or the ancillary service description in positions 13 through
            23 of this field.  **Important** This value must consist of English
            characters.  Required for captures and credits.
        alternate_name (str): An alternate name for the merchant.
        contact (str): Contact information for the merchant.  **Note** These are the
            maximum data lengths for the following payment processors: - FDCCompass
            (13) - Paymentech (13)
        address_1 (str): First line of merchant's address.
        locality (str): Merchant's City.  #### PIN debit City for your business
            location. This value might be displayed on the cardholder’s statement.
            When you do not include this value in your PIN debit request, the
            merchant name from your account is used. **Important** This value must
            consist of English characters.  Optional field for PIN debit credit or
            PIN debit purchase requests.
        country (str): Merchant's country.  #### PIN debit Country code for your
            business location. Use the [ISO Standard Country Codes]( This value might
            be displayed on the cardholder’s statement.  When you do not include this
            value in your PIN debit request, the merchant name from your account is
            used. **Important** This value must consist of English characters.
            **Note** If your business is located in the U.S. or Canada and you
            include this field in a request, you must also include
            `merchantInformation.merchantDescriptor.administrativeArea`.  Optional
            field for PIN debit credit or PIN debit purchase.
        postal_code (str): Merchant's postal code.  #### PIN debit Postal code for
            your business location. This value might be displayed on the cardholder’s
            statement.  If your business is domiciled in the U.S., you can use a
            5-digit or 9-digit postal code. A 9-digit postal code must follow this
            format: [5 digits][dash][4 digits] Example: `12345-6789`  If your
            business is domiciled in Canada, you can use a 6-digit or 9-digit postal
            code. A 6-digit postal code must follow this format:
            [alpha][numeric][alpha][space] [numeric][alpha][numeric] Example: `A1B
            2C3`  When you do not include this value in your PIN debit request, the
            merchant name from your account is used. **Important** This value must
            consist of English characters.  **Note** This field is supported only for
            businesses located in the U.S. or Canada. **Important** Mastercard
            requires a postal code for any country that uses postal codes. You can
            provide the postal code in your account or you can include this field in
            your request.  Optional field for PIN debit credit or PIN debit purchase.
        administrative_area (str): The state where the merchant is located.  #### PIN
            debit State code or region code for your business. Use the Use the
            [State, Province, and Territory Codes for the United States and Canada](
            This value might be displayed on the cardholder’s statement.  When you do
            not include this value in your PIN debit request, the merchant name from
            your account is used. **Important** This value must consist of English
            characters.  **Note** This field is supported only for businesses located
            in the U.S. or Canada.  Optional field for PIN debit credit or PIN debit
            purchase.
        phone (str): Merchant phone as contact information for CNP transactions
        url (str): Address of company's website provided by merchant
        country_of_origin (str): #### Visa Platform Connect This field will indicate
            merchant country of origin
        store_id (str): The identifier of the store.
        store_name (str): The name of the store.
        customer_service_phone_number (str): #### Visa Platform Connect Indicates
            customer service phone number of Merchant.
        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",
        "alternate_name": "alternateName",
        "contact": "contact",
        "address_1": "address1",
        "locality": "locality",
        "country": "country",
        "postal_code": "postalCode",
        "administrative_area": "administrativeArea",
        "phone": "phone",
        "url": "url",
        "country_of_origin": "countryOfOrigin",
        "store_id": "storeId",
        "store_name": "storeName",
        "customer_service_phone_number": "customerServicePhoneNumber",
    }

    _optionals = [
        "name",
        "alternate_name",
        "contact",
        "address_1",
        "locality",
        "country",
        "postal_code",
        "administrative_area",
        "phone",
        "url",
        "country_of_origin",
        "store_id",
        "store_name",
        "customer_service_phone_number",
    ]

    def __init__(
        self,
        name=APIHelper.SKIP,
        alternate_name=APIHelper.SKIP,
        contact=APIHelper.SKIP,
        address_1=APIHelper.SKIP,
        locality=APIHelper.SKIP,
        country=APIHelper.SKIP,
        postal_code=APIHelper.SKIP,
        administrative_area=APIHelper.SKIP,
        phone=APIHelper.SKIP,
        url=APIHelper.SKIP,
        country_of_origin=APIHelper.SKIP,
        store_id=APIHelper.SKIP,
        store_name=APIHelper.SKIP,
        customer_service_phone_number=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a MerchantDescriptor instance."""
        # Initialize members of the class
        if name is not APIHelper.SKIP:
            self.name = name
        if alternate_name is not APIHelper.SKIP:
            self.alternate_name = alternate_name
        if contact is not APIHelper.SKIP:
            self.contact = contact
        if address_1 is not APIHelper.SKIP:
            self.address_1 = address_1
        if locality is not APIHelper.SKIP:
            self.locality = locality
        if country is not APIHelper.SKIP:
            self.country = country
        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 phone is not APIHelper.SKIP:
            self.phone = phone
        if url is not APIHelper.SKIP:
            self.url = url
        if country_of_origin is not APIHelper.SKIP:
            self.country_of_origin = country_of_origin
        if store_id is not APIHelper.SKIP:
            self.store_id = store_id
        if store_name is not APIHelper.SKIP:
            self.store_name = store_name
        if customer_service_phone_number is not APIHelper.SKIP:
            self.customer_service_phone_number = customer_service_phone_number

        # 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
        alternate_name =\
            dictionary.get("alternateName")\
            if dictionary.get("alternateName")\
                else APIHelper.SKIP
        contact =\
            dictionary.get("contact")\
            if dictionary.get("contact")\
                else APIHelper.SKIP
        address_1 =\
            dictionary.get("address1")\
            if dictionary.get("address1")\
                else APIHelper.SKIP
        locality =\
            dictionary.get("locality")\
            if dictionary.get("locality")\
                else APIHelper.SKIP
        country =\
            dictionary.get("country")\
            if dictionary.get("country")\
                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
        phone =\
            dictionary.get("phone")\
            if dictionary.get("phone")\
                else APIHelper.SKIP
        url =\
            dictionary.get("url")\
            if dictionary.get("url")\
                else APIHelper.SKIP
        country_of_origin =\
            dictionary.get("countryOfOrigin")\
            if dictionary.get("countryOfOrigin")\
                else APIHelper.SKIP
        store_id =\
            dictionary.get("storeId")\
            if dictionary.get("storeId")\
                else APIHelper.SKIP
        store_name =\
            dictionary.get("storeName")\
            if dictionary.get("storeName")\
                else APIHelper.SKIP
        customer_service_phone_number =\
            dictionary.get("customerServicePhoneNumber")\
            if dictionary.get("customerServicePhoneNumber")\
                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,
                   alternate_name,
                   contact,
                   address_1,
                   locality,
                   country,
                   postal_code,
                   administrative_area,
                   phone,
                   url,
                   country_of_origin,
                   store_id,
                   store_name,
                   customer_service_phone_number,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _name=(
            self.name
            if hasattr(self, "name")
            else None
        )
        _alternate_name=(
            self.alternate_name
            if hasattr(self, "alternate_name")
            else None
        )
        _contact=(
            self.contact
            if hasattr(self, "contact")
            else None
        )
        _address_1=(
            self.address_1
            if hasattr(self, "address_1")
            else None
        )
        _locality=(
            self.locality
            if hasattr(self, "locality")
            else None
        )
        _country=(
            self.country
            if hasattr(self, "country")
            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
        )
        _phone=(
            self.phone
            if hasattr(self, "phone")
            else None
        )
        _url=(
            self.url
            if hasattr(self, "url")
            else None
        )
        _country_of_origin=(
            self.country_of_origin
            if hasattr(self, "country_of_origin")
            else None
        )
        _store_id=(
            self.store_id
            if hasattr(self, "store_id")
            else None
        )
        _store_name=(
            self.store_name
            if hasattr(self, "store_name")
            else None
        )
        _customer_service_phone_number=(
            self.customer_service_phone_number
            if hasattr(self, "customer_service_phone_number")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"name={_name!r}, "
            f"alternate_name={_alternate_name!r}, "
            f"contact={_contact!r}, "
            f"address_1={_address_1!r}, "
            f"locality={_locality!r}, "
            f"country={_country!r}, "
            f"postal_code={_postal_code!r}, "
            f"administrative_area={_administrative_area!r}, "
            f"phone={_phone!r}, "
            f"url={_url!r}, "
            f"country_of_origin={_country_of_origin!r}, "
            f"store_id={_store_id!r}, "
            f"store_name={_store_name!r}, "
            f"customer_service_phone_number={_customer_service_phone_number!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
        )
        _alternate_name=(
            self.alternate_name
            if hasattr(self, "alternate_name")
            else None
        )
        _contact=(
            self.contact
            if hasattr(self, "contact")
            else None
        )
        _address_1=(
            self.address_1
            if hasattr(self, "address_1")
            else None
        )
        _locality=(
            self.locality
            if hasattr(self, "locality")
            else None
        )
        _country=(
            self.country
            if hasattr(self, "country")
            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
        )
        _phone=(
            self.phone
            if hasattr(self, "phone")
            else None
        )
        _url=(
            self.url
            if hasattr(self, "url")
            else None
        )
        _country_of_origin=(
            self.country_of_origin
            if hasattr(self, "country_of_origin")
            else None
        )
        _store_id=(
            self.store_id
            if hasattr(self, "store_id")
            else None
        )
        _store_name=(
            self.store_name
            if hasattr(self, "store_name")
            else None
        )
        _customer_service_phone_number=(
            self.customer_service_phone_number
            if hasattr(self, "customer_service_phone_number")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"name={_name!s}, "
            f"alternate_name={_alternate_name!s}, "
            f"contact={_contact!s}, "
            f"address_1={_address_1!s}, "
            f"locality={_locality!s}, "
            f"country={_country!s}, "
            f"postal_code={_postal_code!s}, "
            f"administrative_area={_administrative_area!s}, "
            f"phone={_phone!s}, "
            f"url={_url!s}, "
            f"country_of_origin={_country_of_origin!s}, "
            f"store_id={_store_id!s}, "
            f"store_name={_store_name!s}, "
            f"customer_service_phone_number={_customer_service_phone_number!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
