"""mindbodypublicapi.

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

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


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

    contains the information about the staff settings.

    Attributes:
        use_staff_nicknames (bool): When `true`, `DisplayName` of the staff will be
            displayed.  When `false`, `DisplayName` will be displayed as null.
        show_staff_last_names_on_schedules (bool): When `true`, indicates that the
            Name contains both the `FirstName` and `LastName` of the staff.  When
            `false`, indicates that the Name contains only the `FirstName` of the
            staff.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "use_staff_nicknames": "UseStaffNicknames",
        "show_staff_last_names_on_schedules": "ShowStaffLastNamesOnSchedules",
    }

    _optionals = [
        "use_staff_nicknames",
        "show_staff_last_names_on_schedules",
    ]

    def __init__(
        self,
        use_staff_nicknames=APIHelper.SKIP,
        show_staff_last_names_on_schedules=APIHelper.SKIP):
        """Initialize a StaffSetting instance."""
        # Initialize members of the class
        if use_staff_nicknames is not APIHelper.SKIP:
            self.use_staff_nicknames = use_staff_nicknames
        if show_staff_last_names_on_schedules is not APIHelper.SKIP:
            self.show_staff_last_names_on_schedules =\
                 show_staff_last_names_on_schedules

    @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
        use_staff_nicknames =\
            dictionary.get("UseStaffNicknames")\
            if "UseStaffNicknames" in dictionary.keys()\
                else APIHelper.SKIP
        show_staff_last_names_on_schedules =\
            dictionary.get("ShowStaffLastNamesOnSchedules")\
            if "ShowStaffLastNamesOnSchedules" in dictionary.keys()\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(use_staff_nicknames,
                   show_staff_last_names_on_schedules)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _use_staff_nicknames=(
            self.use_staff_nicknames
            if hasattr(self, "use_staff_nicknames")
            else None
        )
        _show_staff_last_names_on_schedules=(
            self.show_staff_last_names_on_schedules
            if hasattr(self, "show_staff_last_names_on_schedules")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"use_staff_nicknames={_use_staff_nicknames!r}, "
            f"show_staff_last_names_on_schedules={_show_staff_last_names_on_schedules!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _use_staff_nicknames=(
            self.use_staff_nicknames
            if hasattr(self, "use_staff_nicknames")
            else None
        )
        _show_staff_last_names_on_schedules=(
            self.show_staff_last_names_on_schedules
            if hasattr(self, "show_staff_last_names_on_schedules")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"use_staff_nicknames={_use_staff_nicknames!s}, "
            f"show_staff_last_names_on_schedules={_show_staff_last_names_on_schedules!s}, "
            f")"
        )
