// @generated by jacquard-lexicon. DO NOT EDIT. // // Lexicon: sh.weaver.graph.defs // // This file was automatically generated from Lexicon schemas. // Any manual changes will be overwritten on the next regeneration. pub mod bookmark; pub mod follow; pub mod follow_accept; pub mod follow_gate; pub mod get_actor_bookmarks; pub mod get_actor_likes; pub mod get_actor_lists; pub mod get_actor_subscriptions; pub mod get_bookmarked_by; pub mod get_followers; pub mod get_following; pub mod get_liked_by; pub mod get_list; pub mod get_popular_tags; pub mod get_resource_tags; pub mod get_subscribers; pub mod get_tag_suggestions; pub mod get_tagged_resources; pub mod get_trending_tags; pub mod like; pub mod list; pub mod listitem; pub mod subscribe; pub mod subscribe_accept; pub mod tag; /// A community tag with how many people applied it. #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct CommunityTagCount<'a> { pub count: i64, #[serde(borrow)] pub tag: jacquard_common::CowStr<'a>, } pub mod community_tag_count_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 Count; type Tag; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Count = Unset; type Tag = Unset; } ///State transition - sets the `count` field to Set pub struct SetCount(PhantomData S>); impl sealed::Sealed for SetCount {} impl State for SetCount { type Count = Set; type Tag = S::Tag; } ///State transition - sets the `tag` field to Set pub struct SetTag(PhantomData S>); impl sealed::Sealed for SetTag {} impl State for SetTag { type Count = S::Count; type Tag = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `count` field pub struct count(()); ///Marker type for the `tag` field pub struct tag(()); } } /// Builder for constructing an instance of this type pub struct CommunityTagCountBuilder<'a, S: community_tag_count_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option, ::core::option::Option>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> CommunityTagCount<'a> { /// Create a new builder for this type pub fn new() -> CommunityTagCountBuilder<'a, community_tag_count_state::Empty> { CommunityTagCountBuilder::new() } } impl<'a> CommunityTagCountBuilder<'a, community_tag_count_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { CommunityTagCountBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None, None), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> CommunityTagCountBuilder<'a, S> where S: community_tag_count_state::State, S::Count: community_tag_count_state::IsUnset, { /// Set the `count` field (required) pub fn count( mut self, value: impl Into, ) -> CommunityTagCountBuilder<'a, community_tag_count_state::SetCount> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); CommunityTagCountBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> CommunityTagCountBuilder<'a, S> where S: community_tag_count_state::State, S::Tag: community_tag_count_state::IsUnset, { /// Set the `tag` field (required) pub fn tag( mut self, value: impl Into>, ) -> CommunityTagCountBuilder<'a, community_tag_count_state::SetTag> { self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); CommunityTagCountBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> CommunityTagCountBuilder<'a, S> where S: community_tag_count_state::State, S::Count: community_tag_count_state::IsSet, S::Tag: community_tag_count_state::IsSet, { /// Build the final struct pub fn build(self) -> CommunityTagCount<'a> { CommunityTagCount { count: self.__unsafe_private_named.0.unwrap(), tag: 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>, >, ) -> CommunityTagCount<'a> { CommunityTagCount { count: self.__unsafe_private_named.0.unwrap(), tag: self.__unsafe_private_named.1.unwrap(), extra_data: Some(extra_data), } } } fn lexicon_doc_sh_weaver_graph_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< 'static, > { ::jacquard_lexicon::lexicon::LexiconDoc { lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, id: ::jacquard_common::CowStr::new_static("sh.weaver.graph.defs"), revision: None, description: None, defs: { let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("communityTagCount"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: Some( ::jacquard_common::CowStr::new_static( "A community tag with how many people applied it.", ), ), required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("tag"), ::jacquard_common::smol_str::SmolStr::new_static("count") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("count"), ::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("tag"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: None, default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map }, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("curatelist"), ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken { description: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("listItemView"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: Some( ::jacquard_common::CowStr::new_static( "An item in a list with hydrated subject.", ), ), required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("uri"), ::jacquard_common::smol_str::SmolStr::new_static("subject") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("addedAt"), ::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("subject"), ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { description: None, refs: vec![ ::jacquard_common::CowStr::new_static("sh.weaver.notebook.defs#notebookView"), ::jacquard_common::CowStr::new_static("sh.weaver.notebook.defs#entryView") ], closed: 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("listPurpose"), ::jacquard_lexicon::lexicon::LexUserType::String(::jacquard_lexicon::lexicon::LexString { description: None, format: None, default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("listView"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: Some( ::jacquard_common::CowStr::new_static("Hydrated view of a list."), ), 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("creator"), ::jacquard_common::smol_str::SmolStr::new_static("name"), ::jacquard_common::smol_str::SmolStr::new_static("purpose"), ::jacquard_common::smol_str::SmolStr::new_static("itemCount"), ::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("avatar"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Uri, ), default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); 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("creator"), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "sh.weaver.actor.defs#profileViewBasic", ), }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "description", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: None, default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::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( "itemCount", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { description: None, default: None, minimum: None, maximum: None, r#enum: None, r#const: None, }), ); map.insert( ::jacquard_common::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: 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("purpose"), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static("#listPurpose"), }), ); 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( "viewerSubscribed", ), ::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("readinglist"), ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken { description: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("resourceTagsView"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: Some( ::jacquard_common::CowStr::new_static( "All tags for a resource, grouped by source.", ), ), required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("resource"), ::jacquard_common::smol_str::SmolStr::new_static("authorTags"), ::jacquard_common::smol_str::SmolStr::new_static("communityTags") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "authorTags", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { description: Some( ::jacquard_common::CowStr::new_static( "Tags from the record itself (author-applied).", ), ), items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { description: None, format: None, default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), min_length: None, max_length: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "communityTags", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { description: Some( ::jacquard_common::CowStr::new_static( "Aggregated community-applied tags with counts.", ), ), items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "#communityTagCount", ), }), min_length: None, max_length: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("resource"), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "com.atproto.repo.strongRef", ), }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "viewerAppliedTags", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { description: Some( ::jacquard_common::CowStr::new_static( "Tags the current viewer has applied.", ), ), items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { description: None, format: None, default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), min_length: None, max_length: None, }), ); map }, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("serieslist"), ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken { description: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("tagApplicationView"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: Some( ::jacquard_common::CowStr::new_static( "A single tag application with who applied it.", ), ), required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("uri"), ::jacquard_common::smol_str::SmolStr::new_static("tag"), ::jacquard_common::smol_str::SmolStr::new_static("appliedBy"), ::jacquard_common::smol_str::SmolStr::new_static("createdAt") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "appliedBy", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "sh.weaver.actor.defs#profileViewBasic", ), }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "createdAt", ), ::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("tag"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: None, default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::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("tagView"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: Some( ::jacquard_common::CowStr::new_static( "Aggregated view of a tag with usage statistics.", ), ), required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("tag"), ::jacquard_common::smol_str::SmolStr::new_static("useCount") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "entryCount", ), ::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( "notebookCount", ), ::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( "recentUseCount", ), ::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("tag"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: None, default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "trendingScore", ), ::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("useCount"), ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { description: None, default: None, minimum: None, maximum: None, r#enum: None, r#const: None, }), ); map }, }), ); map }, } } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for CommunityTagCount<'a> { fn nsid() -> &'static str { "sh.weaver.graph.defs" } fn def_name() -> &'static str { "communityTagCount" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_sh_weaver_graph_defs() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } } /// A curated collection of notebooks/entries for sharing. #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, Hash, jacquard_derive::IntoStatic )] pub struct Curatelist; impl std::fmt::Display for Curatelist { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "curatelist") } } /// An item in a list with hydrated subject. #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct ListItemView<'a> { #[serde(skip_serializing_if = "std::option::Option::is_none")] pub added_at: std::option::Option, #[serde(borrow)] pub subject: ListItemViewSubject<'a>, #[serde(borrow)] pub uri: jacquard_common::types::string::AtUri<'a>, } pub mod list_item_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 Uri; type Subject; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Uri = Unset; type Subject = 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 Subject = S::Subject; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData S>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { type Uri = S::Uri; type Subject = 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 `subject` field pub struct subject(()); } } /// Builder for constructing an instance of this type pub struct ListItemViewBuilder<'a, S: list_item_view_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> ListItemView<'a> { /// Create a new builder for this type pub fn new() -> ListItemViewBuilder<'a, list_item_view_state::Empty> { ListItemViewBuilder::new() } } impl<'a> ListItemViewBuilder<'a, list_item_view_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { ListItemViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None, None, None), _phantom: ::core::marker::PhantomData, } } } impl<'a, S: list_item_view_state::State> ListItemViewBuilder<'a, S> { /// Set the `addedAt` field (optional) pub fn added_at( mut self, value: impl Into>, ) -> Self { self.__unsafe_private_named.0 = value.into(); self } /// Set the `addedAt` field to an Option value (optional) pub fn maybe_added_at( mut self, value: Option, ) -> Self { self.__unsafe_private_named.0 = value; self } } impl<'a, S> ListItemViewBuilder<'a, S> where S: list_item_view_state::State, S::Subject: list_item_view_state::IsUnset, { /// Set the `subject` field (required) pub fn subject( mut self, value: impl Into>, ) -> ListItemViewBuilder<'a, list_item_view_state::SetSubject> { self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); ListItemViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> ListItemViewBuilder<'a, S> where S: list_item_view_state::State, S::Uri: list_item_view_state::IsUnset, { /// Set the `uri` field (required) pub fn uri( mut self, value: impl Into>, ) -> ListItemViewBuilder<'a, list_item_view_state::SetUri> { self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); ListItemViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> ListItemViewBuilder<'a, S> where S: list_item_view_state::State, S::Uri: list_item_view_state::IsSet, S::Subject: list_item_view_state::IsSet, { /// Build the final struct pub fn build(self) -> ListItemView<'a> { ListItemView { added_at: self.__unsafe_private_named.0, subject: 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>, >, ) -> ListItemView<'a> { ListItemView { added_at: self.__unsafe_private_named.0, subject: self.__unsafe_private_named.1.unwrap(), uri: self.__unsafe_private_named.2.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 ListItemViewSubject<'a> { #[serde(rename = "sh.weaver.notebook.defs#notebookView")] NotebookView(Box>), #[serde(rename = "sh.weaver.notebook.defs#entryView")] EntryView(Box>), } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ListItemView<'a> { fn nsid() -> &'static str { "sh.weaver.graph.defs" } fn def_name() -> &'static str { "listItemView" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_sh_weaver_graph_defs() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum ListPurpose<'a> { ShWeaverGraphDefsCuratelist, ShWeaverGraphDefsReadinglist, ShWeaverGraphDefsSerieslist, Other(jacquard_common::CowStr<'a>), } impl<'a> ListPurpose<'a> { pub fn as_str(&self) -> &str { match self { Self::ShWeaverGraphDefsCuratelist => "sh.weaver.graph.defs#curatelist", Self::ShWeaverGraphDefsReadinglist => "sh.weaver.graph.defs#readinglist", Self::ShWeaverGraphDefsSerieslist => "sh.weaver.graph.defs#serieslist", Self::Other(s) => s.as_ref(), } } } impl<'a> From<&'a str> for ListPurpose<'a> { fn from(s: &'a str) -> Self { match s { "sh.weaver.graph.defs#curatelist" => Self::ShWeaverGraphDefsCuratelist, "sh.weaver.graph.defs#readinglist" => Self::ShWeaverGraphDefsReadinglist, "sh.weaver.graph.defs#serieslist" => Self::ShWeaverGraphDefsSerieslist, _ => Self::Other(jacquard_common::CowStr::from(s)), } } } impl<'a> From for ListPurpose<'a> { fn from(s: String) -> Self { match s.as_str() { "sh.weaver.graph.defs#curatelist" => Self::ShWeaverGraphDefsCuratelist, "sh.weaver.graph.defs#readinglist" => Self::ShWeaverGraphDefsReadinglist, "sh.weaver.graph.defs#serieslist" => Self::ShWeaverGraphDefsSerieslist, _ => Self::Other(jacquard_common::CowStr::from(s)), } } } impl<'a> AsRef for ListPurpose<'a> { fn as_ref(&self) -> &str { self.as_str() } } impl<'a> core::fmt::Display for ListPurpose<'a> { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { write!(f, "{}", self.as_str()) } } impl<'a> serde::Serialize for ListPurpose<'a> { fn serialize(&self, serializer: S) -> Result where S: serde::Serializer, { serializer.serialize_str(self.as_str()) } } impl<'de, 'a> serde::Deserialize<'de> for ListPurpose<'a> where 'de: 'a, { fn deserialize(deserializer: D) -> Result where D: serde::Deserializer<'de>, { let s = <&'de str>::deserialize(deserializer)?; Ok(Self::from(s)) } } impl jacquard_common::IntoStatic for ListPurpose<'_> { type Output = ListPurpose<'static>; fn into_static(self) -> Self::Output { match self { ListPurpose::ShWeaverGraphDefsCuratelist => { ListPurpose::ShWeaverGraphDefsCuratelist } ListPurpose::ShWeaverGraphDefsReadinglist => { ListPurpose::ShWeaverGraphDefsReadinglist } ListPurpose::ShWeaverGraphDefsSerieslist => { ListPurpose::ShWeaverGraphDefsSerieslist } ListPurpose::Other(v) => ListPurpose::Other(v.into_static()), } } } /// Hydrated view of a list. #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct ListView<'a> { #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub avatar: std::option::Option>, #[serde(borrow)] pub cid: jacquard_common::types::string::Cid<'a>, #[serde(borrow)] pub creator: crate::sh_weaver::actor::ProfileViewBasic<'a>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub description: std::option::Option>, pub indexed_at: jacquard_common::types::string::Datetime, pub item_count: i64, #[serde(borrow)] pub name: jacquard_common::CowStr<'a>, #[serde(borrow)] pub purpose: crate::sh_weaver::graph::ListPurpose<'a>, #[serde(borrow)] pub uri: jacquard_common::types::string::AtUri<'a>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub viewer_subscribed: std::option::Option< jacquard_common::types::string::AtUri<'a>, >, } pub mod list_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 Uri; type ItemCount; type Creator; type Cid; type Name; type Purpose; 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 ItemCount = Unset; type Creator = Unset; type Cid = Unset; type Name = Unset; type Purpose = 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 ItemCount = S::ItemCount; type Creator = S::Creator; type Cid = S::Cid; type Name = S::Name; type Purpose = S::Purpose; type IndexedAt = S::IndexedAt; } ///State transition - sets the `item_count` field to Set pub struct SetItemCount(PhantomData S>); impl sealed::Sealed for SetItemCount {} impl State for SetItemCount { type Uri = S::Uri; type ItemCount = Set; type Creator = S::Creator; type Cid = S::Cid; type Name = S::Name; type Purpose = S::Purpose; type IndexedAt = S::IndexedAt; } ///State transition - sets the `creator` field to Set pub struct SetCreator(PhantomData S>); impl sealed::Sealed for SetCreator {} impl State for SetCreator { type Uri = S::Uri; type ItemCount = S::ItemCount; type Creator = Set; type Cid = S::Cid; type Name = S::Name; type Purpose = S::Purpose; 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 ItemCount = S::ItemCount; type Creator = S::Creator; type Cid = Set; type Name = S::Name; type Purpose = S::Purpose; type IndexedAt = S::IndexedAt; } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData S>); impl sealed::Sealed for SetName {} impl State for SetName { type Uri = S::Uri; type ItemCount = S::ItemCount; type Creator = S::Creator; type Cid = S::Cid; type Name = Set; type Purpose = S::Purpose; type IndexedAt = S::IndexedAt; } ///State transition - sets the `purpose` field to Set pub struct SetPurpose(PhantomData S>); impl sealed::Sealed for SetPurpose {} impl State for SetPurpose { type Uri = S::Uri; type ItemCount = S::ItemCount; type Creator = S::Creator; type Cid = S::Cid; type Name = S::Name; type Purpose = 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 ItemCount = S::ItemCount; type Creator = S::Creator; type Cid = S::Cid; type Name = S::Name; type Purpose = S::Purpose; 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 `item_count` field pub struct item_count(()); ///Marker type for the `creator` field pub struct creator(()); ///Marker type for the `cid` field pub struct cid(()); ///Marker type for the `name` field pub struct name(()); ///Marker type for the `purpose` field pub struct purpose(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); } } /// Builder for constructing an instance of this type pub struct ListViewBuilder<'a, S: list_view_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>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> ListView<'a> { /// Create a new builder for this type pub fn new() -> ListViewBuilder<'a, list_view_state::Empty> { ListViewBuilder::new() } } impl<'a> ListViewBuilder<'a, list_view_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { ListViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: ( None, None, None, None, None, None, None, None, None, None, ), _phantom: ::core::marker::PhantomData, } } } impl<'a, S: list_view_state::State> ListViewBuilder<'a, S> { /// Set the `avatar` field (optional) pub fn avatar( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.0 = value.into(); self } /// Set the `avatar` field to an Option value (optional) pub fn maybe_avatar( mut self, value: Option>, ) -> Self { self.__unsafe_private_named.0 = value; self } } impl<'a, S> ListViewBuilder<'a, S> where S: list_view_state::State, S::Cid: list_view_state::IsUnset, { /// Set the `cid` field (required) pub fn cid( mut self, value: impl Into>, ) -> ListViewBuilder<'a, list_view_state::SetCid> { self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); ListViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> ListViewBuilder<'a, S> where S: list_view_state::State, S::Creator: list_view_state::IsUnset, { /// Set the `creator` field (required) pub fn creator( mut self, value: impl Into>, ) -> ListViewBuilder<'a, list_view_state::SetCreator> { self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); ListViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S: list_view_state::State> ListViewBuilder<'a, S> { /// Set the `description` field (optional) pub fn description( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.3 = value.into(); self } /// Set the `description` field to an Option value (optional) pub fn maybe_description( mut self, value: Option>, ) -> Self { self.__unsafe_private_named.3 = value; self } } impl<'a, S> ListViewBuilder<'a, S> where S: list_view_state::State, S::IndexedAt: list_view_state::IsUnset, { /// Set the `indexedAt` field (required) pub fn indexed_at( mut self, value: impl Into, ) -> ListViewBuilder<'a, list_view_state::SetIndexedAt> { self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); ListViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> ListViewBuilder<'a, S> where S: list_view_state::State, S::ItemCount: list_view_state::IsUnset, { /// Set the `itemCount` field (required) pub fn item_count( mut self, value: impl Into, ) -> ListViewBuilder<'a, list_view_state::SetItemCount> { self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); ListViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> ListViewBuilder<'a, S> where S: list_view_state::State, S::Name: list_view_state::IsUnset, { /// Set the `name` field (required) pub fn name( mut self, value: impl Into>, ) -> ListViewBuilder<'a, list_view_state::SetName> { self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); ListViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> ListViewBuilder<'a, S> where S: list_view_state::State, S::Purpose: list_view_state::IsUnset, { /// Set the `purpose` field (required) pub fn purpose( mut self, value: impl Into>, ) -> ListViewBuilder<'a, list_view_state::SetPurpose> { self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into()); ListViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> ListViewBuilder<'a, S> where S: list_view_state::State, S::Uri: list_view_state::IsUnset, { /// Set the `uri` field (required) pub fn uri( mut self, value: impl Into>, ) -> ListViewBuilder<'a, list_view_state::SetUri> { self.__unsafe_private_named.8 = ::core::option::Option::Some(value.into()); ListViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S: list_view_state::State> ListViewBuilder<'a, S> { /// Set the `viewerSubscribed` field (optional) pub fn viewer_subscribed( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.9 = value.into(); self } /// Set the `viewerSubscribed` field to an Option value (optional) pub fn maybe_viewer_subscribed( mut self, value: Option>, ) -> Self { self.__unsafe_private_named.9 = value; self } } impl<'a, S> ListViewBuilder<'a, S> where S: list_view_state::State, S::Uri: list_view_state::IsSet, S::ItemCount: list_view_state::IsSet, S::Creator: list_view_state::IsSet, S::Cid: list_view_state::IsSet, S::Name: list_view_state::IsSet, S::Purpose: list_view_state::IsSet, S::IndexedAt: list_view_state::IsSet, { /// Build the final struct pub fn build(self) -> ListView<'a> { ListView { avatar: self.__unsafe_private_named.0, cid: self.__unsafe_private_named.1.unwrap(), creator: self.__unsafe_private_named.2.unwrap(), description: self.__unsafe_private_named.3, indexed_at: self.__unsafe_private_named.4.unwrap(), item_count: self.__unsafe_private_named.5.unwrap(), name: self.__unsafe_private_named.6.unwrap(), purpose: self.__unsafe_private_named.7.unwrap(), uri: self.__unsafe_private_named.8.unwrap(), viewer_subscribed: self.__unsafe_private_named.9, 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>, >, ) -> ListView<'a> { ListView { avatar: self.__unsafe_private_named.0, cid: self.__unsafe_private_named.1.unwrap(), creator: self.__unsafe_private_named.2.unwrap(), description: self.__unsafe_private_named.3, indexed_at: self.__unsafe_private_named.4.unwrap(), item_count: self.__unsafe_private_named.5.unwrap(), name: self.__unsafe_private_named.6.unwrap(), purpose: self.__unsafe_private_named.7.unwrap(), uri: self.__unsafe_private_named.8.unwrap(), viewer_subscribed: self.__unsafe_private_named.9, extra_data: Some(extra_data), } } } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ListView<'a> { fn nsid() -> &'static str { "sh.weaver.graph.defs" } fn def_name() -> &'static str { "listView" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_sh_weaver_graph_defs() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } } /// A personal reading list. #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, Hash, jacquard_derive::IntoStatic )] pub struct Readinglist; impl std::fmt::Display for Readinglist { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "readinglist") } } /// All tags for a resource, grouped by source. #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct ResourceTagsView<'a> { /// Tags from the record itself (author-applied). #[serde(borrow)] pub author_tags: Vec>, /// Aggregated community-applied tags with counts. #[serde(borrow)] pub community_tags: Vec>, #[serde(borrow)] pub resource: crate::com_atproto::repo::strong_ref::StrongRef<'a>, /// Tags the current viewer has applied. #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub viewer_applied_tags: std::option::Option>>, } pub mod resource_tags_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 CommunityTags; type Resource; type AuthorTags; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type CommunityTags = Unset; type Resource = Unset; type AuthorTags = Unset; } ///State transition - sets the `community_tags` field to Set pub struct SetCommunityTags(PhantomData S>); impl sealed::Sealed for SetCommunityTags {} impl State for SetCommunityTags { type CommunityTags = Set; type Resource = S::Resource; type AuthorTags = S::AuthorTags; } ///State transition - sets the `resource` field to Set pub struct SetResource(PhantomData S>); impl sealed::Sealed for SetResource {} impl State for SetResource { type CommunityTags = S::CommunityTags; type Resource = Set; type AuthorTags = S::AuthorTags; } ///State transition - sets the `author_tags` field to Set pub struct SetAuthorTags(PhantomData S>); impl sealed::Sealed for SetAuthorTags {} impl State for SetAuthorTags { type CommunityTags = S::CommunityTags; type Resource = S::Resource; type AuthorTags = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `community_tags` field pub struct community_tags(()); ///Marker type for the `resource` field pub struct resource(()); ///Marker type for the `author_tags` field pub struct author_tags(()); } } /// Builder for constructing an instance of this type pub struct ResourceTagsViewBuilder<'a, S: resource_tags_view_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>>, ::core::option::Option>>, ::core::option::Option>, ::core::option::Option>>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> ResourceTagsView<'a> { /// Create a new builder for this type pub fn new() -> ResourceTagsViewBuilder<'a, resource_tags_view_state::Empty> { ResourceTagsViewBuilder::new() } } impl<'a> ResourceTagsViewBuilder<'a, resource_tags_view_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { ResourceTagsViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None, None, None, None), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> ResourceTagsViewBuilder<'a, S> where S: resource_tags_view_state::State, S::AuthorTags: resource_tags_view_state::IsUnset, { /// Set the `authorTags` field (required) pub fn author_tags( mut self, value: impl Into>>, ) -> ResourceTagsViewBuilder<'a, resource_tags_view_state::SetAuthorTags> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); ResourceTagsViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> ResourceTagsViewBuilder<'a, S> where S: resource_tags_view_state::State, S::CommunityTags: resource_tags_view_state::IsUnset, { /// Set the `communityTags` field (required) pub fn community_tags( mut self, value: impl Into>>, ) -> ResourceTagsViewBuilder<'a, resource_tags_view_state::SetCommunityTags> { self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); ResourceTagsViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> ResourceTagsViewBuilder<'a, S> where S: resource_tags_view_state::State, S::Resource: resource_tags_view_state::IsUnset, { /// Set the `resource` field (required) pub fn resource( mut self, value: impl Into>, ) -> ResourceTagsViewBuilder<'a, resource_tags_view_state::SetResource> { self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); ResourceTagsViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S: resource_tags_view_state::State> ResourceTagsViewBuilder<'a, S> { /// Set the `viewerAppliedTags` field (optional) pub fn viewer_applied_tags( mut self, value: impl Into>>>, ) -> Self { self.__unsafe_private_named.3 = value.into(); self } /// Set the `viewerAppliedTags` field to an Option value (optional) pub fn maybe_viewer_applied_tags( mut self, value: Option>>, ) -> Self { self.__unsafe_private_named.3 = value; self } } impl<'a, S> ResourceTagsViewBuilder<'a, S> where S: resource_tags_view_state::State, S::CommunityTags: resource_tags_view_state::IsSet, S::Resource: resource_tags_view_state::IsSet, S::AuthorTags: resource_tags_view_state::IsSet, { /// Build the final struct pub fn build(self) -> ResourceTagsView<'a> { ResourceTagsView { author_tags: self.__unsafe_private_named.0.unwrap(), community_tags: self.__unsafe_private_named.1.unwrap(), resource: self.__unsafe_private_named.2.unwrap(), viewer_applied_tags: self.__unsafe_private_named.3, 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>, >, ) -> ResourceTagsView<'a> { ResourceTagsView { author_tags: self.__unsafe_private_named.0.unwrap(), community_tags: self.__unsafe_private_named.1.unwrap(), resource: self.__unsafe_private_named.2.unwrap(), viewer_applied_tags: self.__unsafe_private_named.3, extra_data: Some(extra_data), } } } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ResourceTagsView<'a> { fn nsid() -> &'static str { "sh.weaver.graph.defs" } fn def_name() -> &'static str { "resourceTagsView" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_sh_weaver_graph_defs() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } } /// An ordered series of related works (sequels, spin-offs). #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, Hash, jacquard_derive::IntoStatic )] pub struct Serieslist; impl std::fmt::Display for Serieslist { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "serieslist") } } /// A single tag application with who applied it. #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct TagApplicationView<'a> { #[serde(borrow)] pub applied_by: crate::sh_weaver::actor::ProfileViewBasic<'a>, pub created_at: jacquard_common::types::string::Datetime, #[serde(borrow)] pub tag: jacquard_common::CowStr<'a>, #[serde(borrow)] pub uri: jacquard_common::types::string::AtUri<'a>, } pub mod tag_application_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 AppliedBy; type Uri; type Tag; type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type AppliedBy = Unset; type Uri = Unset; type Tag = Unset; type CreatedAt = Unset; } ///State transition - sets the `applied_by` field to Set pub struct SetAppliedBy(PhantomData S>); impl sealed::Sealed for SetAppliedBy {} impl State for SetAppliedBy { type AppliedBy = Set; type Uri = S::Uri; type Tag = S::Tag; type CreatedAt = S::CreatedAt; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { type AppliedBy = S::AppliedBy; type Uri = Set; type Tag = S::Tag; type CreatedAt = S::CreatedAt; } ///State transition - sets the `tag` field to Set pub struct SetTag(PhantomData S>); impl sealed::Sealed for SetTag {} impl State for SetTag { type AppliedBy = S::AppliedBy; type Uri = S::Uri; type Tag = Set; type CreatedAt = S::CreatedAt; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { type AppliedBy = S::AppliedBy; type Uri = S::Uri; type Tag = S::Tag; type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `applied_by` field pub struct applied_by(()); ///Marker type for the `uri` field pub struct uri(()); ///Marker type for the `tag` field pub struct tag(()); ///Marker type for the `created_at` field pub struct created_at(()); } } /// Builder for constructing an instance of this type pub struct TagApplicationViewBuilder<'a, S: tag_application_view_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>, ::core::option::Option, ::core::option::Option>, ::core::option::Option>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> TagApplicationView<'a> { /// Create a new builder for this type pub fn new() -> TagApplicationViewBuilder<'a, tag_application_view_state::Empty> { TagApplicationViewBuilder::new() } } impl<'a> TagApplicationViewBuilder<'a, tag_application_view_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { TagApplicationViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None, None, None, None), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> TagApplicationViewBuilder<'a, S> where S: tag_application_view_state::State, S::AppliedBy: tag_application_view_state::IsUnset, { /// Set the `appliedBy` field (required) pub fn applied_by( mut self, value: impl Into>, ) -> TagApplicationViewBuilder<'a, tag_application_view_state::SetAppliedBy> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); TagApplicationViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> TagApplicationViewBuilder<'a, S> where S: tag_application_view_state::State, S::CreatedAt: tag_application_view_state::IsUnset, { /// Set the `createdAt` field (required) pub fn created_at( mut self, value: impl Into, ) -> TagApplicationViewBuilder<'a, tag_application_view_state::SetCreatedAt> { self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); TagApplicationViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> TagApplicationViewBuilder<'a, S> where S: tag_application_view_state::State, S::Tag: tag_application_view_state::IsUnset, { /// Set the `tag` field (required) pub fn tag( mut self, value: impl Into>, ) -> TagApplicationViewBuilder<'a, tag_application_view_state::SetTag> { self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); TagApplicationViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> TagApplicationViewBuilder<'a, S> where S: tag_application_view_state::State, S::Uri: tag_application_view_state::IsUnset, { /// Set the `uri` field (required) pub fn uri( mut self, value: impl Into>, ) -> TagApplicationViewBuilder<'a, tag_application_view_state::SetUri> { self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); TagApplicationViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> TagApplicationViewBuilder<'a, S> where S: tag_application_view_state::State, S::AppliedBy: tag_application_view_state::IsSet, S::Uri: tag_application_view_state::IsSet, S::Tag: tag_application_view_state::IsSet, S::CreatedAt: tag_application_view_state::IsSet, { /// Build the final struct pub fn build(self) -> TagApplicationView<'a> { TagApplicationView { applied_by: self.__unsafe_private_named.0.unwrap(), created_at: self.__unsafe_private_named.1.unwrap(), tag: self.__unsafe_private_named.2.unwrap(), uri: self.__unsafe_private_named.3.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>, >, ) -> TagApplicationView<'a> { TagApplicationView { applied_by: self.__unsafe_private_named.0.unwrap(), created_at: self.__unsafe_private_named.1.unwrap(), tag: self.__unsafe_private_named.2.unwrap(), uri: self.__unsafe_private_named.3.unwrap(), extra_data: Some(extra_data), } } } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for TagApplicationView<'a> { fn nsid() -> &'static str { "sh.weaver.graph.defs" } fn def_name() -> &'static str { "tagApplicationView" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_sh_weaver_graph_defs() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } } /// Aggregated view of a tag with usage statistics. #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct TagView<'a> { #[serde(skip_serializing_if = "std::option::Option::is_none")] pub entry_count: std::option::Option, #[serde(skip_serializing_if = "std::option::Option::is_none")] pub notebook_count: std::option::Option, /// Uses in the last 30 days. #[serde(skip_serializing_if = "std::option::Option::is_none")] pub recent_use_count: std::option::Option, #[serde(borrow)] pub tag: jacquard_common::CowStr<'a>, /// Appview-computed trending score. #[serde(skip_serializing_if = "std::option::Option::is_none")] pub trending_score: std::option::Option, /// Total number of resources tagged with this tag. pub use_count: i64, } pub mod tag_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 Tag; type UseCount; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Tag = Unset; type UseCount = Unset; } ///State transition - sets the `tag` field to Set pub struct SetTag(PhantomData S>); impl sealed::Sealed for SetTag {} impl State for SetTag { type Tag = Set; type UseCount = S::UseCount; } ///State transition - sets the `use_count` field to Set pub struct SetUseCount(PhantomData S>); impl sealed::Sealed for SetUseCount {} impl State for SetUseCount { type Tag = S::Tag; type UseCount = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `tag` field pub struct tag(()); ///Marker type for the `use_count` field pub struct use_count(()); } } /// Builder for constructing an instance of this type pub struct TagViewBuilder<'a, S: tag_view_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, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> TagView<'a> { /// Create a new builder for this type pub fn new() -> TagViewBuilder<'a, tag_view_state::Empty> { TagViewBuilder::new() } } impl<'a> TagViewBuilder<'a, tag_view_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { TagViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None, None, None, None, None, None), _phantom: ::core::marker::PhantomData, } } } impl<'a, S: tag_view_state::State> TagViewBuilder<'a, S> { /// Set the `entryCount` field (optional) pub fn entry_count(mut self, value: impl Into>) -> Self { self.__unsafe_private_named.0 = value.into(); self } /// Set the `entryCount` field to an Option value (optional) pub fn maybe_entry_count(mut self, value: Option) -> Self { self.__unsafe_private_named.0 = value; self } } impl<'a, S: tag_view_state::State> TagViewBuilder<'a, S> { /// Set the `notebookCount` field (optional) pub fn notebook_count(mut self, value: impl Into>) -> Self { self.__unsafe_private_named.1 = value.into(); self } /// Set the `notebookCount` field to an Option value (optional) pub fn maybe_notebook_count(mut self, value: Option) -> Self { self.__unsafe_private_named.1 = value; self } } impl<'a, S: tag_view_state::State> TagViewBuilder<'a, S> { /// Set the `recentUseCount` field (optional) pub fn recent_use_count(mut self, value: impl Into>) -> Self { self.__unsafe_private_named.2 = value.into(); self } /// Set the `recentUseCount` field to an Option value (optional) pub fn maybe_recent_use_count(mut self, value: Option) -> Self { self.__unsafe_private_named.2 = value; self } } impl<'a, S> TagViewBuilder<'a, S> where S: tag_view_state::State, S::Tag: tag_view_state::IsUnset, { /// Set the `tag` field (required) pub fn tag( mut self, value: impl Into>, ) -> TagViewBuilder<'a, tag_view_state::SetTag> { self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); TagViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S: tag_view_state::State> TagViewBuilder<'a, S> { /// Set the `trendingScore` field (optional) pub fn trending_score(mut self, value: impl Into>) -> Self { self.__unsafe_private_named.4 = value.into(); self } /// Set the `trendingScore` field to an Option value (optional) pub fn maybe_trending_score(mut self, value: Option) -> Self { self.__unsafe_private_named.4 = value; self } } impl<'a, S> TagViewBuilder<'a, S> where S: tag_view_state::State, S::UseCount: tag_view_state::IsUnset, { /// Set the `useCount` field (required) pub fn use_count( mut self, value: impl Into, ) -> TagViewBuilder<'a, tag_view_state::SetUseCount> { self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); TagViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> TagViewBuilder<'a, S> where S: tag_view_state::State, S::Tag: tag_view_state::IsSet, S::UseCount: tag_view_state::IsSet, { /// Build the final struct pub fn build(self) -> TagView<'a> { TagView { entry_count: self.__unsafe_private_named.0, notebook_count: self.__unsafe_private_named.1, recent_use_count: self.__unsafe_private_named.2, tag: self.__unsafe_private_named.3.unwrap(), trending_score: self.__unsafe_private_named.4, use_count: self.__unsafe_private_named.5.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>, >, ) -> TagView<'a> { TagView { entry_count: self.__unsafe_private_named.0, notebook_count: self.__unsafe_private_named.1, recent_use_count: self.__unsafe_private_named.2, tag: self.__unsafe_private_named.3.unwrap(), trending_score: self.__unsafe_private_named.4, use_count: self.__unsafe_private_named.5.unwrap(), extra_data: Some(extra_data), } } } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for TagView<'a> { fn nsid() -> &'static str { "sh.weaver.graph.defs" } fn def_name() -> &'static str { "tagView" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_sh_weaver_graph_defs() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } }