Class DiscogsConnection
java.lang.Object
com.amilesend.client.connection.Connection<GsonFactory>
com.amilesend.discogs.connection.DiscogsConnection
Wraps a
OkHttpClient that manages authentication refresh and parsing responses to corresponding POJO types.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDiscogsConnection.DiscogsConnectionBuilder<C extends DiscogsConnection, B extends DiscogsConnection.DiscogsConnectionBuilder<C,B>> Nested classes/interfaces inherited from class com.amilesend.client.connection.Connection
com.amilesend.client.connection.Connection.ConnectionBuilder<G,C, B>, com.amilesend.client.connection.Connection.Headers -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class com.amilesend.client.connection.Connection
FORM_DATA_CONTENT_TYPE, FORM_DATA_MEDIA_TYPE, JSON_CONTENT_TYPE, JSON_MEDIA_TYPE -
Method Summary
Modifier and TypeMethodDescriptionstatic DiscogsConnection.DiscogsConnectionBuilder<?, ?> builder()download(@NonNull okhttp3.Request request, @NonNull Path folderPath, @NonNull com.amilesend.client.connection.file.TransferProgressCallback callback) Downloads the contents for the givenrequestto the specifiedfolderPath.okhttp3.Responseexecute(@NonNull okhttp3.Request request) <T> Texecute(@NonNull okhttp3.Request request, @NonNull com.amilesend.client.parse.parser.GsonParser<T> parser) The authorization verifier used to check if API calls require authentication prior to invoking the API.okhttp3.Request.BuilderCreates a newRequest.Builderwith pre-configured headers for a download request that expects a CSV-formatted response.Uploads the contents for a givenrequest.Methods inherited from class com.amilesend.client.connection.Connection
getAuthManager, getBaseUrl, getGsonFactory, getHttpClient, getRetryStrategy, getUserAgent, isGzipContentEncodingEnabled, newRequestBuilder
-
Field Details
-
DEFAULT_BASE_URL
- See Also:
-
TEXT_CSV_TYPE
- See Also:
-
LOCATION
- See Also:
-
CONTENT_DISPOSITION
- See Also:
-
CONTENT_LENGTH
- See Also:
-
-
Method Details
-
newRequestBuilderForDownload
public okhttp3.Request.Builder newRequestBuilderForDownload()Creates a newRequest.Builderwith pre-configured headers for a download request that expects a CSV-formatted response.- Returns:
- the request builder
-
execute
public <T> T execute(@NonNull okhttp3.Request request, @NonNull com.amilesend.client.parse.parser.GsonParser<T> parser) throws com.amilesend.client.connection.ConnectionException - Overrides:
executein classcom.amilesend.client.connection.Connection<GsonFactory>- Throws:
com.amilesend.client.connection.ConnectionException
-
upload
Uploads the contents for a givenrequest.- Parameters:
request- the requestfilename- the name of the file that is uploaded- Returns:
- the upload information
- Throws:
com.amilesend.client.connection.ConnectionException- if an error occurred while uploading the content for the request- See Also:
-
execute
public okhttp3.Response execute(@NonNull okhttp3.Request request) throws com.amilesend.client.connection.ConnectionException - Overrides:
executein classcom.amilesend.client.connection.Connection<GsonFactory>- Throws:
com.amilesend.client.connection.ConnectionException
-
download
public DownloadInformation download(@NonNull okhttp3.Request request, @NonNull Path folderPath, @NonNull com.amilesend.client.connection.file.TransferProgressCallback callback) throws com.amilesend.client.connection.ConnectionException Downloads the contents for the givenrequestto the specifiedfolderPath.- Parameters:
request- the requestfolderPath- the path of the folder to download the content tocallback- theTransferProgressCallbackcall to invoke to report download transfer progress- Returns:
- the download information
- Throws:
com.amilesend.client.connection.ConnectionException- if an error occurred while downloading the content for the request- See Also:
-
builder
-
getAuthVerifier
The authorization verifier used to check if API calls require authentication prior to invoking the API.
-