"""mindbodypublicapi.

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

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


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

    Get Categories Request Model

    Attributes:
        category_ids (List[int]): When included, the response only contains details
            about the specified category Ids.
        sub_category_ids (List[int]): When included, the response only contains
            details about the specified subcategory Ids.
        service (bool): When `true`, the response only contains details about Revenue
            Categories.  When `false`, only Product Revenue Categories are returned.
            Default: **All Categories**
        active (bool): When `true`, the response only contains categories which are
            activated.   When `false`, only deactivated categories are returned.
            Default: **All Categories**
        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 = {
        "category_ids": "CategoryIds",
        "sub_category_ids": "SubCategoryIds",
        "service": "Service",
        "active": "Active",
        "limit": "Limit",
        "offset": "Offset",
    }

    _optionals = [
        "category_ids",
        "sub_category_ids",
        "service",
        "active",
        "limit",
        "offset",
    ]

    def __init__(
        self,
        category_ids=APIHelper.SKIP,
        sub_category_ids=APIHelper.SKIP,
        service=APIHelper.SKIP,
        active=APIHelper.SKIP,
        limit=APIHelper.SKIP,
        offset=APIHelper.SKIP):
        """Initialize a GetCategoriesRequest instance."""
        # Initialize members of the class
        if category_ids is not APIHelper.SKIP:
            self.category_ids = category_ids
        if sub_category_ids is not APIHelper.SKIP:
            self.sub_category_ids = sub_category_ids
        if service is not APIHelper.SKIP:
            self.service = service
        if active is not APIHelper.SKIP:
            self.active = active
        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
        category_ids =\
            dictionary.get("CategoryIds")\
            if dictionary.get("CategoryIds")\
                else APIHelper.SKIP
        sub_category_ids =\
            dictionary.get("SubCategoryIds")\
            if dictionary.get("SubCategoryIds")\
                else APIHelper.SKIP
        service =\
            dictionary.get("Service")\
            if "Service" in dictionary.keys()\
                else APIHelper.SKIP
        active =\
            dictionary.get("Active")\
            if "Active" in dictionary.keys()\
                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(category_ids,
                   sub_category_ids,
                   service,
                   active,
                   limit,
                   offset)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _category_ids=(
            self.category_ids
            if hasattr(self, "category_ids")
            else None
        )
        _sub_category_ids=(
            self.sub_category_ids
            if hasattr(self, "sub_category_ids")
            else None
        )
        _service=(
            self.service
            if hasattr(self, "service")
            else None
        )
        _active=(
            self.active
            if hasattr(self, "active")
            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"category_ids={_category_ids!r}, "
            f"sub_category_ids={_sub_category_ids!r}, "
            f"service={_service!r}, "
            f"active={_active!r}, "
            f"limit={_limit!r}, "
            f"offset={_offset!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _category_ids=(
            self.category_ids
            if hasattr(self, "category_ids")
            else None
        )
        _sub_category_ids=(
            self.sub_category_ids
            if hasattr(self, "sub_category_ids")
            else None
        )
        _service=(
            self.service
            if hasattr(self, "service")
            else None
        )
        _active=(
            self.active
            if hasattr(self, "active")
            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"category_ids={_category_ids!s}, "
            f"sub_category_ids={_sub_category_ids!s}, "
            f"service={_service!s}, "
            f"active={_active!s}, "
            f"limit={_limit!s}, "
            f"offset={_offset!s}, "
            f")"
        )
