Assertions are made to give early and precise error messages for wrong API call parameters.
validate_parameters(
artists_or_tracks = NULL,
artist_or_user = NULL,
market = NULL,
country = NULL,
limit = NULL,
offset = NULL,
locale = NULL,
volume_percent = NULL,
time_range = NULL,
position_ms = NULL,
state = NULL,
include_meta_info = NULL
)
A boolean if the parameter matches the Spotify Web API parameter range.
The type parameter must be either 'artists' or 'tracks'."
"The type parameter must be either 'artist' or 'user'."
Optional.
An ISO 3166-1 alpha-2 country code or the string "from_token"
. Provide this parameter if you want to apply Track Relinking
Optional.
An ISO 3166-1 alpha-2 country code or the string "from_token"
. Provide this parameter if you want to apply Track Relinking
Optional. The maximum number of items to return.
Default to 20
. Minimum: 1. Maximum: 50.
Optional. The index of the first item to return.
Defaults to 0
, i.e., the first object.
Use with limit
to get the next set of items.
Optional. The desired language, consisting of an
ISO 639-1 language code and
an ISO 3166-1 alpha-2 country code, joined by an underscore. For example: es_MX
, meaning "Spanish (Mexico)". Provide this parameter if you want the category strings returned in a particular language. Note that, if locale
is not supplied, or if the specified language is not available, the category strings returned will be in the Spotify default language (American English). The locale
parameter,
combined with the country
parameter, may give odd results if not carefully matched.
For example country=SE&locale=de_DE
will return a list of categories relevant to Sweden
but as German language strings.
Required integer value. The volume to set.
Must be a value from 0 to 100 inclusive. Defaults to 50
.
Optional. Over what time frame the affinities are computed.
Valid values: long_term (calculated from several years of data and including all new data
as it becomes available), medium_term
(approximately last 6 months),
short_term
(approximately last 4 weeks). Default: medium_term
.
Optional. Integer indicating from what position to start playback. Must be a positive number. Passing in a position that is greater than the length of the track will cause the player to start playing the next song.
The state parameter must be exactly one of 'track'
,
'context'
or 'off'
.
Optional. Boolean indicating whether to include full result,
with meta information such as "total"
, and "limit"
. Defaults to FALSE
.
These assertions are called from various wrapper functions. However, you can also call this function directly to make sure that you are adding (programatically) the correct parameters to a call.
All validate_parameters
parameters default to NULL
.
Asserts the correct parameter values for any values that are not NULL
.