#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::types::ident::AtIdentifier;
use jacquard_derive::IntoStatic;
use serde::{Serialize, Deserialize};
use crate::app_rocksky::player::CurrentlyPlayingViewDetailed;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct GetCurrentlyPlaying<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub actor: Option<AtIdentifier<'a>>,
}
#[jacquard_derive::lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct GetCurrentlyPlayingOutput<'a> {
#[serde(flatten)]
#[serde(borrow)]
pub value: CurrentlyPlayingViewDetailed<'a>,
}
pub struct GetCurrentlyPlayingResponse;
impl jacquard_common::xrpc::XrpcResp for GetCurrentlyPlayingResponse {
const NSID: &'static str = "app.rocksky.spotify.getCurrentlyPlaying";
const ENCODING: &'static str = "application/json";
type Output<'de> = GetCurrentlyPlayingOutput<'de>;
type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
}
impl<'a> jacquard_common::xrpc::XrpcRequest for GetCurrentlyPlaying<'a> {
const NSID: &'static str = "app.rocksky.spotify.getCurrentlyPlaying";
const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
type Response = GetCurrentlyPlayingResponse;
}
pub struct GetCurrentlyPlayingRequest;
impl jacquard_common::xrpc::XrpcEndpoint for GetCurrentlyPlayingRequest {
const PATH: &'static str = "/xrpc/app.rocksky.spotify.getCurrentlyPlaying";
const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
type Request<'de> = GetCurrentlyPlaying<'de>;
type Response = GetCurrentlyPlayingResponse;
}
pub mod get_currently_playing_state {
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {}
#[allow(non_camel_case_types)]
pub mod members {}
}
pub struct GetCurrentlyPlayingBuilder<'a, S: get_currently_playing_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (Option<AtIdentifier<'a>>,),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> GetCurrentlyPlaying<'a> {
pub fn new() -> GetCurrentlyPlayingBuilder<'a, get_currently_playing_state::Empty> {
GetCurrentlyPlayingBuilder::new()
}
}
impl<'a> GetCurrentlyPlayingBuilder<'a, get_currently_playing_state::Empty> {
pub fn new() -> Self {
GetCurrentlyPlayingBuilder {
_state: PhantomData,
_fields: (None,),
_lifetime: PhantomData,
}
}
}
impl<'a, S: get_currently_playing_state::State> GetCurrentlyPlayingBuilder<'a, S> {
pub fn actor(mut self, value: impl Into<Option<AtIdentifier<'a>>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_actor(mut self, value: Option<AtIdentifier<'a>>) -> Self {
self._fields.0 = value;
self
}
}
impl<'a, S> GetCurrentlyPlayingBuilder<'a, S>
where
S: get_currently_playing_state::State,
{
pub fn build(self) -> GetCurrentlyPlaying<'a> {
GetCurrentlyPlaying {
actor: self._fields.0,
}
}
}