#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct BskyPost<'a> {
#[serde(borrow)]
pub post_ref: crate::com_atproto::repo::strong_ref::StrongRef<'a>,
}
pub mod bsky_post_state {
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type PostRef;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type PostRef = Unset;
}
pub struct SetPostRef<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetPostRef<S> {}
impl<S: State> State for SetPostRef<S> {
type PostRef = Set<members::post_ref>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct post_ref(());
}
}
pub struct BskyPostBuilder<'a, S: bsky_post_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<crate::com_atproto::repo::strong_ref::StrongRef<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> BskyPost<'a> {
pub fn new() -> BskyPostBuilder<'a, bsky_post_state::Empty> {
BskyPostBuilder::new()
}
}
impl<'a> BskyPostBuilder<'a, bsky_post_state::Empty> {
pub fn new() -> Self {
BskyPostBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None,),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> BskyPostBuilder<'a, S>
where
S: bsky_post_state::State,
S::PostRef: bsky_post_state::IsUnset,
{
pub fn post_ref(
mut self,
value: impl Into<crate::com_atproto::repo::strong_ref::StrongRef<'a>>,
) -> BskyPostBuilder<'a, bsky_post_state::SetPostRef<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
BskyPostBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> BskyPostBuilder<'a, S>
where
S: bsky_post_state::State,
S::PostRef: bsky_post_state::IsSet,
{
pub fn build(self) -> BskyPost<'a> {
BskyPost {
post_ref: self.__unsafe_private_named.0.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: std::collections::BTreeMap<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> BskyPost<'a> {
BskyPost {
post_ref: self.__unsafe_private_named.0.unwrap(),
extra_data: Some(extra_data),
}
}
}
fn lexicon_doc_fyi_questionable_richtext_bskyPost() -> ::jacquard_lexicon::lexicon::LexiconDoc<
'static,
> {
::jacquard_lexicon::lexicon::LexiconDoc {
lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1,
id: ::jacquard_common::CowStr::new_static("fyi.questionable.richtext.bskyPost"),
revision: None,
description: None,
defs: {
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("main"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("postRef")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"postRef",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"com.atproto.repo.strongRef",
),
}),
);
map
},
}),
);
map
},
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for BskyPost<'a> {
fn nsid() -> &'static str {
"fyi.questionable.richtext.bskyPost"
}
fn def_name() -> &'static str {
"main"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_fyi_questionable_richtext_bskyPost()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
Ok(())
}
}