Class: Spotted::Resources::Chapters

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Chapters

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

Parameters:



67
68
69
# File 'lib/spotted/resources/chapters.rb', line 67

def initialize(client:)
  @client = client
end

Instance Method Details

#list(ids: , market: nil, request_options: {}) ⇒ Spotted::Models::ChapterListResponse

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

Get Spotify catalog information for several audiobook chapters identified by their Spotify IDs. Chapters are only available within the US, UK, Canada, Ireland, New Zealand and Australia markets.

Parameters:

Returns:

See Also:



53
54
55
56
57
58
59
60
61
62
# File 'lib/spotted/resources/chapters.rb', line 53

def list(params)
  parsed, options = Spotted::ChapterListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "chapters",
    query: parsed,
    model: Spotted::Models::ChapterListResponse,
    options: options
  )
end

#retrieve(id, market: nil, request_options: {}) ⇒ Spotted::Models::ChapterRetrieveResponse

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

Get Spotify catalog information for a single audiobook chapter. Chapters are only available within the US, UK, Canada, Ireland, New Zealand and Australia markets.

Parameters:

Returns:

See Also:



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

def retrieve(id, params = {})
  parsed, options = Spotted::ChapterRetrieveParams.dump_request(params)
  @client.request(
    method: :get,
    path: ["chapters/%1$s", id],
    query: parsed,
    model: Spotted::Models::ChapterRetrieveResponse,
    options: options
  )
end