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;
#[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 {}
}
pub trait State: sealed::Sealed {
type Tag;
type Count;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Tag = Unset;
type Count = Unset;
}
pub struct SetTag<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetTag<S> {}
impl<S: State> State for SetTag<S> {
type Tag = Set<members::tag>;
type Count = S::Count;
}
pub struct SetCount<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCount<S> {}
impl<S: State> State for SetCount<S> {
type Tag = S::Tag;
type Count = Set<members::count>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct tag(());
pub struct count(());
}
}
pub struct CommunityTagCountBuilder<'a, S: community_tag_count_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<i64>,
::core::option::Option<jacquard_common::CowStr<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> CommunityTagCount<'a> {
pub fn new() -> CommunityTagCountBuilder<'a, community_tag_count_state::Empty> {
CommunityTagCountBuilder::new()
}
}
impl<'a> CommunityTagCountBuilder<'a, community_tag_count_state::Empty> {
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,
{
pub fn count(
mut self,
value: impl Into<i64>,
) -> CommunityTagCountBuilder<'a, community_tag_count_state::SetCount<S>> {
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,
{
pub fn tag(
mut self,
value: impl Into<jacquard_common::CowStr<'a>>,
) -> CommunityTagCountBuilder<'a, community_tag_count_state::SetTag<S>> {
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::Tag: community_tag_count_state::IsSet,
S::Count: community_tag_count_state::IsSet,
{
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(),
}
}
pub fn build_with_data(
self,
extra_data: std::collections::BTreeMap<
jacquard_common::deps::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::deps::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::deps::smol_str::SmolStr::new_static("tag"),
::jacquard_common::deps::smol_str::SmolStr::new_static("count")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::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::deps::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::deps::smol_str::SmolStr::new_static("curatelist"),
::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken {
description: None,
}),
);
map.insert(
::jacquard_common::deps::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::deps::smol_str::SmolStr::new_static("uri"),
::jacquard_common::deps::smol_str::SmolStr::new_static("subject")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::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::deps::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::deps::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::deps::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::deps::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::deps::smol_str::SmolStr::new_static("uri"),
::jacquard_common::deps::smol_str::SmolStr::new_static("cid"),
::jacquard_common::deps::smol_str::SmolStr::new_static("creator"),
::jacquard_common::deps::smol_str::SmolStr::new_static("name"),
::jacquard_common::deps::smol_str::SmolStr::new_static("purpose"),
::jacquard_common::deps::smol_str::SmolStr::new_static("itemCount"),
::jacquard_common::deps::smol_str::SmolStr::new_static("indexedAt")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::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::deps::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::deps::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::deps::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::deps::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::deps::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::deps::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::deps::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::deps::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::deps::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::deps::smol_str::SmolStr::new_static("readinglist"),
::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken {
description: None,
}),
);
map.insert(
::jacquard_common::deps::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::deps::smol_str::SmolStr::new_static("resource"),
::jacquard_common::deps::smol_str::SmolStr::new_static("authorTags"),
::jacquard_common::deps::smol_str::SmolStr::new_static("communityTags")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::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::deps::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::deps::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::deps::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::deps::smol_str::SmolStr::new_static("serieslist"),
::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken {
description: None,
}),
);
map.insert(
::jacquard_common::deps::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::deps::smol_str::SmolStr::new_static("uri"),
::jacquard_common::deps::smol_str::SmolStr::new_static("tag"),
::jacquard_common::deps::smol_str::SmolStr::new_static("appliedBy"),
::jacquard_common::deps::smol_str::SmolStr::new_static("createdAt")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::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::deps::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::deps::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::deps::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::deps::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::deps::smol_str::SmolStr::new_static("tag"),
::jacquard_common::deps::smol_str::SmolStr::new_static("useCount")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::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::deps::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::deps::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::deps::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::deps::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::deps::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(())
}
}
#[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")
}
}
#[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<jacquard_common::types::string::Datetime>,
#[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 {}
}
pub trait State: sealed::Sealed {
type Subject;
type Uri;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Subject = Unset;
type Uri = Unset;
}
pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetSubject<S> {}
impl<S: State> State for SetSubject<S> {
type Subject = Set<members::subject>;
type Uri = S::Uri;
}
pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetUri<S> {}
impl<S: State> State for SetUri<S> {
type Subject = S::Subject;
type Uri = Set<members::uri>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct subject(());
pub struct uri(());
}
}
pub struct ListItemViewBuilder<'a, S: list_item_view_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<jacquard_common::types::string::Datetime>,
::core::option::Option<ListItemViewSubject<'a>>,
::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> ListItemView<'a> {
pub fn new() -> ListItemViewBuilder<'a, list_item_view_state::Empty> {
ListItemViewBuilder::new()
}
}
impl<'a> ListItemViewBuilder<'a, list_item_view_state::Empty> {
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> {
pub fn added_at(
mut self,
value: impl Into<Option<jacquard_common::types::string::Datetime>>,
) -> Self {
self.__unsafe_private_named.0 = value.into();
self
}
pub fn maybe_added_at(
mut self,
value: Option<jacquard_common::types::string::Datetime>,
) -> 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,
{
pub fn subject(
mut self,
value: impl Into<ListItemViewSubject<'a>>,
) -> ListItemViewBuilder<'a, list_item_view_state::SetSubject<S>> {
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,
{
pub fn uri(
mut self,
value: impl Into<jacquard_common::types::string::AtUri<'a>>,
) -> ListItemViewBuilder<'a, list_item_view_state::SetUri<S>> {
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::Subject: list_item_view_state::IsSet,
S::Uri: list_item_view_state::IsSet,
{
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(),
}
}
pub fn build_with_data(
self,
extra_data: std::collections::BTreeMap<
jacquard_common::deps::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<crate::sh_weaver::notebook::NotebookView<'a>>),
#[serde(rename = "sh.weaver.notebook.defs#entryView")]
EntryView(Box<crate::sh_weaver::notebook::EntryView<'a>>),
}
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<String> 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<str> 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<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, 'a> serde::Deserialize<'de> for ListPurpose<'a>
where
'de: 'a,
{
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
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()),
}
}
}
#[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<jacquard_common::types::string::UriValue<'a>>,
#[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<jacquard_common::CowStr<'a>>,
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 {}
}
pub trait State: sealed::Sealed {
type ItemCount;
type Cid;
type IndexedAt;
type Uri;
type Name;
type Creator;
type Purpose;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type ItemCount = Unset;
type Cid = Unset;
type IndexedAt = Unset;
type Uri = Unset;
type Name = Unset;
type Creator = Unset;
type Purpose = Unset;
}
pub struct SetItemCount<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetItemCount<S> {}
impl<S: State> State for SetItemCount<S> {
type ItemCount = Set<members::item_count>;
type Cid = S::Cid;
type IndexedAt = S::IndexedAt;
type Uri = S::Uri;
type Name = S::Name;
type Creator = S::Creator;
type Purpose = S::Purpose;
}
pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCid<S> {}
impl<S: State> State for SetCid<S> {
type ItemCount = S::ItemCount;
type Cid = Set<members::cid>;
type IndexedAt = S::IndexedAt;
type Uri = S::Uri;
type Name = S::Name;
type Creator = S::Creator;
type Purpose = S::Purpose;
}
pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetIndexedAt<S> {}
impl<S: State> State for SetIndexedAt<S> {
type ItemCount = S::ItemCount;
type Cid = S::Cid;
type IndexedAt = Set<members::indexed_at>;
type Uri = S::Uri;
type Name = S::Name;
type Creator = S::Creator;
type Purpose = S::Purpose;
}
pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetUri<S> {}
impl<S: State> State for SetUri<S> {
type ItemCount = S::ItemCount;
type Cid = S::Cid;
type IndexedAt = S::IndexedAt;
type Uri = Set<members::uri>;
type Name = S::Name;
type Creator = S::Creator;
type Purpose = S::Purpose;
}
pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetName<S> {}
impl<S: State> State for SetName<S> {
type ItemCount = S::ItemCount;
type Cid = S::Cid;
type IndexedAt = S::IndexedAt;
type Uri = S::Uri;
type Name = Set<members::name>;
type Creator = S::Creator;
type Purpose = S::Purpose;
}
pub struct SetCreator<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCreator<S> {}
impl<S: State> State for SetCreator<S> {
type ItemCount = S::ItemCount;
type Cid = S::Cid;
type IndexedAt = S::IndexedAt;
type Uri = S::Uri;
type Name = S::Name;
type Creator = Set<members::creator>;
type Purpose = S::Purpose;
}
pub struct SetPurpose<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetPurpose<S> {}
impl<S: State> State for SetPurpose<S> {
type ItemCount = S::ItemCount;
type Cid = S::Cid;
type IndexedAt = S::IndexedAt;
type Uri = S::Uri;
type Name = S::Name;
type Creator = S::Creator;
type Purpose = Set<members::purpose>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct item_count(());
pub struct cid(());
pub struct indexed_at(());
pub struct uri(());
pub struct name(());
pub struct creator(());
pub struct purpose(());
}
}
pub struct ListViewBuilder<'a, S: list_view_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<jacquard_common::types::string::UriValue<'a>>,
::core::option::Option<jacquard_common::types::string::Cid<'a>>,
::core::option::Option<crate::sh_weaver::actor::ProfileViewBasic<'a>>,
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<jacquard_common::types::string::Datetime>,
::core::option::Option<i64>,
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<crate::sh_weaver::graph::ListPurpose<'a>>,
::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> ListView<'a> {
pub fn new() -> ListViewBuilder<'a, list_view_state::Empty> {
ListViewBuilder::new()
}
}
impl<'a> ListViewBuilder<'a, list_view_state::Empty> {
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> {
pub fn avatar(
mut self,
value: impl Into<Option<jacquard_common::types::string::UriValue<'a>>>,
) -> Self {
self.__unsafe_private_named.0 = value.into();
self
}
pub fn maybe_avatar(
mut self,
value: Option<jacquard_common::types::string::UriValue<'a>>,
) -> 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,
{
pub fn cid(
mut self,
value: impl Into<jacquard_common::types::string::Cid<'a>>,
) -> ListViewBuilder<'a, list_view_state::SetCid<S>> {
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,
{
pub fn creator(
mut self,
value: impl Into<crate::sh_weaver::actor::ProfileViewBasic<'a>>,
) -> ListViewBuilder<'a, list_view_state::SetCreator<S>> {
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> {
pub fn description(
mut self,
value: impl Into<Option<jacquard_common::CowStr<'a>>>,
) -> Self {
self.__unsafe_private_named.3 = value.into();
self
}
pub fn maybe_description(
mut self,
value: Option<jacquard_common::CowStr<'a>>,
) -> 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,
{
pub fn indexed_at(
mut self,
value: impl Into<jacquard_common::types::string::Datetime>,
) -> ListViewBuilder<'a, list_view_state::SetIndexedAt<S>> {
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,
{
pub fn item_count(
mut self,
value: impl Into<i64>,
) -> ListViewBuilder<'a, list_view_state::SetItemCount<S>> {
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,
{
pub fn name(
mut self,
value: impl Into<jacquard_common::CowStr<'a>>,
) -> ListViewBuilder<'a, list_view_state::SetName<S>> {
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,
{
pub fn purpose(
mut self,
value: impl Into<crate::sh_weaver::graph::ListPurpose<'a>>,
) -> ListViewBuilder<'a, list_view_state::SetPurpose<S>> {
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,
{
pub fn uri(
mut self,
value: impl Into<jacquard_common::types::string::AtUri<'a>>,
) -> ListViewBuilder<'a, list_view_state::SetUri<S>> {
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> {
pub fn viewer_subscribed(
mut self,
value: impl Into<Option<jacquard_common::types::string::AtUri<'a>>>,
) -> Self {
self.__unsafe_private_named.9 = value.into();
self
}
pub fn maybe_viewer_subscribed(
mut self,
value: Option<jacquard_common::types::string::AtUri<'a>>,
) -> Self {
self.__unsafe_private_named.9 = value;
self
}
}
impl<'a, S> ListViewBuilder<'a, S>
where
S: list_view_state::State,
S::ItemCount: list_view_state::IsSet,
S::Cid: list_view_state::IsSet,
S::IndexedAt: list_view_state::IsSet,
S::Uri: list_view_state::IsSet,
S::Name: list_view_state::IsSet,
S::Creator: list_view_state::IsSet,
S::Purpose: list_view_state::IsSet,
{
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(),
}
}
pub fn build_with_data(
self,
extra_data: std::collections::BTreeMap<
jacquard_common::deps::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(())
}
}
#[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")
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct ResourceTagsView<'a> {
#[serde(borrow)]
pub author_tags: Vec<jacquard_common::CowStr<'a>>,
#[serde(borrow)]
pub community_tags: Vec<crate::sh_weaver::graph::CommunityTagCount<'a>>,
#[serde(borrow)]
pub resource: crate::com_atproto::repo::strong_ref::StrongRef<'a>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub viewer_applied_tags: std::option::Option<Vec<jacquard_common::CowStr<'a>>>,
}
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 {}
}
pub trait State: sealed::Sealed {
type CommunityTags;
type Resource;
type AuthorTags;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type CommunityTags = Unset;
type Resource = Unset;
type AuthorTags = Unset;
}
pub struct SetCommunityTags<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCommunityTags<S> {}
impl<S: State> State for SetCommunityTags<S> {
type CommunityTags = Set<members::community_tags>;
type Resource = S::Resource;
type AuthorTags = S::AuthorTags;
}
pub struct SetResource<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetResource<S> {}
impl<S: State> State for SetResource<S> {
type CommunityTags = S::CommunityTags;
type Resource = Set<members::resource>;
type AuthorTags = S::AuthorTags;
}
pub struct SetAuthorTags<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetAuthorTags<S> {}
impl<S: State> State for SetAuthorTags<S> {
type CommunityTags = S::CommunityTags;
type Resource = S::Resource;
type AuthorTags = Set<members::author_tags>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct community_tags(());
pub struct resource(());
pub struct author_tags(());
}
}
pub struct ResourceTagsViewBuilder<'a, S: resource_tags_view_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<Vec<jacquard_common::CowStr<'a>>>,
::core::option::Option<Vec<crate::sh_weaver::graph::CommunityTagCount<'a>>>,
::core::option::Option<crate::com_atproto::repo::strong_ref::StrongRef<'a>>,
::core::option::Option<Vec<jacquard_common::CowStr<'a>>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> ResourceTagsView<'a> {
pub fn new() -> ResourceTagsViewBuilder<'a, resource_tags_view_state::Empty> {
ResourceTagsViewBuilder::new()
}
}
impl<'a> ResourceTagsViewBuilder<'a, resource_tags_view_state::Empty> {
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,
{
pub fn author_tags(
mut self,
value: impl Into<Vec<jacquard_common::CowStr<'a>>>,
) -> ResourceTagsViewBuilder<'a, resource_tags_view_state::SetAuthorTags<S>> {
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,
{
pub fn community_tags(
mut self,
value: impl Into<Vec<crate::sh_weaver::graph::CommunityTagCount<'a>>>,
) -> ResourceTagsViewBuilder<'a, resource_tags_view_state::SetCommunityTags<S>> {
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,
{
pub fn resource(
mut self,
value: impl Into<crate::com_atproto::repo::strong_ref::StrongRef<'a>>,
) -> ResourceTagsViewBuilder<'a, resource_tags_view_state::SetResource<S>> {
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> {
pub fn viewer_applied_tags(
mut self,
value: impl Into<Option<Vec<jacquard_common::CowStr<'a>>>>,
) -> Self {
self.__unsafe_private_named.3 = value.into();
self
}
pub fn maybe_viewer_applied_tags(
mut self,
value: Option<Vec<jacquard_common::CowStr<'a>>>,
) -> 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,
{
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(),
}
}
pub fn build_with_data(
self,
extra_data: std::collections::BTreeMap<
jacquard_common::deps::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(())
}
}
#[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")
}
}
#[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 {}
}
pub trait State: sealed::Sealed {
type Uri;
type Tag;
type CreatedAt;
type AppliedBy;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Uri = Unset;
type Tag = Unset;
type CreatedAt = Unset;
type AppliedBy = Unset;
}
pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetUri<S> {}
impl<S: State> State for SetUri<S> {
type Uri = Set<members::uri>;
type Tag = S::Tag;
type CreatedAt = S::CreatedAt;
type AppliedBy = S::AppliedBy;
}
pub struct SetTag<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetTag<S> {}
impl<S: State> State for SetTag<S> {
type Uri = S::Uri;
type Tag = Set<members::tag>;
type CreatedAt = S::CreatedAt;
type AppliedBy = S::AppliedBy;
}
pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCreatedAt<S> {}
impl<S: State> State for SetCreatedAt<S> {
type Uri = S::Uri;
type Tag = S::Tag;
type CreatedAt = Set<members::created_at>;
type AppliedBy = S::AppliedBy;
}
pub struct SetAppliedBy<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetAppliedBy<S> {}
impl<S: State> State for SetAppliedBy<S> {
type Uri = S::Uri;
type Tag = S::Tag;
type CreatedAt = S::CreatedAt;
type AppliedBy = Set<members::applied_by>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct uri(());
pub struct tag(());
pub struct created_at(());
pub struct applied_by(());
}
}
pub struct TagApplicationViewBuilder<'a, S: tag_application_view_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<crate::sh_weaver::actor::ProfileViewBasic<'a>>,
::core::option::Option<jacquard_common::types::string::Datetime>,
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> TagApplicationView<'a> {
pub fn new() -> TagApplicationViewBuilder<'a, tag_application_view_state::Empty> {
TagApplicationViewBuilder::new()
}
}
impl<'a> TagApplicationViewBuilder<'a, tag_application_view_state::Empty> {
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,
{
pub fn applied_by(
mut self,
value: impl Into<crate::sh_weaver::actor::ProfileViewBasic<'a>>,
) -> TagApplicationViewBuilder<'a, tag_application_view_state::SetAppliedBy<S>> {
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,
{
pub fn created_at(
mut self,
value: impl Into<jacquard_common::types::string::Datetime>,
) -> TagApplicationViewBuilder<'a, tag_application_view_state::SetCreatedAt<S>> {
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,
{
pub fn tag(
mut self,
value: impl Into<jacquard_common::CowStr<'a>>,
) -> TagApplicationViewBuilder<'a, tag_application_view_state::SetTag<S>> {
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,
{
pub fn uri(
mut self,
value: impl Into<jacquard_common::types::string::AtUri<'a>>,
) -> TagApplicationViewBuilder<'a, tag_application_view_state::SetUri<S>> {
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::Uri: tag_application_view_state::IsSet,
S::Tag: tag_application_view_state::IsSet,
S::CreatedAt: tag_application_view_state::IsSet,
S::AppliedBy: tag_application_view_state::IsSet,
{
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(),
}
}
pub fn build_with_data(
self,
extra_data: std::collections::BTreeMap<
jacquard_common::deps::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(())
}
}
#[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<i64>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub notebook_count: std::option::Option<i64>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub recent_use_count: std::option::Option<i64>,
#[serde(borrow)]
pub tag: jacquard_common::CowStr<'a>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub trending_score: std::option::Option<i64>,
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 {}
}
pub trait State: sealed::Sealed {
type Tag;
type UseCount;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Tag = Unset;
type UseCount = Unset;
}
pub struct SetTag<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetTag<S> {}
impl<S: State> State for SetTag<S> {
type Tag = Set<members::tag>;
type UseCount = S::UseCount;
}
pub struct SetUseCount<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetUseCount<S> {}
impl<S: State> State for SetUseCount<S> {
type Tag = S::Tag;
type UseCount = Set<members::use_count>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct tag(());
pub struct use_count(());
}
}
pub struct TagViewBuilder<'a, S: tag_view_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<i64>,
::core::option::Option<i64>,
::core::option::Option<i64>,
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<i64>,
::core::option::Option<i64>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> TagView<'a> {
pub fn new() -> TagViewBuilder<'a, tag_view_state::Empty> {
TagViewBuilder::new()
}
}
impl<'a> TagViewBuilder<'a, tag_view_state::Empty> {
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> {
pub fn entry_count(mut self, value: impl Into<Option<i64>>) -> Self {
self.__unsafe_private_named.0 = value.into();
self
}
pub fn maybe_entry_count(mut self, value: Option<i64>) -> Self {
self.__unsafe_private_named.0 = value;
self
}
}
impl<'a, S: tag_view_state::State> TagViewBuilder<'a, S> {
pub fn notebook_count(mut self, value: impl Into<Option<i64>>) -> Self {
self.__unsafe_private_named.1 = value.into();
self
}
pub fn maybe_notebook_count(mut self, value: Option<i64>) -> Self {
self.__unsafe_private_named.1 = value;
self
}
}
impl<'a, S: tag_view_state::State> TagViewBuilder<'a, S> {
pub fn recent_use_count(mut self, value: impl Into<Option<i64>>) -> Self {
self.__unsafe_private_named.2 = value.into();
self
}
pub fn maybe_recent_use_count(mut self, value: Option<i64>) -> 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,
{
pub fn tag(
mut self,
value: impl Into<jacquard_common::CowStr<'a>>,
) -> TagViewBuilder<'a, tag_view_state::SetTag<S>> {
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> {
pub fn trending_score(mut self, value: impl Into<Option<i64>>) -> Self {
self.__unsafe_private_named.4 = value.into();
self
}
pub fn maybe_trending_score(mut self, value: Option<i64>) -> 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,
{
pub fn use_count(
mut self,
value: impl Into<i64>,
) -> TagViewBuilder<'a, tag_view_state::SetUseCount<S>> {
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,
{
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(),
}
}
pub fn build_with_data(
self,
extra_data: std::collections::BTreeMap<
jacquard_common::deps::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(())
}
}