"""mindbodypublicapi.

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

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


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

    Attributes:
        location_id (int): When included, returns gift cards that are sold at the
            provided location ID.
        sold_online (bool): When `true`, only returns gift cards that are sold
            online.<br />  Default: **false**
        include_custom_layouts (bool): When `true`, includes custom gift card
            layouts.<br />  When `false`, includes only system layouts.  Default:
            **false**
        ids (List[int]): Filters the results to the requested gift card IDs.<br />
            Default: **all** gift cards.
        limit (int): Number of results to include, defaults to 100
        offset (int): Page offset, defaults to 0.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "location_id": "LocationId",
        "sold_online": "SoldOnline",
        "include_custom_layouts": "IncludeCustomLayouts",
        "ids": "Ids",
        "limit": "Limit",
        "offset": "Offset",
    }

    _optionals = [
        "location_id",
        "sold_online",
        "include_custom_layouts",
        "ids",
        "limit",
        "offset",
    ]

    def __init__(
        self,
        location_id=APIHelper.SKIP,
        sold_online=APIHelper.SKIP,
        include_custom_layouts=APIHelper.SKIP,
        ids=APIHelper.SKIP,
        limit=APIHelper.SKIP,
        offset=APIHelper.SKIP):
        """Initialize a GetGiftCardsRequest instance."""
        # Initialize members of the class
        if location_id is not APIHelper.SKIP:
            self.location_id = location_id
        if sold_online is not APIHelper.SKIP:
            self.sold_online = sold_online
        if include_custom_layouts is not APIHelper.SKIP:
            self.include_custom_layouts = include_custom_layouts
        if ids is not APIHelper.SKIP:
            self.ids = ids
        if limit is not APIHelper.SKIP:
            self.limit = limit
        if offset is not APIHelper.SKIP:
            self.offset = offset

    @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
        location_id =\
            dictionary.get("LocationId")\
            if dictionary.get("LocationId")\
                else APIHelper.SKIP
        sold_online =\
            dictionary.get("SoldOnline")\
            if "SoldOnline" in dictionary.keys()\
                else APIHelper.SKIP
        include_custom_layouts =\
            dictionary.get("IncludeCustomLayouts")\
            if "IncludeCustomLayouts" in dictionary.keys()\
                else APIHelper.SKIP
        ids =\
            dictionary.get("Ids")\
            if dictionary.get("Ids")\
                else APIHelper.SKIP
        limit =\
            dictionary.get("Limit")\
            if dictionary.get("Limit")\
                else APIHelper.SKIP
        offset =\
            dictionary.get("Offset")\
            if dictionary.get("Offset")\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(location_id,
                   sold_online,
                   include_custom_layouts,
                   ids,
                   limit,
                   offset)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _location_id=(
            self.location_id
            if hasattr(self, "location_id")
            else None
        )
        _sold_online=(
            self.sold_online
            if hasattr(self, "sold_online")
            else None
        )
        _include_custom_layouts=(
            self.include_custom_layouts
            if hasattr(self, "include_custom_layouts")
            else None
        )
        _ids=(
            self.ids
            if hasattr(self, "ids")
            else None
        )
        _limit=(
            self.limit
            if hasattr(self, "limit")
            else None
        )
        _offset=(
            self.offset
            if hasattr(self, "offset")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"location_id={_location_id!r}, "
            f"sold_online={_sold_online!r}, "
            f"include_custom_layouts={_include_custom_layouts!r}, "
            f"ids={_ids!r}, "
            f"limit={_limit!r}, "
            f"offset={_offset!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _location_id=(
            self.location_id
            if hasattr(self, "location_id")
            else None
        )
        _sold_online=(
            self.sold_online
            if hasattr(self, "sold_online")
            else None
        )
        _include_custom_layouts=(
            self.include_custom_layouts
            if hasattr(self, "include_custom_layouts")
            else None
        )
        _ids=(
            self.ids
            if hasattr(self, "ids")
            else None
        )
        _limit=(
            self.limit
            if hasattr(self, "limit")
            else None
        )
        _offset=(
            self.offset
            if hasattr(self, "offset")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"location_id={_location_id!s}, "
            f"sold_online={_sold_online!s}, "
            f"include_custom_layouts={_include_custom_layouts!s}, "
            f"ids={_ids!s}, "
            f"limit={_limit!s}, "
            f"offset={_offset!s}, "
            f")"
        )
