Class: Spotted::Resources::Browse::Categories

Inherits:
Object
  • Object
show all
Defined in:
lib/spotted/resources/browse/categories.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Categories

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Categories.

Parameters:



104
105
106
# File 'lib/spotted/resources/browse/categories.rb', line 104

def initialize(client:)
  @client = client
end

Instance Method Details

#get_playlists(category_id, limit: nil, offset: nil, request_options: {}) ⇒ Spotted::Models::Browse::CategoryGetPlaylistsResponse

Deprecated.

Some parameter documentations has been truncated, see Models::Browse::CategoryGetPlaylistsParams for more details.

Get a list of Spotify playlists tagged with a particular category.

Parameters:

  • category_id (String)

    The [Spotify category ID](/documentation/web-api/concepts/spotify-uris-ids) for

  • limit (Integer)

    The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50.

  • offset (Integer)

    The index of the first item to return. Default: 0 (the first item). Use with lim

  • request_options (Spotted::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



90
91
92
93
94
95
96
97
98
99
# File 'lib/spotted/resources/browse/categories.rb', line 90

def get_playlists(category_id, params = {})
  parsed, options = Spotted::Browse::CategoryGetPlaylistsParams.dump_request(params)
  @client.request(
    method: :get,
    path: ["browse/categories/%1$s/playlists", category_id],
    query: parsed,
    model: Spotted::Models::Browse::CategoryGetPlaylistsResponse,
    options: options
  )
end

#list(limit: nil, locale: nil, offset: nil, request_options: {}) ⇒ Spotted::Internal::CursorURLPage<Spotted::Models::Browse::CategoryListResponse>

Deprecated.

Some parameter documentations has been truncated, see Models::Browse::CategoryListParams for more details.

Get a list of categories used to tag items in Spotify (on, for example, the Spotify player’s “Browse” tab).

Parameters:

  • limit (Integer)

    The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50.

  • locale (String)

    The desired language, consisting of an [ISO 639-1](en.wikipedia.org/wiki/

  • offset (Integer)

    The index of the first item to return. Default: 0 (the first item). Use with lim

  • request_options (Spotted::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



58
59
60
61
62
63
64
65
66
67
68
# File 'lib/spotted/resources/browse/categories.rb', line 58

def list(params = {})
  parsed, options = Spotted::Browse::CategoryListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "browse/categories",
    query: parsed,
    page: Spotted::Internal::CursorURLPage,
    model: Spotted::Models::Browse::CategoryListResponse,
    options: options
  )
end

#retrieve(category_id, locale: nil, request_options: {}) ⇒ Spotted::Models::Browse::CategoryRetrieveResponse

Deprecated.

Some parameter documentations has been truncated, see Models::Browse::CategoryRetrieveParams for more details.

Get a single category used to tag items in Spotify (on, for example, the Spotify player’s “Browse” tab).

Parameters:

  • category_id (String)

    The [Spotify category ID](/documentation/web-api/concepts/spotify-uris-ids) for

  • locale (String)

    The desired language, consisting of an [ISO 639-1](en.wikipedia.org/wiki/

  • request_options (Spotted::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



26
27
28
29
30
31
32
33
34
35
# File 'lib/spotted/resources/browse/categories.rb', line 26

def retrieve(category_id, params = {})
  parsed, options = Spotted::Browse::CategoryRetrieveParams.dump_request(params)
  @client.request(
    method: :get,
    path: ["browse/categories/%1$s", category_id],
    query: parsed,
    model: Spotted::Models::Browse::CategoryRetrieveResponse,
    options: options
  )
end