"""visaacceptancemergedspec.

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

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


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

    Attributes:
        is_electronic_benefits_transfer (bool): Flag that indicates whether this
            transaction is an EBT transaction. Possible values: - `true` - `false`
            #### PIN debit Required field for EBT and EBT voucher transactions that
            use PIN debit credit or PIN debit purchase; otherwise, not used.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "is_electronic_benefits_transfer": "isElectronicBenefitsTransfer",
    }

    _optionals = [
        "is_electronic_benefits_transfer",
    ]

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

        # 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
        is_electronic_benefits_transfer =\
            dictionary.get("isElectronicBenefitsTransfer")\
            if "isElectronicBenefitsTransfer" 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(is_electronic_benefits_transfer,
                   additional_properties)

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

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