SpotifyApiBuilder

class SpotifyApiBuilder(clientId: String?, clientSecret: String?, redirectUri: String?)

Spotify API builder

Constructors

SpotifyApiBuilder
Link copied to clipboard
common
fun SpotifyApiBuilder(clientId: String?, clientSecret: String?, redirectUri: String?)

Functions

allowBulkRequests
Link copied to clipboard
common
fun allowBulkRequests(allowBulkRequests: Boolean): SpotifyApiBuilder
Set whether you want to allow splitting too-large requests into smaller, allowable api requests
authorizationCode
Link copied to clipboard
common
fun authorizationCode(authorizationCode: String?): SpotifyApiBuilder
Set a returned authorization code
automaticRefresh
Link copied to clipboard
common
fun automaticRefresh(automaticRefresh: Boolean): SpotifyApiBuilder
Enable or disable automatic refresh of the Spotify access token
build
Link copied to clipboard
common
suspend fun build(type: AuthorizationType): GenericSpotifyApi
Create a SpotifyApi instance with the given SpotifyApiBuilder parameters and the type - AuthorizationType.CLIENT for client authentication, or otherwise AuthorizationType.APPLICATION
buildClient
Link copied to clipboard
common
suspend fun buildClient(): SpotifyClientApi
Create a new SpotifyClientApi that has access to public endpoints, in addition to endpoints requiring scopes contained in the client authorization request
buildCredentialed
Link copied to clipboard
common
suspend fun buildCredentialed(): SpotifyAppApi
Create a new SpotifyAppApi that only has access to public endpoints and data
buildPublic
Link copied to clipboard
common
suspend fun buildPublic(): SpotifyAppApi
Create a new SpotifyAppApi that only has access to public endpoints and data
cacheLimit
Link copied to clipboard
common
fun cacheLimit(cacheLimit: Int?): SpotifyApiBuilder
Set the maximum allowed amount of cached requests at one time.
clientId
Link copied to clipboard
common
fun clientId(clientId: String): SpotifyApiBuilder
Set the application client id
clientSecret
Link copied to clipboard
common
fun clientSecret(clientSecret: String): SpotifyApiBuilder
Set the application client secret
defaultLimit
Link copied to clipboard
common
fun defaultLimit(defaultLimit: Int): SpotifyApiBuilder
Allows you to set the default amount of objects to retrieve in one request
enableLogger
Link copied to clipboard
common
fun enableLogger(enableLogger: Boolean): SpotifyApiBuilder
Set whether to enable to the exception logger
equals
Link copied to clipboard
common
open operator fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
common
open fun hashCode(): Int
redirectUri
Link copied to clipboard
common
fun redirectUri(redirectUri: String?): SpotifyApiBuilder
Set the application redirect uri
requestTimeoutMillis
Link copied to clipboard
common
fun requestTimeoutMillis(requestTimeoutMillis: Long?): SpotifyApiBuilder
Set the maximum time, in milliseconds, before terminating an http request
retryWhenRateLimited
Link copied to clipboard
common
fun retryWhenRateLimited(retryWhenRateLimited: Boolean): SpotifyApiBuilder
Set whether to block the current thread and wait until the API can retry the request
testTokenValidity
Link copied to clipboard
common
fun testTokenValidity(testTokenValidity: Boolean): SpotifyApiBuilder
After API creation, set whether to test whether the token is valid by performing a lightweight request
token
Link copied to clipboard
common
fun token(token: Token?): SpotifyApiBuilder
Set the token to be used with this api instance
tokenString
Link copied to clipboard
common
fun tokenString(tokenString: String?): SpotifyApiBuilder
If you only have an access token, the api can be instantiated with it
toString
Link copied to clipboard
common
open fun toString(): String
useCache
Link copied to clipboard
common
fun useCache(useCache: Boolean): SpotifyApiBuilder
Set whether to cache requests.

Properties

authorization
Link copied to clipboard
common
var authorization: SpotifyUserAuthorization
Allows you to authenticate a SpotifyClientApi with an authorization code or build SpotifyApi using a refresh token
options
Link copied to clipboard
common
var options: SpotifyApiOptions
Allows you to override default values for caching, token refresh, and logging

Sources

(source)
Link copied to clipboard