spotify_cli/endpoints/player/
toggle_playback_shuffle.rs

1/// Toggle shuffle on or off for user's playback.
2///
3/// See: https://developer.spotify.com/documentation/web-api/reference/toggle-shuffle-for-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 toggle_playback_shuffle(
10    client: &SpotifyApi,
11    state: bool,
12) -> Result<Option<Value>, HttpError> {
13    client.put(&Endpoint::PlayerShuffle { state }.path()).await
14}