Class: Spotted::Resources::Me::Shows

Inherits:
Object
  • Object
show all
Defined in:
lib/spotted/resources/me/shows.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Shows

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 Shows.

Parameters:



111
112
113
# File 'lib/spotted/resources/me/shows.rb', line 111

def initialize(client:)
  @client = client
end

Instance Method Details

#check(ids:, request_options: {}) ⇒ Array<Boolean>

Some parameter documentations has been truncated, see Models::Me::ShowCheckParams for more details.

Check if one or more shows is already saved in the current Spotify user’s library.

Parameters:

  • ids (String)

    A comma-separated list of the [Spotify IDs](/documentation/web-api/concepts/spot

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

Returns:

  • (Array<Boolean>)

See Also:



51
52
53
54
55
56
57
58
59
60
# File 'lib/spotted/resources/me/shows.rb', line 51

def check(params)
  parsed, options = Spotted::Me::ShowCheckParams.dump_request(params)
  @client.request(
    method: :get,
    path: "me/shows/contains",
    query: parsed,
    model: Spotted::Internal::Type::ArrayOf[Spotted::Internal::Type::Boolean],
    options: options
  )
end

#list(limit: nil, offset: nil, request_options: {}) ⇒ Spotted::Internal::CursorURLPage<Spotted::Models::Me::ShowListResponse>

Some parameter documentations has been truncated, see Models::Me::ShowListParams for more details.

Get a list of shows saved in the current Spotify user’s library. Optional parameters can be used to limit the number of shows returned.

Parameters:

  • 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:



24
25
26
27
28
29
30
31
32
33
34
# File 'lib/spotted/resources/me/shows.rb', line 24

def list(params = {})
  parsed, options = Spotted::Me::ShowListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "me/shows",
    query: parsed,
    page: Spotted::Internal::CursorURLPage,
    model: Spotted::Models::Me::ShowListResponse,
    options: options
  )
end

#remove(ids: nil, published: nil, request_options: {}) ⇒ nil

Deprecated.

Some parameter documentations has been truncated, see Models::Me::ShowRemoveParams for more details.

Delete one or more shows from current Spotify user’s library.

Parameters:

Returns:

  • (nil)

See Also:



80
81
82
83
# File 'lib/spotted/resources/me/shows.rb', line 80

def remove(params = {})
  parsed, options = Spotted::Me::ShowRemoveParams.dump_request(params)
  @client.request(method: :delete, path: "me/shows", body: parsed, model: NilClass, options: options)
end

#save(ids: nil, published: nil, request_options: {}) ⇒ nil

Deprecated.

Some parameter documentations has been truncated, see Models::Me::ShowSaveParams for more details.

Save one or more shows to current Spotify user’s library.

Parameters:

Returns:

  • (nil)

See Also:



103
104
105
106
# File 'lib/spotted/resources/me/shows.rb', line 103

def save(params = {})
  parsed, options = Spotted::Me::ShowSaveParams.dump_request(params)
  @client.request(method: :put, path: "me/shows", body: parsed, model: NilClass, options: options)
end