"""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.staff_permission_group import (
    StaffPermissionGroup,
)


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

    Attributes:
        user_group (StaffPermissionGroup): The model property of type
            StaffPermissionGroup.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "user_group": "UserGroup",
    }

    _optionals = [
        "user_group",
    ]

    def __init__(
        self,
        user_group=APIHelper.SKIP):
        """Initialize a UpdateStaffPermissionsResponse instance."""
        # Initialize members of the class
        if user_group is not APIHelper.SKIP:
            self.user_group = user_group

    @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
        user_group =\
            StaffPermissionGroup.from_dictionary(
                dictionary.get("UserGroup"))\
                if "UserGroup" in dictionary.keys()\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(user_group)

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

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