spotify-cli 0.5.0

A command-line interface for Spotify
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/// Set the volume for the user's current playback device.
///
/// See: https://developer.spotify.com/documentation/web-api/reference/set-volume-for-users-playback
use crate::http::api::SpotifyApi;
use crate::http::client::HttpError;
use crate::http::endpoints::Endpoint;
use serde_json::Value;

pub async fn set_playback_volume(
    client: &SpotifyApi,
    volume_percent: u8,
) -> Result<Option<Value>, HttpError> {
    client
        .put(&Endpoint::PlayerVolume { volume_percent }.path())
        .await
}