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

"""
spotifywebapiwithfixesandimprovementsfromsonallux

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


class PagedCategories(object):

    """Implementation of the 'PagedCategories' model.

    Attributes:
        categories (Categories): The model property of type Categories.

    """

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

    def __init__(self,
                 categories=None):
        """Constructor for the PagedCategories class"""

        # Initialize members of the class
        self.categories = categories 

    @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
        categories = Categories.from_dictionary(dictionary.get('categories')) if dictionary.get('categories') else None
        # Return an object of this model
        return cls(categories)

    def __repr__(self):
        return (f'{self.__class__.__name__}('
                f'categories={self.categories!r})')

    def __str__(self):
        return (f'{self.__class__.__name__}('
                f'categories={self.categories!s})')
