"""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.client_reference_information_11 import (
    ClientReferenceInformation11,
)
from visaacceptancemergedspec.models.links_5 import (
    Links5,
)
from visaacceptancemergedspec.models.order_information_9 import (
    OrderInformation9,
)
from visaacceptancemergedspec.models.point_of_sale_information_7 import (
    PointOfSaleInformation7,
)
from visaacceptancemergedspec.models.processing_information_6 import (
    ProcessingInformation6,
)
from visaacceptancemergedspec.models.processor_information_7 import (
    ProcessorInformation7,
)
from visaacceptancemergedspec.models.refund_amount_details import (
    RefundAmountDetails,
)


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

    Attributes:
        links (Links5): The model property of type Links5.
        id (str): An unique identification number generated by Visa Acceptance to
            identify the submitted request. Returned by all services. It is also
            appended to the endpoint of the resource. On incremental authorizations,
            this value with be the same as the identification number returned in the
            original authorization response.
        submit_time_utc (str): Time of request in UTC. Format: `YYYY-MM-DDThh:mm:ssZ`
            **Example** `2016-08-11T22:47:57Z` equals August 11, 2016, at 22:47:57
            (10:47:57 p.m.). The `T` separates the date and the time. The `Z`
            indicates UTC.  Returned by Visa Acceptance for all services.
        status (str): The status of the submitted transaction.  Possible values:  -
            PENDING
        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.
        client_reference_information (ClientReferenceInformation11): The model
            property of type ClientReferenceInformation11.
        refund_amount_details (RefundAmountDetails): The model property of type
            RefundAmountDetails.
        processing_information (ProcessingInformation6): The model property of type
            ProcessingInformation6.
        processor_information (ProcessorInformation7): The model property of type
            ProcessorInformation7.
        order_information (OrderInformation9): The model property of type
            OrderInformation9.
        point_of_sale_information (PointOfSaleInformation7): The model property of
            type PointOfSaleInformation7.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "links": "_links",
        "id": "id",
        "submit_time_utc": "submitTimeUtc",
        "status": "status",
        "reconciliation_id": "reconciliationId",
        "client_reference_information": "clientReferenceInformation",
        "refund_amount_details": "refundAmountDetails",
        "processing_information": "processingInformation",
        "processor_information": "processorInformation",
        "order_information": "orderInformation",
        "point_of_sale_information": "pointOfSaleInformation",
    }

    _optionals = [
        "links",
        "id",
        "submit_time_utc",
        "status",
        "reconciliation_id",
        "client_reference_information",
        "refund_amount_details",
        "processing_information",
        "processor_information",
        "order_information",
        "point_of_sale_information",
    ]

    def __init__(
        self,
        links=APIHelper.SKIP,
        id=APIHelper.SKIP,
        submit_time_utc=APIHelper.SKIP,
        status=APIHelper.SKIP,
        reconciliation_id=APIHelper.SKIP,
        client_reference_information=APIHelper.SKIP,
        refund_amount_details=APIHelper.SKIP,
        processing_information=APIHelper.SKIP,
        processor_information=APIHelper.SKIP,
        order_information=APIHelper.SKIP,
        point_of_sale_information=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a PtsV2PaymentsRefundPost201Response instance."""
        # Initialize members of the class
        if links is not APIHelper.SKIP:
            self.links = links
        if id is not APIHelper.SKIP:
            self.id = id
        if submit_time_utc is not APIHelper.SKIP:
            self.submit_time_utc = submit_time_utc
        if status is not APIHelper.SKIP:
            self.status = status
        if reconciliation_id is not APIHelper.SKIP:
            self.reconciliation_id = reconciliation_id
        if client_reference_information is not APIHelper.SKIP:
            self.client_reference_information = client_reference_information
        if refund_amount_details is not APIHelper.SKIP:
            self.refund_amount_details = refund_amount_details
        if processing_information is not APIHelper.SKIP:
            self.processing_information = processing_information
        if processor_information is not APIHelper.SKIP:
            self.processor_information = processor_information
        if order_information is not APIHelper.SKIP:
            self.order_information = order_information
        if point_of_sale_information is not APIHelper.SKIP:
            self.point_of_sale_information = point_of_sale_information

        # 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
        links =\
            Links5.from_dictionary(
                dictionary.get("_links"))\
                if "_links" in dictionary.keys()\
                else APIHelper.SKIP
        id =\
            dictionary.get("id")\
            if dictionary.get("id")\
                else APIHelper.SKIP
        submit_time_utc =\
            dictionary.get("submitTimeUtc")\
            if dictionary.get("submitTimeUtc")\
                else APIHelper.SKIP
        status =\
            dictionary.get("status")\
            if dictionary.get("status")\
                else APIHelper.SKIP
        reconciliation_id =\
            dictionary.get("reconciliationId")\
            if dictionary.get("reconciliationId")\
                else APIHelper.SKIP
        client_reference_information =\
            ClientReferenceInformation11.from_dictionary(
                dictionary.get("clientReferenceInformation"))\
                if "clientReferenceInformation" in dictionary.keys()\
                else APIHelper.SKIP
        refund_amount_details =\
            RefundAmountDetails.from_dictionary(
                dictionary.get("refundAmountDetails"))\
                if "refundAmountDetails" in dictionary.keys()\
                else APIHelper.SKIP
        processing_information =\
            ProcessingInformation6.from_dictionary(
                dictionary.get("processingInformation"))\
                if "processingInformation" in dictionary.keys()\
                else APIHelper.SKIP
        processor_information =\
            ProcessorInformation7.from_dictionary(
                dictionary.get("processorInformation"))\
                if "processorInformation" in dictionary.keys()\
                else APIHelper.SKIP
        order_information =\
            OrderInformation9.from_dictionary(
                dictionary.get("orderInformation"))\
                if "orderInformation" in dictionary.keys()\
                else APIHelper.SKIP
        point_of_sale_information =\
            PointOfSaleInformation7.from_dictionary(
                dictionary.get("pointOfSaleInformation"))\
                if "pointOfSaleInformation" 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(links,
                   id,
                   submit_time_utc,
                   status,
                   reconciliation_id,
                   client_reference_information,
                   refund_amount_details,
                   processing_information,
                   processor_information,
                   order_information,
                   point_of_sale_information,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _links=(
            self.links
            if hasattr(self, "links")
            else None
        )
        _id=(
            self.id
            if hasattr(self, "id")
            else None
        )
        _submit_time_utc=(
            self.submit_time_utc
            if hasattr(self, "submit_time_utc")
            else None
        )
        _status=(
            self.status
            if hasattr(self, "status")
            else None
        )
        _reconciliation_id=(
            self.reconciliation_id
            if hasattr(self, "reconciliation_id")
            else None
        )
        _client_reference_information=(
            self.client_reference_information
            if hasattr(self, "client_reference_information")
            else None
        )
        _refund_amount_details=(
            self.refund_amount_details
            if hasattr(self, "refund_amount_details")
            else None
        )
        _processing_information=(
            self.processing_information
            if hasattr(self, "processing_information")
            else None
        )
        _processor_information=(
            self.processor_information
            if hasattr(self, "processor_information")
            else None
        )
        _order_information=(
            self.order_information
            if hasattr(self, "order_information")
            else None
        )
        _point_of_sale_information=(
            self.point_of_sale_information
            if hasattr(self, "point_of_sale_information")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"links={_links!r}, "
            f"id={_id!r}, "
            f"submit_time_utc={_submit_time_utc!r}, "
            f"status={_status!r}, "
            f"reconciliation_id={_reconciliation_id!r}, "
            f"client_reference_information={_client_reference_information!r}, "
            f"refund_amount_details={_refund_amount_details!r}, "
            f"processing_information={_processing_information!r}, "
            f"processor_information={_processor_information!r}, "
            f"order_information={_order_information!r}, "
            f"point_of_sale_information={_point_of_sale_information!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _links=(
            self.links
            if hasattr(self, "links")
            else None
        )
        _id=(
            self.id
            if hasattr(self, "id")
            else None
        )
        _submit_time_utc=(
            self.submit_time_utc
            if hasattr(self, "submit_time_utc")
            else None
        )
        _status=(
            self.status
            if hasattr(self, "status")
            else None
        )
        _reconciliation_id=(
            self.reconciliation_id
            if hasattr(self, "reconciliation_id")
            else None
        )
        _client_reference_information=(
            self.client_reference_information
            if hasattr(self, "client_reference_information")
            else None
        )
        _refund_amount_details=(
            self.refund_amount_details
            if hasattr(self, "refund_amount_details")
            else None
        )
        _processing_information=(
            self.processing_information
            if hasattr(self, "processing_information")
            else None
        )
        _processor_information=(
            self.processor_information
            if hasattr(self, "processor_information")
            else None
        )
        _order_information=(
            self.order_information
            if hasattr(self, "order_information")
            else None
        )
        _point_of_sale_information=(
            self.point_of_sale_information
            if hasattr(self, "point_of_sale_information")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"links={_links!s}, "
            f"id={_id!s}, "
            f"submit_time_utc={_submit_time_utc!s}, "
            f"status={_status!s}, "
            f"reconciliation_id={_reconciliation_id!s}, "
            f"client_reference_information={_client_reference_information!s}, "
            f"refund_amount_details={_refund_amount_details!s}, "
            f"processing_information={_processing_information!s}, "
            f"processor_information={_processor_information!s}, "
            f"order_information={_order_information!s}, "
            f"point_of_sale_information={_point_of_sale_information!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
