"""visaacceptancemergedspec.

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

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


class AuthorizationOptions5(object):
    """Implementation of the 'AuthorizationOptions5' 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.
        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",
    }

    _optionals = [
        "auth_type",
    ]

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

        # 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

        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,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _auth_type=(
            self.auth_type
            if hasattr(self, "auth_type")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"auth_type={_auth_type!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
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"auth_type={_auth_type!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
