"""mindbodypublicapi.

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

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


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

    Attributes:
        resource_ids (List[int]): Filter on resourceIds
        location_ids (List[int]): Filter by location ids (optional)
        schedule_types (List[ScheduleType4Enum]): Filter by schedule types (optional)
        program_ids (List[int]): Filter by program ids (optional)
        include_inactive (bool): Enable to include inactive
        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 = {
        "resource_ids": "ResourceIds",
        "location_ids": "LocationIds",
        "schedule_types": "ScheduleTypes",
        "program_ids": "ProgramIds",
        "include_inactive": "IncludeInactive",
        "limit": "Limit",
        "offset": "Offset",
    }

    _optionals = [
        "resource_ids",
        "location_ids",
        "schedule_types",
        "program_ids",
        "include_inactive",
        "limit",
        "offset",
    ]

    def __init__(
        self,
        resource_ids=APIHelper.SKIP,
        location_ids=APIHelper.SKIP,
        schedule_types=APIHelper.SKIP,
        program_ids=APIHelper.SKIP,
        include_inactive=APIHelper.SKIP,
        limit=APIHelper.SKIP,
        offset=APIHelper.SKIP):
        """Initialize a GetResourcesRequest instance."""
        # Initialize members of the class
        if resource_ids is not APIHelper.SKIP:
            self.resource_ids = resource_ids
        if location_ids is not APIHelper.SKIP:
            self.location_ids = location_ids
        if schedule_types is not APIHelper.SKIP:
            self.schedule_types = schedule_types
        if program_ids is not APIHelper.SKIP:
            self.program_ids = program_ids
        if include_inactive is not APIHelper.SKIP:
            self.include_inactive = include_inactive
        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
        resource_ids =\
            dictionary.get("ResourceIds")\
            if dictionary.get("ResourceIds")\
                else APIHelper.SKIP
        location_ids =\
            dictionary.get("LocationIds")\
            if dictionary.get("LocationIds")\
                else APIHelper.SKIP
        schedule_types =\
            dictionary.get("ScheduleTypes")\
            if dictionary.get("ScheduleTypes")\
                else APIHelper.SKIP
        program_ids =\
            dictionary.get("ProgramIds")\
            if dictionary.get("ProgramIds")\
                else APIHelper.SKIP
        include_inactive =\
            dictionary.get("IncludeInactive")\
            if "IncludeInactive" 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(resource_ids,
                   location_ids,
                   schedule_types,
                   program_ids,
                   include_inactive,
                   limit,
                   offset)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _resource_ids=(
            self.resource_ids
            if hasattr(self, "resource_ids")
            else None
        )
        _location_ids=(
            self.location_ids
            if hasattr(self, "location_ids")
            else None
        )
        _schedule_types=(
            self.schedule_types
            if hasattr(self, "schedule_types")
            else None
        )
        _program_ids=(
            self.program_ids
            if hasattr(self, "program_ids")
            else None
        )
        _include_inactive=(
            self.include_inactive
            if hasattr(self, "include_inactive")
            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"resource_ids={_resource_ids!r}, "
            f"location_ids={_location_ids!r}, "
            f"schedule_types={_schedule_types!r}, "
            f"program_ids={_program_ids!r}, "
            f"include_inactive={_include_inactive!r}, "
            f"limit={_limit!r}, "
            f"offset={_offset!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _resource_ids=(
            self.resource_ids
            if hasattr(self, "resource_ids")
            else None
        )
        _location_ids=(
            self.location_ids
            if hasattr(self, "location_ids")
            else None
        )
        _schedule_types=(
            self.schedule_types
            if hasattr(self, "schedule_types")
            else None
        )
        _program_ids=(
            self.program_ids
            if hasattr(self, "program_ids")
            else None
        )
        _include_inactive=(
            self.include_inactive
            if hasattr(self, "include_inactive")
            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"resource_ids={_resource_ids!s}, "
            f"location_ids={_location_ids!s}, "
            f"schedule_types={_schedule_types!s}, "
            f"program_ids={_program_ids!s}, "
            f"include_inactive={_include_inactive!s}, "
            f"limit={_limit!s}, "
            f"offset={_offset!s}, "
            f")"
        )
