"""visaacceptancemergedspec.

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

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


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

    Attributes:
        original_transaction_id (str): Value that links the previous transaction to
            the current follow-on request. This value is assigned by the client
            software that is installed on the POS terminal, which makes it available
            to the terminal’s software and to Visa Acceptance. Therefore, you can use
            this value to reconcile transactions between Visa Acceptance and the
            terminal’s software.  Visa Acceptance does not forward this value to the
            processor. Instead, the value is forwarded to the Visa Acceptance
            reporting functionality.  This field is supported only on these
            processors: - American Express Direct - Credit Mutuel-CIC - FDC Nashville
            Global - OmniPay Direct - SIX  Optional field.
        developer_id (str): Identifier for the developer that helped integrate a
            partner solution to Visa Acceptance.  Send this value in all requests
            that are sent through the partner solutions built by that developer. Visa
            Acceptance assigns the ID to the developer.  **Note** When you see a
            developer ID of 999 in reports, the developer ID that was submitted is
            incorrect.
        solution_id (str): Identifier for the partner that is integrated to Visa
            Acceptance.  Send this value in all requests that are sent through the
            partner solution. Visa Acceptance assigns the ID to the partner.
            **Note** When you see a solutionId of 999 in reports, the solutionId that
            was submitted is incorrect.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "original_transaction_id": "originalTransactionId",
        "developer_id": "developerId",
        "solution_id": "solutionId",
    }

    _optionals = [
        "original_transaction_id",
        "developer_id",
        "solution_id",
    ]

    def __init__(
        self,
        original_transaction_id=APIHelper.SKIP,
        developer_id=APIHelper.SKIP,
        solution_id=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a Partner1 instance."""
        # Initialize members of the class
        if original_transaction_id is not APIHelper.SKIP:
            self.original_transaction_id = original_transaction_id
        if developer_id is not APIHelper.SKIP:
            self.developer_id = developer_id
        if solution_id is not APIHelper.SKIP:
            self.solution_id = solution_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
        original_transaction_id =\
            dictionary.get("originalTransactionId")\
            if dictionary.get("originalTransactionId")\
                else APIHelper.SKIP
        developer_id =\
            dictionary.get("developerId")\
            if dictionary.get("developerId")\
                else APIHelper.SKIP
        solution_id =\
            dictionary.get("solutionId")\
            if dictionary.get("solutionId")\
                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(original_transaction_id,
                   developer_id,
                   solution_id,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _original_transaction_id=(
            self.original_transaction_id
            if hasattr(self, "original_transaction_id")
            else None
        )
        _developer_id=(
            self.developer_id
            if hasattr(self, "developer_id")
            else None
        )
        _solution_id=(
            self.solution_id
            if hasattr(self, "solution_id")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"original_transaction_id={_original_transaction_id!r}, "
            f"developer_id={_developer_id!r}, "
            f"solution_id={_solution_id!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _original_transaction_id=(
            self.original_transaction_id
            if hasattr(self, "original_transaction_id")
            else None
        )
        _developer_id=(
            self.developer_id
            if hasattr(self, "developer_id")
            else None
        )
        _solution_id=(
            self.solution_id
            if hasattr(self, "solution_id")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"original_transaction_id={_original_transaction_id!s}, "
            f"developer_id={_developer_id!s}, "
            f"solution_id={_solution_id!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
