"""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_4 import (
    AuthorizationOptions4,
)
from visaacceptancemergedspec.models.capture_options_2 import (
    CaptureOptions2,
)
from visaacceptancemergedspec.models.issuer import (
    Issuer,
)
from visaacceptancemergedspec.models.loan_options import (
    LoanOptions,
)


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

    Attributes:
        payment_solution (str): Type of digital payment solution for the transaction.
            Possible Values:   - `visacheckout`: Visa Checkout. This value is
            required for Visa Checkout transactions. For details, see
            `payment_solution` field description in [Visa Checkout Using the REST
            API.](  - `001`: Apple Pay.  - `004`: Visa Acceptance In-App Solution.  -
            `005`: Masterpass. This value is required for Masterpass transactions on
            OmniPay Direct.   - `006`: Android Pay.  - `007`: Chase Pay.  - `008`:
            Samsung Pay.  - `012`: Google Pay.  - `013`: Visa Acceptance P2PE
            Decryption  - `014`: Mastercard credential on file (COF) payment network
            token. Returned in authorizations that use a payment network token
            associated with a TMS token.  - `015`: Visa credential on file (COF)
            payment network token. Returned in authorizations that use a payment
            network token associated with a TMS token.  - `027`: Click to Pay.
        reconciliation_id (str): Please check with Visa Acceptance customer support
            to see if your merchant account is configured correctly so you can
            include this field in your request. * For Payouts: max length for
            FDCCompass is String (22).
        link_id (str): Value that links the current authorization request to the
            original authorization request. Set this value to the ID that was
            returned in the reply message from the original authorization request.
            This value is used for:  - Partial authorizations - Split shipments
        report_group (str): Attribute that lets you define custom grouping for your
            processor reports. This field is supported only for **Worldpay VAP**.
        visa_checkout_id (str): Identifier for the **Visa Checkout** order. Visa
            Checkout provides a unique order ID for every transaction in the Visa
            Checkout **callID** field.
        purchase_level (str): Set this field to 3 to indicate that the request
            includes Level III data.
        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.
        issuer (Issuer): The model property of type Issuer.
        authorization_options (AuthorizationOptions4): The model property of type
            AuthorizationOptions4.
        capture_options (CaptureOptions2): The model property of type CaptureOptions2.
        loan_options (LoanOptions): The model property of type LoanOptions.
        pay_by_points_indicator (bool): Flag that indicates if the transaction is pay
            by points transaction true: Transaction uses loyalty points false:
            Transaction does not use loyalty points Default: false
        action_list (List[str]): Array of actions (one or more) to be included in the
            capture to invoke bundled services along with capture.  Possible values :
            - `AP_CAPTURE`: Use this when Alternative Payment Capture service is
            requested.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "payment_solution": "paymentSolution",
        "reconciliation_id": "reconciliationId",
        "link_id": "linkId",
        "report_group": "reportGroup",
        "visa_checkout_id": "visaCheckoutId",
        "purchase_level": "purchaseLevel",
        "industry_data_type": "industryDataType",
        "issuer": "issuer",
        "authorization_options": "authorizationOptions",
        "capture_options": "captureOptions",
        "loan_options": "loanOptions",
        "pay_by_points_indicator": "payByPointsIndicator",
        "action_list": "actionList",
    }

    _optionals = [
        "payment_solution",
        "reconciliation_id",
        "link_id",
        "report_group",
        "visa_checkout_id",
        "purchase_level",
        "industry_data_type",
        "issuer",
        "authorization_options",
        "capture_options",
        "loan_options",
        "pay_by_points_indicator",
        "action_list",
    ]

    def __init__(
        self,
        payment_solution=APIHelper.SKIP,
        reconciliation_id=APIHelper.SKIP,
        link_id=APIHelper.SKIP,
        report_group=APIHelper.SKIP,
        visa_checkout_id=APIHelper.SKIP,
        purchase_level=APIHelper.SKIP,
        industry_data_type=APIHelper.SKIP,
        issuer=APIHelper.SKIP,
        authorization_options=APIHelper.SKIP,
        capture_options=APIHelper.SKIP,
        loan_options=APIHelper.SKIP,
        pay_by_points_indicator=APIHelper.SKIP,
        action_list=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a ProcessingInformation5 instance."""
        # Initialize members of the class
        if payment_solution is not APIHelper.SKIP:
            self.payment_solution = payment_solution
        if reconciliation_id is not APIHelper.SKIP:
            self.reconciliation_id = reconciliation_id
        if link_id is not APIHelper.SKIP:
            self.link_id = link_id
        if report_group is not APIHelper.SKIP:
            self.report_group = report_group
        if visa_checkout_id is not APIHelper.SKIP:
            self.visa_checkout_id = visa_checkout_id
        if purchase_level is not APIHelper.SKIP:
            self.purchase_level = purchase_level
        if industry_data_type is not APIHelper.SKIP:
            self.industry_data_type = industry_data_type
        if issuer is not APIHelper.SKIP:
            self.issuer = issuer
        if authorization_options is not APIHelper.SKIP:
            self.authorization_options = authorization_options
        if capture_options is not APIHelper.SKIP:
            self.capture_options = capture_options
        if loan_options is not APIHelper.SKIP:
            self.loan_options = loan_options
        if pay_by_points_indicator is not APIHelper.SKIP:
            self.pay_by_points_indicator = pay_by_points_indicator
        if action_list is not APIHelper.SKIP:
            self.action_list = action_list

        # 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
        payment_solution =\
            dictionary.get("paymentSolution")\
            if dictionary.get("paymentSolution")\
                else APIHelper.SKIP
        reconciliation_id =\
            dictionary.get("reconciliationId")\
            if dictionary.get("reconciliationId")\
                else APIHelper.SKIP
        link_id =\
            dictionary.get("linkId")\
            if dictionary.get("linkId")\
                else APIHelper.SKIP
        report_group =\
            dictionary.get("reportGroup")\
            if dictionary.get("reportGroup")\
                else APIHelper.SKIP
        visa_checkout_id =\
            dictionary.get("visaCheckoutId")\
            if dictionary.get("visaCheckoutId")\
                else APIHelper.SKIP
        purchase_level =\
            dictionary.get("purchaseLevel")\
            if dictionary.get("purchaseLevel")\
                else APIHelper.SKIP
        industry_data_type =\
            dictionary.get("industryDataType")\
            if dictionary.get("industryDataType")\
                else APIHelper.SKIP
        issuer =\
            Issuer.from_dictionary(
                dictionary.get("issuer"))\
                if "issuer" in dictionary.keys()\
                else APIHelper.SKIP
        authorization_options =\
            AuthorizationOptions4.from_dictionary(
                dictionary.get("authorizationOptions"))\
                if "authorizationOptions" in dictionary.keys()\
                else APIHelper.SKIP
        capture_options =\
            CaptureOptions2.from_dictionary(
                dictionary.get("captureOptions"))\
                if "captureOptions" in dictionary.keys()\
                else APIHelper.SKIP
        loan_options =\
            LoanOptions.from_dictionary(
                dictionary.get("loanOptions"))\
                if "loanOptions" in dictionary.keys()\
                else APIHelper.SKIP
        pay_by_points_indicator =\
            dictionary.get("payByPointsIndicator")\
            if "payByPointsIndicator" in dictionary.keys()\
                else APIHelper.SKIP
        action_list =\
            dictionary.get("actionList")\
            if dictionary.get("actionList")\
                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(payment_solution,
                   reconciliation_id,
                   link_id,
                   report_group,
                   visa_checkout_id,
                   purchase_level,
                   industry_data_type,
                   issuer,
                   authorization_options,
                   capture_options,
                   loan_options,
                   pay_by_points_indicator,
                   action_list,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _payment_solution=(
            self.payment_solution
            if hasattr(self, "payment_solution")
            else None
        )
        _reconciliation_id=(
            self.reconciliation_id
            if hasattr(self, "reconciliation_id")
            else None
        )
        _link_id=(
            self.link_id
            if hasattr(self, "link_id")
            else None
        )
        _report_group=(
            self.report_group
            if hasattr(self, "report_group")
            else None
        )
        _visa_checkout_id=(
            self.visa_checkout_id
            if hasattr(self, "visa_checkout_id")
            else None
        )
        _purchase_level=(
            self.purchase_level
            if hasattr(self, "purchase_level")
            else None
        )
        _industry_data_type=(
            self.industry_data_type
            if hasattr(self, "industry_data_type")
            else None
        )
        _issuer=(
            self.issuer
            if hasattr(self, "issuer")
            else None
        )
        _authorization_options=(
            self.authorization_options
            if hasattr(self, "authorization_options")
            else None
        )
        _capture_options=(
            self.capture_options
            if hasattr(self, "capture_options")
            else None
        )
        _loan_options=(
            self.loan_options
            if hasattr(self, "loan_options")
            else None
        )
        _pay_by_points_indicator=(
            self.pay_by_points_indicator
            if hasattr(self, "pay_by_points_indicator")
            else None
        )
        _action_list=(
            self.action_list
            if hasattr(self, "action_list")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"payment_solution={_payment_solution!r}, "
            f"reconciliation_id={_reconciliation_id!r}, "
            f"link_id={_link_id!r}, "
            f"report_group={_report_group!r}, "
            f"visa_checkout_id={_visa_checkout_id!r}, "
            f"purchase_level={_purchase_level!r}, "
            f"industry_data_type={_industry_data_type!r}, "
            f"issuer={_issuer!r}, "
            f"authorization_options={_authorization_options!r}, "
            f"capture_options={_capture_options!r}, "
            f"loan_options={_loan_options!r}, "
            f"pay_by_points_indicator={_pay_by_points_indicator!r}, "
            f"action_list={_action_list!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _payment_solution=(
            self.payment_solution
            if hasattr(self, "payment_solution")
            else None
        )
        _reconciliation_id=(
            self.reconciliation_id
            if hasattr(self, "reconciliation_id")
            else None
        )
        _link_id=(
            self.link_id
            if hasattr(self, "link_id")
            else None
        )
        _report_group=(
            self.report_group
            if hasattr(self, "report_group")
            else None
        )
        _visa_checkout_id=(
            self.visa_checkout_id
            if hasattr(self, "visa_checkout_id")
            else None
        )
        _purchase_level=(
            self.purchase_level
            if hasattr(self, "purchase_level")
            else None
        )
        _industry_data_type=(
            self.industry_data_type
            if hasattr(self, "industry_data_type")
            else None
        )
        _issuer=(
            self.issuer
            if hasattr(self, "issuer")
            else None
        )
        _authorization_options=(
            self.authorization_options
            if hasattr(self, "authorization_options")
            else None
        )
        _capture_options=(
            self.capture_options
            if hasattr(self, "capture_options")
            else None
        )
        _loan_options=(
            self.loan_options
            if hasattr(self, "loan_options")
            else None
        )
        _pay_by_points_indicator=(
            self.pay_by_points_indicator
            if hasattr(self, "pay_by_points_indicator")
            else None
        )
        _action_list=(
            self.action_list
            if hasattr(self, "action_list")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"payment_solution={_payment_solution!s}, "
            f"reconciliation_id={_reconciliation_id!s}, "
            f"link_id={_link_id!s}, "
            f"report_group={_report_group!s}, "
            f"visa_checkout_id={_visa_checkout_id!s}, "
            f"purchase_level={_purchase_level!s}, "
            f"industry_data_type={_industry_data_type!s}, "
            f"issuer={_issuer!s}, "
            f"authorization_options={_authorization_options!s}, "
            f"capture_options={_capture_options!s}, "
            f"loan_options={_loan_options!s}, "
            f"pay_by_points_indicator={_pay_by_points_indicator!s}, "
            f"action_list={_action_list!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
