spotify_web_api/api/player/
get_playback_state.rs1use crate::api::prelude::*;
2
3#[derive(Debug, Default, Clone)]
5pub struct GetPlaybackState {
6 pub market: Option<Market>,
14}
15
16impl Endpoint for GetPlaybackState {
17 fn method(&self) -> Method {
18 Method::GET
19 }
20
21 fn endpoint(&self) -> Cow<'static, str> {
22 "me/player".into()
23 }
24
25 fn parameters(&self) -> QueryParams<'_> {
26 let mut params = QueryParams::default();
27 params.push_opt("market", self.market.as_ref());
28 params
29 }
30}
31
32#[cfg(test)]
33mod tests {
34 use super::*;
35 use crate::{
36 api::{self, Query as _},
37 test::client::{ExpectedUrl, SingleTestClient},
38 };
39
40 #[test]
41 fn test_get_playback_state_endpoint() {
42 let endpoint = ExpectedUrl::builder().endpoint("me/player").build();
43
44 let client = SingleTestClient::new_raw(endpoint, "");
45
46 let endpoint = GetPlaybackState::default();
47
48 api::ignore(endpoint).query(&client).unwrap();
49 }
50}