"""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.content import (
    Content,
)


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

    Represents the Card Art Asset associated to the Network Token.

    Attributes:
        id (str): Unique identifier for the Card Art Asset.
        mtype (str): The type of Card Art Asset.
        provider (str): The provider of the Card Art Asset.
        content (List[Content]): Array of content objects representing the Card Art
            Asset.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "id": "id",
        "mtype": "type",
        "provider": "provider",
        "content": "content",
    }

    _optionals = [
        "id",
        "mtype",
        "provider",
        "content",
    ]

    def __init__(
        self,
        id=APIHelper.SKIP,
        mtype=APIHelper.SKIP,
        provider=APIHelper.SKIP,
        content=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a GetCardArtAssetResponse instance."""
        # Initialize members of the class
        if id is not APIHelper.SKIP:
            self.id = id
        if mtype is not APIHelper.SKIP:
            self.mtype = mtype
        if provider is not APIHelper.SKIP:
            self.provider = provider
        if content is not APIHelper.SKIP:
            self.content = content

        # 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
        id =\
            dictionary.get("id")\
            if dictionary.get("id")\
                else APIHelper.SKIP
        mtype =\
            dictionary.get("type")\
            if dictionary.get("type")\
                else APIHelper.SKIP
        provider =\
            dictionary.get("provider")\
            if dictionary.get("provider")\
                else APIHelper.SKIP
        content = None
        if dictionary.get("content") is not None:
            content = [
                Content.from_dictionary(x)
                    for x in dictionary.get("content")
            ]
        else:
            content = 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(id,
                   mtype,
                   provider,
                   content,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _id=(
            self.id
            if hasattr(self, "id")
            else None
        )
        _mtype=(
            self.mtype
            if hasattr(self, "mtype")
            else None
        )
        _provider=(
            self.provider
            if hasattr(self, "provider")
            else None
        )
        _content=(
            self.content
            if hasattr(self, "content")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"id={_id!r}, "
            f"mtype={_mtype!r}, "
            f"provider={_provider!r}, "
            f"content={_content!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _id=(
            self.id
            if hasattr(self, "id")
            else None
        )
        _mtype=(
            self.mtype
            if hasattr(self, "mtype")
            else None
        )
        _provider=(
            self.provider
            if hasattr(self, "provider")
            else None
        )
        _content=(
            self.content
            if hasattr(self, "content")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"id={_id!s}, "
            f"mtype={_mtype!s}, "
            f"provider={_provider!s}, "
            f"content={_content!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
