"""visaacceptancemergedspec.

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

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


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

    Attributes:
        billing_type (str): Configure Unified Checkout to capture billing address
            information.  Possible values: - FULL: Capture complete billing address
            information. - PARTIAL: Capture first name, last name, country and
            postal/zip code only. - NONE: Capture only first name and last name.
        request_email (bool): Configure Unified Checkout to capture customer email
            address.  Possible values:  - True  - False
        request_phone (bool): Configure Unified Checkout to capture customer phone
            number.  Possible values: - True - False
        request_shipping (bool): Configure Unified Checkout to capture customer
            shipping details.  Possible values: - True - False
        ship_to_countries (List[str]): List of countries available to ship to.   Use
            the two-character ISO Standard Country Codes.
        show_accepted_network_icons (bool): Configure Unified Checkout to display the
            list of accepted card networks beneath the payment button  Possible
            values: - True - False
        show_confirmation_step (bool): Configure Unified Checkout to display the
            final confirmation screen when using Click to Pay.<br> Where
            'BillingType'= NONE and 'requestShipping'= FALSE and the customer is
            using an existing Click to Pay card as their chosen payment method, a
            final confirmation screen can be removed allowing the customer to check
            out as soon as they have selected their payment method from within their
            Click to Pay card tray.  Possible values: - True - False
        request_save_card (bool): Configure Unified Checkout to display the "Save
            card for future use" checkbox.<br>  Configurable check box that will show
            in a Manual card entry flow to allow a Cardholder to give consent to
            store their manually entered credential with the Merchant that they are
            paying.<br>  Applicable when manually entering the details and not
            enrolling in Click to Pay.  Possible values:  - True   - False<br><br>
            **Use Cases:**  **Offer consumers option to save their card in Unified
            Checkout:**  - Include the captureMandate.requestSaveCard field in the
            capture context request and set it to true. - When set to true, this will
            show a checkbox with the message ‘Save card for future use’ in Unified
            Checkout. - When selected this provides a response in both the Transient
            Token and Get Credentials API response.<br><br>  **Do not offer consumers
            the option to save their card in Unified Checkout:**  - Include the
            captureMandate.requestSaveCard field in the capture context request and
            set it to false OR omit the field from the capture context request. -
            When set to false, the save card option is not shown to consumers when
            manually entering card details.
        combo_card (bool): Configure Unified Checkout to display combo card at
            checkout.<br>  A combo debit/credit card is a single card that functions
            both as a Debit/Credit card.  Unified Checkout / Click to Pay Drop-in UI
            allows the Cardholder to choose whether they would like the transaction
            to be paid for using either debit or credit card. **Important:** This is
            applicable to Visa cards only.  Possible values: - True  - False<br><br>
            **Use Cases:**  **Offer Combo Card at Checkout:**  - Include the
            captureMandate.comboCard field in the capture context request and set it
            to true. - When set to true, Combo Card selection is shown at checkout
            <br><br>  **Do not offer Combo Card at Checkout:**  - Include the
            captureMandate.comboCard field in the capture context request and set it
            to false OR omit the field from the capture context request. - The Combo
            Card selection is not shown at checkout.
        cpf (bool): Configure Unified Checkout to display and capture the CPF number
            (Cadastro de Pessoas Físicas).  The CPF number is a unique 11-digit
            identifier issued to Brazilian citizens and residents for tax purposes.
            Possible values: - True - False<br><br>  This field is optional.   If set
            to true the field is required. If set to false the field is optional. If
            the field is not included in the capture context then it is not
            captured.<br><br>  **Important:**  - If PANENTRY is specified in the
            allowedPaymentTypes field, the CPF number will be displayed in Unified
            Checkout regardless of what card number is entered.  - If CLICKTOPAY is
            specified in the allowedPaymentTypes field, the CPF number will be
            displayed in Unified Checkout only when a Visa Click To Pay card is
            entered.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "billing_type": "billingType",
        "request_email": "requestEmail",
        "request_phone": "requestPhone",
        "request_shipping": "requestShipping",
        "ship_to_countries": "shipToCountries",
        "show_accepted_network_icons": "showAcceptedNetworkIcons",
        "show_confirmation_step": "showConfirmationStep",
        "request_save_card": "requestSaveCard",
        "combo_card": "comboCard",
        "cpf": "CPF",
    }

    _optionals = [
        "billing_type",
        "request_email",
        "request_phone",
        "request_shipping",
        "ship_to_countries",
        "show_accepted_network_icons",
        "show_confirmation_step",
        "request_save_card",
        "combo_card",
        "cpf",
    ]

    def __init__(
        self,
        billing_type=APIHelper.SKIP,
        request_email=APIHelper.SKIP,
        request_phone=APIHelper.SKIP,
        request_shipping=APIHelper.SKIP,
        ship_to_countries=APIHelper.SKIP,
        show_accepted_network_icons=APIHelper.SKIP,
        show_confirmation_step=APIHelper.SKIP,
        request_save_card=APIHelper.SKIP,
        combo_card=APIHelper.SKIP,
        cpf=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a CaptureMandate instance."""
        # Initialize members of the class
        if billing_type is not APIHelper.SKIP:
            self.billing_type = billing_type
        if request_email is not APIHelper.SKIP:
            self.request_email = request_email
        if request_phone is not APIHelper.SKIP:
            self.request_phone = request_phone
        if request_shipping is not APIHelper.SKIP:
            self.request_shipping = request_shipping
        if ship_to_countries is not APIHelper.SKIP:
            self.ship_to_countries = ship_to_countries
        if show_accepted_network_icons is not APIHelper.SKIP:
            self.show_accepted_network_icons = show_accepted_network_icons
        if show_confirmation_step is not APIHelper.SKIP:
            self.show_confirmation_step = show_confirmation_step
        if request_save_card is not APIHelper.SKIP:
            self.request_save_card = request_save_card
        if combo_card is not APIHelper.SKIP:
            self.combo_card = combo_card
        if cpf is not APIHelper.SKIP:
            self.cpf = cpf

        # 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
        billing_type =\
            dictionary.get("billingType")\
            if dictionary.get("billingType")\
                else APIHelper.SKIP
        request_email =\
            dictionary.get("requestEmail")\
            if "requestEmail" in dictionary.keys()\
                else APIHelper.SKIP
        request_phone =\
            dictionary.get("requestPhone")\
            if "requestPhone" in dictionary.keys()\
                else APIHelper.SKIP
        request_shipping =\
            dictionary.get("requestShipping")\
            if "requestShipping" in dictionary.keys()\
                else APIHelper.SKIP
        ship_to_countries =\
            dictionary.get("shipToCountries")\
            if dictionary.get("shipToCountries")\
                else APIHelper.SKIP
        show_accepted_network_icons =\
            dictionary.get("showAcceptedNetworkIcons")\
            if "showAcceptedNetworkIcons" in dictionary.keys()\
                else APIHelper.SKIP
        show_confirmation_step =\
            dictionary.get("showConfirmationStep")\
            if "showConfirmationStep" in dictionary.keys()\
                else APIHelper.SKIP
        request_save_card =\
            dictionary.get("requestSaveCard")\
            if "requestSaveCard" in dictionary.keys()\
                else APIHelper.SKIP
        combo_card =\
            dictionary.get("comboCard")\
            if "comboCard" in dictionary.keys()\
                else APIHelper.SKIP
        cpf =\
            dictionary.get("CPF")\
            if "CPF" 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(billing_type,
                   request_email,
                   request_phone,
                   request_shipping,
                   ship_to_countries,
                   show_accepted_network_icons,
                   show_confirmation_step,
                   request_save_card,
                   combo_card,
                   cpf,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _billing_type=(
            self.billing_type
            if hasattr(self, "billing_type")
            else None
        )
        _request_email=(
            self.request_email
            if hasattr(self, "request_email")
            else None
        )
        _request_phone=(
            self.request_phone
            if hasattr(self, "request_phone")
            else None
        )
        _request_shipping=(
            self.request_shipping
            if hasattr(self, "request_shipping")
            else None
        )
        _ship_to_countries=(
            self.ship_to_countries
            if hasattr(self, "ship_to_countries")
            else None
        )
        _show_accepted_network_icons=(
            self.show_accepted_network_icons
            if hasattr(self, "show_accepted_network_icons")
            else None
        )
        _show_confirmation_step=(
            self.show_confirmation_step
            if hasattr(self, "show_confirmation_step")
            else None
        )
        _request_save_card=(
            self.request_save_card
            if hasattr(self, "request_save_card")
            else None
        )
        _combo_card=(
            self.combo_card
            if hasattr(self, "combo_card")
            else None
        )
        _cpf=(
            self.cpf
            if hasattr(self, "cpf")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"billing_type={_billing_type!r}, "
            f"request_email={_request_email!r}, "
            f"request_phone={_request_phone!r}, "
            f"request_shipping={_request_shipping!r}, "
            f"ship_to_countries={_ship_to_countries!r}, "
            f"show_accepted_network_icons={_show_accepted_network_icons!r}, "
            f"show_confirmation_step={_show_confirmation_step!r}, "
            f"request_save_card={_request_save_card!r}, "
            f"combo_card={_combo_card!r}, "
            f"cpf={_cpf!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _billing_type=(
            self.billing_type
            if hasattr(self, "billing_type")
            else None
        )
        _request_email=(
            self.request_email
            if hasattr(self, "request_email")
            else None
        )
        _request_phone=(
            self.request_phone
            if hasattr(self, "request_phone")
            else None
        )
        _request_shipping=(
            self.request_shipping
            if hasattr(self, "request_shipping")
            else None
        )
        _ship_to_countries=(
            self.ship_to_countries
            if hasattr(self, "ship_to_countries")
            else None
        )
        _show_accepted_network_icons=(
            self.show_accepted_network_icons
            if hasattr(self, "show_accepted_network_icons")
            else None
        )
        _show_confirmation_step=(
            self.show_confirmation_step
            if hasattr(self, "show_confirmation_step")
            else None
        )
        _request_save_card=(
            self.request_save_card
            if hasattr(self, "request_save_card")
            else None
        )
        _combo_card=(
            self.combo_card
            if hasattr(self, "combo_card")
            else None
        )
        _cpf=(
            self.cpf
            if hasattr(self, "cpf")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"billing_type={_billing_type!s}, "
            f"request_email={_request_email!s}, "
            f"request_phone={_request_phone!s}, "
            f"request_shipping={_request_shipping!s}, "
            f"ship_to_countries={_ship_to_countries!s}, "
            f"show_accepted_network_icons={_show_accepted_network_icons!s}, "
            f"show_confirmation_step={_show_confirmation_step!s}, "
            f"request_save_card={_request_save_card!s}, "
            f"combo_card={_combo_card!s}, "
            f"cpf={_cpf!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
