// @generated by jacquard-lexicon. DO NOT EDIT. // // Lexicon: app.bsky.embed.record // // 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 Record<'a> { #[serde(borrow)] pub record: crate::com_atproto::repo::strong_ref::StrongRef<'a>, } pub mod 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 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 RecordBuilder<'a, S: record_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> Record<'a> { /// Create a new builder for this type pub fn new() -> RecordBuilder<'a, record_state::Empty> { RecordBuilder::new() } } impl<'a> RecordBuilder<'a, record_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { RecordBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None,), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> RecordBuilder<'a, S> where S: record_state::State, S::Record: record_state::IsUnset, { /// Set the `record` field (required) pub fn record( mut self, value: impl Into>, ) -> RecordBuilder<'a, record_state::SetRecord> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); RecordBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> RecordBuilder<'a, S> where S: record_state::State, S::Record: record_state::IsSet, { /// Build the final struct pub fn build(self) -> Record<'a> { Record { 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>, >, ) -> Record<'a> { Record { record: self.__unsafe_private_named.0.unwrap(), extra_data: Some(extra_data), } } } fn lexicon_doc_app_bsky_embed_record() -> ::jacquard_lexicon::lexicon::LexiconDoc< 'static, > { ::jacquard_lexicon::lexicon::LexiconDoc { lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, id: ::jacquard_common::CowStr::new_static("app.bsky.embed.record"), 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("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::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("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( "app.bsky.actor.defs#profileViewBasic", ), }), ); 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::Union(::jacquard_lexicon::lexicon::LexRefUnion { description: None, refs: vec![ ::jacquard_common::CowStr::new_static("app.bsky.embed.images#view"), ::jacquard_common::CowStr::new_static("app.bsky.embed.video#view"), ::jacquard_common::CowStr::new_static("app.bsky.embed.external#view"), ::jacquard_common::CowStr::new_static("app.bsky.embed.record#view"), ::jacquard_common::CowStr::new_static("app.bsky.embed.recordWithMedia#view") ], closed: None, }), 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 Record<'a> { fn nsid() -> &'static str { "app.bsky.embed.record" } fn def_name() -> &'static str { "main" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_app_bsky_embed_record() } 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 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 = "app.bsky.embed.record#viewRecord")] ViewRecord(Box>), #[serde(rename = "app.bsky.embed.record#viewNotFound")] ViewNotFound(Box>), #[serde(rename = "app.bsky.embed.record#viewBlocked")] ViewBlocked(Box>), #[serde(rename = "app.bsky.embed.record#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 { "app.bsky.embed.record" } fn def_name() -> &'static str { "view" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_app_bsky_embed_record() } 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 Blocked; type Author; type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Blocked = Unset; type Author = Unset; type Uri = Unset; } ///State transition - sets the `blocked` field to Set pub struct SetBlocked(PhantomData S>); impl sealed::Sealed for SetBlocked {} impl State for SetBlocked { type Blocked = Set; type Author = S::Author; type Uri = S::Uri; } ///State transition - sets the `author` field to Set pub struct SetAuthor(PhantomData S>); impl sealed::Sealed for SetAuthor {} impl State for SetAuthor { type Blocked = S::Blocked; type Author = 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 Blocked = S::Blocked; type Author = S::Author; type Uri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `blocked` field pub struct blocked(()); ///Marker type for the `author` field pub struct author(()); ///Marker type for the `uri` field pub struct uri(()); } } /// 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::Blocked: view_blocked_state::IsSet, S::Author: view_blocked_state::IsSet, S::Uri: 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 { "app.bsky.embed.record" } fn def_name() -> &'static str { "viewBlocked" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_app_bsky_embed_record() } 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 { "app.bsky.embed.record" } fn def_name() -> &'static str { "viewDetached" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_app_bsky_embed_record() } 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 { "app.bsky.embed.record" } fn def_name() -> &'static str { "viewNotFound" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_app_bsky_embed_record() } 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::app_bsky::actor::ProfileViewBasic<'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>>, 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 Value; type IndexedAt; type Author; type Uri; type Cid; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Value = Unset; type IndexedAt = Unset; type Author = Unset; type Uri = Unset; type Cid = Unset; } ///State transition - sets the `value` field to Set pub struct SetValue(PhantomData S>); impl sealed::Sealed for SetValue {} impl State for SetValue { type Value = Set; type IndexedAt = S::IndexedAt; type Author = S::Author; type Uri = S::Uri; type Cid = S::Cid; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData S>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { type Value = S::Value; type IndexedAt = Set; type Author = S::Author; type Uri = S::Uri; type Cid = S::Cid; } ///State transition - sets the `author` field to Set pub struct SetAuthor(PhantomData S>); impl sealed::Sealed for SetAuthor {} impl State for SetAuthor { type Value = S::Value; type IndexedAt = S::IndexedAt; type Author = Set; type Uri = S::Uri; type Cid = S::Cid; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { type Value = S::Value; type IndexedAt = S::IndexedAt; type Author = S::Author; type Uri = Set; type Cid = S::Cid; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { type Value = S::Value; type IndexedAt = S::IndexedAt; type Author = S::Author; type Uri = S::Uri; type Cid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `value` field pub struct value(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); ///Marker type for the `author` field pub struct author(()); ///Marker type for the `uri` field pub struct uri(()); ///Marker type for the `cid` field pub struct cid(()); } } /// 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>>, ::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>>>, ) -> 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::Value: view_record_state::IsSet, S::IndexedAt: view_record_state::IsSet, S::Author: view_record_state::IsSet, S::Uri: view_record_state::IsSet, S::Cid: 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), } } } #[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 ViewRecordEmbedsItem<'a> { #[serde(rename = "app.bsky.embed.images#view")] ImagesView(Box>), #[serde(rename = "app.bsky.embed.video#view")] VideoView(Box>), #[serde(rename = "app.bsky.embed.external#view")] ExternalView(Box>), #[serde(rename = "app.bsky.embed.record#view")] View(Box>), #[serde(rename = "app.bsky.embed.recordWithMedia#view")] RecordWithMediaView(Box>), } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ViewRecord<'a> { fn nsid() -> &'static str { "app.bsky.embed.record" } fn def_name() -> &'static str { "viewRecord" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_app_bsky_embed_record() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } }