public abstract class AbstractResource
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractResource.TwitchHttpResponseHandler
Handles HTTP response's from the Twitch API.
|
Modifier and Type | Field and Description |
---|---|
protected static com.mb3364.http.AsyncHttpClient |
http |
protected static com.fasterxml.jackson.databind.ObjectMapper |
objectMapper |
Modifier | Constructor and Description |
---|---|
protected |
AbstractResource(java.lang.String baseUrl,
int apiVersion)
Construct a resource using the Twitch API base URL and specified API version.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
getBaseUrl()
Get the base URL to the Twitch API.
|
void |
setAuthAccessToken(java.lang.String accessToken)
Sets the authentication access token to be included in the HTTP headers of each
API request.
|
void |
setClientId(java.lang.String clientId)
Sets the application's client ID to be included in the HTTP headers of each API request.
|
protected static final com.fasterxml.jackson.databind.ObjectMapper objectMapper
protected static final com.mb3364.http.AsyncHttpClient http
protected AbstractResource(java.lang.String baseUrl, int apiVersion)
baseUrl
- the base URL of the Twitch APIapiVersion
- the requested version of the Twitch APIpublic void setAuthAccessToken(java.lang.String accessToken)
accessToken
- the user's authentication access tokenpublic void setClientId(java.lang.String clientId)
clientId
- the application's client IDprotected java.lang.String getBaseUrl()