"""mindbodypublicapi.

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

# ruff: noqa: E501
from mindbodypublicapi.api_helper import APIHelper


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

    Gift card layout

    Attributes:
        layout_id (int): The ID of the layout.
        layout_name (str): The name of the layout.
        layout_url (str): The URL of the layout.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "layout_id": "LayoutId",
        "layout_name": "LayoutName",
        "layout_url": "LayoutUrl",
    }

    _optionals = [
        "layout_id",
        "layout_name",
        "layout_url",
    ]

    def __init__(
        self,
        layout_id=APIHelper.SKIP,
        layout_name=APIHelper.SKIP,
        layout_url=APIHelper.SKIP):
        """Initialize a GiftCardLayout instance."""
        # Initialize members of the class
        if layout_id is not APIHelper.SKIP:
            self.layout_id = layout_id
        if layout_name is not APIHelper.SKIP:
            self.layout_name = layout_name
        if layout_url is not APIHelper.SKIP:
            self.layout_url = layout_url

    @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
        layout_id =\
            dictionary.get("LayoutId")\
            if dictionary.get("LayoutId")\
                else APIHelper.SKIP
        layout_name =\
            dictionary.get("LayoutName")\
            if dictionary.get("LayoutName")\
                else APIHelper.SKIP
        layout_url =\
            dictionary.get("LayoutUrl")\
            if dictionary.get("LayoutUrl")\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(layout_id,
                   layout_name,
                   layout_url)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _layout_id=(
            self.layout_id
            if hasattr(self, "layout_id")
            else None
        )
        _layout_name=(
            self.layout_name
            if hasattr(self, "layout_name")
            else None
        )
        _layout_url=(
            self.layout_url
            if hasattr(self, "layout_url")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"layout_id={_layout_id!r}, "
            f"layout_name={_layout_name!r}, "
            f"layout_url={_layout_url!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _layout_id=(
            self.layout_id
            if hasattr(self, "layout_id")
            else None
        )
        _layout_name=(
            self.layout_name
            if hasattr(self, "layout_name")
            else None
        )
        _layout_url=(
            self.layout_url
            if hasattr(self, "layout_url")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"layout_id={_layout_id!s}, "
            f"layout_name={_layout_name!s}, "
            f"layout_url={_layout_url!s}, "
            f")"
        )
