"""mindbodypublicapi.

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

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


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

    Attributes:
        class_schedule_ids (List[int]): A list of the requested class schedule IDs.
            If omitted, all class schedule IDs return.
        end_date (datetime): The end of the date range. The response returns any
            active enrollments that occur on or before this day.<br />  Default:
            **StartDate**
        location_ids (List[int]): List of the IDs for the requested locations. If
            omitted, all location IDs return.
        program_ids (List[int]): List of the IDs for the requested programs. If
            omitted, all program IDs return.
        session_type_ids (List[int]): List of the IDs for the requested session
            types. If omitted, all session types IDs return.
        staff_ids (List[int]): List of the IDs for the requested staff IDs. If
            omitted, all staff IDs return.
        start_date (datetime): The start of the date range. The response returns any
            active enrollments that occur on or after this day.<br />  Default:
            **today’s date**
        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_schedule_ids": "ClassScheduleIds",
        "end_date": "EndDate",
        "location_ids": "LocationIds",
        "program_ids": "ProgramIds",
        "session_type_ids": "SessionTypeIds",
        "staff_ids": "StaffIds",
        "start_date": "StartDate",
        "limit": "Limit",
        "offset": "Offset",
    }

    _optionals = [
        "class_schedule_ids",
        "end_date",
        "location_ids",
        "program_ids",
        "session_type_ids",
        "staff_ids",
        "start_date",
        "limit",
        "offset",
    ]

    def __init__(
        self,
        class_schedule_ids=APIHelper.SKIP,
        end_date=APIHelper.SKIP,
        location_ids=APIHelper.SKIP,
        program_ids=APIHelper.SKIP,
        session_type_ids=APIHelper.SKIP,
        staff_ids=APIHelper.SKIP,
        start_date=APIHelper.SKIP,
        limit=APIHelper.SKIP,
        offset=APIHelper.SKIP):
        """Initialize a GetEnrollmentsRequest instance."""
        # Initialize members of the class
        if class_schedule_ids is not APIHelper.SKIP:
            self.class_schedule_ids = class_schedule_ids
        if end_date is not APIHelper.SKIP:
            self.end_date =\
                 APIHelper.apply_datetime_converter(
                end_date, APIHelper.RFC3339DateTime)\
                 if end_date else None
        if location_ids is not APIHelper.SKIP:
            self.location_ids = location_ids
        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 staff_ids is not APIHelper.SKIP:
            self.staff_ids = staff_ids
        if start_date is not APIHelper.SKIP:
            self.start_date =\
                 APIHelper.apply_datetime_converter(
                start_date, APIHelper.RFC3339DateTime)\
                 if start_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_schedule_ids =\
            dictionary.get("ClassScheduleIds")\
            if dictionary.get("ClassScheduleIds")\
                else APIHelper.SKIP
        end_date = APIHelper.RFC3339DateTime.from_value(
            dictionary.get("EndDate")).datetime\
            if dictionary.get("EndDate") else APIHelper.SKIP
        location_ids =\
            dictionary.get("LocationIds")\
            if dictionary.get("LocationIds")\
                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
        staff_ids =\
            dictionary.get("StaffIds")\
            if dictionary.get("StaffIds")\
                else APIHelper.SKIP
        start_date = APIHelper.RFC3339DateTime.from_value(
            dictionary.get("StartDate")).datetime\
            if dictionary.get("StartDate") 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_schedule_ids,
                   end_date,
                   location_ids,
                   program_ids,
                   session_type_ids,
                   staff_ids,
                   start_date,
                   limit,
                   offset)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _class_schedule_ids=(
            self.class_schedule_ids
            if hasattr(self, "class_schedule_ids")
            else None
        )
        _end_date=(
            self.end_date
            if hasattr(self, "end_date")
            else None
        )
        _location_ids=(
            self.location_ids
            if hasattr(self, "location_ids")
            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
        )
        _staff_ids=(
            self.staff_ids
            if hasattr(self, "staff_ids")
            else None
        )
        _start_date=(
            self.start_date
            if hasattr(self, "start_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_schedule_ids={_class_schedule_ids!r}, "
            f"end_date={_end_date!r}, "
            f"location_ids={_location_ids!r}, "
            f"program_ids={_program_ids!r}, "
            f"session_type_ids={_session_type_ids!r}, "
            f"staff_ids={_staff_ids!r}, "
            f"start_date={_start_date!r}, "
            f"limit={_limit!r}, "
            f"offset={_offset!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _class_schedule_ids=(
            self.class_schedule_ids
            if hasattr(self, "class_schedule_ids")
            else None
        )
        _end_date=(
            self.end_date
            if hasattr(self, "end_date")
            else None
        )
        _location_ids=(
            self.location_ids
            if hasattr(self, "location_ids")
            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
        )
        _staff_ids=(
            self.staff_ids
            if hasattr(self, "staff_ids")
            else None
        )
        _start_date=(
            self.start_date
            if hasattr(self, "start_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_schedule_ids={_class_schedule_ids!s}, "
            f"end_date={_end_date!s}, "
            f"location_ids={_location_ids!s}, "
            f"program_ids={_program_ids!s}, "
            f"session_type_ids={_session_type_ids!s}, "
            f"staff_ids={_staff_ids!s}, "
            f"start_date={_start_date!s}, "
            f"limit={_limit!s}, "
            f"offset={_offset!s}, "
            f")"
        )
