Class SearchTracksRequest.Builder
java.lang.Object
se.michaelthelin.spotify.requests.AbstractRequest.Builder<Paging<Track>, SearchTracksRequest.Builder>
se.michaelthelin.spotify.requests.data.AbstractDataRequest.Builder<Paging<Track>, SearchTracksRequest.Builder>
se.michaelthelin.spotify.requests.data.AbstractDataPagingRequest.Builder<Track, SearchTracksRequest.Builder>
se.michaelthelin.spotify.requests.data.search.simplified.SearchTracksRequest.Builder
- All Implemented Interfaces:
IPagingRequestBuilder<Track, SearchTracksRequest.Builder>, IRequest.Builder<Paging<Track>, SearchTracksRequest.Builder>
- Enclosing class:
SearchTracksRequest
public static final class SearchTracksRequest.Builder
extends AbstractDataPagingRequest.Builder<Track, SearchTracksRequest.Builder>
Builder class for building a
SearchTracksRequest.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()The request build method.include_external(String include_external) The include_external query parameter setter.The limit query parameter setter.market(CountryCode market) The market query parameter setter.The offset query parameter setter.The q query parameter setter.protected SearchTracksRequest.Builderself()Return this instance to simulate a self-type.Methods inherited from class AbstractRequest.Builder
setBody, setBodyParameter, setContentType, setDefaults, setHeader, setHost, setHttpManager, setPath, setPathParameter, setPort, setQueryParameter, setSchemeModifier and TypeMethodDescriptionsetBody(org.apache.hc.core5.http.HttpEntity httpEntity) Set the body for the request.setBodyParameter(String name, X value) Set a body parameter for the request.setContentType(org.apache.hc.core5.http.ContentType contentType) Set the content type for the request.setDefaults(IHttpManager httpManager, String scheme, String host, Integer port) Set default values for the request.Set a header for the request.Set the host for the request.setHttpManager(IHttpManager httpManager) Set the HTTP manager for the request.Set the path for the request.setPathParameter(String name, String value) Set a path parameter for the request.Set the port for the request.setQueryParameter(String name, X value) Set a query parameter for the request.Set the scheme for the request.
-
Constructor Details
-
Builder
Create a newSearchTracksRequest.Builderinstance.- Parameters:
accessToken- Required. A valid access token from the Spotify Accounts service.
-
-
Method Details
-
q
The q query parameter setter.- Parameters:
q- Required. Your search query. You can narrow down your search using field filters. The available filters arealbum,artist,track,year,upc,tag:hipster,tag:new,isrc, andgenre. Each field filter only applies to certain result types. Theartistandyearfilters can be used while searching albums, artists and tracks. You can filter on a singleyearor a range (e.g. 1955-1960).
Thealbumfilter can be used while searching albums and tracks.
Thegenrefilter can be used while searching artists and tracks.
Theisrcandtrackfilters can be used while searching tracks.
Theupc,tag:newandtag:hipsterfilters can only be used while searching albums. Thetag:newfilter will return albums released in the past two weeks andtag:hipstercan be used to return only albums with the lowest 10% popularity.- Returns:
- A
SearchTracksRequest.Builder.
-
market
The market query parameter setter.- Parameters:
market- Optional. An ISO 3166-1 alpha-2 country code. If a country code is specified, only content that is available in that market will be returned.
If a valid user access token is specified in the request header, the country associated with the user account will take priority over this parameter.
Note: If neither market or user country are provided, the content is considered unavailable for the client.
Users can view the country that is associated with their account in the account settings.- Returns:
- A
SearchTracksRequest.Builder.
-
limit
The limit query parameter setter.- Parameters:
limit- Optional. The maximum number of results to return in each item type.- Returns:
- A
SearchTracksRequest.Builder.
-
offset
The offset query parameter setter.- Parameters:
offset- Optional. The index of the first result to return. Use with limit to get the next page of search results.- Returns:
- A
SearchTracksRequest.Builder.
-
include_external
The include_external query parameter setter.- Parameters:
include_external- Optional. Ifinclude_external=audiois specified it signals that the client can play externally hosted audio content, and marks the content as playable in the response. By default externally hosted audio content is marked as unplayable in the response.- Returns:
- A
SearchTracksRequest.Builder.
-
build
-
self
Description copied from class:AbstractRequest.BuilderReturn this instance to simulate a self-type.- Specified by:
selfin classAbstractRequest.Builder<Paging<Track>, SearchTracksRequest.Builder>- Returns:
- This instance.
-