// @generated by jacquard-lexicon. DO NOT EDIT. // // Lexicon: sh.weaver.embed.records // // This file was automatically generated from Lexicon schemas. // Any manual changes will be overwritten on the next regeneration. #[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>, } pub mod records_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { pub trait Sealed {} } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Records; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Records = Unset; } ///State transition - sets the `records` field to Set pub struct SetRecords(PhantomData S>); impl sealed::Sealed for SetRecords {} impl State for SetRecords { type Records = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `records` field pub struct records(()); } } /// Builder for constructing an instance of this type pub struct RecordsBuilder<'a, S: records_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> Records<'a> { /// Create a new builder for this type pub fn new() -> RecordsBuilder<'a, records_state::Empty> { RecordsBuilder::new() } } impl<'a> RecordsBuilder<'a, records_state::Empty> { /// Create a new builder with all fields unset 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, { /// Set the `records` field (required) pub fn records( mut self, value: impl Into>>, ) -> RecordsBuilder<'a, records_state::SetRecords> { 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, { /// Build the final struct pub fn build(self) -> Records<'a> { Records { records: self.__unsafe_private_named.0.unwrap(), extra_data: Default::default(), } } /// Build the final struct with custom extra_data pub fn build_with_data( self, extra_data: std::collections::BTreeMap< jacquard_common::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::smol_str::SmolStr::new_static("main"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: None, required: Some( vec![::jacquard_common::smol_str::SmolStr::new_static("records")], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::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::smol_str::SmolStr::new_static("recordEmbed"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: None, required: Some( vec![::jacquard_common::smol_str::SmolStr::new_static("record")], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::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::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::smol_str::SmolStr::new_static("recordEmbedView"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: None, required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("recordView") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::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::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::smol_str::SmolStr::new_static("view"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: None, required: Some( vec![::jacquard_common::smol_str::SmolStr::new_static("record")], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::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::smol_str::SmolStr::new_static("viewBlocked"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: None, required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("uri"), ::jacquard_common::smol_str::SmolStr::new_static("blocked"), ::jacquard_common::smol_str::SmolStr::new_static("author") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::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::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::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::smol_str::SmolStr::new_static("viewDetached"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: None, required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("uri"), ::jacquard_common::smol_str::SmolStr::new_static("detached") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::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::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::smol_str::SmolStr::new_static("viewNotFound"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: None, required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("uri"), ::jacquard_common::smol_str::SmolStr::new_static("notFound") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::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::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::smol_str::SmolStr::new_static("viewRecord"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: None, required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("uri"), ::jacquard_common::smol_str::SmolStr::new_static("cid"), ::jacquard_common::smol_str::SmolStr::new_static("author"), ::jacquard_common::smol_str::SmolStr::new_static("value"), ::jacquard_common::smol_str::SmolStr::new_static("indexedAt") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::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::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::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::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::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::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::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::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::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::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::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>, #[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 {} } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Record; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Record = Unset; } ///State transition - sets the `record` field to Set pub struct SetRecord(PhantomData S>); impl sealed::Sealed for SetRecord {} impl State for SetRecord { type Record = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `record` field pub struct record(()); } } /// Builder for constructing an instance of this type pub struct RecordEmbedBuilder<'a, S: record_embed_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>, ::core::option::Option>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> RecordEmbed<'a> { /// Create a new builder for this type pub fn new() -> RecordEmbedBuilder<'a, record_embed_state::Empty> { RecordEmbedBuilder::new() } } impl<'a> RecordEmbedBuilder<'a, record_embed_state::Empty> { /// Create a new builder with all fields unset 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> { /// Set the `name` field (optional) pub fn name( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.0 = value.into(); self } /// Set the `name` field to an Option value (optional) pub fn maybe_name(mut self, value: Option>) -> 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, { /// Set the `record` field (required) pub fn record( mut self, value: impl Into>, ) -> RecordEmbedBuilder<'a, record_embed_state::SetRecord> { 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, { /// Build the final struct pub fn build(self) -> RecordEmbed<'a> { RecordEmbed { name: self.__unsafe_private_named.0, record: self.__unsafe_private_named.1.unwrap(), extra_data: Default::default(), } } /// Build the final struct with custom extra_data pub fn build_with_data( self, extra_data: std::collections::BTreeMap< jacquard_common::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 ::len(value.as_ref()) > 128usize { return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { path: ::jacquard_lexicon::validation::ValidationPath::from_field( "name", ), max: 128usize, actual: ::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>, #[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 {} } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type RecordView; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type RecordView = Unset; } ///State transition - sets the `record_view` field to Set pub struct SetRecordView(PhantomData S>); impl sealed::Sealed for SetRecordView {} impl State for SetRecordView { type RecordView = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `record_view` field pub struct record_view(()); } } /// Builder for constructing an instance of this type pub struct RecordEmbedViewBuilder<'a, S: record_embed_view_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>, ::core::option::Option>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> RecordEmbedView<'a> { /// Create a new builder for this type pub fn new() -> RecordEmbedViewBuilder<'a, record_embed_view_state::Empty> { RecordEmbedViewBuilder::new() } } impl<'a> RecordEmbedViewBuilder<'a, record_embed_view_state::Empty> { /// Create a new builder with all fields unset 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> { /// Set the `name` field (optional) pub fn name( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.0 = value.into(); self } /// Set the `name` field to an Option value (optional) pub fn maybe_name(mut self, value: Option>) -> 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, { /// Set the `recordView` field (required) pub fn record_view( mut self, value: impl Into>, ) -> RecordEmbedViewBuilder<'a, record_embed_view_state::SetRecordView> { 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, { /// Build the final struct 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(), } } /// Build the final struct with custom extra_data pub fn build_with_data( self, extra_data: std::collections::BTreeMap< jacquard_common::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>), #[serde(rename = "sh.weaver.embed.images#view")] ImagesView(Box>), #[serde(rename = "sh.weaver.embed.recordWithMedia#view")] RecordWithMediaView(Box>), #[serde(rename = "sh.weaver.embed.video#view")] VideoView(Box>), } 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 ::len(value.as_ref()) > 128usize { return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { path: ::jacquard_lexicon::validation::ValidationPath::from_field( "name", ), max: 128usize, actual: ::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 {} } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Record; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Record = Unset; } ///State transition - sets the `record` field to Set pub struct SetRecord(PhantomData S>); impl sealed::Sealed for SetRecord {} impl State for SetRecord { type Record = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `record` field pub struct record(()); } } /// Builder for constructing an instance of this type pub struct ViewBuilder<'a, S: view_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: (::core::option::Option>,), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> View<'a> { /// Create a new builder for this type pub fn new() -> ViewBuilder<'a, view_state::Empty> { ViewBuilder::new() } } impl<'a> ViewBuilder<'a, view_state::Empty> { /// Create a new builder with all fields unset 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, { /// Set the `record` field (required) pub fn record( mut self, value: impl Into>, ) -> ViewBuilder<'a, view_state::SetRecord> { 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, { /// Build the final struct pub fn build(self) -> View<'a> { View { record: self.__unsafe_private_named.0.unwrap(), extra_data: Default::default(), } } /// Build the final struct with custom extra_data pub fn build_with_data( self, extra_data: std::collections::BTreeMap< jacquard_common::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>), #[serde(rename = "sh.weaver.embed.records#viewNotFound")] ViewNotFound(Box>), #[serde(rename = "sh.weaver.embed.records#viewBlocked")] ViewBlocked(Box>), #[serde(rename = "sh.weaver.embed.records#viewDetached")] ViewDetached(Box>), #[serde(rename = "app.bsky.feed.defs#generatorView")] GeneratorView(Box>), #[serde(rename = "app.bsky.graph.defs#listView")] ListView(Box>), #[serde(rename = "app.bsky.labeler.defs#labelerView")] LabelerView(Box>), #[serde(rename = "app.bsky.graph.defs#starterPackViewBasic")] StarterPackViewBasic(Box>), } 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 {} } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Uri; type Author; type Blocked; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Uri = Unset; type Author = Unset; type Blocked = Unset; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { type Uri = Set; type Author = S::Author; type Blocked = S::Blocked; } ///State transition - sets the `author` field to Set pub struct SetAuthor(PhantomData S>); impl sealed::Sealed for SetAuthor {} impl State for SetAuthor { type Uri = S::Uri; type Author = Set; type Blocked = S::Blocked; } ///State transition - sets the `blocked` field to Set pub struct SetBlocked(PhantomData S>); impl sealed::Sealed for SetBlocked {} impl State for SetBlocked { type Uri = S::Uri; type Author = S::Author; type Blocked = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `uri` field pub struct uri(()); ///Marker type for the `author` field pub struct author(()); ///Marker type for the `blocked` field pub struct blocked(()); } } /// Builder for constructing an instance of this type pub struct ViewBlockedBuilder<'a, S: view_blocked_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>, ::core::option::Option, ::core::option::Option>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> ViewBlocked<'a> { /// Create a new builder for this type pub fn new() -> ViewBlockedBuilder<'a, view_blocked_state::Empty> { ViewBlockedBuilder::new() } } impl<'a> ViewBlockedBuilder<'a, view_blocked_state::Empty> { /// Create a new builder with all fields unset 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, { /// Set the `author` field (required) pub fn author( mut self, value: impl Into>, ) -> ViewBlockedBuilder<'a, view_blocked_state::SetAuthor> { 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, { /// Set the `blocked` field (required) pub fn blocked( mut self, value: impl Into, ) -> ViewBlockedBuilder<'a, view_blocked_state::SetBlocked> { 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, { /// Set the `uri` field (required) pub fn uri( mut self, value: impl Into>, ) -> ViewBlockedBuilder<'a, view_blocked_state::SetUri> { 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::Uri: view_blocked_state::IsSet, S::Author: view_blocked_state::IsSet, S::Blocked: view_blocked_state::IsSet, { /// Build the final struct 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(), } } /// Build the final struct with custom extra_data pub fn build_with_data( self, extra_data: std::collections::BTreeMap< jacquard_common::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 {} } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Detached; type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Detached = Unset; type Uri = Unset; } ///State transition - sets the `detached` field to Set pub struct SetDetached(PhantomData S>); impl sealed::Sealed for SetDetached {} impl State for SetDetached { type Detached = Set; type Uri = S::Uri; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { type Detached = S::Detached; type Uri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `detached` field pub struct detached(()); ///Marker type for the `uri` field pub struct uri(()); } } /// Builder for constructing an instance of this type pub struct ViewDetachedBuilder<'a, S: view_detached_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option, ::core::option::Option>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> ViewDetached<'a> { /// Create a new builder for this type pub fn new() -> ViewDetachedBuilder<'a, view_detached_state::Empty> { ViewDetachedBuilder::new() } } impl<'a> ViewDetachedBuilder<'a, view_detached_state::Empty> { /// Create a new builder with all fields unset 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, { /// Set the `detached` field (required) pub fn detached( mut self, value: impl Into, ) -> ViewDetachedBuilder<'a, view_detached_state::SetDetached> { 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, { /// Set the `uri` field (required) pub fn uri( mut self, value: impl Into>, ) -> ViewDetachedBuilder<'a, view_detached_state::SetUri> { 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::Detached: view_detached_state::IsSet, S::Uri: view_detached_state::IsSet, { /// Build the final struct 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(), } } /// Build the final struct with custom extra_data pub fn build_with_data( self, extra_data: std::collections::BTreeMap< jacquard_common::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 {} } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type NotFound; type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type NotFound = Unset; type Uri = Unset; } ///State transition - sets the `not_found` field to Set pub struct SetNotFound(PhantomData S>); impl sealed::Sealed for SetNotFound {} impl State for SetNotFound { type NotFound = Set; type Uri = S::Uri; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { type NotFound = S::NotFound; type Uri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `not_found` field pub struct not_found(()); ///Marker type for the `uri` field pub struct uri(()); } } /// Builder for constructing an instance of this type pub struct ViewNotFoundBuilder<'a, S: view_not_found_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option, ::core::option::Option>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> ViewNotFound<'a> { /// Create a new builder for this type pub fn new() -> ViewNotFoundBuilder<'a, view_not_found_state::Empty> { ViewNotFoundBuilder::new() } } impl<'a> ViewNotFoundBuilder<'a, view_not_found_state::Empty> { /// Create a new builder with all fields unset 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, { /// Set the `notFound` field (required) pub fn not_found( mut self, value: impl Into, ) -> ViewNotFoundBuilder<'a, view_not_found_state::SetNotFound> { 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, { /// Set the `uri` field (required) pub fn uri( mut self, value: impl Into>, ) -> ViewNotFoundBuilder<'a, view_not_found_state::SetUri> { 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::NotFound: view_not_found_state::IsSet, S::Uri: view_not_found_state::IsSet, { /// Build the final struct 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(), } } /// Build the final struct with custom extra_data pub fn build_with_data( self, extra_data: std::collections::BTreeMap< jacquard_common::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>, >, pub indexed_at: jacquard_common::types::string::Datetime, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub labels: std::option::Option>>, #[serde(skip_serializing_if = "std::option::Option::is_none")] pub like_count: std::option::Option, #[serde(skip_serializing_if = "std::option::Option::is_none")] pub quote_count: std::option::Option, #[serde(skip_serializing_if = "std::option::Option::is_none")] pub reply_count: std::option::Option, #[serde(skip_serializing_if = "std::option::Option::is_none")] pub repost_count: std::option::Option, #[serde(borrow)] pub uri: jacquard_common::types::string::AtUri<'a>, /// The record data itself. #[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 {} } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Uri; type Cid; type Author; type Value; type IndexedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Uri = Unset; type Cid = Unset; type Author = Unset; type Value = Unset; type IndexedAt = Unset; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { type Uri = Set; type Cid = S::Cid; type Author = S::Author; type Value = S::Value; type IndexedAt = S::IndexedAt; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { type Uri = S::Uri; type Cid = Set; type Author = S::Author; type Value = S::Value; type IndexedAt = S::IndexedAt; } ///State transition - sets the `author` field to Set pub struct SetAuthor(PhantomData S>); impl sealed::Sealed for SetAuthor {} impl State for SetAuthor { type Uri = S::Uri; type Cid = S::Cid; type Author = Set; type Value = S::Value; type IndexedAt = S::IndexedAt; } ///State transition - sets the `value` field to Set pub struct SetValue(PhantomData S>); impl sealed::Sealed for SetValue {} impl State for SetValue { type Uri = S::Uri; type Cid = S::Cid; type Author = S::Author; type Value = Set; type IndexedAt = S::IndexedAt; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData S>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { type Uri = S::Uri; type Cid = S::Cid; type Author = S::Author; type Value = S::Value; type IndexedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `uri` field pub struct uri(()); ///Marker type for the `cid` field pub struct cid(()); ///Marker type for the `author` field pub struct author(()); ///Marker type for the `value` field pub struct value(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); } } /// Builder for constructing an instance of this type pub struct ViewRecordBuilder<'a, S: view_record_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>, ::core::option::Option>, ::core::option::Option< Vec>, >, ::core::option::Option, ::core::option::Option>>, ::core::option::Option, ::core::option::Option, ::core::option::Option, ::core::option::Option, ::core::option::Option>, ::core::option::Option>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> ViewRecord<'a> { /// Create a new builder for this type pub fn new() -> ViewRecordBuilder<'a, view_record_state::Empty> { ViewRecordBuilder::new() } } impl<'a> ViewRecordBuilder<'a, view_record_state::Empty> { /// Create a new builder with all fields unset 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, { /// Set the `author` field (required) pub fn author( mut self, value: impl Into>, ) -> ViewRecordBuilder<'a, view_record_state::SetAuthor> { 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, { /// Set the `cid` field (required) pub fn cid( mut self, value: impl Into>, ) -> ViewRecordBuilder<'a, view_record_state::SetCid> { 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> { /// Set the `embeds` field (optional) pub fn embeds( mut self, value: impl Into< Option>>, >, ) -> Self { self.__unsafe_private_named.2 = value.into(); self } /// Set the `embeds` field to an Option value (optional) pub fn maybe_embeds( mut self, value: Option>>, ) -> 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, { /// Set the `indexedAt` field (required) pub fn indexed_at( mut self, value: impl Into, ) -> ViewRecordBuilder<'a, view_record_state::SetIndexedAt> { 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> { /// Set the `labels` field (optional) pub fn labels( mut self, value: impl Into>>>, ) -> Self { self.__unsafe_private_named.4 = value.into(); self } /// Set the `labels` field to an Option value (optional) pub fn maybe_labels( mut self, value: Option>>, ) -> Self { self.__unsafe_private_named.4 = value; self } } impl<'a, S: view_record_state::State> ViewRecordBuilder<'a, S> { /// Set the `likeCount` field (optional) pub fn like_count(mut self, value: impl Into>) -> Self { self.__unsafe_private_named.5 = value.into(); self } /// Set the `likeCount` field to an Option value (optional) pub fn maybe_like_count(mut self, value: Option) -> Self { self.__unsafe_private_named.5 = value; self } } impl<'a, S: view_record_state::State> ViewRecordBuilder<'a, S> { /// Set the `quoteCount` field (optional) pub fn quote_count(mut self, value: impl Into>) -> Self { self.__unsafe_private_named.6 = value.into(); self } /// Set the `quoteCount` field to an Option value (optional) pub fn maybe_quote_count(mut self, value: Option) -> Self { self.__unsafe_private_named.6 = value; self } } impl<'a, S: view_record_state::State> ViewRecordBuilder<'a, S> { /// Set the `replyCount` field (optional) pub fn reply_count(mut self, value: impl Into>) -> Self { self.__unsafe_private_named.7 = value.into(); self } /// Set the `replyCount` field to an Option value (optional) pub fn maybe_reply_count(mut self, value: Option) -> Self { self.__unsafe_private_named.7 = value; self } } impl<'a, S: view_record_state::State> ViewRecordBuilder<'a, S> { /// Set the `repostCount` field (optional) pub fn repost_count(mut self, value: impl Into>) -> Self { self.__unsafe_private_named.8 = value.into(); self } /// Set the `repostCount` field to an Option value (optional) pub fn maybe_repost_count(mut self, value: Option) -> 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, { /// Set the `uri` field (required) pub fn uri( mut self, value: impl Into>, ) -> ViewRecordBuilder<'a, view_record_state::SetUri> { 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, { /// Set the `value` field (required) pub fn value( mut self, value: impl Into>, ) -> ViewRecordBuilder<'a, view_record_state::SetValue> { 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::Uri: view_record_state::IsSet, S::Cid: view_record_state::IsSet, S::Author: view_record_state::IsSet, S::Value: view_record_state::IsSet, S::IndexedAt: view_record_state::IsSet, { /// Build the final struct 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(), } } /// Build the final struct with custom extra_data pub fn build_with_data( self, extra_data: std::collections::BTreeMap< jacquard_common::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(()) } }