spotify_cli/endpoints/player/set_repeat_mode.rs
1/// Set the repeat mode for the user's playback.
2///
3/// See: https://developer.spotify.com/documentation/web-api/reference/set-repeat-mode-on-users-playback
4use crate::http::api::SpotifyApi;
5use crate::http::client::HttpError;
6use crate::http::endpoints::Endpoint;
7use serde_json::Value;
8
9pub async fn set_repeat_mode(client: &SpotifyApi, state: &str) -> Result<Option<Value>, HttpError> {
10 client.put(&Endpoint::PlayerRepeat { state }.path()).await
11}