"""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.color import (
    Color,
)


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

    Attributes:
        border_radius (str): Border Radius, Allowed Values - Number, Chars, SPACE,
            Percentage(%), DOT(.), Example '25px 10px 25px 10px'; '2em 1em 0.5em 3em'
        theme (str): UI Theme Name/Design Name - Allowed Chars: Alpha Numeric, Dot
            (.), Hyphen (-), Underscore (_)
        color (Color): The model property of type Color.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "border_radius": "borderRadius",
        "theme": "theme",
        "color": "color",
    }

    _optionals = [
        "border_radius",
        "theme",
        "color",
    ]

    def __init__(
        self,
        border_radius=APIHelper.SKIP,
        theme=APIHelper.SKIP,
        color=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a UserInterface instance."""
        # Initialize members of the class
        if border_radius is not APIHelper.SKIP:
            self.border_radius = border_radius
        if theme is not APIHelper.SKIP:
            self.theme = theme
        if color is not APIHelper.SKIP:
            self.color = color

        # 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
        border_radius =\
            dictionary.get("borderRadius")\
            if dictionary.get("borderRadius")\
                else APIHelper.SKIP
        theme =\
            dictionary.get("theme")\
            if dictionary.get("theme")\
                else APIHelper.SKIP
        color =\
            Color.from_dictionary(
                dictionary.get("color"))\
                if "color" 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(border_radius,
                   theme,
                   color,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _border_radius=(
            self.border_radius
            if hasattr(self, "border_radius")
            else None
        )
        _theme=(
            self.theme
            if hasattr(self, "theme")
            else None
        )
        _color=(
            self.color
            if hasattr(self, "color")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"border_radius={_border_radius!r}, "
            f"theme={_theme!r}, "
            f"color={_color!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _border_radius=(
            self.border_radius
            if hasattr(self, "border_radius")
            else None
        )
        _theme=(
            self.theme
            if hasattr(self, "theme")
            else None
        )
        _color=(
            self.color
            if hasattr(self, "color")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"border_radius={_border_radius!s}, "
            f"theme={_theme!s}, "
            f"color={_color!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
