"""mindbodypublicapi.

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

# ruff: noqa: E501
from mindbodypublicapi.api_helper import APIHelper
from mindbodypublicapi.models.api_error import (
    ApiError,
)
from mindbodypublicapi.models.mclass import (
    Class,
)
from mindbodypublicapi.models.pagination_response import (
    PaginationResponse,
)


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

    Remove Clients From Classes Response

    Attributes:
        pagination_response (PaginationResponse): Contains information about the
            pagination to use.
        classes (List[Class]): Contains information about the classes from which the
            clients were removed.
        errors (List[ApiError]): Contains information about the errors

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "pagination_response": "PaginationResponse",
        "classes": "Classes",
        "errors": "Errors",
    }

    _optionals = [
        "pagination_response",
        "classes",
        "errors",
    ]

    def __init__(
        self,
        pagination_response=APIHelper.SKIP,
        classes=APIHelper.SKIP,
        errors=APIHelper.SKIP):
        """Initialize a RemoveClientsFromClassesResponse instance."""
        # Initialize members of the class
        if pagination_response is not APIHelper.SKIP:
            self.pagination_response = pagination_response
        if classes is not APIHelper.SKIP:
            self.classes = classes
        if errors is not APIHelper.SKIP:
            self.errors = errors

    @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
        pagination_response =\
            PaginationResponse.from_dictionary(
                dictionary.get("PaginationResponse"))\
                if "PaginationResponse" in dictionary.keys()\
                else APIHelper.SKIP
        classes = None
        if dictionary.get("Classes") is not None:
            classes = [
                Class.from_dictionary(x)
                    for x in dictionary.get("Classes")
            ]
        else:
            classes = APIHelper.SKIP
        errors = None
        if dictionary.get("Errors") is not None:
            errors = [
                ApiError.from_dictionary(x)
                    for x in dictionary.get("Errors")
            ]
        else:
            errors = APIHelper.SKIP

        # Return an object of this model
        return cls(pagination_response,
                   classes,
                   errors)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _pagination_response=(
            self.pagination_response
            if hasattr(self, "pagination_response")
            else None
        )
        _classes=(
            self.classes
            if hasattr(self, "classes")
            else None
        )
        _errors=(
            self.errors
            if hasattr(self, "errors")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"pagination_response={_pagination_response!r}, "
            f"classes={_classes!r}, "
            f"errors={_errors!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _pagination_response=(
            self.pagination_response
            if hasattr(self, "pagination_response")
            else None
        )
        _classes=(
            self.classes
            if hasattr(self, "classes")
            else None
        )
        _errors=(
            self.errors
            if hasattr(self, "errors")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"pagination_response={_pagination_response!s}, "
            f"classes={_classes!s}, "
            f"errors={_errors!s}, "
            f")"
        )
