"""visaacceptancemergedspec.

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

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


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

    Attributes:
        level_3_transmission_status (bool): Indicates whether Visa Acceptance sent
            the Level III information to the processor. The possible values are:  If
            your account is not enabled for Level III data or if you did not include
            the purchasing level field in your request, Visa Acceptance does not
            include the Level III data in the request sent to the processor.
            Possible values: - **true** - **false**
        sales_slip_number (int): Transaction identifier that is generated. You have
            the option of printing the sales slip number on the receipt. This field
            is supported only on Visa Acceptance through Visanet and JCN gateway.
            Optional field.  #### Card Present processing message If you included
            this field in the request, the returned value is the value that you sent
            in the request. If you did not include this field in the request, the
            system generated this value for you.  The difference between this reply
            field and the `processorInformation.systemTraceAuditNumber` field is that
            the system generates the system trace audit number (STAN), and you must
            print the receipt number on the receipt; whereas you can generate the
            sales slip number, and you can choose to print the sales slip number on
            the receipt.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "level_3_transmission_status": "level3TransmissionStatus",
        "sales_slip_number": "salesSlipNumber",
    }

    _optionals = [
        "level_3_transmission_status",
        "sales_slip_number",
    ]

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

        # 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
        level_3_transmission_status =\
            dictionary.get("level3TransmissionStatus")\
            if "level3TransmissionStatus" in dictionary.keys()\
                else APIHelper.SKIP
        sales_slip_number =\
            dictionary.get("salesSlipNumber")\
            if dictionary.get("salesSlipNumber")\
                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(level_3_transmission_status,
                   sales_slip_number,
                   additional_properties)

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

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