All Downloads are FREE. Search and download functionalities are using the official Maven repository.

se.michaelthelin.spotify.requests.IRequest Maven / Gradle / Ivy

There is a newer version: 9.0.0-RC1
Show newest version
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