pub mod collection;
pub mod collection_item;
pub mod post;
pub mod reaction;
pub mod request;
pub mod request_response;
pub mod room_gate;
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct AspectRatio<'a> {
pub height: i64,
pub width: i64,
}
pub mod aspect_ratio_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 Width;
type Height;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Width = Unset;
type Height = Unset;
}
pub struct SetWidth<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetWidth<S> {}
impl<S: State> State for SetWidth<S> {
type Width = Set<members::width>;
type Height = S::Height;
}
pub struct SetHeight<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetHeight<S> {}
impl<S: State> State for SetHeight<S> {
type Width = S::Width;
type Height = Set<members::height>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct width(());
pub struct height(());
}
}
pub struct AspectRatioBuilder<'a, S: aspect_ratio_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (::core::option::Option<i64>, ::core::option::Option<i64>),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> AspectRatio<'a> {
pub fn new() -> AspectRatioBuilder<'a, aspect_ratio_state::Empty> {
AspectRatioBuilder::new()
}
}
impl<'a> AspectRatioBuilder<'a, aspect_ratio_state::Empty> {
pub fn new() -> Self {
AspectRatioBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> AspectRatioBuilder<'a, S>
where
S: aspect_ratio_state::State,
S::Height: aspect_ratio_state::IsUnset,
{
pub fn height(
mut self,
value: impl Into<i64>,
) -> AspectRatioBuilder<'a, aspect_ratio_state::SetHeight<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
AspectRatioBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> AspectRatioBuilder<'a, S>
where
S: aspect_ratio_state::State,
S::Width: aspect_ratio_state::IsUnset,
{
pub fn width(
mut self,
value: impl Into<i64>,
) -> AspectRatioBuilder<'a, aspect_ratio_state::SetWidth<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
AspectRatioBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> AspectRatioBuilder<'a, S>
where
S: aspect_ratio_state::State,
S::Width: aspect_ratio_state::IsSet,
S::Height: aspect_ratio_state::IsSet,
{
pub fn build(self) -> AspectRatio<'a> {
AspectRatio {
height: self.__unsafe_private_named.0.unwrap(),
width: 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>,
>,
) -> AspectRatio<'a> {
AspectRatio {
height: self.__unsafe_private_named.0.unwrap(),
width: self.__unsafe_private_named.1.unwrap(),
extra_data: Some(extra_data),
}
}
}
fn lexicon_doc_tech_tokimeki_kaku_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc<
'static,
> {
::jacquard_lexicon::lexicon::LexiconDoc {
lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1,
id: ::jacquard_common::CowStr::new_static("tech.tokimeki.kaku.defs"),
revision: None,
description: None,
defs: {
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("aspectRatio"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: Some(
::jacquard_common::CowStr::new_static(
"Width and height representing the aspect ratio of an image",
),
),
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("width"),
::jacquard_common::deps::smol_str::SmolStr::new_static("height")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"height",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
description: None,
default: None,
minimum: Some(1i64),
maximum: None,
r#enum: None,
r#const: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"width",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
description: None,
default: None,
minimum: Some(1i64),
maximum: None,
r#enum: None,
r#const: None,
}),
);
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("collectionView"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: Some(
::jacquard_common::CowStr::new_static(
"A view of a collection with author profile and item count",
),
),
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("uri"),
::jacquard_common::deps::smol_str::SmolStr::new_static("cid"),
::jacquard_common::deps::smol_str::SmolStr::new_static("author"),
::jacquard_common::deps::smol_str::SmolStr::new_static("name"),
::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(
"author",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"app.bsky.actor.defs#profileViewBasic",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"cid",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"CID of the collection record",
),
),
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Cid,
),
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(
"createdAt",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"Timestamp when the collection 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::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"Collection description",
),
),
format: None,
default: None,
min_length: None,
max_length: Some(500usize),
min_graphemes: None,
max_graphemes: Some(200usize),
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"indexedAt",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"Timestamp when the collection was indexed",
),
),
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(
"isPublic",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean {
description: None,
default: None,
r#const: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"itemCount",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
description: None,
default: None,
minimum: None,
maximum: None,
r#enum: None,
r#const: 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("Collection name"),
),
format: None,
default: None,
min_length: None,
max_length: Some(100usize),
min_graphemes: None,
max_graphemes: Some(50usize),
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"uri",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"AT-URI of the collection record",
),
),
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::AtUri,
),
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.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("postView"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: Some(
::jacquard_common::CowStr::new_static(
"A view of a drawing post with author profile and metadata",
),
),
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("uri"),
::jacquard_common::deps::smol_str::SmolStr::new_static("cid"),
::jacquard_common::deps::smol_str::SmolStr::new_static("author"),
::jacquard_common::deps::smol_str::SmolStr::new_static("image"),
::jacquard_common::deps::smol_str::SmolStr::new_static("aspectRatio"),
::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(
"aspectRatio",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static("#aspectRatio"),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"author",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"app.bsky.actor.defs#profileViewBasic",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"cid",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"CID of the post record",
),
),
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Cid,
),
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(
"createdAt",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"Timestamp when the post 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(
"image",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"URL of the drawing image",
),
),
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Uri,
),
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(
"indexedAt",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"Timestamp when the post was indexed",
),
),
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(
"linkedPost",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"com.atproto.repo.strongRef",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"reactionCounts",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"#reactionCounts",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"tags",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
description: Some(
::jacquard_common::CowStr::new_static(
"Tags for categorization",
),
),
items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: None,
default: None,
min_length: None,
max_length: Some(64usize),
min_graphemes: None,
max_graphemes: Some(32usize),
r#enum: None,
r#const: None,
known_values: None,
}),
min_length: None,
max_length: Some(8usize),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"text",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"Optional description or title",
),
),
format: None,
default: None,
min_length: None,
max_length: Some(1000usize),
min_graphemes: None,
max_graphemes: Some(300usize),
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"uri",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"AT-URI of the post record",
),
),
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::AtUri,
),
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(
"viewerReaction",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"#reactionType",
),
}),
);
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("reactionCounts"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: Some(
::jacquard_common::CowStr::new_static(
"Counts of each reaction type on a post",
),
),
required: None,
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"kami",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
description: None,
default: None,
minimum: None,
maximum: None,
r#enum: None,
r#const: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"kawaii",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
description: None,
default: None,
minimum: None,
maximum: None,
r#enum: None,
r#const: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"sugoi",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
description: None,
default: None,
minimum: None,
maximum: None,
r#enum: None,
r#const: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"suki",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
description: None,
default: None,
minimum: None,
maximum: None,
r#enum: None,
r#const: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"tasukaru",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
description: None,
default: None,
minimum: None,
maximum: None,
r#enum: None,
r#const: None,
}),
);
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("reactionType"),
::jacquard_lexicon::lexicon::LexUserType::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"Type of reaction to a post",
),
),
format: None,
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("replyView"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: Some(
::jacquard_common::CowStr::new_static(
"A view of a Bluesky reply to a linked post",
),
),
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("uri"),
::jacquard_common::deps::smol_str::SmolStr::new_static("cid"),
::jacquard_common::deps::smol_str::SmolStr::new_static("author"),
::jacquard_common::deps::smol_str::SmolStr::new_static("text"),
::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(
"author",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"app.bsky.actor.defs#profileViewBasic",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"cid",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"CID of the Bluesky reply",
),
),
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Cid,
),
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(
"createdAt",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"Timestamp when the reply 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(
"text",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static("Reply text content"),
),
format: None,
default: None,
min_length: None,
max_length: Some(3000usize),
min_graphemes: None,
max_graphemes: Some(300usize),
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"uri",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"AT-URI of the Bluesky reply",
),
),
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::AtUri,
),
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.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"requestResponseView",
),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: Some(
::jacquard_common::CowStr::new_static(
"A view of a response to a drawing request",
),
),
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("uri"),
::jacquard_common::deps::smol_str::SmolStr::new_static("cid"),
::jacquard_common::deps::smol_str::SmolStr::new_static("author"),
::jacquard_common::deps::smol_str::SmolStr::new_static("post"),
::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(
"author",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"app.bsky.actor.defs#profileViewBasic",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"cid",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"CID of the response record",
),
),
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Cid,
),
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(
"createdAt",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"Timestamp when the response 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(
"message",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"Optional message to the requester",
),
),
format: None,
default: None,
min_length: None,
max_length: Some(500usize),
min_graphemes: None,
max_graphemes: Some(150usize),
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"post",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static("#postView"),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"uri",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"AT-URI of the response record",
),
),
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::AtUri,
),
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.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("requestView"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: Some(
::jacquard_common::CowStr::new_static(
"A view of a drawing request with author profile and response count",
),
),
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("uri"),
::jacquard_common::deps::smol_str::SmolStr::new_static("cid"),
::jacquard_common::deps::smol_str::SmolStr::new_static("author"),
::jacquard_common::deps::smol_str::SmolStr::new_static("text"),
::jacquard_common::deps::smol_str::SmolStr::new_static("isOpen"),
::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(
"author",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"app.bsky.actor.defs#profileViewBasic",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"cid",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"CID of the request record",
),
),
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Cid,
),
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(
"createdAt",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"Timestamp when the request 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(
"indexedAt",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"Timestamp when the request was indexed",
),
),
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(
"isOpen",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean {
description: None,
default: None,
r#const: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"referenceImages",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
description: Some(
::jacquard_common::CowStr::new_static(
"URLs of reference images for the request",
),
),
items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Uri,
),
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
min_length: None,
max_length: Some(4usize),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"responseCount",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
description: None,
default: None,
minimum: None,
maximum: None,
r#enum: None,
r#const: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"tags",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
description: Some(
::jacquard_common::CowStr::new_static(
"Tags for categorization",
),
),
items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: None,
default: None,
min_length: None,
max_length: Some(64usize),
min_graphemes: None,
max_graphemes: Some(32usize),
r#enum: None,
r#const: None,
known_values: None,
}),
min_length: None,
max_length: Some(8usize),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"targetActor",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"app.bsky.actor.defs#profileViewBasic",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"text",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"Description of what to draw",
),
),
format: None,
default: None,
min_length: None,
max_length: Some(1000usize),
min_graphemes: None,
max_graphemes: Some(300usize),
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"uri",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"AT-URI of the request record",
),
),
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::AtUri,
),
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 AspectRatio<'a> {
fn nsid() -> &'static str {
"tech.tokimeki.kaku.defs"
}
fn def_name() -> &'static str {
"aspectRatio"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_tech_tokimeki_kaku_defs()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
{
let value = &self.height;
if *value < 1i64 {
return Err(::jacquard_lexicon::validation::ConstraintError::Minimum {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"height",
),
min: 1i64,
actual: *value,
});
}
}
{
let value = &self.width;
if *value < 1i64 {
return Err(::jacquard_lexicon::validation::ConstraintError::Minimum {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"width",
),
min: 1i64,
actual: *value,
});
}
}
Ok(())
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct CollectionView<'a> {
#[serde(borrow)]
pub author: crate::app_bsky::actor::ProfileViewBasic<'a>,
#[serde(borrow)]
pub cid: jacquard_common::types::string::Cid<'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<jacquard_common::CowStr<'a>>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub indexed_at: std::option::Option<jacquard_common::types::string::Datetime>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(default = "_default_collection_view_is_public")]
pub is_public: std::option::Option<bool>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub item_count: std::option::Option<i64>,
#[serde(borrow)]
pub name: jacquard_common::CowStr<'a>,
#[serde(borrow)]
pub uri: jacquard_common::types::string::AtUri<'a>,
}
fn _default_collection_view_is_public() -> std::option::Option<bool> {
Some(true)
}
pub mod collection_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 Name;
type Author;
type Cid;
type Uri;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type CreatedAt = Unset;
type Name = Unset;
type Author = Unset;
type Cid = Unset;
type Uri = Unset;
}
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 CreatedAt = Set<members::created_at>;
type Name = S::Name;
type Author = S::Author;
type Cid = S::Cid;
type Uri = S::Uri;
}
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 CreatedAt = S::CreatedAt;
type Name = Set<members::name>;
type Author = S::Author;
type Cid = S::Cid;
type Uri = S::Uri;
}
pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetAuthor<S> {}
impl<S: State> State for SetAuthor<S> {
type CreatedAt = S::CreatedAt;
type Name = S::Name;
type Author = Set<members::author>;
type Cid = S::Cid;
type Uri = S::Uri;
}
pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCid<S> {}
impl<S: State> State for SetCid<S> {
type CreatedAt = S::CreatedAt;
type Name = S::Name;
type Author = S::Author;
type Cid = Set<members::cid>;
type Uri = S::Uri;
}
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 CreatedAt = S::CreatedAt;
type Name = S::Name;
type Author = S::Author;
type Cid = S::Cid;
type Uri = Set<members::uri>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct created_at(());
pub struct name(());
pub struct author(());
pub struct cid(());
pub struct uri(());
}
}
pub struct CollectionViewBuilder<'a, S: collection_view_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<crate::app_bsky::actor::ProfileViewBasic<'a>>,
::core::option::Option<jacquard_common::types::string::Cid<'a>>,
::core::option::Option<jacquard_common::types::string::Datetime>,
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<jacquard_common::types::string::Datetime>,
::core::option::Option<bool>,
::core::option::Option<i64>,
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> CollectionView<'a> {
pub fn new() -> CollectionViewBuilder<'a, collection_view_state::Empty> {
CollectionViewBuilder::new()
}
}
impl<'a> CollectionViewBuilder<'a, collection_view_state::Empty> {
pub fn new() -> Self {
CollectionViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (
None,
None,
None,
None,
None,
None,
None,
None,
None,
),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> CollectionViewBuilder<'a, S>
where
S: collection_view_state::State,
S::Author: collection_view_state::IsUnset,
{
pub fn author(
mut self,
value: impl Into<crate::app_bsky::actor::ProfileViewBasic<'a>>,
) -> CollectionViewBuilder<'a, collection_view_state::SetAuthor<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
CollectionViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> CollectionViewBuilder<'a, S>
where
S: collection_view_state::State,
S::Cid: collection_view_state::IsUnset,
{
pub fn cid(
mut self,
value: impl Into<jacquard_common::types::string::Cid<'a>>,
) -> CollectionViewBuilder<'a, collection_view_state::SetCid<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
CollectionViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> CollectionViewBuilder<'a, S>
where
S: collection_view_state::State,
S::CreatedAt: collection_view_state::IsUnset,
{
pub fn created_at(
mut self,
value: impl Into<jacquard_common::types::string::Datetime>,
) -> CollectionViewBuilder<'a, collection_view_state::SetCreatedAt<S>> {
self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into());
CollectionViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: collection_view_state::State> CollectionViewBuilder<'a, S> {
pub fn description(
mut self,
value: impl Into<Option<jacquard_common::CowStr<'a>>>,
) -> Self {
self.__unsafe_private_named.3 = value.into();
self
}
pub fn maybe_description(
mut self,
value: Option<jacquard_common::CowStr<'a>>,
) -> Self {
self.__unsafe_private_named.3 = value;
self
}
}
impl<'a, S: collection_view_state::State> CollectionViewBuilder<'a, S> {
pub fn indexed_at(
mut self,
value: impl Into<Option<jacquard_common::types::string::Datetime>>,
) -> Self {
self.__unsafe_private_named.4 = value.into();
self
}
pub fn maybe_indexed_at(
mut self,
value: Option<jacquard_common::types::string::Datetime>,
) -> Self {
self.__unsafe_private_named.4 = value;
self
}
}
impl<'a, S: collection_view_state::State> CollectionViewBuilder<'a, S> {
pub fn is_public(mut self, value: impl Into<Option<bool>>) -> Self {
self.__unsafe_private_named.5 = value.into();
self
}
pub fn maybe_is_public(mut self, value: Option<bool>) -> Self {
self.__unsafe_private_named.5 = value;
self
}
}
impl<'a, S: collection_view_state::State> CollectionViewBuilder<'a, S> {
pub fn item_count(mut self, value: impl Into<Option<i64>>) -> Self {
self.__unsafe_private_named.6 = value.into();
self
}
pub fn maybe_item_count(mut self, value: Option<i64>) -> Self {
self.__unsafe_private_named.6 = value;
self
}
}
impl<'a, S> CollectionViewBuilder<'a, S>
where
S: collection_view_state::State,
S::Name: collection_view_state::IsUnset,
{
pub fn name(
mut self,
value: impl Into<jacquard_common::CowStr<'a>>,
) -> CollectionViewBuilder<'a, collection_view_state::SetName<S>> {
self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into());
CollectionViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> CollectionViewBuilder<'a, S>
where
S: collection_view_state::State,
S::Uri: collection_view_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<jacquard_common::types::string::AtUri<'a>>,
) -> CollectionViewBuilder<'a, collection_view_state::SetUri<S>> {
self.__unsafe_private_named.8 = ::core::option::Option::Some(value.into());
CollectionViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> CollectionViewBuilder<'a, S>
where
S: collection_view_state::State,
S::CreatedAt: collection_view_state::IsSet,
S::Name: collection_view_state::IsSet,
S::Author: collection_view_state::IsSet,
S::Cid: collection_view_state::IsSet,
S::Uri: collection_view_state::IsSet,
{
pub fn build(self) -> CollectionView<'a> {
CollectionView {
author: self.__unsafe_private_named.0.unwrap(),
cid: self.__unsafe_private_named.1.unwrap(),
created_at: self.__unsafe_private_named.2.unwrap(),
description: self.__unsafe_private_named.3,
indexed_at: self.__unsafe_private_named.4,
is_public: self.__unsafe_private_named.5.or_else(|| Some(true)),
item_count: self.__unsafe_private_named.6,
name: self.__unsafe_private_named.7.unwrap(),
uri: self.__unsafe_private_named.8.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>,
>,
) -> CollectionView<'a> {
CollectionView {
author: self.__unsafe_private_named.0.unwrap(),
cid: self.__unsafe_private_named.1.unwrap(),
created_at: self.__unsafe_private_named.2.unwrap(),
description: self.__unsafe_private_named.3,
indexed_at: self.__unsafe_private_named.4,
is_public: self.__unsafe_private_named.5.or_else(|| Some(true)),
item_count: self.__unsafe_private_named.6,
name: self.__unsafe_private_named.7.unwrap(),
uri: self.__unsafe_private_named.8.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for CollectionView<'a> {
fn nsid() -> &'static str {
"tech.tokimeki.kaku.defs"
}
fn def_name() -> &'static str {
"collectionView"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_tech_tokimeki_kaku_defs()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
if let Some(ref value) = self.description {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 500usize {
return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"description",
),
max: 500usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.description {
{
let count = jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation::graphemes(
value.as_ref(),
true,
)
.count();
if count > 200usize {
return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"description",
),
max: 200usize,
actual: count,
});
}
}
}
{
let value = &self.name;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"name",
),
max: 100usize,
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 > 50usize {
return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"name",
),
max: 50usize,
actual: count,
});
}
}
}
Ok(())
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct PostView<'a> {
#[serde(borrow)]
pub aspect_ratio: crate::tech_tokimeki::kaku::AspectRatio<'a>,
#[serde(borrow)]
pub author: crate::app_bsky::actor::ProfileViewBasic<'a>,
#[serde(borrow)]
pub cid: jacquard_common::types::string::Cid<'a>,
pub created_at: jacquard_common::types::string::Datetime,
#[serde(borrow)]
pub image: jacquard_common::types::string::UriValue<'a>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub indexed_at: std::option::Option<jacquard_common::types::string::Datetime>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub linked_post: std::option::Option<
crate::com_atproto::repo::strong_ref::StrongRef<'a>,
>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub reaction_counts: std::option::Option<
crate::tech_tokimeki::kaku::ReactionCounts<'a>,
>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub tags: std::option::Option<Vec<jacquard_common::CowStr<'a>>>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub text: std::option::Option<jacquard_common::CowStr<'a>>,
#[serde(borrow)]
pub uri: jacquard_common::types::string::AtUri<'a>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub viewer_reaction: std::option::Option<
crate::tech_tokimeki::kaku::ReactionType<'a>,
>,
}
pub mod post_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 Uri;
type Author;
type AspectRatio;
type Cid;
type Image;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type CreatedAt = Unset;
type Uri = Unset;
type Author = Unset;
type AspectRatio = Unset;
type Cid = Unset;
type Image = Unset;
}
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 CreatedAt = Set<members::created_at>;
type Uri = S::Uri;
type Author = S::Author;
type AspectRatio = S::AspectRatio;
type Cid = S::Cid;
type Image = S::Image;
}
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 CreatedAt = S::CreatedAt;
type Uri = Set<members::uri>;
type Author = S::Author;
type AspectRatio = S::AspectRatio;
type Cid = S::Cid;
type Image = S::Image;
}
pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetAuthor<S> {}
impl<S: State> State for SetAuthor<S> {
type CreatedAt = S::CreatedAt;
type Uri = S::Uri;
type Author = Set<members::author>;
type AspectRatio = S::AspectRatio;
type Cid = S::Cid;
type Image = S::Image;
}
pub struct SetAspectRatio<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetAspectRatio<S> {}
impl<S: State> State for SetAspectRatio<S> {
type CreatedAt = S::CreatedAt;
type Uri = S::Uri;
type Author = S::Author;
type AspectRatio = Set<members::aspect_ratio>;
type Cid = S::Cid;
type Image = S::Image;
}
pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCid<S> {}
impl<S: State> State for SetCid<S> {
type CreatedAt = S::CreatedAt;
type Uri = S::Uri;
type Author = S::Author;
type AspectRatio = S::AspectRatio;
type Cid = Set<members::cid>;
type Image = S::Image;
}
pub struct SetImage<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetImage<S> {}
impl<S: State> State for SetImage<S> {
type CreatedAt = S::CreatedAt;
type Uri = S::Uri;
type Author = S::Author;
type AspectRatio = S::AspectRatio;
type Cid = S::Cid;
type Image = Set<members::image>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct created_at(());
pub struct uri(());
pub struct author(());
pub struct aspect_ratio(());
pub struct cid(());
pub struct image(());
}
}
pub struct PostViewBuilder<'a, S: post_view_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<crate::tech_tokimeki::kaku::AspectRatio<'a>>,
::core::option::Option<crate::app_bsky::actor::ProfileViewBasic<'a>>,
::core::option::Option<jacquard_common::types::string::Cid<'a>>,
::core::option::Option<jacquard_common::types::string::Datetime>,
::core::option::Option<jacquard_common::types::string::UriValue<'a>>,
::core::option::Option<jacquard_common::types::string::Datetime>,
::core::option::Option<crate::com_atproto::repo::strong_ref::StrongRef<'a>>,
::core::option::Option<crate::tech_tokimeki::kaku::ReactionCounts<'a>>,
::core::option::Option<Vec<jacquard_common::CowStr<'a>>>,
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
::core::option::Option<crate::tech_tokimeki::kaku::ReactionType<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> PostView<'a> {
pub fn new() -> PostViewBuilder<'a, post_view_state::Empty> {
PostViewBuilder::new()
}
}
impl<'a> PostViewBuilder<'a, post_view_state::Empty> {
pub fn new() -> Self {
PostViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> PostViewBuilder<'a, S>
where
S: post_view_state::State,
S::AspectRatio: post_view_state::IsUnset,
{
pub fn aspect_ratio(
mut self,
value: impl Into<crate::tech_tokimeki::kaku::AspectRatio<'a>>,
) -> PostViewBuilder<'a, post_view_state::SetAspectRatio<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
PostViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> PostViewBuilder<'a, S>
where
S: post_view_state::State,
S::Author: post_view_state::IsUnset,
{
pub fn author(
mut self,
value: impl Into<crate::app_bsky::actor::ProfileViewBasic<'a>>,
) -> PostViewBuilder<'a, post_view_state::SetAuthor<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
PostViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> PostViewBuilder<'a, S>
where
S: post_view_state::State,
S::Cid: post_view_state::IsUnset,
{
pub fn cid(
mut self,
value: impl Into<jacquard_common::types::string::Cid<'a>>,
) -> PostViewBuilder<'a, post_view_state::SetCid<S>> {
self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into());
PostViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> PostViewBuilder<'a, S>
where
S: post_view_state::State,
S::CreatedAt: post_view_state::IsUnset,
{
pub fn created_at(
mut self,
value: impl Into<jacquard_common::types::string::Datetime>,
) -> PostViewBuilder<'a, post_view_state::SetCreatedAt<S>> {
self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into());
PostViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> PostViewBuilder<'a, S>
where
S: post_view_state::State,
S::Image: post_view_state::IsUnset,
{
pub fn image(
mut self,
value: impl Into<jacquard_common::types::string::UriValue<'a>>,
) -> PostViewBuilder<'a, post_view_state::SetImage<S>> {
self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into());
PostViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: post_view_state::State> PostViewBuilder<'a, S> {
pub fn indexed_at(
mut self,
value: impl Into<Option<jacquard_common::types::string::Datetime>>,
) -> Self {
self.__unsafe_private_named.5 = value.into();
self
}
pub fn maybe_indexed_at(
mut self,
value: Option<jacquard_common::types::string::Datetime>,
) -> Self {
self.__unsafe_private_named.5 = value;
self
}
}
impl<'a, S: post_view_state::State> PostViewBuilder<'a, S> {
pub fn linked_post(
mut self,
value: impl Into<Option<crate::com_atproto::repo::strong_ref::StrongRef<'a>>>,
) -> Self {
self.__unsafe_private_named.6 = value.into();
self
}
pub fn maybe_linked_post(
mut self,
value: Option<crate::com_atproto::repo::strong_ref::StrongRef<'a>>,
) -> Self {
self.__unsafe_private_named.6 = value;
self
}
}
impl<'a, S: post_view_state::State> PostViewBuilder<'a, S> {
pub fn reaction_counts(
mut self,
value: impl Into<Option<crate::tech_tokimeki::kaku::ReactionCounts<'a>>>,
) -> Self {
self.__unsafe_private_named.7 = value.into();
self
}
pub fn maybe_reaction_counts(
mut self,
value: Option<crate::tech_tokimeki::kaku::ReactionCounts<'a>>,
) -> Self {
self.__unsafe_private_named.7 = value;
self
}
}
impl<'a, S: post_view_state::State> PostViewBuilder<'a, S> {
pub fn tags(
mut self,
value: impl Into<Option<Vec<jacquard_common::CowStr<'a>>>>,
) -> Self {
self.__unsafe_private_named.8 = value.into();
self
}
pub fn maybe_tags(
mut self,
value: Option<Vec<jacquard_common::CowStr<'a>>>,
) -> Self {
self.__unsafe_private_named.8 = value;
self
}
}
impl<'a, S: post_view_state::State> PostViewBuilder<'a, S> {
pub fn text(
mut self,
value: impl Into<Option<jacquard_common::CowStr<'a>>>,
) -> Self {
self.__unsafe_private_named.9 = value.into();
self
}
pub fn maybe_text(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self {
self.__unsafe_private_named.9 = value;
self
}
}
impl<'a, S> PostViewBuilder<'a, S>
where
S: post_view_state::State,
S::Uri: post_view_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<jacquard_common::types::string::AtUri<'a>>,
) -> PostViewBuilder<'a, post_view_state::SetUri<S>> {
self.__unsafe_private_named.10 = ::core::option::Option::Some(value.into());
PostViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: post_view_state::State> PostViewBuilder<'a, S> {
pub fn viewer_reaction(
mut self,
value: impl Into<Option<crate::tech_tokimeki::kaku::ReactionType<'a>>>,
) -> Self {
self.__unsafe_private_named.11 = value.into();
self
}
pub fn maybe_viewer_reaction(
mut self,
value: Option<crate::tech_tokimeki::kaku::ReactionType<'a>>,
) -> Self {
self.__unsafe_private_named.11 = value;
self
}
}
impl<'a, S> PostViewBuilder<'a, S>
where
S: post_view_state::State,
S::CreatedAt: post_view_state::IsSet,
S::Uri: post_view_state::IsSet,
S::Author: post_view_state::IsSet,
S::AspectRatio: post_view_state::IsSet,
S::Cid: post_view_state::IsSet,
S::Image: post_view_state::IsSet,
{
pub fn build(self) -> PostView<'a> {
PostView {
aspect_ratio: self.__unsafe_private_named.0.unwrap(),
author: self.__unsafe_private_named.1.unwrap(),
cid: self.__unsafe_private_named.2.unwrap(),
created_at: self.__unsafe_private_named.3.unwrap(),
image: self.__unsafe_private_named.4.unwrap(),
indexed_at: self.__unsafe_private_named.5,
linked_post: self.__unsafe_private_named.6,
reaction_counts: self.__unsafe_private_named.7,
tags: self.__unsafe_private_named.8,
text: self.__unsafe_private_named.9,
uri: self.__unsafe_private_named.10.unwrap(),
viewer_reaction: self.__unsafe_private_named.11,
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>,
>,
) -> PostView<'a> {
PostView {
aspect_ratio: self.__unsafe_private_named.0.unwrap(),
author: self.__unsafe_private_named.1.unwrap(),
cid: self.__unsafe_private_named.2.unwrap(),
created_at: self.__unsafe_private_named.3.unwrap(),
image: self.__unsafe_private_named.4.unwrap(),
indexed_at: self.__unsafe_private_named.5,
linked_post: self.__unsafe_private_named.6,
reaction_counts: self.__unsafe_private_named.7,
tags: self.__unsafe_private_named.8,
text: self.__unsafe_private_named.9,
uri: self.__unsafe_private_named.10.unwrap(),
viewer_reaction: self.__unsafe_private_named.11,
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for PostView<'a> {
fn nsid() -> &'static str {
"tech.tokimeki.kaku.defs"
}
fn def_name() -> &'static str {
"postView"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_tech_tokimeki_kaku_defs()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
if let Some(ref value) = self.tags {
#[allow(unused_comparisons)]
if value.len() > 8usize {
return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"tags",
),
max: 8usize,
actual: value.len(),
});
}
}
if let Some(ref value) = self.text {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 1000usize {
return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"text",
),
max: 1000usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.text {
{
let count = jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation::graphemes(
value.as_ref(),
true,
)
.count();
if count > 300usize {
return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"text",
),
max: 300usize,
actual: count,
});
}
}
}
Ok(())
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct ReactionCounts<'a> {
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(default = "_default_reaction_counts_kami")]
pub kami: std::option::Option<i64>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(default = "_default_reaction_counts_kawaii")]
pub kawaii: std::option::Option<i64>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(default = "_default_reaction_counts_sugoi")]
pub sugoi: std::option::Option<i64>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(default = "_default_reaction_counts_suki")]
pub suki: std::option::Option<i64>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(default = "_default_reaction_counts_tasukaru")]
pub tasukaru: std::option::Option<i64>,
}
fn _default_reaction_counts_kami() -> std::option::Option<i64> {
Some(0i64)
}
fn _default_reaction_counts_kawaii() -> std::option::Option<i64> {
Some(0i64)
}
fn _default_reaction_counts_sugoi() -> std::option::Option<i64> {
Some(0i64)
}
fn _default_reaction_counts_suki() -> std::option::Option<i64> {
Some(0i64)
}
fn _default_reaction_counts_tasukaru() -> std::option::Option<i64> {
Some(0i64)
}
impl Default for ReactionCounts<'_> {
fn default() -> Self {
Self {
kami: Some(0i64),
kawaii: Some(0i64),
sugoi: Some(0i64),
suki: Some(0i64),
tasukaru: Some(0i64),
extra_data: Default::default(),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ReactionCounts<'a> {
fn nsid() -> &'static str {
"tech.tokimeki.kaku.defs"
}
fn def_name() -> &'static str {
"reactionCounts"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_tech_tokimeki_kaku_defs()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ReactionType<'a> {
Suki,
Tasukaru,
Sugoi,
Kawaii,
Kami,
Other(jacquard_common::CowStr<'a>),
}
impl<'a> ReactionType<'a> {
pub fn as_str(&self) -> &str {
match self {
Self::Suki => "suki",
Self::Tasukaru => "tasukaru",
Self::Sugoi => "sugoi",
Self::Kawaii => "kawaii",
Self::Kami => "kami",
Self::Other(s) => s.as_ref(),
}
}
}
impl<'a> From<&'a str> for ReactionType<'a> {
fn from(s: &'a str) -> Self {
match s {
"suki" => Self::Suki,
"tasukaru" => Self::Tasukaru,
"sugoi" => Self::Sugoi,
"kawaii" => Self::Kawaii,
"kami" => Self::Kami,
_ => Self::Other(jacquard_common::CowStr::from(s)),
}
}
}
impl<'a> From<String> for ReactionType<'a> {
fn from(s: String) -> Self {
match s.as_str() {
"suki" => Self::Suki,
"tasukaru" => Self::Tasukaru,
"sugoi" => Self::Sugoi,
"kawaii" => Self::Kawaii,
"kami" => Self::Kami,
_ => Self::Other(jacquard_common::CowStr::from(s)),
}
}
}
impl<'a> AsRef<str> for ReactionType<'a> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<'a> core::fmt::Display for ReactionType<'a> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<'a> serde::Serialize for ReactionType<'a> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, 'a> serde::Deserialize<'de> for ReactionType<'a>
where
'de: 'a,
{
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = <&'de str>::deserialize(deserializer)?;
Ok(Self::from(s))
}
}
impl jacquard_common::IntoStatic for ReactionType<'_> {
type Output = ReactionType<'static>;
fn into_static(self) -> Self::Output {
match self {
ReactionType::Suki => ReactionType::Suki,
ReactionType::Tasukaru => ReactionType::Tasukaru,
ReactionType::Sugoi => ReactionType::Sugoi,
ReactionType::Kawaii => ReactionType::Kawaii,
ReactionType::Kami => ReactionType::Kami,
ReactionType::Other(v) => ReactionType::Other(v.into_static()),
}
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct ReplyView<'a> {
#[serde(borrow)]
pub author: crate::app_bsky::actor::ProfileViewBasic<'a>,
#[serde(borrow)]
pub cid: jacquard_common::types::string::Cid<'a>,
pub created_at: jacquard_common::types::string::Datetime,
#[serde(borrow)]
pub text: jacquard_common::CowStr<'a>,
#[serde(borrow)]
pub uri: jacquard_common::types::string::AtUri<'a>,
}
pub mod reply_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 Cid;
type Uri;
type Author;
type Text;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type CreatedAt = Unset;
type Cid = Unset;
type Uri = Unset;
type Author = Unset;
type Text = Unset;
}
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 CreatedAt = Set<members::created_at>;
type Cid = S::Cid;
type Uri = S::Uri;
type Author = S::Author;
type Text = S::Text;
}
pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCid<S> {}
impl<S: State> State for SetCid<S> {
type CreatedAt = S::CreatedAt;
type Cid = Set<members::cid>;
type Uri = S::Uri;
type Author = S::Author;
type Text = S::Text;
}
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 CreatedAt = S::CreatedAt;
type Cid = S::Cid;
type Uri = Set<members::uri>;
type Author = S::Author;
type Text = S::Text;
}
pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetAuthor<S> {}
impl<S: State> State for SetAuthor<S> {
type CreatedAt = S::CreatedAt;
type Cid = S::Cid;
type Uri = S::Uri;
type Author = Set<members::author>;
type Text = S::Text;
}
pub struct SetText<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetText<S> {}
impl<S: State> State for SetText<S> {
type CreatedAt = S::CreatedAt;
type Cid = S::Cid;
type Uri = S::Uri;
type Author = S::Author;
type Text = Set<members::text>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct created_at(());
pub struct cid(());
pub struct uri(());
pub struct author(());
pub struct text(());
}
}
pub struct ReplyViewBuilder<'a, S: reply_view_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<crate::app_bsky::actor::ProfileViewBasic<'a>>,
::core::option::Option<jacquard_common::types::string::Cid<'a>>,
::core::option::Option<jacquard_common::types::string::Datetime>,
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> ReplyView<'a> {
pub fn new() -> ReplyViewBuilder<'a, reply_view_state::Empty> {
ReplyViewBuilder::new()
}
}
impl<'a> ReplyViewBuilder<'a, reply_view_state::Empty> {
pub fn new() -> Self {
ReplyViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None, None, None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ReplyViewBuilder<'a, S>
where
S: reply_view_state::State,
S::Author: reply_view_state::IsUnset,
{
pub fn author(
mut self,
value: impl Into<crate::app_bsky::actor::ProfileViewBasic<'a>>,
) -> ReplyViewBuilder<'a, reply_view_state::SetAuthor<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
ReplyViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ReplyViewBuilder<'a, S>
where
S: reply_view_state::State,
S::Cid: reply_view_state::IsUnset,
{
pub fn cid(
mut self,
value: impl Into<jacquard_common::types::string::Cid<'a>>,
) -> ReplyViewBuilder<'a, reply_view_state::SetCid<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
ReplyViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ReplyViewBuilder<'a, S>
where
S: reply_view_state::State,
S::CreatedAt: reply_view_state::IsUnset,
{
pub fn created_at(
mut self,
value: impl Into<jacquard_common::types::string::Datetime>,
) -> ReplyViewBuilder<'a, reply_view_state::SetCreatedAt<S>> {
self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into());
ReplyViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ReplyViewBuilder<'a, S>
where
S: reply_view_state::State,
S::Text: reply_view_state::IsUnset,
{
pub fn text(
mut self,
value: impl Into<jacquard_common::CowStr<'a>>,
) -> ReplyViewBuilder<'a, reply_view_state::SetText<S>> {
self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into());
ReplyViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ReplyViewBuilder<'a, S>
where
S: reply_view_state::State,
S::Uri: reply_view_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<jacquard_common::types::string::AtUri<'a>>,
) -> ReplyViewBuilder<'a, reply_view_state::SetUri<S>> {
self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into());
ReplyViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ReplyViewBuilder<'a, S>
where
S: reply_view_state::State,
S::CreatedAt: reply_view_state::IsSet,
S::Cid: reply_view_state::IsSet,
S::Uri: reply_view_state::IsSet,
S::Author: reply_view_state::IsSet,
S::Text: reply_view_state::IsSet,
{
pub fn build(self) -> ReplyView<'a> {
ReplyView {
author: self.__unsafe_private_named.0.unwrap(),
cid: self.__unsafe_private_named.1.unwrap(),
created_at: self.__unsafe_private_named.2.unwrap(),
text: self.__unsafe_private_named.3.unwrap(),
uri: self.__unsafe_private_named.4.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>,
>,
) -> ReplyView<'a> {
ReplyView {
author: self.__unsafe_private_named.0.unwrap(),
cid: self.__unsafe_private_named.1.unwrap(),
created_at: self.__unsafe_private_named.2.unwrap(),
text: self.__unsafe_private_named.3.unwrap(),
uri: self.__unsafe_private_named.4.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ReplyView<'a> {
fn nsid() -> &'static str {
"tech.tokimeki.kaku.defs"
}
fn def_name() -> &'static str {
"replyView"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_tech_tokimeki_kaku_defs()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
{
let value = &self.text;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 3000usize {
return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"text",
),
max: 3000usize,
actual: <str>::len(value.as_ref()),
});
}
}
{
let value = &self.text;
{
let count = jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation::graphemes(
value.as_ref(),
true,
)
.count();
if count > 300usize {
return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"text",
),
max: 300usize,
actual: count,
});
}
}
}
Ok(())
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct RequestResponseView<'a> {
#[serde(borrow)]
pub author: crate::app_bsky::actor::ProfileViewBasic<'a>,
#[serde(borrow)]
pub cid: jacquard_common::types::string::Cid<'a>,
pub created_at: jacquard_common::types::string::Datetime,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub message: std::option::Option<jacquard_common::CowStr<'a>>,
#[serde(borrow)]
pub post: crate::tech_tokimeki::kaku::PostView<'a>,
#[serde(borrow)]
pub uri: jacquard_common::types::string::AtUri<'a>,
}
pub mod request_response_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 Uri;
type Post;
type Author;
type Cid;
type CreatedAt;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Uri = Unset;
type Post = Unset;
type Author = Unset;
type Cid = Unset;
type CreatedAt = 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>;
type Post = S::Post;
type Author = S::Author;
type Cid = S::Cid;
type CreatedAt = S::CreatedAt;
}
pub struct SetPost<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetPost<S> {}
impl<S: State> State for SetPost<S> {
type Uri = S::Uri;
type Post = Set<members::post>;
type Author = S::Author;
type Cid = S::Cid;
type CreatedAt = S::CreatedAt;
}
pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetAuthor<S> {}
impl<S: State> State for SetAuthor<S> {
type Uri = S::Uri;
type Post = S::Post;
type Author = Set<members::author>;
type Cid = S::Cid;
type CreatedAt = S::CreatedAt;
}
pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCid<S> {}
impl<S: State> State for SetCid<S> {
type Uri = S::Uri;
type Post = S::Post;
type Author = S::Author;
type Cid = Set<members::cid>;
type CreatedAt = S::CreatedAt;
}
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 Uri = S::Uri;
type Post = S::Post;
type Author = S::Author;
type Cid = S::Cid;
type CreatedAt = Set<members::created_at>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct uri(());
pub struct post(());
pub struct author(());
pub struct cid(());
pub struct created_at(());
}
}
pub struct RequestResponseViewBuilder<'a, S: request_response_view_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<crate::app_bsky::actor::ProfileViewBasic<'a>>,
::core::option::Option<jacquard_common::types::string::Cid<'a>>,
::core::option::Option<jacquard_common::types::string::Datetime>,
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<crate::tech_tokimeki::kaku::PostView<'a>>,
::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> RequestResponseView<'a> {
pub fn new() -> RequestResponseViewBuilder<'a, request_response_view_state::Empty> {
RequestResponseViewBuilder::new()
}
}
impl<'a> RequestResponseViewBuilder<'a, request_response_view_state::Empty> {
pub fn new() -> Self {
RequestResponseViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None, None, None, None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> RequestResponseViewBuilder<'a, S>
where
S: request_response_view_state::State,
S::Author: request_response_view_state::IsUnset,
{
pub fn author(
mut self,
value: impl Into<crate::app_bsky::actor::ProfileViewBasic<'a>>,
) -> RequestResponseViewBuilder<'a, request_response_view_state::SetAuthor<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
RequestResponseViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> RequestResponseViewBuilder<'a, S>
where
S: request_response_view_state::State,
S::Cid: request_response_view_state::IsUnset,
{
pub fn cid(
mut self,
value: impl Into<jacquard_common::types::string::Cid<'a>>,
) -> RequestResponseViewBuilder<'a, request_response_view_state::SetCid<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
RequestResponseViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> RequestResponseViewBuilder<'a, S>
where
S: request_response_view_state::State,
S::CreatedAt: request_response_view_state::IsUnset,
{
pub fn created_at(
mut self,
value: impl Into<jacquard_common::types::string::Datetime>,
) -> RequestResponseViewBuilder<'a, request_response_view_state::SetCreatedAt<S>> {
self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into());
RequestResponseViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: request_response_view_state::State> RequestResponseViewBuilder<'a, S> {
pub fn message(
mut self,
value: impl Into<Option<jacquard_common::CowStr<'a>>>,
) -> Self {
self.__unsafe_private_named.3 = value.into();
self
}
pub fn maybe_message(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self {
self.__unsafe_private_named.3 = value;
self
}
}
impl<'a, S> RequestResponseViewBuilder<'a, S>
where
S: request_response_view_state::State,
S::Post: request_response_view_state::IsUnset,
{
pub fn post(
mut self,
value: impl Into<crate::tech_tokimeki::kaku::PostView<'a>>,
) -> RequestResponseViewBuilder<'a, request_response_view_state::SetPost<S>> {
self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into());
RequestResponseViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> RequestResponseViewBuilder<'a, S>
where
S: request_response_view_state::State,
S::Uri: request_response_view_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<jacquard_common::types::string::AtUri<'a>>,
) -> RequestResponseViewBuilder<'a, request_response_view_state::SetUri<S>> {
self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into());
RequestResponseViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> RequestResponseViewBuilder<'a, S>
where
S: request_response_view_state::State,
S::Uri: request_response_view_state::IsSet,
S::Post: request_response_view_state::IsSet,
S::Author: request_response_view_state::IsSet,
S::Cid: request_response_view_state::IsSet,
S::CreatedAt: request_response_view_state::IsSet,
{
pub fn build(self) -> RequestResponseView<'a> {
RequestResponseView {
author: self.__unsafe_private_named.0.unwrap(),
cid: self.__unsafe_private_named.1.unwrap(),
created_at: self.__unsafe_private_named.2.unwrap(),
message: self.__unsafe_private_named.3,
post: self.__unsafe_private_named.4.unwrap(),
uri: self.__unsafe_private_named.5.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>,
>,
) -> RequestResponseView<'a> {
RequestResponseView {
author: self.__unsafe_private_named.0.unwrap(),
cid: self.__unsafe_private_named.1.unwrap(),
created_at: self.__unsafe_private_named.2.unwrap(),
message: self.__unsafe_private_named.3,
post: self.__unsafe_private_named.4.unwrap(),
uri: self.__unsafe_private_named.5.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for RequestResponseView<'a> {
fn nsid() -> &'static str {
"tech.tokimeki.kaku.defs"
}
fn def_name() -> &'static str {
"requestResponseView"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_tech_tokimeki_kaku_defs()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
if let Some(ref value) = self.message {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 500usize {
return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"message",
),
max: 500usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.message {
{
let count = jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation::graphemes(
value.as_ref(),
true,
)
.count();
if count > 150usize {
return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"message",
),
max: 150usize,
actual: count,
});
}
}
}
Ok(())
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct RequestView<'a> {
#[serde(borrow)]
pub author: crate::app_bsky::actor::ProfileViewBasic<'a>,
#[serde(borrow)]
pub cid: jacquard_common::types::string::Cid<'a>,
pub created_at: jacquard_common::types::string::Datetime,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub indexed_at: std::option::Option<jacquard_common::types::string::Datetime>,
pub is_open: bool,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub reference_images: std::option::Option<
Vec<jacquard_common::types::string::UriValue<'a>>,
>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub response_count: std::option::Option<i64>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub tags: std::option::Option<Vec<jacquard_common::CowStr<'a>>>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub target_actor: std::option::Option<crate::app_bsky::actor::ProfileViewBasic<'a>>,
#[serde(borrow)]
pub text: jacquard_common::CowStr<'a>,
#[serde(borrow)]
pub uri: jacquard_common::types::string::AtUri<'a>,
}
pub mod request_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 Cid;
type IsOpen;
type Uri;
type Text;
type Author;
type CreatedAt;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Cid = Unset;
type IsOpen = Unset;
type Uri = Unset;
type Text = Unset;
type Author = Unset;
type CreatedAt = Unset;
}
pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCid<S> {}
impl<S: State> State for SetCid<S> {
type Cid = Set<members::cid>;
type IsOpen = S::IsOpen;
type Uri = S::Uri;
type Text = S::Text;
type Author = S::Author;
type CreatedAt = S::CreatedAt;
}
pub struct SetIsOpen<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetIsOpen<S> {}
impl<S: State> State for SetIsOpen<S> {
type Cid = S::Cid;
type IsOpen = Set<members::is_open>;
type Uri = S::Uri;
type Text = S::Text;
type Author = S::Author;
type CreatedAt = S::CreatedAt;
}
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 Cid = S::Cid;
type IsOpen = S::IsOpen;
type Uri = Set<members::uri>;
type Text = S::Text;
type Author = S::Author;
type CreatedAt = S::CreatedAt;
}
pub struct SetText<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetText<S> {}
impl<S: State> State for SetText<S> {
type Cid = S::Cid;
type IsOpen = S::IsOpen;
type Uri = S::Uri;
type Text = Set<members::text>;
type Author = S::Author;
type CreatedAt = S::CreatedAt;
}
pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetAuthor<S> {}
impl<S: State> State for SetAuthor<S> {
type Cid = S::Cid;
type IsOpen = S::IsOpen;
type Uri = S::Uri;
type Text = S::Text;
type Author = Set<members::author>;
type CreatedAt = S::CreatedAt;
}
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 Cid = S::Cid;
type IsOpen = S::IsOpen;
type Uri = S::Uri;
type Text = S::Text;
type Author = S::Author;
type CreatedAt = Set<members::created_at>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct cid(());
pub struct is_open(());
pub struct uri(());
pub struct text(());
pub struct author(());
pub struct created_at(());
}
}
pub struct RequestViewBuilder<'a, S: request_view_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<crate::app_bsky::actor::ProfileViewBasic<'a>>,
::core::option::Option<jacquard_common::types::string::Cid<'a>>,
::core::option::Option<jacquard_common::types::string::Datetime>,
::core::option::Option<jacquard_common::types::string::Datetime>,
::core::option::Option<bool>,
::core::option::Option<Vec<jacquard_common::types::string::UriValue<'a>>>,
::core::option::Option<i64>,
::core::option::Option<Vec<jacquard_common::CowStr<'a>>>,
::core::option::Option<crate::app_bsky::actor::ProfileViewBasic<'a>>,
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> RequestView<'a> {
pub fn new() -> RequestViewBuilder<'a, request_view_state::Empty> {
RequestViewBuilder::new()
}
}
impl<'a> RequestViewBuilder<'a, request_view_state::Empty> {
pub fn new() -> Self {
RequestViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> RequestViewBuilder<'a, S>
where
S: request_view_state::State,
S::Author: request_view_state::IsUnset,
{
pub fn author(
mut self,
value: impl Into<crate::app_bsky::actor::ProfileViewBasic<'a>>,
) -> RequestViewBuilder<'a, request_view_state::SetAuthor<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
RequestViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> RequestViewBuilder<'a, S>
where
S: request_view_state::State,
S::Cid: request_view_state::IsUnset,
{
pub fn cid(
mut self,
value: impl Into<jacquard_common::types::string::Cid<'a>>,
) -> RequestViewBuilder<'a, request_view_state::SetCid<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
RequestViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> RequestViewBuilder<'a, S>
where
S: request_view_state::State,
S::CreatedAt: request_view_state::IsUnset,
{
pub fn created_at(
mut self,
value: impl Into<jacquard_common::types::string::Datetime>,
) -> RequestViewBuilder<'a, request_view_state::SetCreatedAt<S>> {
self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into());
RequestViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: request_view_state::State> RequestViewBuilder<'a, S> {
pub fn indexed_at(
mut self,
value: impl Into<Option<jacquard_common::types::string::Datetime>>,
) -> Self {
self.__unsafe_private_named.3 = value.into();
self
}
pub fn maybe_indexed_at(
mut self,
value: Option<jacquard_common::types::string::Datetime>,
) -> Self {
self.__unsafe_private_named.3 = value;
self
}
}
impl<'a, S> RequestViewBuilder<'a, S>
where
S: request_view_state::State,
S::IsOpen: request_view_state::IsUnset,
{
pub fn is_open(
mut self,
value: impl Into<bool>,
) -> RequestViewBuilder<'a, request_view_state::SetIsOpen<S>> {
self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into());
RequestViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: request_view_state::State> RequestViewBuilder<'a, S> {
pub fn reference_images(
mut self,
value: impl Into<Option<Vec<jacquard_common::types::string::UriValue<'a>>>>,
) -> Self {
self.__unsafe_private_named.5 = value.into();
self
}
pub fn maybe_reference_images(
mut self,
value: Option<Vec<jacquard_common::types::string::UriValue<'a>>>,
) -> Self {
self.__unsafe_private_named.5 = value;
self
}
}
impl<'a, S: request_view_state::State> RequestViewBuilder<'a, S> {
pub fn response_count(mut self, value: impl Into<Option<i64>>) -> Self {
self.__unsafe_private_named.6 = value.into();
self
}
pub fn maybe_response_count(mut self, value: Option<i64>) -> Self {
self.__unsafe_private_named.6 = value;
self
}
}
impl<'a, S: request_view_state::State> RequestViewBuilder<'a, S> {
pub fn tags(
mut self,
value: impl Into<Option<Vec<jacquard_common::CowStr<'a>>>>,
) -> Self {
self.__unsafe_private_named.7 = value.into();
self
}
pub fn maybe_tags(
mut self,
value: Option<Vec<jacquard_common::CowStr<'a>>>,
) -> Self {
self.__unsafe_private_named.7 = value;
self
}
}
impl<'a, S: request_view_state::State> RequestViewBuilder<'a, S> {
pub fn target_actor(
mut self,
value: impl Into<Option<crate::app_bsky::actor::ProfileViewBasic<'a>>>,
) -> Self {
self.__unsafe_private_named.8 = value.into();
self
}
pub fn maybe_target_actor(
mut self,
value: Option<crate::app_bsky::actor::ProfileViewBasic<'a>>,
) -> Self {
self.__unsafe_private_named.8 = value;
self
}
}
impl<'a, S> RequestViewBuilder<'a, S>
where
S: request_view_state::State,
S::Text: request_view_state::IsUnset,
{
pub fn text(
mut self,
value: impl Into<jacquard_common::CowStr<'a>>,
) -> RequestViewBuilder<'a, request_view_state::SetText<S>> {
self.__unsafe_private_named.9 = ::core::option::Option::Some(value.into());
RequestViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> RequestViewBuilder<'a, S>
where
S: request_view_state::State,
S::Uri: request_view_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<jacquard_common::types::string::AtUri<'a>>,
) -> RequestViewBuilder<'a, request_view_state::SetUri<S>> {
self.__unsafe_private_named.10 = ::core::option::Option::Some(value.into());
RequestViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> RequestViewBuilder<'a, S>
where
S: request_view_state::State,
S::Cid: request_view_state::IsSet,
S::IsOpen: request_view_state::IsSet,
S::Uri: request_view_state::IsSet,
S::Text: request_view_state::IsSet,
S::Author: request_view_state::IsSet,
S::CreatedAt: request_view_state::IsSet,
{
pub fn build(self) -> RequestView<'a> {
RequestView {
author: self.__unsafe_private_named.0.unwrap(),
cid: self.__unsafe_private_named.1.unwrap(),
created_at: self.__unsafe_private_named.2.unwrap(),
indexed_at: self.__unsafe_private_named.3,
is_open: self.__unsafe_private_named.4.unwrap(),
reference_images: self.__unsafe_private_named.5,
response_count: self.__unsafe_private_named.6,
tags: self.__unsafe_private_named.7,
target_actor: self.__unsafe_private_named.8,
text: self.__unsafe_private_named.9.unwrap(),
uri: self.__unsafe_private_named.10.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>,
>,
) -> RequestView<'a> {
RequestView {
author: self.__unsafe_private_named.0.unwrap(),
cid: self.__unsafe_private_named.1.unwrap(),
created_at: self.__unsafe_private_named.2.unwrap(),
indexed_at: self.__unsafe_private_named.3,
is_open: self.__unsafe_private_named.4.unwrap(),
reference_images: self.__unsafe_private_named.5,
response_count: self.__unsafe_private_named.6,
tags: self.__unsafe_private_named.7,
target_actor: self.__unsafe_private_named.8,
text: self.__unsafe_private_named.9.unwrap(),
uri: self.__unsafe_private_named.10.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for RequestView<'a> {
fn nsid() -> &'static str {
"tech.tokimeki.kaku.defs"
}
fn def_name() -> &'static str {
"requestView"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_tech_tokimeki_kaku_defs()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
if let Some(ref value) = self.reference_images {
#[allow(unused_comparisons)]
if value.len() > 4usize {
return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"reference_images",
),
max: 4usize,
actual: value.len(),
});
}
}
if let Some(ref value) = self.tags {
#[allow(unused_comparisons)]
if value.len() > 8usize {
return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"tags",
),
max: 8usize,
actual: value.len(),
});
}
}
{
let value = &self.text;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 1000usize {
return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"text",
),
max: 1000usize,
actual: <str>::len(value.as_ref()),
});
}
}
{
let value = &self.text;
{
let count = jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation::graphemes(
value.as_ref(),
true,
)
.count();
if count > 300usize {
return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"text",
),
max: 300usize,
actual: count,
});
}
}
}
Ok(())
}
}