# -*- coding: utf-8 -*-

"""
spotifywebapiwithfixesandimprovementsfromsonallux

This file was automatically generated by APIMATIC v3.0 (
 https://www.apimatic.io ).
"""
from spotifywebapiwithfixesandimprovementsfromsonallux.api_helper import APIHelper


class ExplicitContentSettingsObject(object):

    """Implementation of the 'ExplicitContentSettingsObject' model.

    Attributes:
        filter_enabled (bool): When `true`, indicates that explicit content
            should not be played.
        filter_locked (bool): When `true`, indicates that the explicit content
            setting is locked and can't be changed by the user.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "filter_enabled": 'filter_enabled',
        "filter_locked": 'filter_locked'
    }

    _optionals = [
        'filter_enabled',
        'filter_locked',
    ]

    def __init__(self,
                 filter_enabled=APIHelper.SKIP,
                 filter_locked=APIHelper.SKIP):
        """Constructor for the ExplicitContentSettingsObject class"""

        # Initialize members of the class
        if filter_enabled is not APIHelper.SKIP:
            self.filter_enabled = filter_enabled 
        if filter_locked is not APIHelper.SKIP:
            self.filter_locked = filter_locked 

    @classmethod
    def from_dictionary(cls,
                        dictionary):
        """Creates 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
        filter_enabled = dictionary.get("filter_enabled") if "filter_enabled" in dictionary.keys() else APIHelper.SKIP
        filter_locked = dictionary.get("filter_locked") if "filter_locked" in dictionary.keys() else APIHelper.SKIP
        # Return an object of this model
        return cls(filter_enabled,
                   filter_locked)

    def __repr__(self):
        return (f'{self.__class__.__name__}('
                f'filter_enabled={(self.filter_enabled if hasattr(self, "filter_enabled") else None)!r}, '
                f'filter_locked={(self.filter_locked if hasattr(self, "filter_locked") else None)!r})')

    def __str__(self):
        return (f'{self.__class__.__name__}('
                f'filter_enabled={(self.filter_enabled if hasattr(self, "filter_enabled") else None)!s}, '
                f'filter_locked={(self.filter_locked if hasattr(self, "filter_locked") else None)!s})')
