"""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.class_client_detail import (
    ClassClientDetail,
)


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

    Remove Clients From Classes Request

    Attributes:
        details (List[ClassClientDetail]): This object includes  `ClientIds`: List of
            the RSSID(string) of the clients to remove from the specified class.
            `ClassId`: The ID(number) of the class that you want to remove the
            clients from.
        test (bool): When `true`, the request ensures that its parameters are valid
            without affecting real data.<br />  When `false`, the request performs as
            intended and may affect live client data.<br />  Default: **false**
        send_email (bool): When `true`, indicates that the client should be sent an
            email. Depending on the site and client settings, an email may or may not
            be sent.<br />  Default: **false**  **Note**: When the Authorization
            header is passed and the SendEmail is set to `true`, then an email will
            be sent.  When the Authorization header is passed and the SendEmail is
            set to `false`, then an email will not be sent.  When the Authorization
            header is not passed and the SendEmail is set to either `true` or
            `false`, then an email will not be sent.
        late_cancel (bool): When `true`, indicates that the client is to be late
            cancelled from the class.<br />  When `false`, indicates that the client
            is to be early cancelled from the class.<br />  Default: **false**
        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 = {
        "details": "Details",
        "test": "Test",
        "send_email": "SendEmail",
        "late_cancel": "LateCancel",
        "limit": "Limit",
        "offset": "Offset",
    }

    _optionals = [
        "details",
        "test",
        "send_email",
        "late_cancel",
        "limit",
        "offset",
    ]

    def __init__(
        self,
        details=APIHelper.SKIP,
        test=APIHelper.SKIP,
        send_email=APIHelper.SKIP,
        late_cancel=APIHelper.SKIP,
        limit=APIHelper.SKIP,
        offset=APIHelper.SKIP):
        """Initialize a RemoveClientsFromClassesRequest instance."""
        # Initialize members of the class
        if details is not APIHelper.SKIP:
            self.details = details
        if test is not APIHelper.SKIP:
            self.test = test
        if send_email is not APIHelper.SKIP:
            self.send_email = send_email
        if late_cancel is not APIHelper.SKIP:
            self.late_cancel = late_cancel
        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
        details = None
        if dictionary.get("Details") is not None:
            details = [
                ClassClientDetail.from_dictionary(x)
                    for x in dictionary.get("Details")
            ]
        else:
            details = APIHelper.SKIP
        test =\
            dictionary.get("Test")\
            if "Test" in dictionary.keys()\
                else APIHelper.SKIP
        send_email =\
            dictionary.get("SendEmail")\
            if "SendEmail" in dictionary.keys()\
                else APIHelper.SKIP
        late_cancel =\
            dictionary.get("LateCancel")\
            if "LateCancel" 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(details,
                   test,
                   send_email,
                   late_cancel,
                   limit,
                   offset)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _details=(
            self.details
            if hasattr(self, "details")
            else None
        )
        _test=(
            self.test
            if hasattr(self, "test")
            else None
        )
        _send_email=(
            self.send_email
            if hasattr(self, "send_email")
            else None
        )
        _late_cancel=(
            self.late_cancel
            if hasattr(self, "late_cancel")
            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"details={_details!r}, "
            f"test={_test!r}, "
            f"send_email={_send_email!r}, "
            f"late_cancel={_late_cancel!r}, "
            f"limit={_limit!r}, "
            f"offset={_offset!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _details=(
            self.details
            if hasattr(self, "details")
            else None
        )
        _test=(
            self.test
            if hasattr(self, "test")
            else None
        )
        _send_email=(
            self.send_email
            if hasattr(self, "send_email")
            else None
        )
        _late_cancel=(
            self.late_cancel
            if hasattr(self, "late_cancel")
            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"details={_details!s}, "
            f"test={_test!s}, "
            f"send_email={_send_email!s}, "
            f"late_cancel={_late_cancel!s}, "
            f"limit={_limit!s}, "
            f"offset={_offset!s}, "
            f")"
        )
