Trait OAuthClient

Source
pub trait OAuthClient: BaseClient {
Show 60 methods // Required methods fn get_oauth(&self) -> &OAuth; fn request_token<'life0, 'life1, 'async_trait>( &'life0 self, code: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; // Provided methods fn read_token_cache<'life0, 'async_trait>( &'life0 self, allow_expired: bool, ) -> Pin<Box<dyn Future<Output = Result<Option<Token>, ClientError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: Sync + 'async_trait { ... } fn parse_response_code(&self, url: &str) -> Option<String> { ... } fn current_user_playlists( &self, ) -> Pin<Box<dyn Stream<Item = Result<SimplifiedPlaylist, ClientError>> + Send + '_>> { ... } fn current_user_playlists_manual<'life0, 'async_trait>( &'life0 self, limit: Option<u32>, offset: Option<u32>, ) -> Pin<Box<dyn Future<Output = Result<Page<SimplifiedPlaylist>, ClientError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: Sync + 'async_trait { ... } fn user_playlist_create<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, user_id: UserId<'life1>, name: &'life2 str, public: Option<bool>, collaborative: Option<bool>, description: Option<&'life3 str>, ) -> Pin<Box<dyn Future<Output = Result<FullPlaylist, ClientError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, Self: Sync + 'async_trait { ... } fn playlist_change_detail<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, playlist_id: PlaylistId<'life1>, name: Option<&'life2 str>, public: Option<bool>, description: Option<&'life3 str>, collaborative: Option<bool>, ) -> Pin<Box<dyn Future<Output = Result<String, ClientError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, Self: Sync + 'async_trait { ... } fn playlist_unfollow<'life0, 'life1, 'async_trait>( &'life0 self, playlist_id: PlaylistId<'life1>, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: Sync + 'async_trait { ... } fn playlist_add_items<'a, 'life0, 'life1, 'async_trait>( &'life0 self, playlist_id: PlaylistId<'life1>, items: impl IntoIterator<Item = PlayableId<'a>> + Send + 'async_trait + 'a, position: Option<u32>, ) -> Pin<Box<dyn Future<Output = Result<PlaylistResult, ClientError>> + Send + 'async_trait>> where 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, Self: Sync + 'async_trait { ... } fn playlist_replace_items<'a, 'life0, 'life1, 'async_trait>( &'life0 self, playlist_id: PlaylistId<'life1>, items: impl IntoIterator<Item = PlayableId<'a>> + Send + 'async_trait + 'a, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>> where 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, Self: Sync + 'async_trait { ... } fn playlist_reorder_items<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, playlist_id: PlaylistId<'life1>, range_start: Option<i32>, insert_before: Option<i32>, range_length: Option<u32>, snapshot_id: Option<&'life2 str>, ) -> Pin<Box<dyn Future<Output = Result<PlaylistResult, ClientError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: Sync + 'async_trait { ... } fn playlist_remove_all_occurrences_of_items<'a, 'life0, 'life1, 'life2, 'async_trait>( &'life0 self, playlist_id: PlaylistId<'life1>, track_ids: impl IntoIterator<Item = PlayableId<'a>> + Send + 'async_trait + 'a, snapshot_id: Option<&'life2 str>, ) -> Pin<Box<dyn Future<Output = Result<PlaylistResult, ClientError>> + Send + 'async_trait>> where 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: Sync + 'async_trait { ... } fn playlist_remove_specific_occurrences_of_items<'a, 'life0, 'life1, 'life2, 'async_trait>( &'life0 self, playlist_id: PlaylistId<'life1>, items: impl IntoIterator<Item = ItemPositions<'a>> + Send + 'async_trait + 'a, snapshot_id: Option<&'life2 str>, ) -> Pin<Box<dyn Future<Output = Result<PlaylistResult, ClientError>> + Send + 'async_trait>> where 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: Sync + 'async_trait { ... } fn playlist_follow<'life0, 'life1, 'async_trait>( &'life0 self, playlist_id: PlaylistId<'life1>, public: Option<bool>, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: Sync + 'async_trait { ... } fn me<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<PrivateUser, ClientError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: Sync + 'async_trait { ... } fn current_user<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<PrivateUser, ClientError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: Sync + 'async_trait { ... } fn current_user_playing_item<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<CurrentlyPlayingContext>, ClientError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: Sync + 'async_trait { ... } fn current_user_saved_albums( &self, market: Option<Market>, ) -> Pin<Box<dyn Stream<Item = Result<SavedAlbum, ClientError>> + Send + '_>> { ... } fn current_user_saved_albums_manual<'life0, 'async_trait>( &'life0 self, market: Option<Market>, limit: Option<u32>, offset: Option<u32>, ) -> Pin<Box<dyn Future<Output = Result<Page<SavedAlbum>, ClientError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: Sync + 'async_trait { ... } fn current_user_saved_tracks( &self, market: Option<Market>, ) -> Pin<Box<dyn Stream<Item = Result<SavedTrack, ClientError>> + Send + '_>> { ... } fn current_user_saved_tracks_manual<'life0, 'async_trait>( &'life0 self, market: Option<Market>, limit: Option<u32>, offset: Option<u32>, ) -> Pin<Box<dyn Future<Output = Result<Page<SavedTrack>, ClientError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: Sync + 'async_trait { ... } fn current_user_followed_artists<'life0, 'life1, 'async_trait>( &'life0 self, after: Option<&'life1 str>, limit: Option<u32>, ) -> Pin<Box<dyn Future<Output = Result<CursorBasedPage<FullArtist>, ClientError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: Sync + 'async_trait { ... } fn current_user_saved_tracks_delete<'a, 'life0, 'async_trait>( &'life0 self, track_ids: impl IntoIterator<Item = TrackId<'a>> + Send + 'async_trait + 'a, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>> where 'a: 'async_trait, 'life0: 'async_trait, Self: Sync + 'async_trait { ... } fn current_user_saved_tracks_contains<'a, 'life0, 'async_trait>( &'life0 self, track_ids: impl IntoIterator<Item = TrackId<'a>> + Send + 'async_trait + 'a, ) -> Pin<Box<dyn Future<Output = Result<Vec<bool>, ClientError>> + Send + 'async_trait>> where 'a: 'async_trait, 'life0: 'async_trait, Self: Sync + 'async_trait { ... } fn current_user_saved_tracks_add<'a, 'life0, 'async_trait>( &'life0 self, track_ids: impl IntoIterator<Item = TrackId<'a>> + Send + 'async_trait + 'a, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>> where 'a: 'async_trait, 'life0: 'async_trait, Self: Sync + 'async_trait { ... } fn current_user_top_artists( &self, time_range: Option<TimeRange>, ) -> Pin<Box<dyn Stream<Item = Result<FullArtist, ClientError>> + Send + '_>> { ... } fn current_user_top_artists_manual<'life0, 'async_trait>( &'life0 self, time_range: Option<TimeRange>, limit: Option<u32>, offset: Option<u32>, ) -> Pin<Box<dyn Future<Output = Result<Page<FullArtist>, ClientError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: Sync + 'async_trait { ... } fn current_user_top_tracks( &self, time_range: Option<TimeRange>, ) -> Pin<Box<dyn Stream<Item = Result<FullTrack, ClientError>> + Send + '_>> { ... } fn current_user_top_tracks_manual<'life0, 'async_trait>( &'life0 self, time_range: Option<TimeRange>, limit: Option<u32>, offset: Option<u32>, ) -> Pin<Box<dyn Future<Output = Result<Page<FullTrack>, ClientError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: Sync + 'async_trait { ... } fn current_user_recently_played<'life0, 'async_trait>( &'life0 self, limit: Option<u32>, time_limit: Option<TimeLimits>, ) -> Pin<Box<dyn Future<Output = Result<CursorBasedPage<PlayHistory>, ClientError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: Sync + 'async_trait { ... } fn current_user_saved_albums_add<'a, 'life0, 'async_trait>( &'life0 self, album_ids: impl IntoIterator<Item = AlbumId<'a>> + Send + 'async_trait + 'a, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>> where 'a: 'async_trait, 'life0: 'async_trait, Self: Sync + 'async_trait { ... } fn current_user_saved_albums_delete<'a, 'life0, 'async_trait>( &'life0 self, album_ids: impl IntoIterator<Item = AlbumId<'a>> + Send + 'async_trait + 'a, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>> where 'a: 'async_trait, 'life0: 'async_trait, Self: Sync + 'async_trait { ... } fn current_user_saved_albums_contains<'a, 'life0, 'async_trait>( &'life0 self, album_ids: impl IntoIterator<Item = AlbumId<'a>> + Send + 'async_trait + 'a, ) -> Pin<Box<dyn Future<Output = Result<Vec<bool>, ClientError>> + Send + 'async_trait>> where 'a: 'async_trait, 'life0: 'async_trait, Self: Sync + 'async_trait { ... } fn user_follow_artists<'a, 'life0, 'async_trait>( &'life0 self, artist_ids: impl IntoIterator<Item = ArtistId<'a>> + Send + 'async_trait + 'a, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>> where 'a: 'async_trait, 'life0: 'async_trait, Self: Sync + 'async_trait { ... } fn user_unfollow_artists<'a, 'life0, 'async_trait>( &'life0 self, artist_ids: impl IntoIterator<Item = ArtistId<'a>> + Send + 'async_trait + 'a, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>> where 'a: 'async_trait, 'life0: 'async_trait, Self: Sync + 'async_trait { ... } fn user_artist_check_follow<'a, 'life0, 'async_trait>( &'life0 self, artist_ids: impl IntoIterator<Item = ArtistId<'a>> + Send + 'async_trait + 'a, ) -> Pin<Box<dyn Future<Output = Result<Vec<bool>, ClientError>> + Send + 'async_trait>> where 'a: 'async_trait, 'life0: 'async_trait, Self: Sync + 'async_trait { ... } fn user_follow_users<'a, 'life0, 'async_trait>( &'life0 self, user_ids: impl IntoIterator<Item = UserId<'a>> + Send + 'async_trait + 'a, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>> where 'a: 'async_trait, 'life0: 'async_trait, Self: Sync + 'async_trait { ... } fn user_unfollow_users<'a, 'life0, 'async_trait>( &'life0 self, user_ids: impl IntoIterator<Item = UserId<'a>> + Send + 'async_trait + 'a, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>> where 'a: 'async_trait, 'life0: 'async_trait, Self: Sync + 'async_trait { ... } fn device<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Device>, ClientError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: Sync + 'async_trait { ... } fn current_playback<'a, 'life0, 'async_trait>( &'life0 self, country: Option<Market>, additional_types: Option<impl IntoIterator<Item = &'a AdditionalType> + Send + 'async_trait + 'a>, ) -> Pin<Box<dyn Future<Output = Result<Option<CurrentPlaybackContext>, ClientError>> + Send + 'async_trait>> where 'a: 'async_trait, 'life0: 'async_trait, Self: Sync + 'async_trait { ... } fn current_playing<'a, 'async_trait>( &'a self, market: Option<Market>, additional_types: Option<impl IntoIterator<Item = &'a AdditionalType> + Send + 'async_trait + 'a>, ) -> Pin<Box<dyn Future<Output = Result<Option<CurrentlyPlayingContext>, ClientError>> + Send + 'async_trait>> where 'a: 'async_trait, Self: Sync + 'async_trait { ... } fn current_user_queue<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<CurrentUserQueue, ClientError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: Sync + 'async_trait { ... } fn transfer_playback<'life0, 'life1, 'async_trait>( &'life0 self, device_id: &'life1 str, play: Option<bool>, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: Sync + 'async_trait { ... } fn start_context_playback<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, context_uri: PlayContextId<'life1>, device_id: Option<&'life2 str>, offset: Option<Offset>, position: Option<TimeDelta>, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: Sync + 'async_trait { ... } fn start_uris_playback<'a, 'life0, 'life1, 'async_trait>( &'life0 self, uris: impl IntoIterator<Item = PlayableId<'a>> + Send + 'async_trait + 'a, device_id: Option<&'life1 str>, offset: Option<Offset>, position: Option<TimeDelta>, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>> where 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, Self: Sync + 'async_trait { ... } fn pause_playback<'life0, 'life1, 'async_trait>( &'life0 self, device_id: Option<&'life1 str>, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: Sync + 'async_trait { ... } fn resume_playback<'life0, 'life1, 'async_trait>( &'life0 self, device_id: Option<&'life1 str>, position: Option<TimeDelta>, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: Sync + 'async_trait { ... } fn next_track<'life0, 'life1, 'async_trait>( &'life0 self, device_id: Option<&'life1 str>, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: Sync + 'async_trait { ... } fn previous_track<'life0, 'life1, 'async_trait>( &'life0 self, device_id: Option<&'life1 str>, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: Sync + 'async_trait { ... } fn seek_track<'life0, 'life1, 'async_trait>( &'life0 self, position: TimeDelta, device_id: Option<&'life1 str>, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: Sync + 'async_trait { ... } fn repeat<'life0, 'life1, 'async_trait>( &'life0 self, state: RepeatState, device_id: Option<&'life1 str>, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: Sync + 'async_trait { ... } fn volume<'life0, 'life1, 'async_trait>( &'life0 self, volume_percent: u8, device_id: Option<&'life1 str>, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: Sync + 'async_trait { ... } fn shuffle<'life0, 'life1, 'async_trait>( &'life0 self, state: bool, device_id: Option<&'life1 str>, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: Sync + 'async_trait { ... } fn add_item_to_queue<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, item: PlayableId<'life1>, device_id: Option<&'life2 str>, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: Sync + 'async_trait { ... } fn save_shows<'a, 'life0, 'async_trait>( &'life0 self, show_ids: impl IntoIterator<Item = ShowId<'a>> + Send + 'async_trait + 'a, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>> where 'a: 'async_trait, 'life0: 'async_trait, Self: Sync + 'async_trait { ... } fn get_saved_show( &self, ) -> Pin<Box<dyn Stream<Item = Result<Show, ClientError>> + Send + '_>> { ... } fn get_saved_show_manual<'life0, 'async_trait>( &'life0 self, limit: Option<u32>, offset: Option<u32>, ) -> Pin<Box<dyn Future<Output = Result<Page<Show>, ClientError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: Sync + 'async_trait { ... } fn check_users_saved_shows<'a, 'life0, 'async_trait>( &'life0 self, ids: impl IntoIterator<Item = ShowId<'a>> + Send + 'async_trait + 'a, ) -> Pin<Box<dyn Future<Output = Result<Vec<bool>, ClientError>> + Send + 'async_trait>> where 'a: 'async_trait, 'life0: 'async_trait, Self: Sync + 'async_trait { ... } fn remove_users_saved_shows<'a, 'life0, 'async_trait>( &'life0 self, show_ids: impl IntoIterator<Item = ShowId<'a>> + Send + 'async_trait + 'a, country: Option<Market>, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>> where 'a: 'async_trait, 'life0: 'async_trait, Self: Sync + 'async_trait { ... }
}
Expand description

This trait implements the methods available strictly to clients with user authorization, including some parts of the authentication flow that are shared, and the endpoints.

Note that the base trait BaseClient may have endpoints that conditionally require authorization like user_playlist. This trait only separates endpoints that always need authorization from the base ones.

Required Methods§

Source

fn get_oauth(&self) -> &OAuth

Source

fn request_token<'life0, 'life1, 'async_trait>( &'life0 self, code: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Obtains a user access token given a code, as part of the OAuth authentication. The access token will be saved internally.

Provided Methods§

Source

fn read_token_cache<'life0, 'async_trait>( &'life0 self, allow_expired: bool, ) -> Pin<Box<dyn Future<Output = Result<Option<Token>, ClientError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Tries to read the cache file’s token.

This will return an error if the token couldn’t be read (e.g. it’s not available or the JSON is malformed). It may return Ok(None) if:

  • The read token is expired and allow_expired is false
  • Its scopes don’t match with the current client (you will need to re-authenticate to gain access to more scopes)
  • The cached token is disabled in the config
§Note

This function’s implementation differs slightly from the implementation in ClientCredsSpotify::read_token_cache. The boolean parameter allow_expired allows users to load expired tokens from the cache. This functionality can be used to access the refresh token and obtain a new, valid token. This option is unavailable in the implementation of ClientCredsSpotify::read_token_cache since the client credentials authorization flow does not have a refresh token and instead requires the application re-authenticate.

Source

fn parse_response_code(&self, url: &str) -> Option<String>

Parse the response code in the given response url. If the URL cannot be parsed or the code parameter is not present, this will return None.

Source

fn current_user_playlists( &self, ) -> Pin<Box<dyn Stream<Item = Result<SimplifiedPlaylist, ClientError>> + Send + '_>>

Get current user playlists without required getting his profile.

Parameters:

  • limit - the number of items to return
  • offset - the index of the first item to return

See Self::current_user_playlists_manual for a manually paginated version of this.

Reference

Source

fn current_user_playlists_manual<'life0, 'async_trait>( &'life0 self, limit: Option<u32>, offset: Option<u32>, ) -> Pin<Box<dyn Future<Output = Result<Page<SimplifiedPlaylist>, ClientError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

The manually paginated version of Self::current_user_playlists.

Source

fn user_playlist_create<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, user_id: UserId<'life1>, name: &'life2 str, public: Option<bool>, collaborative: Option<bool>, description: Option<&'life3 str>, ) -> Pin<Box<dyn Future<Output = Result<FullPlaylist, ClientError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, Self: Sync + 'async_trait,

Creates a playlist for a user.

Parameters:

  • user_id - the id of the user
  • name - the name of the playlist
  • public - is the created playlist public
  • description - the description of the playlist
  • collaborative - if the playlist will be collaborative. Note: to create a collaborative playlist you must also set public to false

Reference

Source

fn playlist_change_detail<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, playlist_id: PlaylistId<'life1>, name: Option<&'life2 str>, public: Option<bool>, description: Option<&'life3 str>, collaborative: Option<bool>, ) -> Pin<Box<dyn Future<Output = Result<String, ClientError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, Self: Sync + 'async_trait,

Changes a playlist’s name and/or public/private state.

Parameters:

  • playlist_id - the id of the playlist
  • name - optional name of the playlist
  • public - optional is the playlist public
  • collaborative - optional is the playlist collaborative
  • description - optional description of the playlist

Reference

Source

fn playlist_unfollow<'life0, 'life1, 'async_trait>( &'life0 self, playlist_id: PlaylistId<'life1>, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: Sync + 'async_trait,

Unfollows (deletes) a playlist for a user.

Parameters:

  • playlist_id - the id of the playlist

Reference

Source

fn playlist_add_items<'a, 'life0, 'life1, 'async_trait>( &'life0 self, playlist_id: PlaylistId<'life1>, items: impl IntoIterator<Item = PlayableId<'a>> + Send + 'async_trait + 'a, position: Option<u32>, ) -> Pin<Box<dyn Future<Output = Result<PlaylistResult, ClientError>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, Self: Sync + 'async_trait,

Adds items to a playlist.

Parameters:

  • playlist_id - the id of the playlist
  • track_ids - a list of track URIs, URLs or IDs
  • position - the position to add the items, a zero-based index

Reference

Source

fn playlist_replace_items<'a, 'life0, 'life1, 'async_trait>( &'life0 self, playlist_id: PlaylistId<'life1>, items: impl IntoIterator<Item = PlayableId<'a>> + Send + 'async_trait + 'a, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, Self: Sync + 'async_trait,

Replace all items in a playlist

Parameters:

  • user - the id of the user
  • playlist_id - the id of the playlist
  • tracks - the list of track ids to add to the playlist

Reference

Source

fn playlist_reorder_items<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, playlist_id: PlaylistId<'life1>, range_start: Option<i32>, insert_before: Option<i32>, range_length: Option<u32>, snapshot_id: Option<&'life2 str>, ) -> Pin<Box<dyn Future<Output = Result<PlaylistResult, ClientError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: Sync + 'async_trait,

Reorder items in a playlist.

Parameters:

  • playlist_id - the id of the playlist
  • uris - a list of Spotify URIs to replace or clear
  • range_start - the position of the first track to be reordered
  • insert_before - the position where the tracks should be inserted
  • range_length - optional the number of tracks to be reordered (default: 1)
  • snapshot_id - optional playlist’s snapshot ID

Reference

Source

fn playlist_remove_all_occurrences_of_items<'a, 'life0, 'life1, 'life2, 'async_trait>( &'life0 self, playlist_id: PlaylistId<'life1>, track_ids: impl IntoIterator<Item = PlayableId<'a>> + Send + 'async_trait + 'a, snapshot_id: Option<&'life2 str>, ) -> Pin<Box<dyn Future<Output = Result<PlaylistResult, ClientError>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: Sync + 'async_trait,

Removes all occurrences of the given items from the given playlist.

Parameters:

  • playlist_id - the id of the playlist
  • track_ids - the list of track ids to add to the playlist
  • snapshot_id - optional id of the playlist snapshot

Reference

Source

fn playlist_remove_specific_occurrences_of_items<'a, 'life0, 'life1, 'life2, 'async_trait>( &'life0 self, playlist_id: PlaylistId<'life1>, items: impl IntoIterator<Item = ItemPositions<'a>> + Send + 'async_trait + 'a, snapshot_id: Option<&'life2 str>, ) -> Pin<Box<dyn Future<Output = Result<PlaylistResult, ClientError>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: Sync + 'async_trait,

Removes specfic occurrences of the given items from the given playlist.

Parameters:

  • playlist_id: the id of the playlist
  • tracks: an array of map containing Spotify URIs of the tracks to remove with their current positions in the playlist. For example:
{
   "tracks":[
      {
         "uri":"spotify:track:4iV5W9uYEdYUVa79Axb7Rh",
         "positions":[
            0,
            3
         ]
      },
      {
         "uri":"spotify:track:1301WleyT98MSxVHPZCA6M",
         "positions":[
            7
         ]
      }
   ]
}
  • snapshot_id: optional id of the playlist snapshot

Reference

Source

fn playlist_follow<'life0, 'life1, 'async_trait>( &'life0 self, playlist_id: PlaylistId<'life1>, public: Option<bool>, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: Sync + 'async_trait,

Add the current authenticated user as a follower of a playlist.

Parameters:

  • playlist_id - the id of the playlist

Reference

Source

fn me<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<PrivateUser, ClientError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Get detailed profile information about the current user. An alias for the ‘current_user’ method.

Reference

Source

fn current_user<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<PrivateUser, ClientError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Get detailed profile information about the current user. An alias for the ‘me’ method.

Reference

Source

fn current_user_playing_item<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<CurrentlyPlayingContext>, ClientError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Get information about the current users currently playing item.

Reference

Source

fn current_user_saved_albums( &self, market: Option<Market>, ) -> Pin<Box<dyn Stream<Item = Result<SavedAlbum, ClientError>> + Send + '_>>

Gets a list of the albums saved in the current authorized user’s “Your Music” library

Parameters:

  • limit - the number of albums to return
  • offset - the index of the first album to return
  • market - Provide this parameter if you want to apply Track Relinking.

See Self::current_user_saved_albums for a manually paginated version of this.

Reference

Source

fn current_user_saved_albums_manual<'life0, 'async_trait>( &'life0 self, market: Option<Market>, limit: Option<u32>, offset: Option<u32>, ) -> Pin<Box<dyn Future<Output = Result<Page<SavedAlbum>, ClientError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

The manually paginated version of Self::current_user_saved_albums.

Source

fn current_user_saved_tracks( &self, market: Option<Market>, ) -> Pin<Box<dyn Stream<Item = Result<SavedTrack, ClientError>> + Send + '_>>

Get a list of the songs saved in the current Spotify user’s “Your Music” library.

Parameters:

  • limit - the number of tracks to return
  • offset - the index of the first track to return
  • market - Provide this parameter if you want to apply Track Relinking.

See Self::current_user_saved_tracks_manual for a manually paginated version of this.

Reference

Source

fn current_user_saved_tracks_manual<'life0, 'async_trait>( &'life0 self, market: Option<Market>, limit: Option<u32>, offset: Option<u32>, ) -> Pin<Box<dyn Future<Output = Result<Page<SavedTrack>, ClientError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

The manually paginated version of Self::current_user_saved_tracks.

Source

fn current_user_followed_artists<'life0, 'life1, 'async_trait>( &'life0 self, after: Option<&'life1 str>, limit: Option<u32>, ) -> Pin<Box<dyn Future<Output = Result<CursorBasedPage<FullArtist>, ClientError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: Sync + 'async_trait,

Gets a list of the artists followed by the current authorized user.

Parameters:

  • after - the last artist ID retrieved from the previous request
  • limit - the number of tracks to return

Reference

Source

fn current_user_saved_tracks_delete<'a, 'life0, 'async_trait>( &'life0 self, track_ids: impl IntoIterator<Item = TrackId<'a>> + Send + 'async_trait + 'a, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, Self: Sync + 'async_trait,

Remove one or more tracks from the current user’s “Your Music” library.

Parameters:

  • track_ids - a list of track URIs, URLs or IDs

Reference

Source

fn current_user_saved_tracks_contains<'a, 'life0, 'async_trait>( &'life0 self, track_ids: impl IntoIterator<Item = TrackId<'a>> + Send + 'async_trait + 'a, ) -> Pin<Box<dyn Future<Output = Result<Vec<bool>, ClientError>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, Self: Sync + 'async_trait,

Check if one or more tracks is already saved in the current Spotify user’s “Your Music” library.

Parameters:

  • track_ids - a list of track URIs, URLs or IDs

Reference

Source

fn current_user_saved_tracks_add<'a, 'life0, 'async_trait>( &'life0 self, track_ids: impl IntoIterator<Item = TrackId<'a>> + Send + 'async_trait + 'a, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, Self: Sync + 'async_trait,

Save one or more tracks to the current user’s “Your Music” library.

Parameters:

  • track_ids - a list of track URIs, URLs or IDs

Reference

Source

fn current_user_top_artists( &self, time_range: Option<TimeRange>, ) -> Pin<Box<dyn Stream<Item = Result<FullArtist, ClientError>> + Send + '_>>

Get the current user’s top artists.

Parameters:

  • limit - the number of entities to return
  • offset - the index of the first entity to return
  • time_range - Over what time frame are the affinities computed

See Self::current_user_top_artists_manual for a manually paginated version of this.

Reference

Source

fn current_user_top_artists_manual<'life0, 'async_trait>( &'life0 self, time_range: Option<TimeRange>, limit: Option<u32>, offset: Option<u32>, ) -> Pin<Box<dyn Future<Output = Result<Page<FullArtist>, ClientError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

The manually paginated version of Self::current_user_top_artists.

Source

fn current_user_top_tracks( &self, time_range: Option<TimeRange>, ) -> Pin<Box<dyn Stream<Item = Result<FullTrack, ClientError>> + Send + '_>>

Get the current user’s top tracks.

Parameters:

  • limit - the number of entities to return
  • offset - the index of the first entity to return
  • time_range - Over what time frame are the affinities computed

See Self::current_user_top_tracks_manual for a manually paginated version of this.

Reference

Source

fn current_user_top_tracks_manual<'life0, 'async_trait>( &'life0 self, time_range: Option<TimeRange>, limit: Option<u32>, offset: Option<u32>, ) -> Pin<Box<dyn Future<Output = Result<Page<FullTrack>, ClientError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

The manually paginated version of Self::current_user_top_tracks.

Source

fn current_user_recently_played<'life0, 'async_trait>( &'life0 self, limit: Option<u32>, time_limit: Option<TimeLimits>, ) -> Pin<Box<dyn Future<Output = Result<CursorBasedPage<PlayHistory>, ClientError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Get the current user’s recently played tracks.

Parameters:

  • limit - the number of entities to return
  • time_limit - a timestamp. The endpoint will return all items after or before (but not including) this cursor position.

Reference

Source

fn current_user_saved_albums_add<'a, 'life0, 'async_trait>( &'life0 self, album_ids: impl IntoIterator<Item = AlbumId<'a>> + Send + 'async_trait + 'a, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, Self: Sync + 'async_trait,

Add one or more albums to the current user’s “Your Music” library.

Parameters:

  • album_ids - a list of album URIs, URLs or IDs

Reference

Source

fn current_user_saved_albums_delete<'a, 'life0, 'async_trait>( &'life0 self, album_ids: impl IntoIterator<Item = AlbumId<'a>> + Send + 'async_trait + 'a, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, Self: Sync + 'async_trait,

Remove one or more albums from the current user’s “Your Music” library.

Parameters:

  • album_ids - a list of album URIs, URLs or IDs

Reference

Source

fn current_user_saved_albums_contains<'a, 'life0, 'async_trait>( &'life0 self, album_ids: impl IntoIterator<Item = AlbumId<'a>> + Send + 'async_trait + 'a, ) -> Pin<Box<dyn Future<Output = Result<Vec<bool>, ClientError>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, Self: Sync + 'async_trait,

Check if one or more albums is already saved in the current Spotify user’s “Your Music” library.

Parameters:

  • album_ids - a list of album URIs, URLs or IDs

Reference

Source

fn user_follow_artists<'a, 'life0, 'async_trait>( &'life0 self, artist_ids: impl IntoIterator<Item = ArtistId<'a>> + Send + 'async_trait + 'a, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, Self: Sync + 'async_trait,

Follow one or more artists.

Parameters:

  • artist_ids - a list of artist IDs

Reference

Source

fn user_unfollow_artists<'a, 'life0, 'async_trait>( &'life0 self, artist_ids: impl IntoIterator<Item = ArtistId<'a>> + Send + 'async_trait + 'a, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, Self: Sync + 'async_trait,

Unfollow one or more artists.

Parameters:

  • artist_ids - a list of artist IDs

Reference

Source

fn user_artist_check_follow<'a, 'life0, 'async_trait>( &'life0 self, artist_ids: impl IntoIterator<Item = ArtistId<'a>> + Send + 'async_trait + 'a, ) -> Pin<Box<dyn Future<Output = Result<Vec<bool>, ClientError>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, Self: Sync + 'async_trait,

Check to see if the current user is following one or more artists or other Spotify users.

Parameters:

  • artist_ids - the ids of the users that you want to

Reference

Source

fn user_follow_users<'a, 'life0, 'async_trait>( &'life0 self, user_ids: impl IntoIterator<Item = UserId<'a>> + Send + 'async_trait + 'a, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, Self: Sync + 'async_trait,

Follow one or more users.

Parameters:

  • user_ids - a list of artist IDs

Reference

Source

fn user_unfollow_users<'a, 'life0, 'async_trait>( &'life0 self, user_ids: impl IntoIterator<Item = UserId<'a>> + Send + 'async_trait + 'a, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, Self: Sync + 'async_trait,

Unfollow one or more users.

Parameters:

  • user_ids - a list of artist IDs

Reference

Source

fn device<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Device>, ClientError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Get a User’s Available Devices

Reference

Source

fn current_playback<'a, 'life0, 'async_trait>( &'life0 self, country: Option<Market>, additional_types: Option<impl IntoIterator<Item = &'a AdditionalType> + Send + 'async_trait + 'a>, ) -> Pin<Box<dyn Future<Output = Result<Option<CurrentPlaybackContext>, ClientError>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, Self: Sync + 'async_trait,

Get Information About The User’s Current Playback

Parameters:

  • market: Optional. an ISO 3166-1 alpha-2 country code or the string from_token.
  • additional_types: Optional. A list of item types that your client supports besides the default track type. Valid types are: track and episode.

Reference

Source

fn current_playing<'a, 'async_trait>( &'a self, market: Option<Market>, additional_types: Option<impl IntoIterator<Item = &'a AdditionalType> + Send + 'async_trait + 'a>, ) -> Pin<Box<dyn Future<Output = Result<Option<CurrentlyPlayingContext>, ClientError>> + Send + 'async_trait>>
where 'a: 'async_trait, Self: Sync + 'async_trait,

Get the User’s Currently Playing Track

Parameters:

  • market: Optional. an ISO 3166-1 alpha-2 country code or the string from_token.
  • additional_types: Optional. A comma-separated list of item types that your client supports besides the default track type. Valid types are: track and episode.

Reference

Source

fn current_user_queue<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<CurrentUserQueue, ClientError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Get the Current User’s Queue

Reference

Source

fn transfer_playback<'life0, 'life1, 'async_trait>( &'life0 self, device_id: &'life1 str, play: Option<bool>, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: Sync + 'async_trait,

Transfer a User’s Playback.

Note: Although an array is accepted, only a single device_id is currently supported. Supplying more than one will return 400 Bad Request

Parameters:

  • device_id - transfer playback to this device
  • force_play - true: after transfer, play. false: keep current state.

Reference

Source

fn start_context_playback<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, context_uri: PlayContextId<'life1>, device_id: Option<&'life2 str>, offset: Option<Offset>, position: Option<TimeDelta>, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: Sync + 'async_trait,

Start/Resume a User’s Playback.

Provide a context_uri to start playback or a album, artist, or playlist. Provide a uris list to start playback of one or more tracks. Provide offset as {"position": <int>} or {"uri": "<track uri>"} to start playback at a particular offset.

Parameters:

  • device_id - device target for playback
  • context_uri - spotify context uri to play
  • uris - spotify track uris
  • offset - offset into context by index or track
  • position - Indicates from what position to start playback.

Reference

Source

fn start_uris_playback<'a, 'life0, 'life1, 'async_trait>( &'life0 self, uris: impl IntoIterator<Item = PlayableId<'a>> + Send + 'async_trait + 'a, device_id: Option<&'life1 str>, offset: Option<Offset>, position: Option<TimeDelta>, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, Self: Sync + 'async_trait,

Start a user’s playback

Parameters:

  • uris
  • device_id
  • offset
  • position

Reference

Source

fn pause_playback<'life0, 'life1, 'async_trait>( &'life0 self, device_id: Option<&'life1 str>, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: Sync + 'async_trait,

Pause a User’s Playback.

Parameters:

  • device_id - device target for playback

Reference

Source

fn resume_playback<'life0, 'life1, 'async_trait>( &'life0 self, device_id: Option<&'life1 str>, position: Option<TimeDelta>, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: Sync + 'async_trait,

Resume a User’s Playback.

Parameters:

  • device_id - device target for playback
  • position

Reference

Source

fn next_track<'life0, 'life1, 'async_trait>( &'life0 self, device_id: Option<&'life1 str>, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: Sync + 'async_trait,

Skip User’s Playback To Next Track.

Parameters:

  • device_id - device target for playback

Reference

Source

fn previous_track<'life0, 'life1, 'async_trait>( &'life0 self, device_id: Option<&'life1 str>, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: Sync + 'async_trait,

Skip User’s Playback To Previous Track.

Parameters:

  • device_id - device target for playback

Reference

Source

fn seek_track<'life0, 'life1, 'async_trait>( &'life0 self, position: TimeDelta, device_id: Option<&'life1 str>, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: Sync + 'async_trait,

Seek To Position In Currently Playing Track.

Parameters:

  • position - position in milliseconds to seek to
  • device_id - device target for playback

Reference

Source

fn repeat<'life0, 'life1, 'async_trait>( &'life0 self, state: RepeatState, device_id: Option<&'life1 str>, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: Sync + 'async_trait,

Set Repeat Mode On User’s Playback.

Parameters:

  • state - track, context, or off
  • device_id - device target for playback

Reference

Source

fn volume<'life0, 'life1, 'async_trait>( &'life0 self, volume_percent: u8, device_id: Option<&'life1 str>, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: Sync + 'async_trait,

Set Volume For User’s Playback.

Parameters:

  • volume_percent - volume between 0 and 100
  • device_id - device target for playback

Reference

Source

fn shuffle<'life0, 'life1, 'async_trait>( &'life0 self, state: bool, device_id: Option<&'life1 str>, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: Sync + 'async_trait,

Toggle Shuffle For User’s Playback.

Parameters:

  • state - true or false
  • device_id - device target for playback

Reference

Source

fn add_item_to_queue<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, item: PlayableId<'life1>, device_id: Option<&'life2 str>, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: Sync + 'async_trait,

Add an item to the end of the user’s playback queue.

Parameters:

  • uri - The uri of the item to add, Track or Episode
  • device id - The id of the device targeting
  • If no device ID provided the user’s currently active device is targeted

Reference

Source

fn save_shows<'a, 'life0, 'async_trait>( &'life0 self, show_ids: impl IntoIterator<Item = ShowId<'a>> + Send + 'async_trait + 'a, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, Self: Sync + 'async_trait,

Add a show or a list of shows to a user’s library.

Parameters:

  • ids(Required) A comma-separated list of Spotify IDs for the shows to be added to the user’s library.

Reference

Source

fn get_saved_show( &self, ) -> Pin<Box<dyn Stream<Item = Result<Show, ClientError>> + Send + '_>>

Get a list of shows saved in the current Spotify user’s library. Optional parameters can be used to limit the number of shows returned.

Parameters:

  • limit(Optional). The maximum number of shows to return. Default: 20. Minimum: 1. Maximum: 50.
  • offset(Optional). The index of the first show to return. Default: 0 (the first object). Use with limit to get the next set of shows.

See Self::get_saved_show_manual for a manually paginated version of this.

Reference

Source

fn get_saved_show_manual<'life0, 'async_trait>( &'life0 self, limit: Option<u32>, offset: Option<u32>, ) -> Pin<Box<dyn Future<Output = Result<Page<Show>, ClientError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

The manually paginated version of Self::get_saved_show.

Source

fn check_users_saved_shows<'a, 'life0, 'async_trait>( &'life0 self, ids: impl IntoIterator<Item = ShowId<'a>> + Send + 'async_trait + 'a, ) -> Pin<Box<dyn Future<Output = Result<Vec<bool>, ClientError>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, Self: Sync + 'async_trait,

Check if one or more shows is already saved in the current Spotify user’s library.

Query Parameters

  • ids: Required. A comma-separated list of the Spotify IDs for the shows. Maximum: 50 IDs.

Reference

Source

fn remove_users_saved_shows<'a, 'life0, 'async_trait>( &'life0 self, show_ids: impl IntoIterator<Item = ShowId<'a>> + Send + 'async_trait + 'a, country: Option<Market>, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, Self: Sync + 'async_trait,

Delete one or more shows from current Spotify user’s library. Changes to a user’s saved shows may not be visible in other Spotify applications immediately.

Query Parameters

  • ids: Required. A comma-separated list of Spotify IDs for the shows to be deleted from the user’s library.
  • market: Optional. An ISO 3166-1 alpha-2 country code or the string from_token.

Reference

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl OAuthClient for AuthCodeSpotify

This client includes user authorization, so it has access to the user private endpoints in OAuthClient.

Source§

impl OAuthClient for AuthCodePkceSpotify

This client includes user authorization, so it has access to the user private endpoints in OAuthClient.