"""visaacceptancemergedspec.

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

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


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

    Attributes:
        terminal_id (str): Identifier for the terminal at your retail location. You
            can define this value yourself, but consult the processor for
            requirements.  #### Visa Acceptance through VisaNet A list of all
            possible values is stored in your Visa Acceptance account. If terminal ID
            validation is enabled for your Visa Acceptance account, the value you
            send for this field is validated against the list each time you include
            the field in a request. To enable or disable terminal ID validation,
            contact Visa Acceptance Customer Support.  When you do not include this
            field in a request, Visa Acceptance uses the default value that is
            defined in your Visa Acceptance account.  #### FDC Nashville Global To
            have your account configured to support this field, contact Visa
            Acceptance Customer Support. This value must be a value that FDC
            Nashville Global issued to you.  #### For Payouts This field is
            applicable for Visa Acceptance through VisaNet.  #### GPX Identifier for
            the terminal at your retail location. A list of all possible values is
            stored in your account. If terminal ID validation is enabled for your
            account, the value you send for this field is validated against the list
            each time you include the field in a request. To enable or disable
            terminal ID validation, contact customer support.  When you do not
            include this field in a request, the default value that is defined in
            your account is used.  Optional for authorizations.  #### Used by
            **Authorization** Optional for the following processors. When you do not
            include this field in a request, the default value that is defined in
            your account is used.   - American Express Direct   - Credit Mutuel-CIC
            - FDC Nashville Global   - SIX - Chase Paymentech Solutions: Optional
            field. If you include this field in your request, you must also include
            `pointOfSaleInformation.catLevel`. - FDMS Nashville: The default value
            that is defined in your account is used. - GPX - OmniPay Direct: Optional
            field.  For the following processors, this field is not used. - GPN - JCN
            Gateway - RBS WorldPay Atlanta - TSYS Acquiring Solutions - Worldpay VAP
            #### Card Present reply Terminal identifier assigned by the acquirer.
            This value must be printed on the receipt.
        entry_mode (str): Method of entering payment card information into the POS
            terminal. Possible values:   - `contact`: Read from direct contact with
            chip card.  - `contactless`: Read from a contactless interface using chip
            data.  - `keyed`: Manually keyed into POS terminal. This value is not
            supported on OmniPay Direct.  - `msd`: Read from a contactless interface
            using magnetic stripe data (MSD). This value is not supported on OmniPay
            Direct.  - `swiped`: Read from credit card magnetic stripe.  The
            `contact`, `contactless`, and `msd` values are supported only for EMV
            transactions.  #### Used by **Authorization** Required field.  #### Card
            Present Card present information about EMV applies only to credit card
            processing and PIN debit processing. All other card present information
            applies only to credit card processing.  #### PIN debit Required for a
            PIN debit purchase and a PIN debit credit request.
        terminal_capability (int): POS terminal’s capability. Possible values:   -
            `1`: Terminal has a magnetic stripe reader only.  - `2`: Terminal has a
            magnetic stripe reader and manual entry capability.  - `3`: Terminal has
            manual entry capability only.  - `4`: Terminal can read chip cards.  -
            `5`: Terminal can read contactless chip cards; cannot use contact to read
            chip cards.  For an EMV transaction, the value of this field must be `4`
            or `5`.  #### PIN debit Required for PIN debit purchase and PIN debit
            credit request.  #### Used by **Authorization** Required for the
            following processors: - American Express Direct - Chase Paymentech
            Solutions - Credit Mutuel-CIC - FDC Nashville Global - FDMS Nashville -
            OmniPay Direct - SIX - Worldpay VAP  Optional for the following
            processors: - Visa Acceptance through VisaNet - GPN - GPX - JCN Gateway -
            RBS WorldPay Atlanta - TSYS Acquiring Solutions
        cardholder_verification_method_used (int): Method that was used to verify the
            cardholder's identity. Possible values:    - `0`: No verification   -
            `1`: Signature   - `2`: PIN   - `3`: Cardholder device CVM   - `4`:
            Biometric   - `5`: OTP
        emv (Emv2): The model property of type Emv2.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "terminal_id": "terminalId",
        "entry_mode": "entryMode",
        "terminal_capability": "terminalCapability",
        "cardholder_verification_method_used": "cardholderVerificationMethodUsed",
        "emv": "emv",
    }

    _optionals = [
        "terminal_id",
        "entry_mode",
        "terminal_capability",
        "cardholder_verification_method_used",
        "emv",
    ]

    def __init__(
        self,
        terminal_id=APIHelper.SKIP,
        entry_mode=APIHelper.SKIP,
        terminal_capability=APIHelper.SKIP,
        cardholder_verification_method_used=APIHelper.SKIP,
        emv=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a PointOfSaleInformation14 instance."""
        # Initialize members of the class
        if terminal_id is not APIHelper.SKIP:
            self.terminal_id = terminal_id
        if entry_mode is not APIHelper.SKIP:
            self.entry_mode = entry_mode
        if terminal_capability is not APIHelper.SKIP:
            self.terminal_capability = terminal_capability
        if cardholder_verification_method_used is not APIHelper.SKIP:
            self.cardholder_verification_method_used =\
                 cardholder_verification_method_used
        if emv is not APIHelper.SKIP:
            self.emv = emv

        # 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
        terminal_id =\
            dictionary.get("terminalId")\
            if dictionary.get("terminalId")\
                else APIHelper.SKIP
        entry_mode =\
            dictionary.get("entryMode")\
            if dictionary.get("entryMode")\
                else APIHelper.SKIP
        terminal_capability =\
            dictionary.get("terminalCapability")\
            if dictionary.get("terminalCapability")\
                else APIHelper.SKIP
        cardholder_verification_method_used =\
            dictionary.get("cardholderVerificationMethodUsed")\
            if dictionary.get("cardholderVerificationMethodUsed")\
                else APIHelper.SKIP
        emv =\
            Emv2.from_dictionary(
                dictionary.get("emv"))\
                if "emv" in dictionary.keys()\
                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(terminal_id,
                   entry_mode,
                   terminal_capability,
                   cardholder_verification_method_used,
                   emv,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _terminal_id=(
            self.terminal_id
            if hasattr(self, "terminal_id")
            else None
        )
        _entry_mode=(
            self.entry_mode
            if hasattr(self, "entry_mode")
            else None
        )
        _terminal_capability=(
            self.terminal_capability
            if hasattr(self, "terminal_capability")
            else None
        )
        _cardholder_verification_method_used=(
            self.cardholder_verification_method_used
            if hasattr(self, "cardholder_verification_method_used")
            else None
        )
        _emv=(
            self.emv
            if hasattr(self, "emv")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"terminal_id={_terminal_id!r}, "
            f"entry_mode={_entry_mode!r}, "
            f"terminal_capability={_terminal_capability!r}, "
            f"cardholder_verification_method_used={_cardholder_verification_method_used!r}, "
            f"emv={_emv!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _terminal_id=(
            self.terminal_id
            if hasattr(self, "terminal_id")
            else None
        )
        _entry_mode=(
            self.entry_mode
            if hasattr(self, "entry_mode")
            else None
        )
        _terminal_capability=(
            self.terminal_capability
            if hasattr(self, "terminal_capability")
            else None
        )
        _cardholder_verification_method_used=(
            self.cardholder_verification_method_used
            if hasattr(self, "cardholder_verification_method_used")
            else None
        )
        _emv=(
            self.emv
            if hasattr(self, "emv")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"terminal_id={_terminal_id!s}, "
            f"entry_mode={_entry_mode!s}, "
            f"terminal_capability={_terminal_capability!s}, "
            f"cardholder_verification_method_used={_cardholder_verification_method_used!s}, "
            f"emv={_emv!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
