"""mindbodypublicapi.

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

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


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

    Attributes:
        class_id (int): The ClassScheduleId.
        class_instance_ids (List[int]): The individual ClassIds of the enrollment
            schedule.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "class_id": "ClassId",
        "class_instance_ids": "ClassInstanceIds",
    }

    _optionals = [
        "class_id",
        "class_instance_ids",
    ]

    def __init__(
        self,
        class_id=APIHelper.SKIP,
        class_instance_ids=APIHelper.SKIP):
        """Initialize a WrittenClassSchedulesInfo instance."""
        # Initialize members of the class
        if class_id is not APIHelper.SKIP:
            self.class_id = class_id
        if class_instance_ids is not APIHelper.SKIP:
            self.class_instance_ids = class_instance_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
        class_id =\
            dictionary.get("ClassId")\
            if dictionary.get("ClassId")\
                else APIHelper.SKIP
        class_instance_ids =\
            dictionary.get("ClassInstanceIds")\
            if dictionary.get("ClassInstanceIds")\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(class_id,
                   class_instance_ids)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _class_id=(
            self.class_id
            if hasattr(self, "class_id")
            else None
        )
        _class_instance_ids=(
            self.class_instance_ids
            if hasattr(self, "class_instance_ids")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"class_id={_class_id!r}, "
            f"class_instance_ids={_class_instance_ids!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _class_id=(
            self.class_id
            if hasattr(self, "class_id")
            else None
        )
        _class_instance_ids=(
            self.class_instance_ids
            if hasattr(self, "class_instance_ids")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"class_id={_class_id!s}, "
            f"class_instance_ids={_class_instance_ids!s}, "
            f")"
        )
