"""paypalserversdk.

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

# ruff: noqa: E501
from paypalserversdk.api_helper import APIHelper
from paypalserversdk.models.related_identifiers import (
    RelatedIdentifiers,
)


class PaymentSupplementaryData(object):
    """Implementation of the 'Payment Supplementary Data' model.

    The supplementary data.

    Attributes:
        related_ids (RelatedIdentifiers): Identifiers related to a specific resource.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "related_ids": "related_ids",
    }

    _optionals = [
        "related_ids",
    ]

    def __init__(
        self,
        related_ids=APIHelper.SKIP):
        """Initialize a PaymentSupplementaryData instance."""
        # Initialize members of the class
        if related_ids is not APIHelper.SKIP:
            self.related_ids = related_ids

    @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
        related_ids =\
            RelatedIdentifiers.from_dictionary(
                dictionary.get("related_ids"))\
                if "related_ids" in dictionary.keys()\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(related_ids)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _related_ids=(
            self.related_ids
            if hasattr(self, "related_ids")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"related_ids={_related_ids!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _related_ids=(
            self.related_ids
            if hasattr(self, "related_ids")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"related_ids={_related_ids!s}, "
            f")"
        )
