"""visaacceptancemergedspec.

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

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


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

    Attributes:
        commerce_indicator (str): Type of transaction. Used to determine fees based
            on channel.  Possible values:    - aesk: American Express SafeKey
            authentication was successful.   - aesk_attempted: American Express
            SafeKey authentication was attempted but did not succeed. • install:
            Installment payment.   - install_internet: Non-U.S. e-commerce (Internet)
            installment payment. This value is supported only on Visa Platform
            Connect.   - internet (default for authorizations): E-commerce order
            placed using a web site.   - js: JCB J/Secure authentication was
            successful.   - js_attempted: JCB J/Secure authentication was attempted
            but did not succeed.   - moto: Mail order or telephone order.   -
            moto_cc: Mail order or telephone order from a call center. This value is
            supported only on the Asia, Middle East, and Africa Gateway.   - pb:
            ProtectBuy authentication was successful.   - pb_attempted: ProtectBuy
            authentication was attempted but did not succeed.   - recurring:
            Recurring payment that is a U.S. transaction or non-U.S. mail order /
            telephone order (MOTO) transaction.   - recurring_internet: Recurring
            payment that is a non-U.S. e-commerce (Internet) transaction.   - retail:
            Card-present transaction.   - spa: For Mastercard Identity Check:
            Authentication was successful or was attempted but did not succeed. The
            e-commerce indicator for all Mastercard Identity Check transactions,
            including authentication attempts, must be set to spa.   - spa_attempted:
            Authentication for a co-badged Mastercard and Cartes Bancaires card was
            attempted but did not succeed.   - spa_failure: – For Mastercard Identity
            Check: Authentication failed. This value is supported only on Elavon,
            HSBC, and Streamline.   - vbv: – For Visa Secure: Authentication was
            successful.   - vbv_attempted: – For Visa Secure: Authentication was
            attempted but did not succeed.   - vbv_failure: – For Visa Secure:
            Authentication failed. This value is supported only on HSBC and
            Streamline.
        action_list (List[str]): - Use `CONSUMER_AUTHENTICATION` to use Payer
            Authentication along with Decision Manager. For any other value, only
            Decision Manager will run. - Use `WATCHLIST_SCREENING`  when you want to
            call Watchlist Screening service. - Use `UPDATE_AGREEMENT` - Use
            `BILLING_AGREEMENT_CREATE` when Alternative Payment create mandate
            service is requested - Use `CANCEL_AGREEMENT` - Use `AP_IMPORT_AGREEMENT`
            when Alternative Payment import mandate service is requested.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "commerce_indicator": "commerceIndicator",
        "action_list": "actionList",
    }

    _optionals = [
        "commerce_indicator",
        "action_list",
    ]

    def __init__(
        self,
        commerce_indicator=APIHelper.SKIP,
        action_list=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a ProcessingInformation19 instance."""
        # Initialize members of the class
        if commerce_indicator is not APIHelper.SKIP:
            self.commerce_indicator = commerce_indicator
        if action_list is not APIHelper.SKIP:
            self.action_list = action_list

        # 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
        commerce_indicator =\
            dictionary.get("commerceIndicator")\
            if dictionary.get("commerceIndicator")\
                else APIHelper.SKIP
        action_list =\
            dictionary.get("actionList")\
            if dictionary.get("actionList")\
                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(commerce_indicator,
                   action_list,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _commerce_indicator=(
            self.commerce_indicator
            if hasattr(self, "commerce_indicator")
            else None
        )
        _action_list=(
            self.action_list
            if hasattr(self, "action_list")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"commerce_indicator={_commerce_indicator!r}, "
            f"action_list={_action_list!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _commerce_indicator=(
            self.commerce_indicator
            if hasattr(self, "commerce_indicator")
            else None
        )
        _action_list=(
            self.action_list
            if hasattr(self, "action_list")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"commerce_indicator={_commerce_indicator!s}, "
            f"action_list={_action_list!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
