"""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_1 import (
    ClientReferenceInformation1,
)
from visaacceptancemergedspec.models.links_1 import (
    Links1,
)
from visaacceptancemergedspec.models.processor_information_10 import (
    ProcessorInformation10,
)
from visaacceptancemergedspec.models.void_amount_details import (
    VoidAmountDetails,
)


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

    Attributes:
        links (Links1): The model property of type Links1.
        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:  -
            VOIDED  - CANCELLED  - FAILED
        client_reference_information (ClientReferenceInformation1): The model
            property of type ClientReferenceInformation1.
        void_amount_details (VoidAmountDetails): The model property of type
            VoidAmountDetails.
        processor_information (ProcessorInformation10): The model property of type
            ProcessorInformation10.
        reconciliation_id (str): Reference number that you use to reconcile Visa
            Acceptance reports with your reports.
        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",
        "client_reference_information": "clientReferenceInformation",
        "void_amount_details": "voidAmountDetails",
        "processor_information": "processorInformation",
        "reconciliation_id": "reconciliationId",
    }

    _optionals = [
        "links",
        "id",
        "submit_time_utc",
        "status",
        "client_reference_information",
        "void_amount_details",
        "processor_information",
        "reconciliation_id",
    ]

    def __init__(
        self,
        links=APIHelper.SKIP,
        id=APIHelper.SKIP,
        submit_time_utc=APIHelper.SKIP,
        status=APIHelper.SKIP,
        client_reference_information=APIHelper.SKIP,
        void_amount_details=APIHelper.SKIP,
        processor_information=APIHelper.SKIP,
        reconciliation_id=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a PtsV2RefundsVoidsPost201Response 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 client_reference_information is not APIHelper.SKIP:
            self.client_reference_information = client_reference_information
        if void_amount_details is not APIHelper.SKIP:
            self.void_amount_details = void_amount_details
        if processor_information is not APIHelper.SKIP:
            self.processor_information = processor_information
        if reconciliation_id is not APIHelper.SKIP:
            self.reconciliation_id = reconciliation_id

        # 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 =\
            Links1.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
        client_reference_information =\
            ClientReferenceInformation1.from_dictionary(
                dictionary.get("clientReferenceInformation"))\
                if "clientReferenceInformation" in dictionary.keys()\
                else APIHelper.SKIP
        void_amount_details =\
            VoidAmountDetails.from_dictionary(
                dictionary.get("voidAmountDetails"))\
                if "voidAmountDetails" in dictionary.keys()\
                else APIHelper.SKIP
        processor_information =\
            ProcessorInformation10.from_dictionary(
                dictionary.get("processorInformation"))\
                if "processorInformation" in dictionary.keys()\
                else APIHelper.SKIP
        reconciliation_id =\
            dictionary.get("reconciliationId")\
            if dictionary.get("reconciliationId")\
                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,
                   client_reference_information,
                   void_amount_details,
                   processor_information,
                   reconciliation_id,
                   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
        )
        _client_reference_information=(
            self.client_reference_information
            if hasattr(self, "client_reference_information")
            else None
        )
        _void_amount_details=(
            self.void_amount_details
            if hasattr(self, "void_amount_details")
            else None
        )
        _processor_information=(
            self.processor_information
            if hasattr(self, "processor_information")
            else None
        )
        _reconciliation_id=(
            self.reconciliation_id
            if hasattr(self, "reconciliation_id")
            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"client_reference_information={_client_reference_information!r}, "
            f"void_amount_details={_void_amount_details!r}, "
            f"processor_information={_processor_information!r}, "
            f"reconciliation_id={_reconciliation_id!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
        )
        _client_reference_information=(
            self.client_reference_information
            if hasattr(self, "client_reference_information")
            else None
        )
        _void_amount_details=(
            self.void_amount_details
            if hasattr(self, "void_amount_details")
            else None
        )
        _processor_information=(
            self.processor_information
            if hasattr(self, "processor_information")
            else None
        )
        _reconciliation_id=(
            self.reconciliation_id
            if hasattr(self, "reconciliation_id")
            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"client_reference_information={_client_reference_information!s}, "
            f"void_amount_details={_void_amount_details!s}, "
            f"processor_information={_processor_information!s}, "
            f"reconciliation_id={_reconciliation_id!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
