public class SearchResource extends AbstractResource
SearchResource
provides the functionality
to access the /search
endpoints of the Twitch API.AbstractResource.TwitchHttpResponseHandler
http, objectMapper
Constructor and Description |
---|
SearchResource(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 |
channels(java.lang.String query,
ChannelsResponseHandler handler)
Returns a list of channel objects matching the search query.
|
void |
channels(java.lang.String query,
com.mb3364.http.RequestParams params,
ChannelsResponseHandler handler)
Returns a list of channel objects matching the search query.
|
void |
games(java.lang.String query,
GamesResponseHandler handler)
Returns a list of game objects matching the search query.
|
void |
games(java.lang.String query,
com.mb3364.http.RequestParams params,
GamesResponseHandler handler)
Returns a list of game objects matching the search query.
|
void |
streams(java.lang.String query,
com.mb3364.http.RequestParams params,
StreamsResponseHandler handler)
Returns a list of stream objects matching the search query.
|
void |
streams(java.lang.String query,
StreamsResponseHandler handler)
Returns a list of stream objects matching the search query.
|
getBaseUrl, setAuthAccessToken, setClientId
public SearchResource(java.lang.String baseUrl, int apiVersion)
baseUrl
- the base URL of the Twitch APIapiVersion
- the requested version of the Twitch APIpublic void channels(java.lang.String query, com.mb3364.http.RequestParams params, ChannelsResponseHandler handler)
query
- the search queryparams
- the optional request parameters:
limit
: the maximum number of objects in array. Maximum is 100.offset
: the object offset for pagination. Default is 0.handler
- the response handlerpublic void channels(java.lang.String query, ChannelsResponseHandler handler)
query
- the search queryhandler
- the response handlerpublic void streams(java.lang.String query, com.mb3364.http.RequestParams params, StreamsResponseHandler handler)
query
- the search queryparams
- the optional request parameters:
limit
: the maximum number of objects in array. Maximum is 100.offset
: the object offset for pagination. Default is 0.hls
: If set to true, only returns streams using HLS.
If set to false, only returns streams that are non-HLS.handler
- the response handlerpublic void streams(java.lang.String query, StreamsResponseHandler handler)
query
- the search queryhandler
- the response handlerpublic void games(java.lang.String query, com.mb3364.http.RequestParams params, GamesResponseHandler handler)
query
- the search queryparams
- the optional request parameters:
live
: If true, only returns games that are live on at least one channel.handler
- the response handlerpublic void games(java.lang.String query, GamesResponseHandler handler)
query
- the search queryhandler
- the response handler