"""mindbodypublicapi.

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

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


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

    Attributes:
        id (int): The model property of type int.
        name (str): The model property of type str.
        location_id (int): The model property of type int.
        is_active (bool): The model property of type bool.
        schedule_types (List[ScheduleType4Enum]): The model property of type
            List[ScheduleType4Enum].
        program_ids (List[int]): The model property of type List[int].
        session_type_ids (List[int]): The model property of type List[int].

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "id": "Id",
        "name": "Name",
        "location_id": "LocationId",
        "is_active": "IsActive",
        "schedule_types": "ScheduleTypes",
        "program_ids": "ProgramIds",
        "session_type_ids": "SessionTypeIds",
    }

    _optionals = [
        "id",
        "name",
        "location_id",
        "is_active",
        "schedule_types",
        "program_ids",
        "session_type_ids",
    ]

    def __init__(
        self,
        id=APIHelper.SKIP,
        name=APIHelper.SKIP,
        location_id=APIHelper.SKIP,
        is_active=APIHelper.SKIP,
        schedule_types=APIHelper.SKIP,
        program_ids=APIHelper.SKIP,
        session_type_ids=APIHelper.SKIP):
        """Initialize a Resource1 instance."""
        # Initialize members of the class
        if id is not APIHelper.SKIP:
            self.id = id
        if name is not APIHelper.SKIP:
            self.name = name
        if location_id is not APIHelper.SKIP:
            self.location_id = location_id
        if is_active is not APIHelper.SKIP:
            self.is_active = is_active
        if schedule_types is not APIHelper.SKIP:
            self.schedule_types = schedule_types
        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

    @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
        id =\
            dictionary.get("Id")\
            if dictionary.get("Id")\
                else APIHelper.SKIP
        name =\
            dictionary.get("Name")\
            if dictionary.get("Name")\
                else APIHelper.SKIP
        location_id =\
            dictionary.get("LocationId")\
            if dictionary.get("LocationId")\
                else APIHelper.SKIP
        is_active =\
            dictionary.get("IsActive")\
            if "IsActive" in dictionary.keys()\
                else APIHelper.SKIP
        schedule_types =\
            dictionary.get("ScheduleTypes")\
            if dictionary.get("ScheduleTypes")\
                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

        # Return an object of this model
        return cls(id,
                   name,
                   location_id,
                   is_active,
                   schedule_types,
                   program_ids,
                   session_type_ids)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _id=(
            self.id
            if hasattr(self, "id")
            else None
        )
        _name=(
            self.name
            if hasattr(self, "name")
            else None
        )
        _location_id=(
            self.location_id
            if hasattr(self, "location_id")
            else None
        )
        _is_active=(
            self.is_active
            if hasattr(self, "is_active")
            else None
        )
        _schedule_types=(
            self.schedule_types
            if hasattr(self, "schedule_types")
            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
        )
        return (
            f"{self.__class__.__name__}("
            f"id={_id!r}, "
            f"name={_name!r}, "
            f"location_id={_location_id!r}, "
            f"is_active={_is_active!r}, "
            f"schedule_types={_schedule_types!r}, "
            f"program_ids={_program_ids!r}, "
            f"session_type_ids={_session_type_ids!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _id=(
            self.id
            if hasattr(self, "id")
            else None
        )
        _name=(
            self.name
            if hasattr(self, "name")
            else None
        )
        _location_id=(
            self.location_id
            if hasattr(self, "location_id")
            else None
        )
        _is_active=(
            self.is_active
            if hasattr(self, "is_active")
            else None
        )
        _schedule_types=(
            self.schedule_types
            if hasattr(self, "schedule_types")
            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
        )
        return (
            f"{self.__class__.__name__}("
            f"id={_id!s}, "
            f"name={_name!s}, "
            f"location_id={_location_id!s}, "
            f"is_active={_is_active!s}, "
            f"schedule_types={_schedule_types!s}, "
            f"program_ids={_program_ids!s}, "
            f"session_type_ids={_session_type_ids!s}, "
            f")"
        )
