"""mindbodypublicapi.

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

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


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

    Attributes:
        class_description_id (int): The ID of the requested client.
        program_ids (List[int]): A list of requested program IDs.
        start_class_date_time (datetime): Filters the results to class descriptions
            for scheduled classes that happen on or after the given date and time.
        end_class_date_time (datetime): Filters the results to class descriptions for
            scheduled classes that happen before the given date and time.
        staff_id (int): Filters results to class descriptions for scheduled classes
            taught by the given staff member.
        location_id (int): Filters results to classes descriptions for schedule
            classes as the given location.
        include_inactive (bool): Includes inactive class descriptions, defaulting to
            true. When set to false, it filters out inactive class descriptions.
        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_id": "ClassDescriptionId",
        "program_ids": "ProgramIds",
        "start_class_date_time": "StartClassDateTime",
        "end_class_date_time": "EndClassDateTime",
        "staff_id": "StaffId",
        "location_id": "LocationId",
        "include_inactive": "IncludeInactive",
        "limit": "Limit",
        "offset": "Offset",
    }

    _optionals = [
        "class_description_id",
        "program_ids",
        "start_class_date_time",
        "end_class_date_time",
        "staff_id",
        "location_id",
        "include_inactive",
        "limit",
        "offset",
    ]

    def __init__(
        self,
        class_description_id=APIHelper.SKIP,
        program_ids=APIHelper.SKIP,
        start_class_date_time=APIHelper.SKIP,
        end_class_date_time=APIHelper.SKIP,
        staff_id=APIHelper.SKIP,
        location_id=APIHelper.SKIP,
        include_inactive=APIHelper.SKIP,
        limit=APIHelper.SKIP,
        offset=APIHelper.SKIP):
        """Initialize a GetClassDescriptionsRequest instance."""
        # Initialize members of the class
        if class_description_id is not APIHelper.SKIP:
            self.class_description_id = class_description_id
        if program_ids is not APIHelper.SKIP:
            self.program_ids = program_ids
        if start_class_date_time is not APIHelper.SKIP:
            self.start_class_date_time =\
                 APIHelper.apply_datetime_converter(
                start_class_date_time, APIHelper.RFC3339DateTime)\
                 if start_class_date_time else None
        if end_class_date_time is not APIHelper.SKIP:
            self.end_class_date_time =\
                 APIHelper.apply_datetime_converter(
                end_class_date_time, APIHelper.RFC3339DateTime)\
                 if end_class_date_time else None
        if staff_id is not APIHelper.SKIP:
            self.staff_id = staff_id
        if location_id is not APIHelper.SKIP:
            self.location_id = location_id
        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
        class_description_id =\
            dictionary.get("ClassDescriptionId")\
            if dictionary.get("ClassDescriptionId")\
                else APIHelper.SKIP
        program_ids =\
            dictionary.get("ProgramIds")\
            if dictionary.get("ProgramIds")\
                else APIHelper.SKIP
        start_class_date_time = APIHelper.RFC3339DateTime.from_value(
            dictionary.get("StartClassDateTime")).datetime\
            if dictionary.get("StartClassDateTime") else APIHelper.SKIP
        end_class_date_time = APIHelper.RFC3339DateTime.from_value(
            dictionary.get("EndClassDateTime")).datetime\
            if dictionary.get("EndClassDateTime") else APIHelper.SKIP
        staff_id =\
            dictionary.get("StaffId")\
            if dictionary.get("StaffId")\
                else APIHelper.SKIP
        location_id =\
            dictionary.get("LocationId")\
            if dictionary.get("LocationId")\
                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(class_description_id,
                   program_ids,
                   start_class_date_time,
                   end_class_date_time,
                   staff_id,
                   location_id,
                   include_inactive,
                   limit,
                   offset)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _class_description_id=(
            self.class_description_id
            if hasattr(self, "class_description_id")
            else None
        )
        _program_ids=(
            self.program_ids
            if hasattr(self, "program_ids")
            else None
        )
        _start_class_date_time=(
            self.start_class_date_time
            if hasattr(self, "start_class_date_time")
            else None
        )
        _end_class_date_time=(
            self.end_class_date_time
            if hasattr(self, "end_class_date_time")
            else None
        )
        _staff_id=(
            self.staff_id
            if hasattr(self, "staff_id")
            else None
        )
        _location_id=(
            self.location_id
            if hasattr(self, "location_id")
            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"class_description_id={_class_description_id!r}, "
            f"program_ids={_program_ids!r}, "
            f"start_class_date_time={_start_class_date_time!r}, "
            f"end_class_date_time={_end_class_date_time!r}, "
            f"staff_id={_staff_id!r}, "
            f"location_id={_location_id!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."""
        _class_description_id=(
            self.class_description_id
            if hasattr(self, "class_description_id")
            else None
        )
        _program_ids=(
            self.program_ids
            if hasattr(self, "program_ids")
            else None
        )
        _start_class_date_time=(
            self.start_class_date_time
            if hasattr(self, "start_class_date_time")
            else None
        )
        _end_class_date_time=(
            self.end_class_date_time
            if hasattr(self, "end_class_date_time")
            else None
        )
        _staff_id=(
            self.staff_id
            if hasattr(self, "staff_id")
            else None
        )
        _location_id=(
            self.location_id
            if hasattr(self, "location_id")
            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"class_description_id={_class_description_id!s}, "
            f"program_ids={_program_ids!s}, "
            f"start_class_date_time={_start_class_date_time!s}, "
            f"end_class_date_time={_end_class_date_time!s}, "
            f"staff_id={_staff_id!s}, "
            f"location_id={_location_id!s}, "
            f"include_inactive={_include_inactive!s}, "
            f"limit={_limit!s}, "
            f"offset={_offset!s}, "
            f")"
        )
