"""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.initiator_26 import (
    Initiator26,
)


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

    Attributes:
        auth_type (str): Authorization type. Possible values:   - `AUTOCAPTURE`:
            automatic capture.  - `STANDARDCAPTURE`: standard capture.  - `VERBAL`:
            forced capture. Include it in the payment request for a forced capture.
            Include it in the capture request for a verbal payment.  #### Asia,
            Middle East, and Africa Gateway; Cielo; Comercio Latino; and Visa
            Acceptance Latin American Processing Set this field to `AUTOCAPTURE` and
            include it in a bundled request to indicate that you are requesting an
            automatic capture. If your account is configured to enable automatic
            captures, set this field to `STANDARDCAPTURE` and include it in a
            standard authorization or bundled request to indicate that you are
            overriding an automatic capture.  #### Forced Capture Set this field to
            `VERBAL` and include it in the authorization request to indicate that you
            are performing a forced capture; therefore, you receive the authorization
            code outside the Visa Acceptance system.  #### Verbal Authorization Set
            this field to `VERBAL` and include it in the capture request to indicate
            that the request is for a verbal authorization.  #### for PayPal
            ptsV2CreateOrderPost400Response Set this field to 'AUTHORIZE' or
            'CAPTURE' depending on whether you want to invoke delayed capture or sale
            respectively.
        auth_indicator (str): Flag that specifies the purpose of the authorization.
            Possible values:  - **0**: Preauthorization  - **1**: Final authorization
            To set the default for this field, contact Visa Acceptance Customer
            Support.  #### Barclays and Elavon The default for Barclays and Elavon is
            1 (final authorization). To change the default for this field, contact
            Visa Acceptance Customer Support.  #### Visa Acceptance through VisaNet
            When the value for this field is 0, it corresponds to the following data
            in the TC 33 capture file:  - Record: CP01 TCR0  - Position: 164  -
            Field: Additional Authorization Indicators When the value for this field
            is 1, it does not correspond to any data in the TC 33 capture file.
        extend_auth_indicator (str): Indicates Authorization extension transaction.
            Extension transaction is used to prolong the settlement period by one
            additional settlement cycle period.  Possible values: - true: Transaction
            is an Authorization Extension transaction.  - false: Transaction is not
            an Authorization Extension transaction.
        card_verification_indicator (bool): This API field will indicate whether a
            card verification check is being performed during the transaction
            Possible values:   - `true`   - `false` (default value)
        initiator (Initiator26): The model property of type Initiator26.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "auth_type": "authType",
        "auth_indicator": "authIndicator",
        "extend_auth_indicator": "extendAuthIndicator",
        "card_verification_indicator": "cardVerificationIndicator",
        "initiator": "initiator",
    }

    _optionals = [
        "auth_type",
        "auth_indicator",
        "extend_auth_indicator",
        "card_verification_indicator",
        "initiator",
    ]

    def __init__(
        self,
        auth_type=APIHelper.SKIP,
        auth_indicator=APIHelper.SKIP,
        extend_auth_indicator=APIHelper.SKIP,
        card_verification_indicator=APIHelper.SKIP,
        initiator=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a AuthorizationOptions6 instance."""
        # Initialize members of the class
        if auth_type is not APIHelper.SKIP:
            self.auth_type = auth_type
        if auth_indicator is not APIHelper.SKIP:
            self.auth_indicator = auth_indicator
        if extend_auth_indicator is not APIHelper.SKIP:
            self.extend_auth_indicator = extend_auth_indicator
        if card_verification_indicator is not APIHelper.SKIP:
            self.card_verification_indicator = card_verification_indicator
        if initiator is not APIHelper.SKIP:
            self.initiator = initiator

        # 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
        auth_type =\
            dictionary.get("authType")\
            if dictionary.get("authType")\
                else APIHelper.SKIP
        auth_indicator =\
            dictionary.get("authIndicator")\
            if dictionary.get("authIndicator")\
                else APIHelper.SKIP
        extend_auth_indicator =\
            dictionary.get("extendAuthIndicator")\
            if dictionary.get("extendAuthIndicator")\
                else APIHelper.SKIP
        card_verification_indicator =\
            dictionary.get("cardVerificationIndicator")\
            if "cardVerificationIndicator" in dictionary.keys()\
                else APIHelper.SKIP
        initiator =\
            Initiator26.from_dictionary(
                dictionary.get("initiator"))\
                if "initiator" 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(auth_type,
                   auth_indicator,
                   extend_auth_indicator,
                   card_verification_indicator,
                   initiator,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _auth_type=(
            self.auth_type
            if hasattr(self, "auth_type")
            else None
        )
        _auth_indicator=(
            self.auth_indicator
            if hasattr(self, "auth_indicator")
            else None
        )
        _extend_auth_indicator=(
            self.extend_auth_indicator
            if hasattr(self, "extend_auth_indicator")
            else None
        )
        _card_verification_indicator=(
            self.card_verification_indicator
            if hasattr(self, "card_verification_indicator")
            else None
        )
        _initiator=(
            self.initiator
            if hasattr(self, "initiator")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"auth_type={_auth_type!r}, "
            f"auth_indicator={_auth_indicator!r}, "
            f"extend_auth_indicator={_extend_auth_indicator!r}, "
            f"card_verification_indicator={_card_verification_indicator!r}, "
            f"initiator={_initiator!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _auth_type=(
            self.auth_type
            if hasattr(self, "auth_type")
            else None
        )
        _auth_indicator=(
            self.auth_indicator
            if hasattr(self, "auth_indicator")
            else None
        )
        _extend_auth_indicator=(
            self.extend_auth_indicator
            if hasattr(self, "extend_auth_indicator")
            else None
        )
        _card_verification_indicator=(
            self.card_verification_indicator
            if hasattr(self, "card_verification_indicator")
            else None
        )
        _initiator=(
            self.initiator
            if hasattr(self, "initiator")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"auth_type={_auth_type!s}, "
            f"auth_indicator={_auth_indicator!s}, "
            f"extend_auth_indicator={_extend_auth_indicator!s}, "
            f"card_verification_indicator={_card_verification_indicator!s}, "
            f"initiator={_initiator!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
