"""mindbodypublicapi.

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

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


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

    Attributes:
        class_id (int): The ID of the class to which a substitute teacher needs to be
            assigned.
        staff_id (int): The staff ID of the teacher to substitute.
        override_conflicts (bool): When `true`, overrides any conflicts in the
            schedule.
        send_client_email (bool): When `true`, sends the client an automatic email
            about the substitution, if the client has opted to receive email.
        send_original_teacher_email (bool): When `true`, sends the originally
            scheduled teacher an automatic email about the substitution.
        send_substitute_teacher_email (bool): When `true`, sends the substituted
            teacher an automatic email about the substitution.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "class_id": "ClassId",
        "staff_id": "StaffId",
        "override_conflicts": "OverrideConflicts",
        "send_client_email": "SendClientEmail",
        "send_original_teacher_email": "SendOriginalTeacherEmail",
        "send_substitute_teacher_email": "SendSubstituteTeacherEmail",
    }

    _optionals = [
        "override_conflicts",
        "send_client_email",
        "send_original_teacher_email",
        "send_substitute_teacher_email",
    ]

    def __init__(
        self,
        class_id=None,
        staff_id=None,
        override_conflicts=APIHelper.SKIP,
        send_client_email=APIHelper.SKIP,
        send_original_teacher_email=APIHelper.SKIP,
        send_substitute_teacher_email=APIHelper.SKIP):
        """Initialize a SubstituteClassTeacherRequest instance."""
        # Initialize members of the class
        self.class_id = class_id
        self.staff_id = staff_id
        if override_conflicts is not APIHelper.SKIP:
            self.override_conflicts = override_conflicts
        if send_client_email is not APIHelper.SKIP:
            self.send_client_email = send_client_email
        if send_original_teacher_email is not APIHelper.SKIP:
            self.send_original_teacher_email = send_original_teacher_email
        if send_substitute_teacher_email is not APIHelper.SKIP:
            self.send_substitute_teacher_email = send_substitute_teacher_email

    @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 None
        staff_id =\
            dictionary.get("StaffId")\
            if dictionary.get("StaffId")\
                else None
        override_conflicts =\
            dictionary.get("OverrideConflicts")\
            if "OverrideConflicts" in dictionary.keys()\
                else APIHelper.SKIP
        send_client_email =\
            dictionary.get("SendClientEmail")\
            if "SendClientEmail" in dictionary.keys()\
                else APIHelper.SKIP
        send_original_teacher_email =\
            dictionary.get("SendOriginalTeacherEmail")\
            if "SendOriginalTeacherEmail" in dictionary.keys()\
                else APIHelper.SKIP
        send_substitute_teacher_email =\
            dictionary.get("SendSubstituteTeacherEmail")\
            if "SendSubstituteTeacherEmail" in dictionary.keys()\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(class_id,
                   staff_id,
                   override_conflicts,
                   send_client_email,
                   send_original_teacher_email,
                   send_substitute_teacher_email)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _class_id=self.class_id
        _staff_id=self.staff_id
        _override_conflicts=(
            self.override_conflicts
            if hasattr(self, "override_conflicts")
            else None
        )
        _send_client_email=(
            self.send_client_email
            if hasattr(self, "send_client_email")
            else None
        )
        _send_original_teacher_email=(
            self.send_original_teacher_email
            if hasattr(self, "send_original_teacher_email")
            else None
        )
        _send_substitute_teacher_email=(
            self.send_substitute_teacher_email
            if hasattr(self, "send_substitute_teacher_email")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"class_id={_class_id!r}, "
            f"staff_id={_staff_id!r}, "
            f"override_conflicts={_override_conflicts!r}, "
            f"send_client_email={_send_client_email!r}, "
            f"send_original_teacher_email={_send_original_teacher_email!r}, "
            f"send_substitute_teacher_email={_send_substitute_teacher_email!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _class_id=self.class_id
        _staff_id=self.staff_id
        _override_conflicts=(
            self.override_conflicts
            if hasattr(self, "override_conflicts")
            else None
        )
        _send_client_email=(
            self.send_client_email
            if hasattr(self, "send_client_email")
            else None
        )
        _send_original_teacher_email=(
            self.send_original_teacher_email
            if hasattr(self, "send_original_teacher_email")
            else None
        )
        _send_substitute_teacher_email=(
            self.send_substitute_teacher_email
            if hasattr(self, "send_substitute_teacher_email")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"class_id={_class_id!s}, "
            f"staff_id={_staff_id!s}, "
            f"override_conflicts={_override_conflicts!s}, "
            f"send_client_email={_send_client_email!s}, "
            f"send_original_teacher_email={_send_original_teacher_email!s}, "
            f"send_substitute_teacher_email={_send_substitute_teacher_email!s}, "
            f")"
        )
