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

"""
spotifywebapiwithfixesandimprovementsfromsonallux

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


class RecommendationSeedObject(object):

    """Implementation of the 'RecommendationSeedObject' model.

    Attributes:
        after_filtering_size (int): The number of tracks available after
            min\_\* and max\_\* filters have been applied.
        after_relinking_size (int): The number of tracks available after
            relinking for regional availability.
        href (str): A link to the full track or artist data for this seed. For
            tracks this will be a link to a Track Object. For artists a link
            to an Artist Object. For genre seeds, this value will be `null`.
        id (str): The id used to select this seed. This will be the same as
            the string used in the `seed_artists`, `seed_tracks` or
            `seed_genres` parameter.
        initial_pool_size (int): The number of recommended tracks available
            for this seed.
        mtype (str): The entity type of this seed. One of `artist`, `track` or
            `genre`.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "after_filtering_size": 'afterFilteringSize',
        "after_relinking_size": 'afterRelinkingSize',
        "href": 'href',
        "id": 'id',
        "initial_pool_size": 'initialPoolSize',
        "mtype": 'type'
    }

    _optionals = [
        'after_filtering_size',
        'after_relinking_size',
        'href',
        'id',
        'initial_pool_size',
        'mtype',
    ]

    def __init__(self,
                 after_filtering_size=APIHelper.SKIP,
                 after_relinking_size=APIHelper.SKIP,
                 href=APIHelper.SKIP,
                 id=APIHelper.SKIP,
                 initial_pool_size=APIHelper.SKIP,
                 mtype=APIHelper.SKIP):
        """Constructor for the RecommendationSeedObject class"""

        # Initialize members of the class
        if after_filtering_size is not APIHelper.SKIP:
            self.after_filtering_size = after_filtering_size 
        if after_relinking_size is not APIHelper.SKIP:
            self.after_relinking_size = after_relinking_size 
        if href is not APIHelper.SKIP:
            self.href = href 
        if id is not APIHelper.SKIP:
            self.id = id 
        if initial_pool_size is not APIHelper.SKIP:
            self.initial_pool_size = initial_pool_size 
        if mtype is not APIHelper.SKIP:
            self.mtype = mtype 

    @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
        after_filtering_size = dictionary.get("afterFilteringSize") if dictionary.get("afterFilteringSize") else APIHelper.SKIP
        after_relinking_size = dictionary.get("afterRelinkingSize") if dictionary.get("afterRelinkingSize") else APIHelper.SKIP
        href = dictionary.get("href") if dictionary.get("href") else APIHelper.SKIP
        id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP
        initial_pool_size = dictionary.get("initialPoolSize") if dictionary.get("initialPoolSize") else APIHelper.SKIP
        mtype = dictionary.get("type") if dictionary.get("type") else APIHelper.SKIP
        # Return an object of this model
        return cls(after_filtering_size,
                   after_relinking_size,
                   href,
                   id,
                   initial_pool_size,
                   mtype)

    def __repr__(self):
        return (f'{self.__class__.__name__}('
                f'after_filtering_size={(self.after_filtering_size if hasattr(self, "after_filtering_size") else None)!r}, '
                f'after_relinking_size={(self.after_relinking_size if hasattr(self, "after_relinking_size") else None)!r}, '
                f'href={(self.href if hasattr(self, "href") else None)!r}, '
                f'id={(self.id if hasattr(self, "id") else None)!r}, '
                f'initial_pool_size={(self.initial_pool_size if hasattr(self, "initial_pool_size") else None)!r}, '
                f'mtype={(self.mtype if hasattr(self, "mtype") else None)!r})')

    def __str__(self):
        return (f'{self.__class__.__name__}('
                f'after_filtering_size={(self.after_filtering_size if hasattr(self, "after_filtering_size") else None)!s}, '
                f'after_relinking_size={(self.after_relinking_size if hasattr(self, "after_relinking_size") else None)!s}, '
                f'href={(self.href if hasattr(self, "href") else None)!s}, '
                f'id={(self.id if hasattr(self, "id") else None)!s}, '
                f'initial_pool_size={(self.initial_pool_size if hasattr(self, "initial_pool_size") else None)!s}, '
                f'mtype={(self.mtype if hasattr(self, "mtype") else None)!s})')
