"""visaacceptancemergedspec.

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

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


class PurchaseOptions(object):
    """Implementation of the 'PurchaseOptions' 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.
        mtype (str): Flag that indicates an EBT voucher transaction. Possible value:
            - `EBT_VOUCHER`: Indicates the PIN debit transaction is an EBT voucher. -
            `BUY` - `RENT` - `BOOK` - `SUBSCRIBE` - `DOWNLOAD` - `ORDER` - `CONTINUE`
            #### PIN debit Required field for EBT voucher transactions that use PIN
            debit purchase; otherwise, not used.
        eligibility_indicator (str): This field contains installment data defined by
            MasterCard. Possible values:   - Y = eligible   - N = not eligile
        benefit_amount (str): Workplace benefit amount.
        benefit_type (str): Workplace benefit type. Possible values: - 70 = employee
            benefit - 4T = transportation / transit - 52 = general benefit - 53 =
            meal voucher - 54 = fuel - 55 = ecological / sustainability - 58 =
            philanthropy / patronage / consumption - 59 = gift - 5S = sport / culture
            - 5T = book / education
        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",
        "mtype": "type",
        "eligibility_indicator": "eligibilityIndicator",
        "benefit_amount": "benefitAmount",
        "benefit_type": "benefitType",
    }

    _optionals = [
        "is_electronic_benefits_transfer",
        "mtype",
        "eligibility_indicator",
        "benefit_amount",
        "benefit_type",
    ]

    def __init__(
        self,
        is_electronic_benefits_transfer=APIHelper.SKIP,
        mtype=APIHelper.SKIP,
        eligibility_indicator=APIHelper.SKIP,
        benefit_amount=APIHelper.SKIP,
        benefit_type=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a PurchaseOptions instance."""
        # Initialize members of the class
        if is_electronic_benefits_transfer is not APIHelper.SKIP:
            self.is_electronic_benefits_transfer = is_electronic_benefits_transfer
        if mtype is not APIHelper.SKIP:
            self.mtype = mtype
        if eligibility_indicator is not APIHelper.SKIP:
            self.eligibility_indicator = eligibility_indicator
        if benefit_amount is not APIHelper.SKIP:
            self.benefit_amount = benefit_amount
        if benefit_type is not APIHelper.SKIP:
            self.benefit_type = benefit_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
        is_electronic_benefits_transfer =\
            dictionary.get("isElectronicBenefitsTransfer")\
            if "isElectronicBenefitsTransfer" in dictionary.keys()\
                else APIHelper.SKIP
        mtype =\
            dictionary.get("type")\
            if dictionary.get("type")\
                else APIHelper.SKIP
        eligibility_indicator =\
            dictionary.get("eligibilityIndicator")\
            if dictionary.get("eligibilityIndicator")\
                else APIHelper.SKIP
        benefit_amount =\
            dictionary.get("benefitAmount")\
            if dictionary.get("benefitAmount")\
                else APIHelper.SKIP
        benefit_type =\
            dictionary.get("benefitType")\
            if dictionary.get("benefitType")\
                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,
                   mtype,
                   eligibility_indicator,
                   benefit_amount,
                   benefit_type,
                   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
        )
        _mtype=(
            self.mtype
            if hasattr(self, "mtype")
            else None
        )
        _eligibility_indicator=(
            self.eligibility_indicator
            if hasattr(self, "eligibility_indicator")
            else None
        )
        _benefit_amount=(
            self.benefit_amount
            if hasattr(self, "benefit_amount")
            else None
        )
        _benefit_type=(
            self.benefit_type
            if hasattr(self, "benefit_type")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"is_electronic_benefits_transfer={_is_electronic_benefits_transfer!r}, "
            f"mtype={_mtype!r}, "
            f"eligibility_indicator={_eligibility_indicator!r}, "
            f"benefit_amount={_benefit_amount!r}, "
            f"benefit_type={_benefit_type!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
        )
        _mtype=(
            self.mtype
            if hasattr(self, "mtype")
            else None
        )
        _eligibility_indicator=(
            self.eligibility_indicator
            if hasattr(self, "eligibility_indicator")
            else None
        )
        _benefit_amount=(
            self.benefit_amount
            if hasattr(self, "benefit_amount")
            else None
        )
        _benefit_type=(
            self.benefit_type
            if hasattr(self, "benefit_type")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"is_electronic_benefits_transfer={_is_electronic_benefits_transfer!s}, "
            f"mtype={_mtype!s}, "
            f"eligibility_indicator={_eligibility_indicator!s}, "
            f"benefit_amount={_benefit_amount!s}, "
            f"benefit_type={_benefit_type!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
