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

"""
spotifywebapiwithfixesandimprovementsfromsonallux

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


class PagingFeaturedPlaylistObject(object):

    """Implementation of the 'PagingFeaturedPlaylistObject' model.

    Attributes:
        message (str): The localized message of a playlist.
        playlists (PagingPlaylistObject): The model property of type
            PagingPlaylistObject.

    """

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

    _optionals = [
        'message',
        'playlists',
    ]

    def __init__(self,
                 message=APIHelper.SKIP,
                 playlists=APIHelper.SKIP):
        """Constructor for the PagingFeaturedPlaylistObject class"""

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

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

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

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