de.sonallux.spotify.api.apis.users.UnfollowArtistsUsersRequest 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.*;
/**
* Unfollow Artists or Users request
*
* Required OAuth scopes
* user-follow-modify
*
* Response
* Artist or user unfollowed
*/
public class UnfollowArtistsUsersRequest {
private static final TypeReference RESPONSE_TYPE = new TypeReference<>() {};
private final ApiClient apiClient;
private final Request request;
/**
* Unfollow Artists or Users request
* @param apiClient The API client
* @param type The ID type: either artist
or user
.
* @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 UnfollowArtistsUsersRequest(ApiClient apiClient, String type, java.util.List ids) {
this.apiClient = apiClient;
this.request = new Request("DELETE", "/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