se.michaelthelin.spotify.requests.IRequest 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 client for Spotify's Web API
package se.michaelthelin.spotify.requests;
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
import org.apache.hc.core5.http.*;
import se.michaelthelin.spotify.IHttpManager;
import se.michaelthelin.spotify.exceptions.SpotifyWebApiException;
import java.io.IOException;
import java.net.URI;
import java.util.List;
import java.util.concurrent.CompletableFuture;
public interface IRequest {
IHttpManager getHttpManager();
URI getUri();
List getHeaders();
ContentType getContentType();
HttpEntity getBody();
List getBodyParameters();
T execute() throws
IOException,
SpotifyWebApiException,
ParseException;
CompletableFuture executeAsync();
String getJson() throws
IOException,
SpotifyWebApiException,
ParseException;
String postJson() throws
IOException,
SpotifyWebApiException,
ParseException;
String putJson() throws
IOException,
SpotifyWebApiException,
ParseException;
String deleteJson() throws
IOException,
SpotifyWebApiException,
ParseException;
@JsonPOJOBuilder(withPrefix = "set")
interface Builder> {
BT setHttpManager(final IHttpManager httpManager);
BT setScheme(final String scheme);
BT setHost(final String host);
BT setPort(final Integer port);
BT setPath(final String path);
BT setPathParameter(final String name, final String value);
BT setDefaults(final IHttpManager httpManager,
final String scheme,
final String host,
final Integer port);
BT setQueryParameter(final String name, final ST value);
BT setHeader(final String name, final ST value);
BT setContentType(final ContentType contentType);
BT setBody(final HttpEntity httpEntity);
BT setBodyParameter(final String name, final ST value);
IRequest build();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy