#[allow(unused_imports)]
use alloc::collections::BTreeMap;
#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::{BosStr, DefaultStr, FromStaticStr};
use jacquard_common::deps::smol_str::SmolStr;
use jacquard_common::types::value::Data;
use jacquard_derive::IntoStatic;
use serde::{Serialize, Deserialize};
use crate::app_rocksky::feed::NowPlayingsView;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct GetNowPlayings {
#[serde(skip_serializing_if = "Option::is_none")]
pub size: Option<i64>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct GetNowPlayingsOutput<S: BosStr = DefaultStr> {
#[serde(flatten)]
pub value: NowPlayingsView<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
pub struct GetNowPlayingsResponse;
impl jacquard_common::xrpc::XrpcResp for GetNowPlayingsResponse {
const NSID: &'static str = "app.rocksky.feed.getNowPlayings";
const ENCODING: &'static str = "application/json";
type Output<S: BosStr> = GetNowPlayingsOutput<S>;
type Err = jacquard_common::xrpc::GenericError;
}
impl jacquard_common::xrpc::XrpcRequest for GetNowPlayings {
const NSID: &'static str = "app.rocksky.feed.getNowPlayings";
const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
type Response = GetNowPlayingsResponse;
}
pub struct GetNowPlayingsRequest;
impl jacquard_common::xrpc::XrpcEndpoint for GetNowPlayingsRequest {
const PATH: &'static str = "/xrpc/app.rocksky.feed.getNowPlayings";
const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
type Request<S: BosStr> = GetNowPlayings;
type Response = GetNowPlayingsResponse;
}
pub mod get_now_playings_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 GetNowPlayingsBuilder<St: get_now_playings_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<i64>,),
}
impl GetNowPlayings {
pub fn new() -> GetNowPlayingsBuilder<get_now_playings_state::Empty> {
GetNowPlayingsBuilder::new()
}
}
impl GetNowPlayingsBuilder<get_now_playings_state::Empty> {
pub fn new() -> Self {
GetNowPlayingsBuilder {
_state: PhantomData,
_fields: (None,),
}
}
}
impl<St: get_now_playings_state::State> GetNowPlayingsBuilder<St> {
pub fn size(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_size(mut self, value: Option<i64>) -> Self {
self._fields.0 = value;
self
}
}
impl<St> GetNowPlayingsBuilder<St>
where
St: get_now_playings_state::State,
{
pub fn build(self) -> GetNowPlayings {
GetNowPlayings {
size: self._fields.0,
}
}
}