#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct Records<'a> {
#[serde(borrow)]
pub records: Vec<crate::sh_weaver::embed::records::RecordEmbed<'a>>,
}
pub mod records_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 Records;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Records = Unset;
}
pub struct SetRecords<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetRecords<S> {}
impl<S: State> State for SetRecords<S> {
type Records = Set<members::records>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct records(());
}
}
pub struct RecordsBuilder<'a, S: records_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<Vec<crate::sh_weaver::embed::records::RecordEmbed<'a>>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> Records<'a> {
pub fn new() -> RecordsBuilder<'a, records_state::Empty> {
RecordsBuilder::new()
}
}
impl<'a> RecordsBuilder<'a, records_state::Empty> {
pub fn new() -> Self {
RecordsBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None,),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> RecordsBuilder<'a, S>
where
S: records_state::State,
S::Records: records_state::IsUnset,
{
pub fn records(
mut self,
value: impl Into<Vec<crate::sh_weaver::embed::records::RecordEmbed<'a>>>,
) -> RecordsBuilder<'a, records_state::SetRecords<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
RecordsBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> RecordsBuilder<'a, S>
where
S: records_state::State,
S::Records: records_state::IsSet,
{
pub fn build(self) -> Records<'a> {
Records {
records: self.__unsafe_private_named.0.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>,
>,
) -> Records<'a> {
Records {
records: self.__unsafe_private_named.0.unwrap(),
extra_data: Some(extra_data),
}
}
}
fn lexicon_doc_sh_weaver_embed_records() -> ::jacquard_lexicon::lexicon::LexiconDoc<
'static,
> {
::jacquard_lexicon::lexicon::LexiconDoc {
lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1,
id: ::jacquard_common::CowStr::new_static("sh.weaver.embed.records"),
revision: None,
description: None,
defs: {
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("main"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("records")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"records",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
description: None,
items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static("#recordEmbed"),
}),
min_length: None,
max_length: Some(48usize),
}),
);
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("recordEmbed"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("record")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"name",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: None,
default: None,
min_length: None,
max_length: Some(128usize),
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(
"record",
),
::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(
"recordEmbedView",
),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("recordView")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"name",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: None,
default: None,
min_length: None,
max_length: Some(128usize),
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(
"recordView",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion {
description: None,
refs: vec![
::jacquard_common::CowStr::new_static("sh.weaver.embed.records#view"),
::jacquard_common::CowStr::new_static("sh.weaver.embed.images#view"),
::jacquard_common::CowStr::new_static("sh.weaver.embed.recordWithMedia#view"),
::jacquard_common::CowStr::new_static("sh.weaver.embed.video#view")
],
closed: None,
}),
);
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("view"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("record")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"record",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion {
description: None,
refs: vec![
::jacquard_common::CowStr::new_static("#viewRecord"),
::jacquard_common::CowStr::new_static("#viewNotFound"),
::jacquard_common::CowStr::new_static("#viewBlocked"),
::jacquard_common::CowStr::new_static("#viewDetached"),
::jacquard_common::CowStr::new_static("app.bsky.feed.defs#generatorView"),
::jacquard_common::CowStr::new_static("app.bsky.graph.defs#listView"),
::jacquard_common::CowStr::new_static("app.bsky.labeler.defs#labelerView"),
::jacquard_common::CowStr::new_static("app.bsky.graph.defs#starterPackViewBasic")
],
closed: None,
}),
);
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("viewBlocked"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("uri"),
::jacquard_common::deps::smol_str::SmolStr::new_static("blocked"),
::jacquard_common::deps::smol_str::SmolStr::new_static("author")
],
),
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.feed.defs#blockedAuthor",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"blocked",
),
::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(
"uri",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
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("viewDetached"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("uri"),
::jacquard_common::deps::smol_str::SmolStr::new_static("detached")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"detached",
),
::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(
"uri",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
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("viewNotFound"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("uri"),
::jacquard_common::deps::smol_str::SmolStr::new_static("notFound")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"notFound",
),
::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(
"uri",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
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("viewRecord"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
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("value"),
::jacquard_common::deps::smol_str::SmolStr::new_static("indexedAt")
],
),
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(
"sh.weaver.actor.defs#profileDataViewBasic",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"cid",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
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(
"embeds",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
description: None,
items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"#recordEmbedView",
),
}),
min_length: None,
max_length: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"indexedAt",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
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(
"labels",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
description: None,
items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"com.atproto.label.defs#label",
),
}),
min_length: None,
max_length: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"likeCount",
),
::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(
"quoteCount",
),
::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(
"replyCount",
),
::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(
"repostCount",
),
::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(
"uri",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
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(
"value",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown {
description: None,
}),
);
map
},
}),
);
map
},
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Records<'a> {
fn nsid() -> &'static str {
"sh.weaver.embed.records"
}
fn def_name() -> &'static str {
"main"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_sh_weaver_embed_records()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
{
let value = &self.records;
#[allow(unused_comparisons)]
if value.len() > 48usize {
return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"records",
),
max: 48usize,
actual: value.len(),
});
}
}
Ok(())
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct RecordEmbed<'a> {
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub name: std::option::Option<jacquard_common::CowStr<'a>>,
#[serde(borrow)]
pub record: crate::com_atproto::repo::strong_ref::StrongRef<'a>,
}
pub mod record_embed_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 Record;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Record = Unset;
}
pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetRecord<S> {}
impl<S: State> State for SetRecord<S> {
type Record = Set<members::record>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct record(());
}
}
pub struct RecordEmbedBuilder<'a, S: record_embed_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<crate::com_atproto::repo::strong_ref::StrongRef<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> RecordEmbed<'a> {
pub fn new() -> RecordEmbedBuilder<'a, record_embed_state::Empty> {
RecordEmbedBuilder::new()
}
}
impl<'a> RecordEmbedBuilder<'a, record_embed_state::Empty> {
pub fn new() -> Self {
RecordEmbedBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: record_embed_state::State> RecordEmbedBuilder<'a, S> {
pub fn name(
mut self,
value: impl Into<Option<jacquard_common::CowStr<'a>>>,
) -> Self {
self.__unsafe_private_named.0 = value.into();
self
}
pub fn maybe_name(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self {
self.__unsafe_private_named.0 = value;
self
}
}
impl<'a, S> RecordEmbedBuilder<'a, S>
where
S: record_embed_state::State,
S::Record: record_embed_state::IsUnset,
{
pub fn record(
mut self,
value: impl Into<crate::com_atproto::repo::strong_ref::StrongRef<'a>>,
) -> RecordEmbedBuilder<'a, record_embed_state::SetRecord<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
RecordEmbedBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> RecordEmbedBuilder<'a, S>
where
S: record_embed_state::State,
S::Record: record_embed_state::IsSet,
{
pub fn build(self) -> RecordEmbed<'a> {
RecordEmbed {
name: self.__unsafe_private_named.0,
record: 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>,
>,
) -> RecordEmbed<'a> {
RecordEmbed {
name: self.__unsafe_private_named.0,
record: self.__unsafe_private_named.1.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for RecordEmbed<'a> {
fn nsid() -> &'static str {
"sh.weaver.embed.records"
}
fn def_name() -> &'static str {
"recordEmbed"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_sh_weaver_embed_records()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
if let Some(ref value) = self.name {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 128usize {
return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"name",
),
max: 128usize,
actual: <str>::len(value.as_ref()),
});
}
}
Ok(())
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct RecordEmbedView<'a> {
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub name: std::option::Option<jacquard_common::CowStr<'a>>,
#[serde(borrow)]
pub record_view: RecordEmbedViewRecordView<'a>,
}
pub mod record_embed_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 RecordView;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type RecordView = Unset;
}
pub struct SetRecordView<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetRecordView<S> {}
impl<S: State> State for SetRecordView<S> {
type RecordView = Set<members::record_view>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct record_view(());
}
}
pub struct RecordEmbedViewBuilder<'a, S: record_embed_view_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<RecordEmbedViewRecordView<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> RecordEmbedView<'a> {
pub fn new() -> RecordEmbedViewBuilder<'a, record_embed_view_state::Empty> {
RecordEmbedViewBuilder::new()
}
}
impl<'a> RecordEmbedViewBuilder<'a, record_embed_view_state::Empty> {
pub fn new() -> Self {
RecordEmbedViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: record_embed_view_state::State> RecordEmbedViewBuilder<'a, S> {
pub fn name(
mut self,
value: impl Into<Option<jacquard_common::CowStr<'a>>>,
) -> Self {
self.__unsafe_private_named.0 = value.into();
self
}
pub fn maybe_name(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self {
self.__unsafe_private_named.0 = value;
self
}
}
impl<'a, S> RecordEmbedViewBuilder<'a, S>
where
S: record_embed_view_state::State,
S::RecordView: record_embed_view_state::IsUnset,
{
pub fn record_view(
mut self,
value: impl Into<RecordEmbedViewRecordView<'a>>,
) -> RecordEmbedViewBuilder<'a, record_embed_view_state::SetRecordView<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
RecordEmbedViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> RecordEmbedViewBuilder<'a, S>
where
S: record_embed_view_state::State,
S::RecordView: record_embed_view_state::IsSet,
{
pub fn build(self) -> RecordEmbedView<'a> {
RecordEmbedView {
name: self.__unsafe_private_named.0,
record_view: 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>,
>,
) -> RecordEmbedView<'a> {
RecordEmbedView {
name: self.__unsafe_private_named.0,
record_view: self.__unsafe_private_named.1.unwrap(),
extra_data: Some(extra_data),
}
}
}
#[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 RecordEmbedViewRecordView<'a> {
#[serde(rename = "sh.weaver.embed.records#view")]
View(Box<crate::sh_weaver::embed::records::View<'a>>),
#[serde(rename = "sh.weaver.embed.images#view")]
ImagesView(Box<crate::sh_weaver::embed::images::View<'a>>),
#[serde(rename = "sh.weaver.embed.recordWithMedia#view")]
RecordWithMediaView(Box<crate::sh_weaver::embed::record_with_media::View<'a>>),
#[serde(rename = "sh.weaver.embed.video#view")]
VideoView(Box<crate::sh_weaver::embed::video::View<'a>>),
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for RecordEmbedView<'a> {
fn nsid() -> &'static str {
"sh.weaver.embed.records"
}
fn def_name() -> &'static str {
"recordEmbedView"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_sh_weaver_embed_records()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
if let Some(ref value) = self.name {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 128usize {
return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"name",
),
max: 128usize,
actual: <str>::len(value.as_ref()),
});
}
}
Ok(())
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct View<'a> {
#[serde(borrow)]
pub record: ViewUnionRecord<'a>,
}
pub mod 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 Record;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Record = Unset;
}
pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetRecord<S> {}
impl<S: State> State for SetRecord<S> {
type Record = Set<members::record>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct record(());
}
}
pub struct ViewBuilder<'a, S: view_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (::core::option::Option<ViewUnionRecord<'a>>,),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> View<'a> {
pub fn new() -> ViewBuilder<'a, view_state::Empty> {
ViewBuilder::new()
}
}
impl<'a> ViewBuilder<'a, view_state::Empty> {
pub fn new() -> Self {
ViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None,),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ViewBuilder<'a, S>
where
S: view_state::State,
S::Record: view_state::IsUnset,
{
pub fn record(
mut self,
value: impl Into<ViewUnionRecord<'a>>,
) -> ViewBuilder<'a, view_state::SetRecord<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
ViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ViewBuilder<'a, S>
where
S: view_state::State,
S::Record: view_state::IsSet,
{
pub fn build(self) -> View<'a> {
View {
record: self.__unsafe_private_named.0.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>,
>,
) -> View<'a> {
View {
record: self.__unsafe_private_named.0.unwrap(),
extra_data: Some(extra_data),
}
}
}
#[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 ViewUnionRecord<'a> {
#[serde(rename = "sh.weaver.embed.records#viewRecord")]
ViewRecord(Box<crate::sh_weaver::embed::records::ViewRecord<'a>>),
#[serde(rename = "sh.weaver.embed.records#viewNotFound")]
ViewNotFound(Box<crate::sh_weaver::embed::records::ViewNotFound<'a>>),
#[serde(rename = "sh.weaver.embed.records#viewBlocked")]
ViewBlocked(Box<crate::sh_weaver::embed::records::ViewBlocked<'a>>),
#[serde(rename = "sh.weaver.embed.records#viewDetached")]
ViewDetached(Box<crate::sh_weaver::embed::records::ViewDetached<'a>>),
#[serde(rename = "app.bsky.feed.defs#generatorView")]
GeneratorView(Box<crate::app_bsky::feed::GeneratorView<'a>>),
#[serde(rename = "app.bsky.graph.defs#listView")]
ListView(Box<crate::app_bsky::graph::ListView<'a>>),
#[serde(rename = "app.bsky.labeler.defs#labelerView")]
LabelerView(Box<crate::app_bsky::labeler::LabelerView<'a>>),
#[serde(rename = "app.bsky.graph.defs#starterPackViewBasic")]
StarterPackViewBasic(Box<crate::app_bsky::graph::StarterPackViewBasic<'a>>),
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for View<'a> {
fn nsid() -> &'static str {
"sh.weaver.embed.records"
}
fn def_name() -> &'static str {
"view"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_sh_weaver_embed_records()
}
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 ViewBlocked<'a> {
#[serde(borrow)]
pub author: crate::app_bsky::feed::BlockedAuthor<'a>,
pub blocked: bool,
#[serde(borrow)]
pub uri: jacquard_common::types::string::AtUri<'a>,
}
pub mod view_blocked_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 Author;
type Blocked;
type Uri;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Author = Unset;
type Blocked = Unset;
type Uri = Unset;
}
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 Author = Set<members::author>;
type Blocked = S::Blocked;
type Uri = S::Uri;
}
pub struct SetBlocked<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetBlocked<S> {}
impl<S: State> State for SetBlocked<S> {
type Author = S::Author;
type Blocked = Set<members::blocked>;
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 Author = S::Author;
type Blocked = S::Blocked;
type Uri = Set<members::uri>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct author(());
pub struct blocked(());
pub struct uri(());
}
}
pub struct ViewBlockedBuilder<'a, S: view_blocked_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<crate::app_bsky::feed::BlockedAuthor<'a>>,
::core::option::Option<bool>,
::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> ViewBlocked<'a> {
pub fn new() -> ViewBlockedBuilder<'a, view_blocked_state::Empty> {
ViewBlockedBuilder::new()
}
}
impl<'a> ViewBlockedBuilder<'a, view_blocked_state::Empty> {
pub fn new() -> Self {
ViewBlockedBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ViewBlockedBuilder<'a, S>
where
S: view_blocked_state::State,
S::Author: view_blocked_state::IsUnset,
{
pub fn author(
mut self,
value: impl Into<crate::app_bsky::feed::BlockedAuthor<'a>>,
) -> ViewBlockedBuilder<'a, view_blocked_state::SetAuthor<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
ViewBlockedBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ViewBlockedBuilder<'a, S>
where
S: view_blocked_state::State,
S::Blocked: view_blocked_state::IsUnset,
{
pub fn blocked(
mut self,
value: impl Into<bool>,
) -> ViewBlockedBuilder<'a, view_blocked_state::SetBlocked<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
ViewBlockedBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ViewBlockedBuilder<'a, S>
where
S: view_blocked_state::State,
S::Uri: view_blocked_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<jacquard_common::types::string::AtUri<'a>>,
) -> ViewBlockedBuilder<'a, view_blocked_state::SetUri<S>> {
self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into());
ViewBlockedBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ViewBlockedBuilder<'a, S>
where
S: view_blocked_state::State,
S::Author: view_blocked_state::IsSet,
S::Blocked: view_blocked_state::IsSet,
S::Uri: view_blocked_state::IsSet,
{
pub fn build(self) -> ViewBlocked<'a> {
ViewBlocked {
author: self.__unsafe_private_named.0.unwrap(),
blocked: self.__unsafe_private_named.1.unwrap(),
uri: self.__unsafe_private_named.2.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>,
>,
) -> ViewBlocked<'a> {
ViewBlocked {
author: self.__unsafe_private_named.0.unwrap(),
blocked: self.__unsafe_private_named.1.unwrap(),
uri: self.__unsafe_private_named.2.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ViewBlocked<'a> {
fn nsid() -> &'static str {
"sh.weaver.embed.records"
}
fn def_name() -> &'static str {
"viewBlocked"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_sh_weaver_embed_records()
}
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 ViewDetached<'a> {
pub detached: bool,
#[serde(borrow)]
pub uri: jacquard_common::types::string::AtUri<'a>,
}
pub mod view_detached_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 Detached;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Uri = Unset;
type Detached = 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 Detached = S::Detached;
}
pub struct SetDetached<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetDetached<S> {}
impl<S: State> State for SetDetached<S> {
type Uri = S::Uri;
type Detached = Set<members::detached>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct uri(());
pub struct detached(());
}
}
pub struct ViewDetachedBuilder<'a, S: view_detached_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<bool>,
::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> ViewDetached<'a> {
pub fn new() -> ViewDetachedBuilder<'a, view_detached_state::Empty> {
ViewDetachedBuilder::new()
}
}
impl<'a> ViewDetachedBuilder<'a, view_detached_state::Empty> {
pub fn new() -> Self {
ViewDetachedBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ViewDetachedBuilder<'a, S>
where
S: view_detached_state::State,
S::Detached: view_detached_state::IsUnset,
{
pub fn detached(
mut self,
value: impl Into<bool>,
) -> ViewDetachedBuilder<'a, view_detached_state::SetDetached<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
ViewDetachedBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ViewDetachedBuilder<'a, S>
where
S: view_detached_state::State,
S::Uri: view_detached_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<jacquard_common::types::string::AtUri<'a>>,
) -> ViewDetachedBuilder<'a, view_detached_state::SetUri<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
ViewDetachedBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ViewDetachedBuilder<'a, S>
where
S: view_detached_state::State,
S::Uri: view_detached_state::IsSet,
S::Detached: view_detached_state::IsSet,
{
pub fn build(self) -> ViewDetached<'a> {
ViewDetached {
detached: self.__unsafe_private_named.0.unwrap(),
uri: 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>,
>,
) -> ViewDetached<'a> {
ViewDetached {
detached: self.__unsafe_private_named.0.unwrap(),
uri: self.__unsafe_private_named.1.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ViewDetached<'a> {
fn nsid() -> &'static str {
"sh.weaver.embed.records"
}
fn def_name() -> &'static str {
"viewDetached"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_sh_weaver_embed_records()
}
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 ViewNotFound<'a> {
pub not_found: bool,
#[serde(borrow)]
pub uri: jacquard_common::types::string::AtUri<'a>,
}
pub mod view_not_found_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 NotFound;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Uri = Unset;
type NotFound = 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 NotFound = S::NotFound;
}
pub struct SetNotFound<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetNotFound<S> {}
impl<S: State> State for SetNotFound<S> {
type Uri = S::Uri;
type NotFound = Set<members::not_found>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct uri(());
pub struct not_found(());
}
}
pub struct ViewNotFoundBuilder<'a, S: view_not_found_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<bool>,
::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> ViewNotFound<'a> {
pub fn new() -> ViewNotFoundBuilder<'a, view_not_found_state::Empty> {
ViewNotFoundBuilder::new()
}
}
impl<'a> ViewNotFoundBuilder<'a, view_not_found_state::Empty> {
pub fn new() -> Self {
ViewNotFoundBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ViewNotFoundBuilder<'a, S>
where
S: view_not_found_state::State,
S::NotFound: view_not_found_state::IsUnset,
{
pub fn not_found(
mut self,
value: impl Into<bool>,
) -> ViewNotFoundBuilder<'a, view_not_found_state::SetNotFound<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
ViewNotFoundBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ViewNotFoundBuilder<'a, S>
where
S: view_not_found_state::State,
S::Uri: view_not_found_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<jacquard_common::types::string::AtUri<'a>>,
) -> ViewNotFoundBuilder<'a, view_not_found_state::SetUri<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
ViewNotFoundBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ViewNotFoundBuilder<'a, S>
where
S: view_not_found_state::State,
S::Uri: view_not_found_state::IsSet,
S::NotFound: view_not_found_state::IsSet,
{
pub fn build(self) -> ViewNotFound<'a> {
ViewNotFound {
not_found: self.__unsafe_private_named.0.unwrap(),
uri: 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>,
>,
) -> ViewNotFound<'a> {
ViewNotFound {
not_found: self.__unsafe_private_named.0.unwrap(),
uri: self.__unsafe_private_named.1.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ViewNotFound<'a> {
fn nsid() -> &'static str {
"sh.weaver.embed.records"
}
fn def_name() -> &'static str {
"viewNotFound"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_sh_weaver_embed_records()
}
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 ViewRecord<'a> {
#[serde(borrow)]
pub author: crate::sh_weaver::actor::ProfileDataViewBasic<'a>,
#[serde(borrow)]
pub cid: jacquard_common::types::string::Cid<'a>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub embeds: std::option::Option<
Vec<crate::sh_weaver::embed::records::RecordEmbedView<'a>>,
>,
pub indexed_at: jacquard_common::types::string::Datetime,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub labels: std::option::Option<Vec<crate::com_atproto::label::Label<'a>>>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub like_count: std::option::Option<i64>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub quote_count: std::option::Option<i64>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub reply_count: std::option::Option<i64>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub repost_count: std::option::Option<i64>,
#[serde(borrow)]
pub uri: jacquard_common::types::string::AtUri<'a>,
#[serde(borrow)]
pub value: jacquard_common::types::value::Data<'a>,
}
pub mod view_record_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 Author;
type Value;
type IndexedAt;
type Cid;
type Uri;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Author = Unset;
type Value = Unset;
type IndexedAt = Unset;
type Cid = Unset;
type Uri = Unset;
}
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 Author = Set<members::author>;
type Value = S::Value;
type IndexedAt = S::IndexedAt;
type Cid = S::Cid;
type Uri = S::Uri;
}
pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetValue<S> {}
impl<S: State> State for SetValue<S> {
type Author = S::Author;
type Value = Set<members::value>;
type IndexedAt = S::IndexedAt;
type Cid = S::Cid;
type Uri = S::Uri;
}
pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetIndexedAt<S> {}
impl<S: State> State for SetIndexedAt<S> {
type Author = S::Author;
type Value = S::Value;
type IndexedAt = Set<members::indexed_at>;
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 Author = S::Author;
type Value = S::Value;
type IndexedAt = S::IndexedAt;
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 Author = S::Author;
type Value = S::Value;
type IndexedAt = S::IndexedAt;
type Cid = S::Cid;
type Uri = Set<members::uri>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct author(());
pub struct value(());
pub struct indexed_at(());
pub struct cid(());
pub struct uri(());
}
}
pub struct ViewRecordBuilder<'a, S: view_record_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<crate::sh_weaver::actor::ProfileDataViewBasic<'a>>,
::core::option::Option<jacquard_common::types::string::Cid<'a>>,
::core::option::Option<
Vec<crate::sh_weaver::embed::records::RecordEmbedView<'a>>,
>,
::core::option::Option<jacquard_common::types::string::Datetime>,
::core::option::Option<Vec<crate::com_atproto::label::Label<'a>>>,
::core::option::Option<i64>,
::core::option::Option<i64>,
::core::option::Option<i64>,
::core::option::Option<i64>,
::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
::core::option::Option<jacquard_common::types::value::Data<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> ViewRecord<'a> {
pub fn new() -> ViewRecordBuilder<'a, view_record_state::Empty> {
ViewRecordBuilder::new()
}
}
impl<'a> ViewRecordBuilder<'a, view_record_state::Empty> {
pub fn new() -> Self {
ViewRecordBuilder {
_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> ViewRecordBuilder<'a, S>
where
S: view_record_state::State,
S::Author: view_record_state::IsUnset,
{
pub fn author(
mut self,
value: impl Into<crate::sh_weaver::actor::ProfileDataViewBasic<'a>>,
) -> ViewRecordBuilder<'a, view_record_state::SetAuthor<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
ViewRecordBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ViewRecordBuilder<'a, S>
where
S: view_record_state::State,
S::Cid: view_record_state::IsUnset,
{
pub fn cid(
mut self,
value: impl Into<jacquard_common::types::string::Cid<'a>>,
) -> ViewRecordBuilder<'a, view_record_state::SetCid<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
ViewRecordBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: view_record_state::State> ViewRecordBuilder<'a, S> {
pub fn embeds(
mut self,
value: impl Into<
Option<Vec<crate::sh_weaver::embed::records::RecordEmbedView<'a>>>,
>,
) -> Self {
self.__unsafe_private_named.2 = value.into();
self
}
pub fn maybe_embeds(
mut self,
value: Option<Vec<crate::sh_weaver::embed::records::RecordEmbedView<'a>>>,
) -> Self {
self.__unsafe_private_named.2 = value;
self
}
}
impl<'a, S> ViewRecordBuilder<'a, S>
where
S: view_record_state::State,
S::IndexedAt: view_record_state::IsUnset,
{
pub fn indexed_at(
mut self,
value: impl Into<jacquard_common::types::string::Datetime>,
) -> ViewRecordBuilder<'a, view_record_state::SetIndexedAt<S>> {
self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into());
ViewRecordBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: view_record_state::State> ViewRecordBuilder<'a, S> {
pub fn labels(
mut self,
value: impl Into<Option<Vec<crate::com_atproto::label::Label<'a>>>>,
) -> Self {
self.__unsafe_private_named.4 = value.into();
self
}
pub fn maybe_labels(
mut self,
value: Option<Vec<crate::com_atproto::label::Label<'a>>>,
) -> Self {
self.__unsafe_private_named.4 = value;
self
}
}
impl<'a, S: view_record_state::State> ViewRecordBuilder<'a, S> {
pub fn like_count(mut self, value: impl Into<Option<i64>>) -> Self {
self.__unsafe_private_named.5 = value.into();
self
}
pub fn maybe_like_count(mut self, value: Option<i64>) -> Self {
self.__unsafe_private_named.5 = value;
self
}
}
impl<'a, S: view_record_state::State> ViewRecordBuilder<'a, S> {
pub fn quote_count(mut self, value: impl Into<Option<i64>>) -> Self {
self.__unsafe_private_named.6 = value.into();
self
}
pub fn maybe_quote_count(mut self, value: Option<i64>) -> Self {
self.__unsafe_private_named.6 = value;
self
}
}
impl<'a, S: view_record_state::State> ViewRecordBuilder<'a, S> {
pub fn reply_count(mut self, value: impl Into<Option<i64>>) -> Self {
self.__unsafe_private_named.7 = value.into();
self
}
pub fn maybe_reply_count(mut self, value: Option<i64>) -> Self {
self.__unsafe_private_named.7 = value;
self
}
}
impl<'a, S: view_record_state::State> ViewRecordBuilder<'a, S> {
pub fn repost_count(mut self, value: impl Into<Option<i64>>) -> Self {
self.__unsafe_private_named.8 = value.into();
self
}
pub fn maybe_repost_count(mut self, value: Option<i64>) -> Self {
self.__unsafe_private_named.8 = value;
self
}
}
impl<'a, S> ViewRecordBuilder<'a, S>
where
S: view_record_state::State,
S::Uri: view_record_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<jacquard_common::types::string::AtUri<'a>>,
) -> ViewRecordBuilder<'a, view_record_state::SetUri<S>> {
self.__unsafe_private_named.9 = ::core::option::Option::Some(value.into());
ViewRecordBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ViewRecordBuilder<'a, S>
where
S: view_record_state::State,
S::Value: view_record_state::IsUnset,
{
pub fn value(
mut self,
value: impl Into<jacquard_common::types::value::Data<'a>>,
) -> ViewRecordBuilder<'a, view_record_state::SetValue<S>> {
self.__unsafe_private_named.10 = ::core::option::Option::Some(value.into());
ViewRecordBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ViewRecordBuilder<'a, S>
where
S: view_record_state::State,
S::Author: view_record_state::IsSet,
S::Value: view_record_state::IsSet,
S::IndexedAt: view_record_state::IsSet,
S::Cid: view_record_state::IsSet,
S::Uri: view_record_state::IsSet,
{
pub fn build(self) -> ViewRecord<'a> {
ViewRecord {
author: self.__unsafe_private_named.0.unwrap(),
cid: self.__unsafe_private_named.1.unwrap(),
embeds: self.__unsafe_private_named.2,
indexed_at: self.__unsafe_private_named.3.unwrap(),
labels: self.__unsafe_private_named.4,
like_count: self.__unsafe_private_named.5,
quote_count: self.__unsafe_private_named.6,
reply_count: self.__unsafe_private_named.7,
repost_count: self.__unsafe_private_named.8,
uri: self.__unsafe_private_named.9.unwrap(),
value: 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>,
>,
) -> ViewRecord<'a> {
ViewRecord {
author: self.__unsafe_private_named.0.unwrap(),
cid: self.__unsafe_private_named.1.unwrap(),
embeds: self.__unsafe_private_named.2,
indexed_at: self.__unsafe_private_named.3.unwrap(),
labels: self.__unsafe_private_named.4,
like_count: self.__unsafe_private_named.5,
quote_count: self.__unsafe_private_named.6,
reply_count: self.__unsafe_private_named.7,
repost_count: self.__unsafe_private_named.8,
uri: self.__unsafe_private_named.9.unwrap(),
value: self.__unsafe_private_named.10.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ViewRecord<'a> {
fn nsid() -> &'static str {
"sh.weaver.embed.records"
}
fn def_name() -> &'static str {
"viewRecord"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_sh_weaver_embed_records()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
Ok(())
}
}