#[allow(unused_imports)]
use alloc::collections::BTreeMap;
#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr};
#[allow(unused_imports)]
use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
use jacquard_common::deps::smol_str::SmolStr;
use jacquard_common::types::string::{Did, AtUri, Datetime};
use jacquard_common::types::value::Data;
use jacquard_derive::IntoStatic;
use jacquard_lexicon::lexicon::LexiconDoc;
use jacquard_lexicon::schema::LexiconSchema;
#[allow(unused_imports)]
use jacquard_lexicon::validation::{ConstraintError, ValidationPath};
use serde::{Serialize, Deserialize};
use crate::games_gamesgamesgamesgames::feed::get_list;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct CreatorView<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub avatar: Option<Data<S>>,
pub did: Did<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub display_name: Option<S>,
pub handle: S,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ListDetailView<S: BosStr = DefaultStr> {
pub created_at: Datetime,
pub creator: get_list::CreatorView<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<S>,
pub item_count: i64,
pub name: S,
pub uri: AtUri<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct GetList<S: BosStr = DefaultStr> {
pub uri: AtUri<S>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct GetListOutput<S: BosStr = DefaultStr> {
pub list: get_list::ListDetailView<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
impl<S: BosStr> LexiconSchema for CreatorView<S> {
fn nsid() -> &'static str {
"games.gamesgamesgamesgames.feed.getList"
}
fn def_name() -> &'static str {
"creatorView"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_games_gamesgamesgamesgames_feed_getList()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ListDetailView<S> {
fn nsid() -> &'static str {
"games.gamesgamesgamesgames.feed.getList"
}
fn def_name() -> &'static str {
"listDetailView"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_games_gamesgamesgamesgames_feed_getList()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
pub struct GetListResponse;
impl jacquard_common::xrpc::XrpcResp for GetListResponse {
const NSID: &'static str = "games.gamesgamesgamesgames.feed.getList";
const ENCODING: &'static str = "application/json";
type Output<S: BosStr> = GetListOutput<S>;
type Err = jacquard_common::xrpc::GenericError;
}
impl<S: BosStr> jacquard_common::xrpc::XrpcRequest for GetList<S> {
const NSID: &'static str = "games.gamesgamesgamesgames.feed.getList";
const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
type Response = GetListResponse;
}
pub struct GetListRequest;
impl jacquard_common::xrpc::XrpcEndpoint for GetListRequest {
const PATH: &'static str = "/xrpc/games.gamesgamesgamesgames.feed.getList";
const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
type Request<S: BosStr> = GetList<S>;
type Response = GetListResponse;
}
pub mod creator_view_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 Did;
type Handle;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Did = Unset;
type Handle = Unset;
}
pub struct SetDid<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetDid<St> {}
impl<St: State> State for SetDid<St> {
type Did = Set<members::did>;
type Handle = St::Handle;
}
pub struct SetHandle<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetHandle<St> {}
impl<St: State> State for SetHandle<St> {
type Did = St::Did;
type Handle = Set<members::handle>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct did(());
pub struct handle(());
}
}
pub struct CreatorViewBuilder<St: creator_view_state::State, S: BosStr = DefaultStr> {
_state: PhantomData<fn() -> St>,
_fields: (Option<Data<S>>, Option<Did<S>>, Option<S>, Option<S>),
_type: PhantomData<fn() -> S>,
}
impl CreatorView<DefaultStr> {
pub fn new() -> CreatorViewBuilder<creator_view_state::Empty, DefaultStr> {
CreatorViewBuilder::new()
}
}
impl<S: BosStr> CreatorView<S> {
pub fn builder() -> CreatorViewBuilder<creator_view_state::Empty, S> {
CreatorViewBuilder::builder()
}
}
impl CreatorViewBuilder<creator_view_state::Empty, DefaultStr> {
pub fn new() -> Self {
CreatorViewBuilder {
_state: PhantomData,
_fields: (None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr> CreatorViewBuilder<creator_view_state::Empty, S> {
pub fn builder() -> Self {
CreatorViewBuilder {
_state: PhantomData,
_fields: (None, None, None, None),
_type: PhantomData,
}
}
}
impl<St: creator_view_state::State, S: BosStr> CreatorViewBuilder<St, S> {
pub fn avatar(mut self, value: impl Into<Option<Data<S>>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_avatar(mut self, value: Option<Data<S>>) -> Self {
self._fields.0 = value;
self
}
}
impl<St, S: BosStr> CreatorViewBuilder<St, S>
where
St: creator_view_state::State,
St::Did: creator_view_state::IsUnset,
{
pub fn did(
mut self,
value: impl Into<Did<S>>,
) -> CreatorViewBuilder<creator_view_state::SetDid<St>, S> {
self._fields.1 = Option::Some(value.into());
CreatorViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<St: creator_view_state::State, S: BosStr> CreatorViewBuilder<St, S> {
pub fn display_name(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_display_name(mut self, value: Option<S>) -> Self {
self._fields.2 = value;
self
}
}
impl<St, S: BosStr> CreatorViewBuilder<St, S>
where
St: creator_view_state::State,
St::Handle: creator_view_state::IsUnset,
{
pub fn handle(
mut self,
value: impl Into<S>,
) -> CreatorViewBuilder<creator_view_state::SetHandle<St>, S> {
self._fields.3 = Option::Some(value.into());
CreatorViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<St, S: BosStr> CreatorViewBuilder<St, S>
where
St: creator_view_state::State,
St::Did: creator_view_state::IsSet,
St::Handle: creator_view_state::IsSet,
{
pub fn build(self) -> CreatorView<S> {
CreatorView {
avatar: self._fields.0,
did: self._fields.1.unwrap(),
display_name: self._fields.2,
handle: self._fields.3.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> CreatorView<S> {
CreatorView {
avatar: self._fields.0,
did: self._fields.1.unwrap(),
display_name: self._fields.2,
handle: self._fields.3.unwrap(),
extra_data: Some(extra_data),
}
}
}
fn lexicon_doc_games_gamesgamesgamesgames_feed_getList() -> LexiconDoc<'static> {
#[allow(unused_imports)]
use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType};
use jacquard_lexicon::lexicon::*;
use alloc::collections::BTreeMap;
LexiconDoc {
lexicon: Lexicon::Lexicon1,
id: CowStr::new_static("games.gamesgamesgamesgames.feed.getList"),
defs: {
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("creatorView"),
LexUserType::Object(LexObject {
required: Some(
vec![SmolStr::new_static("did"), SmolStr::new_static("handle")],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("avatar"),
LexObjectProperty::Unknown(LexUnknown {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("did"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Did),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("displayName"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("handle"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("listDetailView"),
LexUserType::Object(LexObject {
required: Some(
vec![
SmolStr::new_static("uri"), SmolStr::new_static("name"),
SmolStr::new_static("itemCount"),
SmolStr::new_static("createdAt"),
SmolStr::new_static("creator")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("createdAt"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("creator"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#creatorView"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("description"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("itemCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("name"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("uri"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("main"),
LexUserType::XrpcQuery(LexXrpcQuery {
parameters: Some(
LexXrpcQueryParameter::Params(LexXrpcParameters {
required: Some(vec![SmolStr::new_static("uri")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("uri"),
LexXrpcParametersProperty::String(LexString {
description: Some(
CowStr::new_static("The AT-URI of the list record."),
),
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map
},
..Default::default()
}),
),
..Default::default()
}),
);
map
},
..Default::default()
}
}
pub mod list_detail_view_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 CreatedAt;
type Creator;
type ItemCount;
type Name;
type Uri;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type CreatedAt = Unset;
type Creator = Unset;
type ItemCount = Unset;
type Name = Unset;
type Uri = Unset;
}
pub struct SetCreatedAt<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetCreatedAt<St> {}
impl<St: State> State for SetCreatedAt<St> {
type CreatedAt = Set<members::created_at>;
type Creator = St::Creator;
type ItemCount = St::ItemCount;
type Name = St::Name;
type Uri = St::Uri;
}
pub struct SetCreator<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetCreator<St> {}
impl<St: State> State for SetCreator<St> {
type CreatedAt = St::CreatedAt;
type Creator = Set<members::creator>;
type ItemCount = St::ItemCount;
type Name = St::Name;
type Uri = St::Uri;
}
pub struct SetItemCount<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetItemCount<St> {}
impl<St: State> State for SetItemCount<St> {
type CreatedAt = St::CreatedAt;
type Creator = St::Creator;
type ItemCount = Set<members::item_count>;
type Name = St::Name;
type Uri = St::Uri;
}
pub struct SetName<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetName<St> {}
impl<St: State> State for SetName<St> {
type CreatedAt = St::CreatedAt;
type Creator = St::Creator;
type ItemCount = St::ItemCount;
type Name = Set<members::name>;
type Uri = St::Uri;
}
pub struct SetUri<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetUri<St> {}
impl<St: State> State for SetUri<St> {
type CreatedAt = St::CreatedAt;
type Creator = St::Creator;
type ItemCount = St::ItemCount;
type Name = St::Name;
type Uri = Set<members::uri>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct created_at(());
pub struct creator(());
pub struct item_count(());
pub struct name(());
pub struct uri(());
}
}
pub struct ListDetailViewBuilder<
St: list_detail_view_state::State,
S: BosStr = DefaultStr,
> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<Datetime>,
Option<get_list::CreatorView<S>>,
Option<S>,
Option<i64>,
Option<S>,
Option<AtUri<S>>,
),
_type: PhantomData<fn() -> S>,
}
impl ListDetailView<DefaultStr> {
pub fn new() -> ListDetailViewBuilder<list_detail_view_state::Empty, DefaultStr> {
ListDetailViewBuilder::new()
}
}
impl<S: BosStr> ListDetailView<S> {
pub fn builder() -> ListDetailViewBuilder<list_detail_view_state::Empty, S> {
ListDetailViewBuilder::builder()
}
}
impl ListDetailViewBuilder<list_detail_view_state::Empty, DefaultStr> {
pub fn new() -> Self {
ListDetailViewBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr> ListDetailViewBuilder<list_detail_view_state::Empty, S> {
pub fn builder() -> Self {
ListDetailViewBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None),
_type: PhantomData,
}
}
}
impl<St, S: BosStr> ListDetailViewBuilder<St, S>
where
St: list_detail_view_state::State,
St::CreatedAt: list_detail_view_state::IsUnset,
{
pub fn created_at(
mut self,
value: impl Into<Datetime>,
) -> ListDetailViewBuilder<list_detail_view_state::SetCreatedAt<St>, S> {
self._fields.0 = Option::Some(value.into());
ListDetailViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<St, S: BosStr> ListDetailViewBuilder<St, S>
where
St: list_detail_view_state::State,
St::Creator: list_detail_view_state::IsUnset,
{
pub fn creator(
mut self,
value: impl Into<get_list::CreatorView<S>>,
) -> ListDetailViewBuilder<list_detail_view_state::SetCreator<St>, S> {
self._fields.1 = Option::Some(value.into());
ListDetailViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<St: list_detail_view_state::State, S: BosStr> ListDetailViewBuilder<St, S> {
pub fn description(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_description(mut self, value: Option<S>) -> Self {
self._fields.2 = value;
self
}
}
impl<St, S: BosStr> ListDetailViewBuilder<St, S>
where
St: list_detail_view_state::State,
St::ItemCount: list_detail_view_state::IsUnset,
{
pub fn item_count(
mut self,
value: impl Into<i64>,
) -> ListDetailViewBuilder<list_detail_view_state::SetItemCount<St>, S> {
self._fields.3 = Option::Some(value.into());
ListDetailViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<St, S: BosStr> ListDetailViewBuilder<St, S>
where
St: list_detail_view_state::State,
St::Name: list_detail_view_state::IsUnset,
{
pub fn name(
mut self,
value: impl Into<S>,
) -> ListDetailViewBuilder<list_detail_view_state::SetName<St>, S> {
self._fields.4 = Option::Some(value.into());
ListDetailViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<St, S: BosStr> ListDetailViewBuilder<St, S>
where
St: list_detail_view_state::State,
St::Uri: list_detail_view_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<AtUri<S>>,
) -> ListDetailViewBuilder<list_detail_view_state::SetUri<St>, S> {
self._fields.5 = Option::Some(value.into());
ListDetailViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<St, S: BosStr> ListDetailViewBuilder<St, S>
where
St: list_detail_view_state::State,
St::CreatedAt: list_detail_view_state::IsSet,
St::Creator: list_detail_view_state::IsSet,
St::ItemCount: list_detail_view_state::IsSet,
St::Name: list_detail_view_state::IsSet,
St::Uri: list_detail_view_state::IsSet,
{
pub fn build(self) -> ListDetailView<S> {
ListDetailView {
created_at: self._fields.0.unwrap(),
creator: self._fields.1.unwrap(),
description: self._fields.2,
item_count: self._fields.3.unwrap(),
name: self._fields.4.unwrap(),
uri: self._fields.5.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> ListDetailView<S> {
ListDetailView {
created_at: self._fields.0.unwrap(),
creator: self._fields.1.unwrap(),
description: self._fields.2,
item_count: self._fields.3.unwrap(),
name: self._fields.4.unwrap(),
uri: self._fields.5.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod get_list_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<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetUri<St> {}
impl<St: State> State for SetUri<St> {
type Uri = Set<members::uri>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct uri(());
}
}
pub struct GetListBuilder<St: get_list_state::State, S: BosStr = DefaultStr> {
_state: PhantomData<fn() -> St>,
_fields: (Option<AtUri<S>>,),
_type: PhantomData<fn() -> S>,
}
impl GetList<DefaultStr> {
pub fn new() -> GetListBuilder<get_list_state::Empty, DefaultStr> {
GetListBuilder::new()
}
}
impl<S: BosStr> GetList<S> {
pub fn builder() -> GetListBuilder<get_list_state::Empty, S> {
GetListBuilder::builder()
}
}
impl GetListBuilder<get_list_state::Empty, DefaultStr> {
pub fn new() -> Self {
GetListBuilder {
_state: PhantomData,
_fields: (None,),
_type: PhantomData,
}
}
}
impl<S: BosStr> GetListBuilder<get_list_state::Empty, S> {
pub fn builder() -> Self {
GetListBuilder {
_state: PhantomData,
_fields: (None,),
_type: PhantomData,
}
}
}
impl<St, S: BosStr> GetListBuilder<St, S>
where
St: get_list_state::State,
St::Uri: get_list_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<AtUri<S>>,
) -> GetListBuilder<get_list_state::SetUri<St>, S> {
self._fields.0 = Option::Some(value.into());
GetListBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<St, S: BosStr> GetListBuilder<St, S>
where
St: get_list_state::State,
St::Uri: get_list_state::IsSet,
{
pub fn build(self) -> GetList<S> {
GetList {
uri: self._fields.0.unwrap(),
}
}
}