"""mindbodypublicapi.

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

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


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

    Attributes:
        class_description_ids (List[int]): The requested class description IDs.
        class_ids (List[int]): The requested class IDs.
        class_schedule_ids (List[int]): The requested classSchedule Ids.
        staff_ids (List[int]): The requested IDs of the teaching staff members.
        start_date_time (datetime): The requested start date for filtering. This also
            determines what you will see for the ‘BookingWindow’ StartDateTime in the
            response. For example, if you pass a StartDateTime that is on OR before
            the BookingWindow ‘Open’ days of the class, you will retrieve the actual
            ‘StartDateTime’ for the Booking Window. If you pass a StartDateTime that
            is after the BookingWindow ‘date’, then you will receive results based on
            that start date.  NOTE: ClassDate does not take Class Time into
            consideration.
        end_date_time (datetime): The requested end date for filtering.  NOTE:
            ClassDate does not take Class Time into consideration.  <br />Default:
            **today’s date**
        client_id (str): The client ID of the client who is viewing this class list.
            Based on identity, the client may be able to see additional information,
            such as membership specials.
        unique_client_id (int): The unique ID of the client who is viewing this class
            list. Based on identity, the client may be able to see additional
            information, such as membership specials.  Note: you need to provide the
            'UniqueClientId' OR the 'ClientId'. If both are provided, the
            'UniqueClientId' takes precedence.
        program_ids (List[int]): A list of program IDs on which to base the search.
        session_type_ids (List[int]): A list of session type IDs on which to base the
            search.
        location_ids (List[int]): A list of location IDs on which to base the search.
        semester_ids (List[int]): A list of semester IDs on which to base the search.
        hide_canceled_classes (bool): When `true`, canceled classes are removed from
            the response.<br />  When `false`, canceled classes are included in the
            response.<br />  Default: **false**
        scheduling_window (bool): When `true`, classes outside scheduling window are
            removed from the response.<br />  When `false`, classes are included in
            the response, regardless of the scheduling window.<br />  Default:
            **false**
        last_modified_date (datetime): When included in the request, only records
            modified on or after the `LastModifiedDate` specified are included in the
            response.
        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 = {
        "class_description_ids": "ClassDescriptionIds",
        "class_ids": "ClassIds",
        "class_schedule_ids": "ClassScheduleIds",
        "staff_ids": "StaffIds",
        "start_date_time": "StartDateTime",
        "end_date_time": "EndDateTime",
        "client_id": "ClientId",
        "unique_client_id": "UniqueClientId",
        "program_ids": "ProgramIds",
        "session_type_ids": "SessionTypeIds",
        "location_ids": "LocationIds",
        "semester_ids": "SemesterIds",
        "hide_canceled_classes": "HideCanceledClasses",
        "scheduling_window": "SchedulingWindow",
        "last_modified_date": "LastModifiedDate",
        "limit": "Limit",
        "offset": "Offset",
    }

    _optionals = [
        "class_description_ids",
        "class_ids",
        "class_schedule_ids",
        "staff_ids",
        "start_date_time",
        "end_date_time",
        "client_id",
        "unique_client_id",
        "program_ids",
        "session_type_ids",
        "location_ids",
        "semester_ids",
        "hide_canceled_classes",
        "scheduling_window",
        "last_modified_date",
        "limit",
        "offset",
    ]

    def __init__(
        self,
        class_description_ids=APIHelper.SKIP,
        class_ids=APIHelper.SKIP,
        class_schedule_ids=APIHelper.SKIP,
        staff_ids=APIHelper.SKIP,
        start_date_time=APIHelper.SKIP,
        end_date_time=APIHelper.SKIP,
        client_id=APIHelper.SKIP,
        unique_client_id=APIHelper.SKIP,
        program_ids=APIHelper.SKIP,
        session_type_ids=APIHelper.SKIP,
        location_ids=APIHelper.SKIP,
        semester_ids=APIHelper.SKIP,
        hide_canceled_classes=APIHelper.SKIP,
        scheduling_window=APIHelper.SKIP,
        last_modified_date=APIHelper.SKIP,
        limit=APIHelper.SKIP,
        offset=APIHelper.SKIP):
        """Initialize a GetClassesRequest instance."""
        # Initialize members of the class
        if class_description_ids is not APIHelper.SKIP:
            self.class_description_ids = class_description_ids
        if class_ids is not APIHelper.SKIP:
            self.class_ids = class_ids
        if class_schedule_ids is not APIHelper.SKIP:
            self.class_schedule_ids = class_schedule_ids
        if staff_ids is not APIHelper.SKIP:
            self.staff_ids = staff_ids
        if start_date_time is not APIHelper.SKIP:
            self.start_date_time =\
                 APIHelper.apply_datetime_converter(
                start_date_time, APIHelper.RFC3339DateTime)\
                 if start_date_time else None
        if end_date_time is not APIHelper.SKIP:
            self.end_date_time =\
                 APIHelper.apply_datetime_converter(
                end_date_time, APIHelper.RFC3339DateTime)\
                 if end_date_time else None
        if client_id is not APIHelper.SKIP:
            self.client_id = client_id
        if unique_client_id is not APIHelper.SKIP:
            self.unique_client_id = unique_client_id
        if program_ids is not APIHelper.SKIP:
            self.program_ids = program_ids
        if session_type_ids is not APIHelper.SKIP:
            self.session_type_ids = session_type_ids
        if location_ids is not APIHelper.SKIP:
            self.location_ids = location_ids
        if semester_ids is not APIHelper.SKIP:
            self.semester_ids = semester_ids
        if hide_canceled_classes is not APIHelper.SKIP:
            self.hide_canceled_classes = hide_canceled_classes
        if scheduling_window is not APIHelper.SKIP:
            self.scheduling_window = scheduling_window
        if last_modified_date is not APIHelper.SKIP:
            self.last_modified_date =\
                 APIHelper.apply_datetime_converter(
                last_modified_date, APIHelper.RFC3339DateTime)\
                 if last_modified_date else None
        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
        class_description_ids =\
            dictionary.get("ClassDescriptionIds")\
            if dictionary.get("ClassDescriptionIds")\
                else APIHelper.SKIP
        class_ids =\
            dictionary.get("ClassIds")\
            if dictionary.get("ClassIds")\
                else APIHelper.SKIP
        class_schedule_ids =\
            dictionary.get("ClassScheduleIds")\
            if dictionary.get("ClassScheduleIds")\
                else APIHelper.SKIP
        staff_ids =\
            dictionary.get("StaffIds")\
            if dictionary.get("StaffIds")\
                else APIHelper.SKIP
        start_date_time = APIHelper.RFC3339DateTime.from_value(
            dictionary.get("StartDateTime")).datetime\
            if dictionary.get("StartDateTime") else APIHelper.SKIP
        end_date_time = APIHelper.RFC3339DateTime.from_value(
            dictionary.get("EndDateTime")).datetime\
            if dictionary.get("EndDateTime") else APIHelper.SKIP
        client_id =\
            dictionary.get("ClientId")\
            if dictionary.get("ClientId")\
                else APIHelper.SKIP
        unique_client_id =\
            dictionary.get("UniqueClientId")\
            if dictionary.get("UniqueClientId")\
                else APIHelper.SKIP
        program_ids =\
            dictionary.get("ProgramIds")\
            if dictionary.get("ProgramIds")\
                else APIHelper.SKIP
        session_type_ids =\
            dictionary.get("SessionTypeIds")\
            if dictionary.get("SessionTypeIds")\
                else APIHelper.SKIP
        location_ids =\
            dictionary.get("LocationIds")\
            if dictionary.get("LocationIds")\
                else APIHelper.SKIP
        semester_ids =\
            dictionary.get("SemesterIds")\
            if dictionary.get("SemesterIds")\
                else APIHelper.SKIP
        hide_canceled_classes =\
            dictionary.get("HideCanceledClasses")\
            if "HideCanceledClasses" in dictionary.keys()\
                else APIHelper.SKIP
        scheduling_window =\
            dictionary.get("SchedulingWindow")\
            if "SchedulingWindow" in dictionary.keys()\
                else APIHelper.SKIP
        last_modified_date = APIHelper.RFC3339DateTime.from_value(
            dictionary.get("LastModifiedDate")).datetime\
            if dictionary.get("LastModifiedDate") 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(class_description_ids,
                   class_ids,
                   class_schedule_ids,
                   staff_ids,
                   start_date_time,
                   end_date_time,
                   client_id,
                   unique_client_id,
                   program_ids,
                   session_type_ids,
                   location_ids,
                   semester_ids,
                   hide_canceled_classes,
                   scheduling_window,
                   last_modified_date,
                   limit,
                   offset)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _class_description_ids=(
            self.class_description_ids
            if hasattr(self, "class_description_ids")
            else None
        )
        _class_ids=(
            self.class_ids
            if hasattr(self, "class_ids")
            else None
        )
        _class_schedule_ids=(
            self.class_schedule_ids
            if hasattr(self, "class_schedule_ids")
            else None
        )
        _staff_ids=(
            self.staff_ids
            if hasattr(self, "staff_ids")
            else None
        )
        _start_date_time=(
            self.start_date_time
            if hasattr(self, "start_date_time")
            else None
        )
        _end_date_time=(
            self.end_date_time
            if hasattr(self, "end_date_time")
            else None
        )
        _client_id=(
            self.client_id
            if hasattr(self, "client_id")
            else None
        )
        _unique_client_id=(
            self.unique_client_id
            if hasattr(self, "unique_client_id")
            else None
        )
        _program_ids=(
            self.program_ids
            if hasattr(self, "program_ids")
            else None
        )
        _session_type_ids=(
            self.session_type_ids
            if hasattr(self, "session_type_ids")
            else None
        )
        _location_ids=(
            self.location_ids
            if hasattr(self, "location_ids")
            else None
        )
        _semester_ids=(
            self.semester_ids
            if hasattr(self, "semester_ids")
            else None
        )
        _hide_canceled_classes=(
            self.hide_canceled_classes
            if hasattr(self, "hide_canceled_classes")
            else None
        )
        _scheduling_window=(
            self.scheduling_window
            if hasattr(self, "scheduling_window")
            else None
        )
        _last_modified_date=(
            self.last_modified_date
            if hasattr(self, "last_modified_date")
            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"class_description_ids={_class_description_ids!r}, "
            f"class_ids={_class_ids!r}, "
            f"class_schedule_ids={_class_schedule_ids!r}, "
            f"staff_ids={_staff_ids!r}, "
            f"start_date_time={_start_date_time!r}, "
            f"end_date_time={_end_date_time!r}, "
            f"client_id={_client_id!r}, "
            f"unique_client_id={_unique_client_id!r}, "
            f"program_ids={_program_ids!r}, "
            f"session_type_ids={_session_type_ids!r}, "
            f"location_ids={_location_ids!r}, "
            f"semester_ids={_semester_ids!r}, "
            f"hide_canceled_classes={_hide_canceled_classes!r}, "
            f"scheduling_window={_scheduling_window!r}, "
            f"last_modified_date={_last_modified_date!r}, "
            f"limit={_limit!r}, "
            f"offset={_offset!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _class_description_ids=(
            self.class_description_ids
            if hasattr(self, "class_description_ids")
            else None
        )
        _class_ids=(
            self.class_ids
            if hasattr(self, "class_ids")
            else None
        )
        _class_schedule_ids=(
            self.class_schedule_ids
            if hasattr(self, "class_schedule_ids")
            else None
        )
        _staff_ids=(
            self.staff_ids
            if hasattr(self, "staff_ids")
            else None
        )
        _start_date_time=(
            self.start_date_time
            if hasattr(self, "start_date_time")
            else None
        )
        _end_date_time=(
            self.end_date_time
            if hasattr(self, "end_date_time")
            else None
        )
        _client_id=(
            self.client_id
            if hasattr(self, "client_id")
            else None
        )
        _unique_client_id=(
            self.unique_client_id
            if hasattr(self, "unique_client_id")
            else None
        )
        _program_ids=(
            self.program_ids
            if hasattr(self, "program_ids")
            else None
        )
        _session_type_ids=(
            self.session_type_ids
            if hasattr(self, "session_type_ids")
            else None
        )
        _location_ids=(
            self.location_ids
            if hasattr(self, "location_ids")
            else None
        )
        _semester_ids=(
            self.semester_ids
            if hasattr(self, "semester_ids")
            else None
        )
        _hide_canceled_classes=(
            self.hide_canceled_classes
            if hasattr(self, "hide_canceled_classes")
            else None
        )
        _scheduling_window=(
            self.scheduling_window
            if hasattr(self, "scheduling_window")
            else None
        )
        _last_modified_date=(
            self.last_modified_date
            if hasattr(self, "last_modified_date")
            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"class_description_ids={_class_description_ids!s}, "
            f"class_ids={_class_ids!s}, "
            f"class_schedule_ids={_class_schedule_ids!s}, "
            f"staff_ids={_staff_ids!s}, "
            f"start_date_time={_start_date_time!s}, "
            f"end_date_time={_end_date_time!s}, "
            f"client_id={_client_id!s}, "
            f"unique_client_id={_unique_client_id!s}, "
            f"program_ids={_program_ids!s}, "
            f"session_type_ids={_session_type_ids!s}, "
            f"location_ids={_location_ids!s}, "
            f"semester_ids={_semester_ids!s}, "
            f"hide_canceled_classes={_hide_canceled_classes!s}, "
            f"scheduling_window={_scheduling_window!s}, "
            f"last_modified_date={_last_modified_date!s}, "
            f"limit={_limit!s}, "
            f"offset={_offset!s}, "
            f")"
        )
