#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct CardItem<'a> {
pub added_at: jacquard_common::types::string::Datetime,
#[serde(borrow)]
pub r#ref: crate::com_deckbelcher::CardRef<'a>,
}
pub mod card_item_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 AddedAt;
type Ref;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type AddedAt = Unset;
type Ref = Unset;
}
pub struct SetAddedAt<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetAddedAt<S> {}
impl<S: State> State for SetAddedAt<S> {
type AddedAt = Set<members::added_at>;
type Ref = S::Ref;
}
pub struct SetRef<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetRef<S> {}
impl<S: State> State for SetRef<S> {
type AddedAt = S::AddedAt;
type Ref = Set<members::r#ref>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct added_at(());
pub struct r#ref(());
}
}
pub struct CardItemBuilder<'a, S: card_item_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<jacquard_common::types::string::Datetime>,
::core::option::Option<crate::com_deckbelcher::CardRef<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> CardItem<'a> {
pub fn new() -> CardItemBuilder<'a, card_item_state::Empty> {
CardItemBuilder::new()
}
}
impl<'a> CardItemBuilder<'a, card_item_state::Empty> {
pub fn new() -> Self {
CardItemBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> CardItemBuilder<'a, S>
where
S: card_item_state::State,
S::AddedAt: card_item_state::IsUnset,
{
pub fn added_at(
mut self,
value: impl Into<jacquard_common::types::string::Datetime>,
) -> CardItemBuilder<'a, card_item_state::SetAddedAt<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
CardItemBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> CardItemBuilder<'a, S>
where
S: card_item_state::State,
S::Ref: card_item_state::IsUnset,
{
pub fn r#ref(
mut self,
value: impl Into<crate::com_deckbelcher::CardRef<'a>>,
) -> CardItemBuilder<'a, card_item_state::SetRef<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
CardItemBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> CardItemBuilder<'a, S>
where
S: card_item_state::State,
S::AddedAt: card_item_state::IsSet,
S::Ref: card_item_state::IsSet,
{
pub fn build(self) -> CardItem<'a> {
CardItem {
added_at: self.__unsafe_private_named.0.unwrap(),
r#ref: self.__unsafe_private_named.1.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: std::collections::BTreeMap<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> CardItem<'a> {
CardItem {
added_at: self.__unsafe_private_named.0.unwrap(),
r#ref: self.__unsafe_private_named.1.unwrap(),
extra_data: Some(extra_data),
}
}
}
fn lexicon_doc_com_deckbelcher_collection_list() -> ::jacquard_lexicon::lexicon::LexiconDoc<
'static,
> {
::jacquard_lexicon::lexicon::LexiconDoc {
lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1,
id: ::jacquard_common::CowStr::new_static("com.deckbelcher.collection.list"),
revision: None,
description: None,
defs: {
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("cardItem"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: Some(
::jacquard_common::CowStr::new_static(
"A card saved to the list.",
),
),
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("ref"),
::jacquard_common::deps::smol_str::SmolStr::new_static("addedAt")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"addedAt",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"Timestamp when this item was added to the list.",
),
),
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
),
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"ref",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"com.deckbelcher.defs#cardRef",
),
}),
);
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("deckItem"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: Some(
::jacquard_common::CowStr::new_static(
"A deck saved to the list.",
),
),
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("ref"),
::jacquard_common::deps::smol_str::SmolStr::new_static("addedAt")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"addedAt",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"Timestamp when this item was added to the list.",
),
),
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
),
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"ref",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"com.atproto.repo.strongRef",
),
}),
);
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("main"),
::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord {
description: Some(
::jacquard_common::CowStr::new_static(
"A curated list of cards and/or decks.",
),
),
key: Some(::jacquard_common::CowStr::new_static("tid")),
record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("name"),
::jacquard_common::deps::smol_str::SmolStr::new_static("items"),
::jacquard_common::deps::smol_str::SmolStr::new_static("createdAt")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"createdAt",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"Timestamp when the list was created.",
),
),
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
),
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"description",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"com.deckbelcher.richtext#document",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"items",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
description: Some(
::jacquard_common::CowStr::new_static("Items in the list."),
),
items: ::jacquard_lexicon::lexicon::LexArrayItem::Union(::jacquard_lexicon::lexicon::LexRefUnion {
description: None,
refs: vec![
::jacquard_common::CowStr::new_static("#cardItem"),
::jacquard_common::CowStr::new_static("#deckItem")
],
closed: None,
}),
min_length: None,
max_length: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"name",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static("Name of the list."),
),
format: None,
default: None,
min_length: None,
max_length: Some(1280usize),
min_graphemes: None,
max_graphemes: Some(128usize),
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"updatedAt",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"Timestamp when the list was last updated.",
),
),
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
),
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map
},
}),
}),
);
map
},
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for CardItem<'a> {
fn nsid() -> &'static str {
"com.deckbelcher.collection.list"
}
fn def_name() -> &'static str {
"cardItem"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_com_deckbelcher_collection_list()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
Ok(())
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct DeckItem<'a> {
pub added_at: jacquard_common::types::string::Datetime,
#[serde(borrow)]
pub r#ref: crate::com_atproto::repo::strong_ref::StrongRef<'a>,
}
pub mod deck_item_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 Ref;
type AddedAt;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Ref = Unset;
type AddedAt = Unset;
}
pub struct SetRef<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetRef<S> {}
impl<S: State> State for SetRef<S> {
type Ref = Set<members::r#ref>;
type AddedAt = S::AddedAt;
}
pub struct SetAddedAt<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetAddedAt<S> {}
impl<S: State> State for SetAddedAt<S> {
type Ref = S::Ref;
type AddedAt = Set<members::added_at>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct r#ref(());
pub struct added_at(());
}
}
pub struct DeckItemBuilder<'a, S: deck_item_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<jacquard_common::types::string::Datetime>,
::core::option::Option<crate::com_atproto::repo::strong_ref::StrongRef<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> DeckItem<'a> {
pub fn new() -> DeckItemBuilder<'a, deck_item_state::Empty> {
DeckItemBuilder::new()
}
}
impl<'a> DeckItemBuilder<'a, deck_item_state::Empty> {
pub fn new() -> Self {
DeckItemBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> DeckItemBuilder<'a, S>
where
S: deck_item_state::State,
S::AddedAt: deck_item_state::IsUnset,
{
pub fn added_at(
mut self,
value: impl Into<jacquard_common::types::string::Datetime>,
) -> DeckItemBuilder<'a, deck_item_state::SetAddedAt<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
DeckItemBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> DeckItemBuilder<'a, S>
where
S: deck_item_state::State,
S::Ref: deck_item_state::IsUnset,
{
pub fn r#ref(
mut self,
value: impl Into<crate::com_atproto::repo::strong_ref::StrongRef<'a>>,
) -> DeckItemBuilder<'a, deck_item_state::SetRef<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
DeckItemBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> DeckItemBuilder<'a, S>
where
S: deck_item_state::State,
S::Ref: deck_item_state::IsSet,
S::AddedAt: deck_item_state::IsSet,
{
pub fn build(self) -> DeckItem<'a> {
DeckItem {
added_at: self.__unsafe_private_named.0.unwrap(),
r#ref: self.__unsafe_private_named.1.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: std::collections::BTreeMap<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> DeckItem<'a> {
DeckItem {
added_at: self.__unsafe_private_named.0.unwrap(),
r#ref: self.__unsafe_private_named.1.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for DeckItem<'a> {
fn nsid() -> &'static str {
"com.deckbelcher.collection.list"
}
fn def_name() -> &'static str {
"deckItem"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_com_deckbelcher_collection_list()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
Ok(())
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct List<'a> {
pub created_at: jacquard_common::types::string::Datetime,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub description: std::option::Option<crate::com_deckbelcher::richtext::Document<'a>>,
#[serde(borrow)]
pub items: Vec<ListItemsItem<'a>>,
#[serde(borrow)]
pub name: jacquard_common::CowStr<'a>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub updated_at: std::option::Option<jacquard_common::types::string::Datetime>,
}
pub mod 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 Name;
type CreatedAt;
type Items;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Name = Unset;
type CreatedAt = Unset;
type Items = Unset;
}
pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetName<S> {}
impl<S: State> State for SetName<S> {
type Name = Set<members::name>;
type CreatedAt = S::CreatedAt;
type Items = S::Items;
}
pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCreatedAt<S> {}
impl<S: State> State for SetCreatedAt<S> {
type Name = S::Name;
type CreatedAt = Set<members::created_at>;
type Items = S::Items;
}
pub struct SetItems<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetItems<S> {}
impl<S: State> State for SetItems<S> {
type Name = S::Name;
type CreatedAt = S::CreatedAt;
type Items = Set<members::items>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct name(());
pub struct created_at(());
pub struct items(());
}
}
pub struct ListBuilder<'a, S: list_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<jacquard_common::types::string::Datetime>,
::core::option::Option<crate::com_deckbelcher::richtext::Document<'a>>,
::core::option::Option<Vec<ListItemsItem<'a>>>,
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<jacquard_common::types::string::Datetime>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> List<'a> {
pub fn new() -> ListBuilder<'a, list_state::Empty> {
ListBuilder::new()
}
}
impl<'a> ListBuilder<'a, list_state::Empty> {
pub fn new() -> Self {
ListBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None, None, None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ListBuilder<'a, S>
where
S: list_state::State,
S::CreatedAt: list_state::IsUnset,
{
pub fn created_at(
mut self,
value: impl Into<jacquard_common::types::string::Datetime>,
) -> ListBuilder<'a, list_state::SetCreatedAt<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
ListBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: list_state::State> ListBuilder<'a, S> {
pub fn description(
mut self,
value: impl Into<Option<crate::com_deckbelcher::richtext::Document<'a>>>,
) -> Self {
self.__unsafe_private_named.1 = value.into();
self
}
pub fn maybe_description(
mut self,
value: Option<crate::com_deckbelcher::richtext::Document<'a>>,
) -> Self {
self.__unsafe_private_named.1 = value;
self
}
}
impl<'a, S> ListBuilder<'a, S>
where
S: list_state::State,
S::Items: list_state::IsUnset,
{
pub fn items(
mut self,
value: impl Into<Vec<ListItemsItem<'a>>>,
) -> ListBuilder<'a, list_state::SetItems<S>> {
self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into());
ListBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ListBuilder<'a, S>
where
S: list_state::State,
S::Name: list_state::IsUnset,
{
pub fn name(
mut self,
value: impl Into<jacquard_common::CowStr<'a>>,
) -> ListBuilder<'a, list_state::SetName<S>> {
self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into());
ListBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: list_state::State> ListBuilder<'a, S> {
pub fn updated_at(
mut self,
value: impl Into<Option<jacquard_common::types::string::Datetime>>,
) -> Self {
self.__unsafe_private_named.4 = value.into();
self
}
pub fn maybe_updated_at(
mut self,
value: Option<jacquard_common::types::string::Datetime>,
) -> Self {
self.__unsafe_private_named.4 = value;
self
}
}
impl<'a, S> ListBuilder<'a, S>
where
S: list_state::State,
S::Name: list_state::IsSet,
S::CreatedAt: list_state::IsSet,
S::Items: list_state::IsSet,
{
pub fn build(self) -> List<'a> {
List {
created_at: self.__unsafe_private_named.0.unwrap(),
description: self.__unsafe_private_named.1,
items: self.__unsafe_private_named.2.unwrap(),
name: self.__unsafe_private_named.3.unwrap(),
updated_at: self.__unsafe_private_named.4,
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: std::collections::BTreeMap<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> List<'a> {
List {
created_at: self.__unsafe_private_named.0.unwrap(),
description: self.__unsafe_private_named.1,
items: self.__unsafe_private_named.2.unwrap(),
name: self.__unsafe_private_named.3.unwrap(),
updated_at: self.__unsafe_private_named.4,
extra_data: Some(extra_data),
}
}
}
impl<'a> List<'a> {
pub fn uri(
uri: impl Into<jacquard_common::CowStr<'a>>,
) -> Result<
jacquard_common::types::uri::RecordUri<'a, ListRecord>,
jacquard_common::types::uri::UriError,
> {
jacquard_common::types::uri::RecordUri::try_from_uri(
jacquard_common::types::string::AtUri::new_cow(uri.into())?,
)
}
}
#[jacquard_derive::open_union]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(tag = "$type")]
#[serde(bound(deserialize = "'de: 'a"))]
pub enum ListItemsItem<'a> {
#[serde(rename = "com.deckbelcher.collection.list#cardItem")]
CardItem(Box<crate::com_deckbelcher::collection::list::CardItem<'a>>),
#[serde(rename = "com.deckbelcher.collection.list#deckItem")]
DeckItem(Box<crate::com_deckbelcher::collection::list::DeckItem<'a>>),
}
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct ListGetRecordOutput<'a> {
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>,
#[serde(borrow)]
pub uri: jacquard_common::types::string::AtUri<'a>,
#[serde(borrow)]
pub value: List<'a>,
}
impl From<ListGetRecordOutput<'_>> for List<'_> {
fn from(output: ListGetRecordOutput<'_>) -> Self {
use jacquard_common::IntoStatic;
output.value.into_static()
}
}
impl jacquard_common::types::collection::Collection for List<'_> {
const NSID: &'static str = "com.deckbelcher.collection.list";
type Record = ListRecord;
}
#[derive(Debug, serde::Serialize, serde::Deserialize)]
pub struct ListRecord;
impl jacquard_common::xrpc::XrpcResp for ListRecord {
const NSID: &'static str = "com.deckbelcher.collection.list";
const ENCODING: &'static str = "application/json";
type Output<'de> = ListGetRecordOutput<'de>;
type Err<'de> = jacquard_common::types::collection::RecordError<'de>;
}
impl jacquard_common::types::collection::Collection for ListRecord {
const NSID: &'static str = "com.deckbelcher.collection.list";
type Record = ListRecord;
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for List<'a> {
fn nsid() -> &'static str {
"com.deckbelcher.collection.list"
}
fn def_name() -> &'static str {
"main"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_com_deckbelcher_collection_list()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
{
let value = &self.name;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 1280usize {
return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"name",
),
max: 1280usize,
actual: <str>::len(value.as_ref()),
});
}
}
{
let value = &self.name;
{
let count = jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation::graphemes(
value.as_ref(),
true,
)
.count();
if count > 128usize {
return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"name",
),
max: 128usize,
actual: count,
});
}
}
}
Ok(())
}
}