"""mindbodypublicapi.

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

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


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

    Attributes:
        staff_ids (List[int]): A list of the requested staff IDs.
        filters (List[str]): Filters to apply to the search. Possible values are:  *
            StaffViewable  * AppointmentInstructor  * ClassInstructor  * Male  *
            Female
        session_type_id (int): Return only staff members that are available for the
            specified session type. You must supply a valid `StartDateTime` and
            `LocationID` to use this parameter.
        start_date_time (datetime): Return only staff members that are available at
            the specified date and time. You must supply a valid `SessionTypeID` and
            `LocationID` to use this parameter.
        location_id (int): Return only staff members that are available at the
            specified location. You must supply a valid `SessionTypeID` and
            `StartDateTime` to use this parameter.
        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 = {
        "staff_ids": "StaffIds",
        "filters": "Filters",
        "session_type_id": "SessionTypeId",
        "start_date_time": "StartDateTime",
        "location_id": "LocationId",
        "limit": "Limit",
        "offset": "Offset",
    }

    _optionals = [
        "staff_ids",
        "filters",
        "session_type_id",
        "start_date_time",
        "location_id",
        "limit",
        "offset",
    ]

    def __init__(
        self,
        staff_ids=APIHelper.SKIP,
        filters=APIHelper.SKIP,
        session_type_id=APIHelper.SKIP,
        start_date_time=APIHelper.SKIP,
        location_id=APIHelper.SKIP,
        limit=APIHelper.SKIP,
        offset=APIHelper.SKIP):
        """Initialize a GetStaffRequest instance."""
        # Initialize members of the class
        if staff_ids is not APIHelper.SKIP:
            self.staff_ids = staff_ids
        if filters is not APIHelper.SKIP:
            self.filters = filters
        if session_type_id is not APIHelper.SKIP:
            self.session_type_id = session_type_id
        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 location_id is not APIHelper.SKIP:
            self.location_id = location_id
        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
        staff_ids =\
            dictionary.get("StaffIds")\
            if dictionary.get("StaffIds")\
                else APIHelper.SKIP
        filters =\
            dictionary.get("Filters")\
            if dictionary.get("Filters")\
                else APIHelper.SKIP
        session_type_id =\
            dictionary.get("SessionTypeId")\
            if dictionary.get("SessionTypeId")\
                else APIHelper.SKIP
        start_date_time = APIHelper.RFC3339DateTime.from_value(
            dictionary.get("StartDateTime")).datetime\
            if dictionary.get("StartDateTime") else APIHelper.SKIP
        location_id =\
            dictionary.get("LocationId")\
            if dictionary.get("LocationId")\
                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(staff_ids,
                   filters,
                   session_type_id,
                   start_date_time,
                   location_id,
                   limit,
                   offset)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _staff_ids=(
            self.staff_ids
            if hasattr(self, "staff_ids")
            else None
        )
        _filters=(
            self.filters
            if hasattr(self, "filters")
            else None
        )
        _session_type_id=(
            self.session_type_id
            if hasattr(self, "session_type_id")
            else None
        )
        _start_date_time=(
            self.start_date_time
            if hasattr(self, "start_date_time")
            else None
        )
        _location_id=(
            self.location_id
            if hasattr(self, "location_id")
            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"staff_ids={_staff_ids!r}, "
            f"filters={_filters!r}, "
            f"session_type_id={_session_type_id!r}, "
            f"start_date_time={_start_date_time!r}, "
            f"location_id={_location_id!r}, "
            f"limit={_limit!r}, "
            f"offset={_offset!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _staff_ids=(
            self.staff_ids
            if hasattr(self, "staff_ids")
            else None
        )
        _filters=(
            self.filters
            if hasattr(self, "filters")
            else None
        )
        _session_type_id=(
            self.session_type_id
            if hasattr(self, "session_type_id")
            else None
        )
        _start_date_time=(
            self.start_date_time
            if hasattr(self, "start_date_time")
            else None
        )
        _location_id=(
            self.location_id
            if hasattr(self, "location_id")
            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"staff_ids={_staff_ids!s}, "
            f"filters={_filters!s}, "
            f"session_type_id={_session_type_id!s}, "
            f"start_date_time={_start_date_time!s}, "
            f"location_id={_location_id!s}, "
            f"limit={_limit!s}, "
            f"offset={_offset!s}, "
            f")"
        )
