"""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.authorization_options_6 import (
    AuthorizationOptions6,
)
from visaacceptancemergedspec.models.bank_transfer_options_21 import (
    BankTransferOptions21,
)
from visaacceptancemergedspec.models.capture_options_3 import (
    CaptureOptions3,
)
from visaacceptancemergedspec.models.japan_payment_options_2 import (
    JapanPaymentOptions2,
)


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

    Attributes:
        bin_source (str): Bin Source File Identifier. Possible values: - itmx - rupay
        industry_data_type (str): Indicates that the transaction includes
            industry-specific data.  Possible Values: - `airline` - `restaurant` -
            `lodging` - `auto_rental` - `transit` - `healthcare_medical` -
            `healthcare_transit` - `transit`  #### Card Present, Airlines and Auto
            Rental You must set this field to `airline` in order for airline data to
            be sent to the processor. For example, if this field is not set to
            `airline` or is not included in the request, no airline data is sent to
            the processor.  You must set this field to `restaurant` in order for
            restaurant data to be sent to the processor. When this field is not set
            to `restaurant` or is not included in the request, no restaurant data is
            sent to the processor.  You must set this field to `auto_rental` in order
            for auto rental data to be sent to the processor. For example, if this
            field is not set to `auto_rental` or is not included in the request, no
            auto rental data is sent to the processor.  Restaurant data is supported
            only on Visa Acceptance through VisaNet.
        payment_solution (str): Type of digital payment solution for the transaction.
        commerce_indicator (str): Type of transaction. Some payment card companies
            use this information when determining discount rates.  #### Used by
            **Authorization** Required payer authentication transactions; otherwise,
            optional. **Credit** Required for standalone credits on Chase Paymentech
            solutions; otherwise, optional.  The list of valid values in this field
            depends on your processor.  #### Ingenico ePayments When you omit this
            field for Ingenico ePayments, the processor uses the default transaction
            type they have on file for you instead of the default value   #### Card
            Present You must set this field to `retail`. This field is required for a
            card-present transaction. Note that this should ONLY be used when the
            cardholder and card are present at the time of the transaction. For all
            keyed transactions originated from a POS terminal where the cardholder
            and card are not present, commerceIndicator should be submitted as “moto"
        commerce_indicator_label (str): Type of transaction. Some payment card
            companies use this information when determining discount rates.  ####
            Used by **Authorization** Required payer authentication transactions;
            otherwise, optional. **Credit** Required for standalone credits on Chase
            Paymentech solutions; otherwise, optional.  The list of valid values in
            this field depends on your processor.  #### Ingenico ePayments When you
            omit this field for Ingenico ePayments, the processor uses the default
            transaction type they have on file for you instead of the default value
            #### Card Present You must set this field to `retail`. This field is
            required for a card-present transaction. Note that this should ONLY be
            used when the cardholder and card are present at the time of the
            transaction. For all keyed transactions originated from a POS terminal
            where the cardholder and card are not present, commerceIndicator should
            be submitted as `moto`
        business_application_id (str): Required for AFT and OCT transactions.  Given
            below is a list of all the BAI values available. However, the processors
            may support only few specific BAI values.  - AA : Account-to-account  -
            BB : Supplier Payments - BI : Bank-Initiated P2P Money Transfer - BP :
            Non-Card Bill Pay/Bill Pay - CD : Cash Deposit - CP : Credit card Bill
            Payment - FD : Funds disbursement  - FT : Funds transfer - GD :
            Government Disbursement - GP : Gambling payout (non-online gambling) - LO
            : Loyalty credits and rebates - MD : Merchant Settlement - OG : Online
            Gambling Payout - PD : Payroll and pension disbursement - PP :
            Person-to-Person or Peer-to-Peer - TU : Top up, prepaid load - WT :
            Digital wallet
        authorization_options (AuthorizationOptions6): The model property of type
            AuthorizationOptions6.
        bank_transfer_options (BankTransferOptions21): The model property of type
            BankTransferOptions21.
        capture_options (CaptureOptions3): The model property of type CaptureOptions3.
        reconciliation_id (str): Reference number for the transaction. Depending on
            how your Visa Acceptance account is configured, this value could either
            be provided in the API request or generated by Visa Acceptance. The
            actual value used in the request to the processor is provided back to you
            by Visa Acceptance in the response.
        japan_payment_options (JapanPaymentOptions2): The model property of type
            JapanPaymentOptions2.
        validation_level (int): Enter 1 for routing and account number validation.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "bin_source": "binSource",
        "industry_data_type": "industryDataType",
        "payment_solution": "paymentSolution",
        "commerce_indicator": "commerceIndicator",
        "commerce_indicator_label": "commerceIndicatorLabel",
        "business_application_id": "businessApplicationId",
        "authorization_options": "authorizationOptions",
        "bank_transfer_options": "bankTransferOptions",
        "capture_options": "captureOptions",
        "reconciliation_id": "reconciliationId",
        "japan_payment_options": "japanPaymentOptions",
        "validation_level": "validationLevel",
    }

    _optionals = [
        "bin_source",
        "industry_data_type",
        "payment_solution",
        "commerce_indicator",
        "commerce_indicator_label",
        "business_application_id",
        "authorization_options",
        "bank_transfer_options",
        "capture_options",
        "reconciliation_id",
        "japan_payment_options",
        "validation_level",
    ]

    def __init__(
        self,
        bin_source=APIHelper.SKIP,
        industry_data_type=APIHelper.SKIP,
        payment_solution=APIHelper.SKIP,
        commerce_indicator=APIHelper.SKIP,
        commerce_indicator_label=APIHelper.SKIP,
        business_application_id=APIHelper.SKIP,
        authorization_options=APIHelper.SKIP,
        bank_transfer_options=APIHelper.SKIP,
        capture_options=APIHelper.SKIP,
        reconciliation_id=APIHelper.SKIP,
        japan_payment_options=APIHelper.SKIP,
        validation_level=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a ProcessingInformation52 instance."""
        # Initialize members of the class
        if bin_source is not APIHelper.SKIP:
            self.bin_source = bin_source
        if industry_data_type is not APIHelper.SKIP:
            self.industry_data_type = industry_data_type
        if payment_solution is not APIHelper.SKIP:
            self.payment_solution = payment_solution
        if commerce_indicator is not APIHelper.SKIP:
            self.commerce_indicator = commerce_indicator
        if commerce_indicator_label is not APIHelper.SKIP:
            self.commerce_indicator_label = commerce_indicator_label
        if business_application_id is not APIHelper.SKIP:
            self.business_application_id = business_application_id
        if authorization_options is not APIHelper.SKIP:
            self.authorization_options = authorization_options
        if bank_transfer_options is not APIHelper.SKIP:
            self.bank_transfer_options = bank_transfer_options
        if capture_options is not APIHelper.SKIP:
            self.capture_options = capture_options
        if reconciliation_id is not APIHelper.SKIP:
            self.reconciliation_id = reconciliation_id
        if japan_payment_options is not APIHelper.SKIP:
            self.japan_payment_options = japan_payment_options
        if validation_level is not APIHelper.SKIP:
            self.validation_level = validation_level

        # 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
        bin_source =\
            dictionary.get("binSource")\
            if dictionary.get("binSource")\
                else APIHelper.SKIP
        industry_data_type =\
            dictionary.get("industryDataType")\
            if dictionary.get("industryDataType")\
                else APIHelper.SKIP
        payment_solution =\
            dictionary.get("paymentSolution")\
            if dictionary.get("paymentSolution")\
                else APIHelper.SKIP
        commerce_indicator =\
            dictionary.get("commerceIndicator")\
            if dictionary.get("commerceIndicator")\
                else APIHelper.SKIP
        commerce_indicator_label =\
            dictionary.get("commerceIndicatorLabel")\
            if dictionary.get("commerceIndicatorLabel")\
                else APIHelper.SKIP
        business_application_id =\
            dictionary.get("businessApplicationId")\
            if dictionary.get("businessApplicationId")\
                else APIHelper.SKIP
        authorization_options =\
            AuthorizationOptions6.from_dictionary(
                dictionary.get("authorizationOptions"))\
                if "authorizationOptions" in dictionary.keys()\
                else APIHelper.SKIP
        bank_transfer_options =\
            BankTransferOptions21.from_dictionary(
                dictionary.get("bankTransferOptions"))\
                if "bankTransferOptions" in dictionary.keys()\
                else APIHelper.SKIP
        capture_options =\
            CaptureOptions3.from_dictionary(
                dictionary.get("captureOptions"))\
                if "captureOptions" in dictionary.keys()\
                else APIHelper.SKIP
        reconciliation_id =\
            dictionary.get("reconciliationId")\
            if dictionary.get("reconciliationId")\
                else APIHelper.SKIP
        japan_payment_options =\
            JapanPaymentOptions2.from_dictionary(
                dictionary.get("japanPaymentOptions"))\
                if "japanPaymentOptions" in dictionary.keys()\
                else APIHelper.SKIP
        validation_level =\
            dictionary.get("validationLevel")\
            if dictionary.get("validationLevel")\
                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(bin_source,
                   industry_data_type,
                   payment_solution,
                   commerce_indicator,
                   commerce_indicator_label,
                   business_application_id,
                   authorization_options,
                   bank_transfer_options,
                   capture_options,
                   reconciliation_id,
                   japan_payment_options,
                   validation_level,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _bin_source=(
            self.bin_source
            if hasattr(self, "bin_source")
            else None
        )
        _industry_data_type=(
            self.industry_data_type
            if hasattr(self, "industry_data_type")
            else None
        )
        _payment_solution=(
            self.payment_solution
            if hasattr(self, "payment_solution")
            else None
        )
        _commerce_indicator=(
            self.commerce_indicator
            if hasattr(self, "commerce_indicator")
            else None
        )
        _commerce_indicator_label=(
            self.commerce_indicator_label
            if hasattr(self, "commerce_indicator_label")
            else None
        )
        _business_application_id=(
            self.business_application_id
            if hasattr(self, "business_application_id")
            else None
        )
        _authorization_options=(
            self.authorization_options
            if hasattr(self, "authorization_options")
            else None
        )
        _bank_transfer_options=(
            self.bank_transfer_options
            if hasattr(self, "bank_transfer_options")
            else None
        )
        _capture_options=(
            self.capture_options
            if hasattr(self, "capture_options")
            else None
        )
        _reconciliation_id=(
            self.reconciliation_id
            if hasattr(self, "reconciliation_id")
            else None
        )
        _japan_payment_options=(
            self.japan_payment_options
            if hasattr(self, "japan_payment_options")
            else None
        )
        _validation_level=(
            self.validation_level
            if hasattr(self, "validation_level")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"bin_source={_bin_source!r}, "
            f"industry_data_type={_industry_data_type!r}, "
            f"payment_solution={_payment_solution!r}, "
            f"commerce_indicator={_commerce_indicator!r}, "
            f"commerce_indicator_label={_commerce_indicator_label!r}, "
            f"business_application_id={_business_application_id!r}, "
            f"authorization_options={_authorization_options!r}, "
            f"bank_transfer_options={_bank_transfer_options!r}, "
            f"capture_options={_capture_options!r}, "
            f"reconciliation_id={_reconciliation_id!r}, "
            f"japan_payment_options={_japan_payment_options!r}, "
            f"validation_level={_validation_level!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _bin_source=(
            self.bin_source
            if hasattr(self, "bin_source")
            else None
        )
        _industry_data_type=(
            self.industry_data_type
            if hasattr(self, "industry_data_type")
            else None
        )
        _payment_solution=(
            self.payment_solution
            if hasattr(self, "payment_solution")
            else None
        )
        _commerce_indicator=(
            self.commerce_indicator
            if hasattr(self, "commerce_indicator")
            else None
        )
        _commerce_indicator_label=(
            self.commerce_indicator_label
            if hasattr(self, "commerce_indicator_label")
            else None
        )
        _business_application_id=(
            self.business_application_id
            if hasattr(self, "business_application_id")
            else None
        )
        _authorization_options=(
            self.authorization_options
            if hasattr(self, "authorization_options")
            else None
        )
        _bank_transfer_options=(
            self.bank_transfer_options
            if hasattr(self, "bank_transfer_options")
            else None
        )
        _capture_options=(
            self.capture_options
            if hasattr(self, "capture_options")
            else None
        )
        _reconciliation_id=(
            self.reconciliation_id
            if hasattr(self, "reconciliation_id")
            else None
        )
        _japan_payment_options=(
            self.japan_payment_options
            if hasattr(self, "japan_payment_options")
            else None
        )
        _validation_level=(
            self.validation_level
            if hasattr(self, "validation_level")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"bin_source={_bin_source!s}, "
            f"industry_data_type={_industry_data_type!s}, "
            f"payment_solution={_payment_solution!s}, "
            f"commerce_indicator={_commerce_indicator!s}, "
            f"commerce_indicator_label={_commerce_indicator_label!s}, "
            f"business_application_id={_business_application_id!s}, "
            f"authorization_options={_authorization_options!s}, "
            f"bank_transfer_options={_bank_transfer_options!s}, "
            f"capture_options={_capture_options!s}, "
            f"reconciliation_id={_reconciliation_id!s}, "
            f"japan_payment_options={_japan_payment_options!s}, "
            f"validation_level={_validation_level!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
