public class StreamsResource extends AbstractResource
StreamsResource
provides the functionality
to access the /streams
endpoints of the Twitch API.AbstractResource.TwitchHttpResponseHandler
http, objectMapper
Constructor and Description |
---|
StreamsResource(java.lang.String baseUrl,
int apiVersion)
Construct the resource using the Twitch API base URL and specified API version.
|
Modifier and Type | Method and Description |
---|---|
void |
get(com.mb3364.http.RequestParams params,
StreamsResponseHandler handler)
Returns a list of stream objects that are queried by a number of parameters
sorted by number of viewers descending.
|
void |
get(StreamsResponseHandler handler)
Returns a list of stream objects that are queried by a number of parameters
sorted by number of viewers descending.
|
void |
get(java.lang.String channelName,
StreamResponseHandler handler)
Returns a stream object.
|
void |
getFeatured(FeaturedStreamResponseHandler handler)
Returns a list of featured (promoted) stream objects.
|
void |
getFeatured(com.mb3364.http.RequestParams params,
FeaturedStreamResponseHandler handler)
Returns a list of featured (promoted) stream objects.
|
void |
getFollowed(com.mb3364.http.RequestParams params,
StreamsResponseHandler handler)
Returns a list of stream objects that the authenticated user is following.
|
void |
getFollowed(StreamsResponseHandler handler)
Returns a list of stream objects that the authenticated user is following.
|
void |
getSummary(StreamsSummaryResponseHandler handler)
Returns a summary of current streams.
|
void |
getSummary(java.lang.String game,
StreamsSummaryResponseHandler handler)
Returns a summary of current streams.
|
getBaseUrl, setAuthAccessToken, setClientId
public StreamsResource(java.lang.String baseUrl, int apiVersion)
baseUrl
- the base URL of the Twitch APIapiVersion
- the requested version of the Twitch APIpublic void get(java.lang.String channelName, StreamResponseHandler handler)
The stream object in the onSuccess() response will be null
if the stream is offline.
channelName
- the name of the Channelhandler
- the response handlerpublic void get(com.mb3364.http.RequestParams params, StreamsResponseHandler handler)
params
- the optional request parameters:
game
: Streams categorized under game
.channel
: Streams from a comma separated list of channels.limit
: Maximum number of objects in array. Default is 25. Maximum is 100.offset
: Object offset for pagination. Default is 0.client_id
: Only shows streams from applications of client_id
.handler
- the response handlerpublic void get(StreamsResponseHandler handler)
handler
- the response handlerpublic void getFeatured(com.mb3364.http.RequestParams params, FeaturedStreamResponseHandler handler)
params
- the optional request parameters:
limit
: Maximum number of objects in array. Default is 25. Maximum is 100.offset
: Object offset for pagination. Default is 0.handler
- the response handlerpublic void getFeatured(FeaturedStreamResponseHandler handler)
handler
- the response handlerpublic void getSummary(java.lang.String game, StreamsSummaryResponseHandler handler)
game
- Only show stats for the set gamehandler
- the response handlerpublic void getSummary(StreamsSummaryResponseHandler handler)
handler
- the response handlerpublic void getFollowed(com.mb3364.http.RequestParams params, StreamsResponseHandler handler)
Scopes.USER_READ
params
- the optional request parameters:
limit
: Maximum number of objects in array. Default is 25. Maximum is 100.offset
: Object offset for pagination. Default is 0.handler
- the response handlerpublic void getFollowed(StreamsResponseHandler handler)
Scopes.USER_READ
handler
- the response handler