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

"""
spotifywebapiwithfixesandimprovementsfromsonallux

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


class PlaylistsFollowersRequest(object):

    """Implementation of the 'Playlists Followers Request' model.

    Attributes:
        public (bool): Defaults to `true`. If `true` the playlist will be
            included in user's public playlists, if `false` it will remain
            private.

    """

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

    _optionals = [
        'public',
    ]

    def __init__(self,
                 public=APIHelper.SKIP):
        """Constructor for the PlaylistsFollowersRequest class"""

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

    @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
        public = dictionary.get("public") if "public" in dictionary.keys() else APIHelper.SKIP
        # Return an object of this model
        return cls(public)

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

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