"""visaacceptancemergedspec.

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

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


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

    Attributes:
        code (str): Merchant-generated order reference or tracking number. It is
            recommended that you send a unique value for each transaction so that you
            can perform meaningful searches for the transaction.  #### Used by
            **Authorization** Required field.  #### PIN Debit Requests for PIN debit
            reversals need to use the same merchant reference number that was used in
            the transaction that is being reversed.  Required field for all PIN Debit
            requests (purchase, credit, and reversal).  #### FDC Nashville Global
            Certain circumstances can cause the processor to truncate this value to
            15 or 17 characters for Level II and Level III processing, which can
            cause a discrepancy between the value you submit and the value included
            in some processor reports.
        submit_local_date_time (str): Date and time at your physical location.
            Format: `YYYYMMDDhhmmss`, where YYYY = year, MM = month, DD = day, hh =
            hour, mm = minutes ss = seconds  #### PIN Debit Optional field for PIN
            Debit purchase and credit requests.
        owner_merchant_id (str): Merchant ID that was used to create the subscription
            or customer profile for which the service was requested.  If your Visa
            Acceptance account is enabled for Recurring Billing, this field is
            returned only if you are using subscription sharing and if your merchant
            ID is in the same merchant ID pool as the owner merchant ID.  If your
            Visa Acceptance account is enabled for Payment Tokenization, this field
            is returned only if you are using profile sharing and if your merchant ID
            is in the same merchant ID pool as the owner merchant ID.
        return_reconciliation_id (str): A new ID which is created for refund
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "code": "code",
        "submit_local_date_time": "submitLocalDateTime",
        "owner_merchant_id": "ownerMerchantId",
        "return_reconciliation_id": "returnReconciliationId",
    }

    _optionals = [
        "code",
        "submit_local_date_time",
        "owner_merchant_id",
        "return_reconciliation_id",
    ]

    def __init__(
        self,
        code=APIHelper.SKIP,
        submit_local_date_time=APIHelper.SKIP,
        owner_merchant_id=APIHelper.SKIP,
        return_reconciliation_id=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a ClientReferenceInformation11 instance."""
        # Initialize members of the class
        if code is not APIHelper.SKIP:
            self.code = code
        if submit_local_date_time is not APIHelper.SKIP:
            self.submit_local_date_time = submit_local_date_time
        if owner_merchant_id is not APIHelper.SKIP:
            self.owner_merchant_id = owner_merchant_id
        if return_reconciliation_id is not APIHelper.SKIP:
            self.return_reconciliation_id = return_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
        code =\
            dictionary.get("code")\
            if dictionary.get("code")\
                else APIHelper.SKIP
        submit_local_date_time =\
            dictionary.get("submitLocalDateTime")\
            if dictionary.get("submitLocalDateTime")\
                else APIHelper.SKIP
        owner_merchant_id =\
            dictionary.get("ownerMerchantId")\
            if dictionary.get("ownerMerchantId")\
                else APIHelper.SKIP
        return_reconciliation_id =\
            dictionary.get("returnReconciliationId")\
            if dictionary.get("returnReconciliationId")\
                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(code,
                   submit_local_date_time,
                   owner_merchant_id,
                   return_reconciliation_id,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _code=(
            self.code
            if hasattr(self, "code")
            else None
        )
        _submit_local_date_time=(
            self.submit_local_date_time
            if hasattr(self, "submit_local_date_time")
            else None
        )
        _owner_merchant_id=(
            self.owner_merchant_id
            if hasattr(self, "owner_merchant_id")
            else None
        )
        _return_reconciliation_id=(
            self.return_reconciliation_id
            if hasattr(self, "return_reconciliation_id")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"code={_code!r}, "
            f"submit_local_date_time={_submit_local_date_time!r}, "
            f"owner_merchant_id={_owner_merchant_id!r}, "
            f"return_reconciliation_id={_return_reconciliation_id!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _code=(
            self.code
            if hasattr(self, "code")
            else None
        )
        _submit_local_date_time=(
            self.submit_local_date_time
            if hasattr(self, "submit_local_date_time")
            else None
        )
        _owner_merchant_id=(
            self.owner_merchant_id
            if hasattr(self, "owner_merchant_id")
            else None
        )
        _return_reconciliation_id=(
            self.return_reconciliation_id
            if hasattr(self, "return_reconciliation_id")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"code={_code!s}, "
            f"submit_local_date_time={_submit_local_date_time!s}, "
            f"owner_merchant_id={_owner_merchant_id!s}, "
            f"return_reconciliation_id={_return_reconciliation_id!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
