"""mindbodypublicapi.

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

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


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

    Attributes:
        schedule_type (ScheduleType3Enum): A schedule type used to filter the
            returned results. Possible values are:  * All  * Class  * Enrollment  *
            Appointment  * Resource  * Media  * Arrival
        online_only (bool): If `true`, filters results to show only those programs
            that are shown online.<br />  If `false`, all programs are returned.<br
            />  Default: **false**
        program_ids (List[int]): Program Ids to filter for
        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 = {
        "schedule_type": "ScheduleType",
        "online_only": "OnlineOnly",
        "program_ids": "ProgramIds",
        "limit": "Limit",
        "offset": "Offset",
    }

    _optionals = [
        "schedule_type",
        "online_only",
        "program_ids",
        "limit",
        "offset",
    ]

    def __init__(
        self,
        schedule_type=APIHelper.SKIP,
        online_only=APIHelper.SKIP,
        program_ids=APIHelper.SKIP,
        limit=APIHelper.SKIP,
        offset=APIHelper.SKIP):
        """Initialize a GetProgramsRequest instance."""
        # Initialize members of the class
        if schedule_type is not APIHelper.SKIP:
            self.schedule_type = schedule_type
        if online_only is not APIHelper.SKIP:
            self.online_only = online_only
        if program_ids is not APIHelper.SKIP:
            self.program_ids = program_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
        schedule_type =\
            dictionary.get("ScheduleType")\
            if dictionary.get("ScheduleType")\
                else APIHelper.SKIP
        online_only =\
            dictionary.get("OnlineOnly")\
            if "OnlineOnly" in dictionary.keys()\
                else APIHelper.SKIP
        program_ids =\
            dictionary.get("ProgramIds")\
            if dictionary.get("ProgramIds")\
                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(schedule_type,
                   online_only,
                   program_ids,
                   limit,
                   offset)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _schedule_type=(
            self.schedule_type
            if hasattr(self, "schedule_type")
            else None
        )
        _online_only=(
            self.online_only
            if hasattr(self, "online_only")
            else None
        )
        _program_ids=(
            self.program_ids
            if hasattr(self, "program_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"schedule_type={_schedule_type!r}, "
            f"online_only={_online_only!r}, "
            f"program_ids={_program_ids!r}, "
            f"limit={_limit!r}, "
            f"offset={_offset!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _schedule_type=(
            self.schedule_type
            if hasattr(self, "schedule_type")
            else None
        )
        _online_only=(
            self.online_only
            if hasattr(self, "online_only")
            else None
        )
        _program_ids=(
            self.program_ids
            if hasattr(self, "program_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"schedule_type={_schedule_type!s}, "
            f"online_only={_online_only!s}, "
            f"program_ids={_program_ids!s}, "
            f"limit={_limit!s}, "
            f"offset={_offset!s}, "
            f")"
        )
