// @generated by jacquard-lexicon. DO NOT EDIT. // // Lexicon: com.whtwnd.blog.defs // // This file was automatically generated from Lexicon schemas. // Any manual changes will be overwritten on the next regeneration. pub mod entry; pub mod get_author_posts; pub mod get_entry_metadata_by_name; pub mod get_mentions_by_entry; pub mod notify_of_new_entry; #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct BlobMetadata<'a> { #[serde(borrow)] pub blobref: jacquard_common::types::blob::BlobRef<'a>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub name: std::option::Option>, } pub mod blob_metadata_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 Blobref; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Blobref = Unset; } ///State transition - sets the `blobref` field to Set pub struct SetBlobref(PhantomData S>); impl sealed::Sealed for SetBlobref {} impl State for SetBlobref { type Blobref = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `blobref` field pub struct blobref(()); } } /// Builder for constructing an instance of this type pub struct BlobMetadataBuilder<'a, S: blob_metadata_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>, ::core::option::Option>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> BlobMetadata<'a> { /// Create a new builder for this type pub fn new() -> BlobMetadataBuilder<'a, blob_metadata_state::Empty> { BlobMetadataBuilder::new() } } impl<'a> BlobMetadataBuilder<'a, blob_metadata_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { BlobMetadataBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None, None), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> BlobMetadataBuilder<'a, S> where S: blob_metadata_state::State, S::Blobref: blob_metadata_state::IsUnset, { /// Set the `blobref` field (required) pub fn blobref( mut self, value: impl Into>, ) -> BlobMetadataBuilder<'a, blob_metadata_state::SetBlobref> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); BlobMetadataBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S: blob_metadata_state::State> BlobMetadataBuilder<'a, S> { /// Set the `name` field (optional) pub fn name( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.1 = value.into(); self } /// Set the `name` field to an Option value (optional) pub fn maybe_name(mut self, value: Option>) -> Self { self.__unsafe_private_named.1 = value; self } } impl<'a, S> BlobMetadataBuilder<'a, S> where S: blob_metadata_state::State, S::Blobref: blob_metadata_state::IsSet, { /// Build the final struct pub fn build(self) -> BlobMetadata<'a> { BlobMetadata { blobref: self.__unsafe_private_named.0.unwrap(), name: self.__unsafe_private_named.1, 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>, >, ) -> BlobMetadata<'a> { BlobMetadata { blobref: self.__unsafe_private_named.0.unwrap(), name: self.__unsafe_private_named.1, extra_data: Some(extra_data), } } } fn lexicon_doc_com_whtwnd_blog_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< 'static, > { ::jacquard_lexicon::lexicon::LexiconDoc { lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, id: ::jacquard_common::CowStr::new_static("com.whtwnd.blog.defs"), revision: None, description: None, defs: { let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("blobMetadata"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: None, required: Some( vec![::jacquard_common::smol_str::SmolStr::new_static("blobref")], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("blobref"), ::jacquard_lexicon::lexicon::LexObjectProperty::Blob(::jacquard_lexicon::lexicon::LexBlob { description: None, accept: None, max_size: 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 }, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("blogEntry"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: None, required: Some( vec![::jacquard_common::smol_str::SmolStr::new_static("content")], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("content"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: None, default: None, min_length: None, max_length: Some(100000usize), min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); 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 }, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("comment"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: None, required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("content"), ::jacquard_common::smol_str::SmolStr::new_static("entryUri") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("content"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: None, default: None, min_length: None, max_length: Some(1000usize), min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("entryUri"), ::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("ogp"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: None, required: Some( vec![::jacquard_common::smol_str::SmolStr::new_static("url")], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("height"), ::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("url"), ::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("width"), ::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 BlobMetadata<'a> { fn nsid() -> &'static str { "com.whtwnd.blog.defs" } fn def_name() -> &'static str { "blobMetadata" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_com_whtwnd_blog_defs() } 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, Default )] #[serde(rename_all = "camelCase")] pub struct BlogEntry<'a> { #[serde(borrow)] pub content: jacquard_common::CowStr<'a>, #[serde(skip_serializing_if = "std::option::Option::is_none")] pub created_at: std::option::Option, } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for BlogEntry<'a> { fn nsid() -> &'static str { "com.whtwnd.blog.defs" } fn def_name() -> &'static str { "blogEntry" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_com_whtwnd_blog_defs() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { { let value = &self.content; #[allow(unused_comparisons)] if ::len(value.as_ref()) > 100000usize { return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { path: ::jacquard_lexicon::validation::ValidationPath::from_field( "content", ), max: 100000usize, actual: ::len(value.as_ref()), }); } } Ok(()) } } #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct Comment<'a> { #[serde(borrow)] pub content: jacquard_common::CowStr<'a>, #[serde(borrow)] pub entry_uri: jacquard_common::types::string::AtUri<'a>, } pub mod comment_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 Content; type EntryUri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Content = Unset; type EntryUri = Unset; } ///State transition - sets the `content` field to Set pub struct SetContent(PhantomData S>); impl sealed::Sealed for SetContent {} impl State for SetContent { type Content = Set; type EntryUri = S::EntryUri; } ///State transition - sets the `entry_uri` field to Set pub struct SetEntryUri(PhantomData S>); impl sealed::Sealed for SetEntryUri {} impl State for SetEntryUri { type Content = S::Content; type EntryUri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `content` field pub struct content(()); ///Marker type for the `entry_uri` field pub struct entry_uri(()); } } /// Builder for constructing an instance of this type pub struct CommentBuilder<'a, S: comment_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>, ::core::option::Option>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> Comment<'a> { /// Create a new builder for this type pub fn new() -> CommentBuilder<'a, comment_state::Empty> { CommentBuilder::new() } } impl<'a> CommentBuilder<'a, comment_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { CommentBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None, None), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> CommentBuilder<'a, S> where S: comment_state::State, S::Content: comment_state::IsUnset, { /// Set the `content` field (required) pub fn content( mut self, value: impl Into>, ) -> CommentBuilder<'a, comment_state::SetContent> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); CommentBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> CommentBuilder<'a, S> where S: comment_state::State, S::EntryUri: comment_state::IsUnset, { /// Set the `entryUri` field (required) pub fn entry_uri( mut self, value: impl Into>, ) -> CommentBuilder<'a, comment_state::SetEntryUri> { self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); CommentBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> CommentBuilder<'a, S> where S: comment_state::State, S::Content: comment_state::IsSet, S::EntryUri: comment_state::IsSet, { /// Build the final struct pub fn build(self) -> Comment<'a> { Comment { content: self.__unsafe_private_named.0.unwrap(), entry_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>, >, ) -> Comment<'a> { Comment { content: self.__unsafe_private_named.0.unwrap(), entry_uri: self.__unsafe_private_named.1.unwrap(), extra_data: Some(extra_data), } } } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Comment<'a> { fn nsid() -> &'static str { "com.whtwnd.blog.defs" } fn def_name() -> &'static str { "comment" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_com_whtwnd_blog_defs() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { { let value = &self.content; #[allow(unused_comparisons)] if ::len(value.as_ref()) > 1000usize { return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { path: ::jacquard_lexicon::validation::ValidationPath::from_field( "content", ), max: 1000usize, actual: ::len(value.as_ref()), }); } } Ok(()) } } #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct Ogp<'a> { #[serde(skip_serializing_if = "std::option::Option::is_none")] pub height: std::option::Option, #[serde(borrow)] pub url: jacquard_common::types::string::Uri<'a>, #[serde(skip_serializing_if = "std::option::Option::is_none")] pub width: std::option::Option, } pub mod ogp_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 Url; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Url = Unset; } ///State transition - sets the `url` field to Set pub struct SetUrl(PhantomData S>); impl sealed::Sealed for SetUrl {} impl State for SetUrl { type Url = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `url` field pub struct url(()); } } /// Builder for constructing an instance of this type pub struct OgpBuilder<'a, S: ogp_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> Ogp<'a> { /// Create a new builder for this type pub fn new() -> OgpBuilder<'a, ogp_state::Empty> { OgpBuilder::new() } } impl<'a> OgpBuilder<'a, ogp_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { OgpBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None, None, None), _phantom: ::core::marker::PhantomData, } } } impl<'a, S: ogp_state::State> OgpBuilder<'a, S> { /// Set the `height` field (optional) pub fn height(mut self, value: impl Into>) -> Self { self.__unsafe_private_named.0 = value.into(); self } /// Set the `height` field to an Option value (optional) pub fn maybe_height(mut self, value: Option) -> Self { self.__unsafe_private_named.0 = value; self } } impl<'a, S> OgpBuilder<'a, S> where S: ogp_state::State, S::Url: ogp_state::IsUnset, { /// Set the `url` field (required) pub fn url( mut self, value: impl Into>, ) -> OgpBuilder<'a, ogp_state::SetUrl> { self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); OgpBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S: ogp_state::State> OgpBuilder<'a, S> { /// Set the `width` field (optional) pub fn width(mut self, value: impl Into>) -> Self { self.__unsafe_private_named.2 = value.into(); self } /// Set the `width` field to an Option value (optional) pub fn maybe_width(mut self, value: Option) -> Self { self.__unsafe_private_named.2 = value; self } } impl<'a, S> OgpBuilder<'a, S> where S: ogp_state::State, S::Url: ogp_state::IsSet, { /// Build the final struct pub fn build(self) -> Ogp<'a> { Ogp { height: self.__unsafe_private_named.0, url: self.__unsafe_private_named.1.unwrap(), width: self.__unsafe_private_named.2, 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>, >, ) -> Ogp<'a> { Ogp { height: self.__unsafe_private_named.0, url: self.__unsafe_private_named.1.unwrap(), width: self.__unsafe_private_named.2, extra_data: Some(extra_data), } } } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Ogp<'a> { fn nsid() -> &'static str { "com.whtwnd.blog.defs" } fn def_name() -> &'static str { "ogp" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_com_whtwnd_blog_defs() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } }