de.sonallux.spotify.api.apis.users.FollowArtistsUsersRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spotify-web-api-java Show documentation
Show all versions of spotify-web-api-java Show documentation
A Java wrapper for Spotify's Web API
The newest version!
package de.sonallux.spotify.api.apis.users;
import com.fasterxml.jackson.core.type.TypeReference;
import de.sonallux.spotify.api.http.ApiCall;
import de.sonallux.spotify.api.http.ApiClient;
import de.sonallux.spotify.api.http.Request;
import de.sonallux.spotify.api.models.*;
/**
* Follow Artists or Users request
*
* Required OAuth scopes
* user-follow-modify
*
* Response
* Artist or user followed
*/
public class FollowArtistsUsersRequest {
private static final TypeReference RESPONSE_TYPE = new TypeReference<>() {};
private final ApiClient apiClient;
private final Request request;
/**
* Follow Artists or Users request
* @param apiClient The API client
* @param type The ID type.
* @param ids A JSON array of the artist or user Spotify IDs. For example: {ids:["74ASZWbe4lXaubB36ztrGX", "08td7MxkoHQkXnWAYD8d6Q"]}
. A maximum of 50 IDs can be sent in one request. Note: if the ids
parameter is present in the query string, any IDs listed here in the body will be ignored.
*/
public FollowArtistsUsersRequest(ApiClient apiClient, String type, java.util.List ids) {
this.apiClient = apiClient;
this.request = new Request("PUT", "/me/following")
.addQueryParameter("type", String.valueOf(type))
.addBodyParameter("ids", ids)
;
}
/**
* Build the request into an executable api call
* @return an executable api call
*/
public ApiCall build() {
return apiClient.createApiCall(request, RESPONSE_TYPE);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy