Class SearchItemRequest.Builder
java.lang.Object
se.michaelthelin.spotify.requests.AbstractRequest.Builder<SearchResult,SearchItemRequest.Builder>
se.michaelthelin.spotify.requests.data.AbstractDataRequest.Builder<SearchResult,SearchItemRequest.Builder>
se.michaelthelin.spotify.requests.data.search.SearchItemRequest.Builder
- All Implemented Interfaces:
IRequest.Builder<SearchResult,
SearchItemRequest.Builder>
- Enclosing class:
SearchItemRequest
public static final class SearchItemRequest.Builder
extends AbstractDataRequest.Builder<SearchResult,SearchItemRequest.Builder>
Builder class for building a
SearchItemRequest
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
The request build method.includeExternal
(String includeExternal) The include external setter.The limit setter.market
(com.neovisionaries.i18n.CountryCode market) The market country code setter.The offset setter.The search query setter.protected SearchItemRequest.Builder
self()
Return this instance to simulate a self-type.The type setter.Methods inherited from class se.michaelthelin.spotify.requests.AbstractRequest.Builder
setBody, setBodyParameter, setContentType, setDefaults, setHeader, setHost, setHttpManager, setPath, setPathParameter, setPort, setQueryParameter, setScheme
-
Constructor Details
-
Builder
Create a newSearchItemRequest.Builder
.- Parameters:
accessToken
- Required. A valid access token from the Spotify Accounts service.
-
-
Method Details
-
q
The search query setter.- Parameters:
q
- Required. The search query's keywords (and optional field filters and operators).- Returns:
- A
SearchItemRequest.Builder
. - See Also:
-
type
The type setter.- Parameters:
type
- Required. A comma-separated list of item types to search across. Valid types are:album
,artist
,episode
,playlist
,show
andtrack
.- Returns:
- A
SearchItemRequest.Builder
.
-
market
The market country code setter.- Parameters:
market
- Optional. An ISO 3166-1 alpha-2 country code. If a country code is given, only artists, albums, and tracks with content playable in that market will be returned. (Playlist results are not affected by the market parameter.)- Returns:
- A
SearchItemRequest.Builder
. - See Also:
-
limit
The limit setter.- Parameters:
limit
- Optional. The maximum number of results to return. Default: 20. Minimum: 1. Maximum: 50.- Returns:
- A
SearchItemRequest.Builder
.
-
offset
The offset setter.- Parameters:
offset
- Optional. The index of the first result to return. Default: 0 (i.e., the first result). Maximum offset: 100.000. Use withlimit(Integer)
to get the next page of search results.- Returns:
- A
SearchItemRequest.Builder
.
-
includeExternal
The include external setter.- Parameters:
includeExternal
- Optional. Possible values:audio
. Ifaudio
is set the response will include any relevant audio content that is hosted externally. By default external content is filtered out from responses.- Returns:
- A
SearchItemRequest.Builder
.
-
build
The request build method.- Returns:
- A
SearchItemRequest.Builder
.
-
self
Description copied from class:AbstractRequest.Builder
Return this instance to simulate a self-type.- Specified by:
self
in classAbstractRequest.Builder<SearchResult,
SearchItemRequest.Builder> - Returns:
- This instance.
-