Class: Spotted::Resources::Me::Following

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Following

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

Parameters:



135
136
137
# File 'lib/spotted/resources/me/following.rb', line 135

def initialize(client:)
  @client = client
end

Instance Method Details

#bulk_retrieve(after: nil, limit: nil, type: :artist, request_options: {}) ⇒ Spotted::Models::Me::FollowingBulkRetrieveResponse

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

Get the current user’s followed artists.

Parameters:

  • after (String)

    The last artist ID retrieved from the previous request.

  • limit (Integer)

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

  • type (Symbol, :artist)

    The ID type: currently only ‘artist` is supported.

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

Returns:

See Also:



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

def bulk_retrieve(params)
  parsed, options = Spotted::Me::FollowingBulkRetrieveParams.dump_request(params)
  @client.request(
    method: :get,
    path: "me/following",
    query: parsed,
    model: Spotted::Models::Me::FollowingBulkRetrieveResponse,
    options: options
  )
end

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

Deprecated.

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

Check to see if the current user is following one or more artists or other Spotify users.

Note: This endpoint is deprecated. Use [Check User’s Saved Items](/documentation/web-api/reference/check-library-contains) instead.

Parameters:

Returns:

  • (Array<Boolean>)

See Also:



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

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

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

Deprecated.

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

Add the current user as a follower of one or more artists or other Spotify users.

Note: This endpoint is deprecated. Use [Save Items to Library](/documentation/web-api/reference/save-library-items) instead.

Parameters:

  • ids (Array<String>)

    A JSON array of the artist or user [Spotify IDs](/documentation/web-api/concepts

  • published (Boolean)

    The playlist’s public/private status (if it should be added to the user’s profil

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

Returns:

  • (nil)

See Also:



93
94
95
96
# File 'lib/spotted/resources/me/following.rb', line 93

def follow(params)
  parsed, options = Spotted::Me::FollowingFollowParams.dump_request(params)
  @client.request(method: :put, path: "me/following", body: parsed, model: NilClass, options: options)
end

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

Deprecated.

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

Remove the current user as a follower of one or more artists or other Spotify users.

Note: This endpoint is deprecated. Use [Remove Items from Library](/documentation/web-api/reference/remove-library-items) instead.

Parameters:

  • ids (Array<String>)

    A JSON array of the artist or user [Spotify IDs](/documentation/web-api/concepts

  • published (Boolean)

    The playlist’s public/private status (if it should be added to the user’s profil

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

Returns:

  • (nil)

See Also:



121
122
123
124
125
126
127
128
129
130
# File 'lib/spotted/resources/me/following.rb', line 121

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