#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::types::string::AtUri;
use jacquard_derive::IntoStatic;
use serde::{Serialize, Deserialize};
use crate::app_rocksky::artist::ArtistViewDetailed;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct GetArtist<'a> {
#[serde(borrow)]
pub uri: AtUri<'a>,
}
#[jacquard_derive::lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct GetArtistOutput<'a> {
#[serde(flatten)]
#[serde(borrow)]
pub value: ArtistViewDetailed<'a>,
}
pub struct GetArtistResponse;
impl jacquard_common::xrpc::XrpcResp for GetArtistResponse {
const NSID: &'static str = "app.rocksky.artist.getArtist";
const ENCODING: &'static str = "application/json";
type Output<'de> = GetArtistOutput<'de>;
type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
}
impl<'a> jacquard_common::xrpc::XrpcRequest for GetArtist<'a> {
const NSID: &'static str = "app.rocksky.artist.getArtist";
const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
type Response = GetArtistResponse;
}
pub struct GetArtistRequest;
impl jacquard_common::xrpc::XrpcEndpoint for GetArtistRequest {
const PATH: &'static str = "/xrpc/app.rocksky.artist.getArtist";
const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
type Request<'de> = GetArtist<'de>;
type Response = GetArtistResponse;
}
pub mod get_artist_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 {
type Uri;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Uri = Unset;
}
pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetUri<S> {}
impl<S: State> State for SetUri<S> {
type Uri = Set<members::uri>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct uri(());
}
}
pub struct GetArtistBuilder<'a, S: get_artist_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (Option<AtUri<'a>>,),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> GetArtist<'a> {
pub fn new() -> GetArtistBuilder<'a, get_artist_state::Empty> {
GetArtistBuilder::new()
}
}
impl<'a> GetArtistBuilder<'a, get_artist_state::Empty> {
pub fn new() -> Self {
GetArtistBuilder {
_state: PhantomData,
_fields: (None,),
_lifetime: PhantomData,
}
}
}
impl<'a, S> GetArtistBuilder<'a, S>
where
S: get_artist_state::State,
S::Uri: get_artist_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<AtUri<'a>>,
) -> GetArtistBuilder<'a, get_artist_state::SetUri<S>> {
self._fields.0 = Option::Some(value.into());
GetArtistBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> GetArtistBuilder<'a, S>
where
S: get_artist_state::State,
S::Uri: get_artist_state::IsSet,
{
pub fn build(self) -> GetArtist<'a> {
GetArtist {
uri: self._fields.0.unwrap(),
}
}
}