"""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.brand_logo_asset_2 import (
    BrandLogoAsset2,
)
from visaacceptancemergedspec.models.combined_asset_2 import (
    CombinedAsset2,
)
from visaacceptancemergedspec.models.icon_asset_2 import (
    IconAsset2,
)
from visaacceptancemergedspec.models.issuer_logo_asset_2 import (
    IssuerLogoAsset2,
)


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

    Card art associated with the tokenized card.

    Attributes:
        foreground_color (str): Card foreground color.
        combined_asset (CombinedAsset2): The model property of type CombinedAsset2.
        brand_logo_asset (BrandLogoAsset2): The model property of type
            BrandLogoAsset2.
        issuer_logo_asset (IssuerLogoAsset2): The model property of type
            IssuerLogoAsset2.
        icon_asset (IconAsset2): The model property of type IconAsset2.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "foreground_color": "foregroundColor",
        "combined_asset": "combinedAsset",
        "brand_logo_asset": "brandLogoAsset",
        "issuer_logo_asset": "issuerLogoAsset",
        "icon_asset": "iconAsset",
    }

    _optionals = [
        "foreground_color",
        "combined_asset",
        "brand_logo_asset",
        "issuer_logo_asset",
        "icon_asset",
    ]

    def __init__(
        self,
        foreground_color=APIHelper.SKIP,
        combined_asset=APIHelper.SKIP,
        brand_logo_asset=APIHelper.SKIP,
        issuer_logo_asset=APIHelper.SKIP,
        icon_asset=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a TmsCardArt instance."""
        # Initialize members of the class
        if foreground_color is not APIHelper.SKIP:
            self.foreground_color = foreground_color
        if combined_asset is not APIHelper.SKIP:
            self.combined_asset = combined_asset
        if brand_logo_asset is not APIHelper.SKIP:
            self.brand_logo_asset = brand_logo_asset
        if issuer_logo_asset is not APIHelper.SKIP:
            self.issuer_logo_asset = issuer_logo_asset
        if icon_asset is not APIHelper.SKIP:
            self.icon_asset = icon_asset

        # 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
        foreground_color =\
            dictionary.get("foregroundColor")\
            if dictionary.get("foregroundColor")\
                else APIHelper.SKIP
        combined_asset =\
            CombinedAsset2.from_dictionary(
                dictionary.get("combinedAsset"))\
                if "combinedAsset" in dictionary.keys()\
                else APIHelper.SKIP
        brand_logo_asset =\
            BrandLogoAsset2.from_dictionary(
                dictionary.get("brandLogoAsset"))\
                if "brandLogoAsset" in dictionary.keys()\
                else APIHelper.SKIP
        issuer_logo_asset =\
            IssuerLogoAsset2.from_dictionary(
                dictionary.get("issuerLogoAsset"))\
                if "issuerLogoAsset" in dictionary.keys()\
                else APIHelper.SKIP
        icon_asset =\
            IconAsset2.from_dictionary(
                dictionary.get("iconAsset"))\
                if "iconAsset" in dictionary.keys()\
                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(foreground_color,
                   combined_asset,
                   brand_logo_asset,
                   issuer_logo_asset,
                   icon_asset,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _foreground_color=(
            self.foreground_color
            if hasattr(self, "foreground_color")
            else None
        )
        _combined_asset=(
            self.combined_asset
            if hasattr(self, "combined_asset")
            else None
        )
        _brand_logo_asset=(
            self.brand_logo_asset
            if hasattr(self, "brand_logo_asset")
            else None
        )
        _issuer_logo_asset=(
            self.issuer_logo_asset
            if hasattr(self, "issuer_logo_asset")
            else None
        )
        _icon_asset=(
            self.icon_asset
            if hasattr(self, "icon_asset")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"foreground_color={_foreground_color!r}, "
            f"combined_asset={_combined_asset!r}, "
            f"brand_logo_asset={_brand_logo_asset!r}, "
            f"issuer_logo_asset={_issuer_logo_asset!r}, "
            f"icon_asset={_icon_asset!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _foreground_color=(
            self.foreground_color
            if hasattr(self, "foreground_color")
            else None
        )
        _combined_asset=(
            self.combined_asset
            if hasattr(self, "combined_asset")
            else None
        )
        _brand_logo_asset=(
            self.brand_logo_asset
            if hasattr(self, "brand_logo_asset")
            else None
        )
        _issuer_logo_asset=(
            self.issuer_logo_asset
            if hasattr(self, "issuer_logo_asset")
            else None
        )
        _icon_asset=(
            self.icon_asset
            if hasattr(self, "icon_asset")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"foreground_color={_foreground_color!s}, "
            f"combined_asset={_combined_asset!s}, "
            f"brand_logo_asset={_brand_logo_asset!s}, "
            f"issuer_logo_asset={_issuer_logo_asset!s}, "
            f"icon_asset={_icon_asset!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
