spotifywebapipython.models.restrictions

@export
class Restrictions:

Spotify Web API Content Restrictions object.

Contains information about content restrictions.

Restrictions(root: dict = None)

Initializes a new instance of the class.

Arguments:
  • root (dict): Spotify Web API JSON response in dictionary format, used to load object attributes; otherwise, None to not load attributes.
Reason: str

The reason for the restriction. Supported values:

  • market: The content item is not available in the given market.
  • product: The content item is not available for the user's subscription type.
  • explicit: The content item is explicit and the user's account is set to not play explicit content.

Additional reasons may be added in the future.

Note: If you use this field, make sure that your application safely handles unknown values.

def ToDictionary(self) -> dict:

Returns a dictionary representation of the class.

def ToString(self) -> str:

Returns a displayable string representation of the class.