pub mod describe_feed_generator;
pub mod generator;
pub mod get_actor_feeds;
pub mod get_actor_likes;
pub mod get_author_feed;
pub mod get_feed;
pub mod get_feed_generator;
pub mod get_feed_generators;
pub mod get_feed_skeleton;
pub mod get_likes;
pub mod get_list_feed;
pub mod get_post_thread;
pub mod get_posts;
pub mod get_quotes;
pub mod get_reposted_by;
pub mod get_suggested_feeds;
pub mod get_timeline;
pub mod like;
pub mod post;
pub mod postgate;
pub mod repost;
pub mod search_posts;
pub mod send_interactions;
pub mod threadgate;
#[allow(unused_imports)]
use alloc::collections::BTreeMap;
#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr};
#[allow(unused_imports)]
use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
use jacquard_common::deps::smol_str::SmolStr;
use jacquard_common::types::string::{Did, AtUri, Cid, Datetime, UriValue};
use jacquard_common::types::value::Data;
use jacquard_derive::{IntoStatic, open_union};
use jacquard_lexicon::lexicon::LexiconDoc;
use jacquard_lexicon::schema::LexiconSchema;
#[allow(unused_imports)]
use jacquard_lexicon::validation::{ConstraintError, ValidationPath};
use serde::{Serialize, Deserialize};
use crate::app_bsky::actor::ProfileView;
use crate::app_bsky::actor::ProfileViewBasic;
use crate::app_bsky::graph::ListViewBasic;
use crate::app_bsky::richtext::facet::Facet;
use crate::com_atproto::label::Label;
use crate::app_bsky::actor;
use crate::app_bsky::embed::external;
use crate::app_bsky::embed::images;
use crate::app_bsky::embed::record;
use crate::app_bsky::embed::record_with_media;
use crate::app_bsky::embed::video;
use crate::app_bsky::feed;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct BlockedAuthor<S: BosStr = DefaultStr> {
pub did: Did<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub viewer: Option<actor::ViewerState<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct BlockedPost<S: BosStr = DefaultStr> {
pub author: feed::BlockedAuthor<S>,
pub blocked: bool,
pub uri: AtUri<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct ClickthroughAuthor;
impl core::fmt::Display for ClickthroughAuthor {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "clickthroughAuthor")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct ClickthroughEmbed;
impl core::fmt::Display for ClickthroughEmbed {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "clickthroughEmbed")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct ClickthroughItem;
impl core::fmt::Display for ClickthroughItem {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "clickthroughItem")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct ClickthroughReposter;
impl core::fmt::Display for ClickthroughReposter {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "clickthroughReposter")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct ContentModeUnspecified;
impl core::fmt::Display for ContentModeUnspecified {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "contentModeUnspecified")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct ContentModeVideo;
impl core::fmt::Display for ContentModeVideo {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "contentModeVideo")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct FeedViewPost<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub feed_context: Option<S>,
pub post: feed::PostView<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub reason: Option<FeedViewPostReason<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub reply: Option<feed::ReplyRef<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub req_id: Option<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub enum FeedViewPostReason<S: BosStr = DefaultStr> {
#[serde(rename = "app.bsky.feed.defs#reasonRepost")]
ReasonRepost(Box<feed::ReasonRepost<S>>),
#[serde(rename = "app.bsky.feed.defs#reasonPin")]
ReasonPin(Box<feed::ReasonPin<S>>),
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct GeneratorView<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub accepts_interactions: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub avatar: Option<UriValue<S>>,
pub cid: Cid<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub content_mode: Option<GeneratorViewContentMode<S>>,
pub creator: ProfileView<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub description_facets: Option<Vec<Facet<S>>>,
pub did: Did<S>,
pub display_name: S,
pub indexed_at: Datetime,
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<Vec<Label<S>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub like_count: Option<i64>,
pub uri: AtUri<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub viewer: Option<feed::GeneratorViewerState<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum GeneratorViewContentMode<S: BosStr = DefaultStr> {
ContentModeUnspecified,
ContentModeVideo,
Other(S),
}
impl<S: BosStr> GeneratorViewContentMode<S> {
pub fn as_str(&self) -> &str {
match self {
Self::ContentModeUnspecified => "app.bsky.feed.defs#contentModeUnspecified",
Self::ContentModeVideo => "app.bsky.feed.defs#contentModeVideo",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"app.bsky.feed.defs#contentModeUnspecified" => Self::ContentModeUnspecified,
"app.bsky.feed.defs#contentModeVideo" => Self::ContentModeVideo,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for GeneratorViewContentMode<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for GeneratorViewContentMode<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for GeneratorViewContentMode<S> {
fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
where
Ser: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de>
for GeneratorViewContentMode<S> {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = S::deserialize(deserializer)?;
Ok(Self::from_value(s))
}
}
impl<S: BosStr + Default> Default for GeneratorViewContentMode<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for GeneratorViewContentMode<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = GeneratorViewContentMode<S::Output>;
fn into_static(self) -> Self::Output {
match self {
GeneratorViewContentMode::ContentModeUnspecified => {
GeneratorViewContentMode::ContentModeUnspecified
}
GeneratorViewContentMode::ContentModeVideo => {
GeneratorViewContentMode::ContentModeVideo
}
GeneratorViewContentMode::Other(v) => {
GeneratorViewContentMode::Other(v.into_static())
}
}
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct GeneratorViewerState<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub like: Option<AtUri<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct Interaction<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub event: Option<InteractionEvent<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub feed_context: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub item: Option<AtUri<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub req_id: Option<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum InteractionEvent<S: BosStr = DefaultStr> {
RequestLess,
RequestMore,
ClickthroughItem,
ClickthroughAuthor,
ClickthroughReposter,
ClickthroughEmbed,
InteractionSeen,
InteractionLike,
InteractionRepost,
InteractionReply,
InteractionQuote,
InteractionShare,
Other(S),
}
impl<S: BosStr> InteractionEvent<S> {
pub fn as_str(&self) -> &str {
match self {
Self::RequestLess => "app.bsky.feed.defs#requestLess",
Self::RequestMore => "app.bsky.feed.defs#requestMore",
Self::ClickthroughItem => "app.bsky.feed.defs#clickthroughItem",
Self::ClickthroughAuthor => "app.bsky.feed.defs#clickthroughAuthor",
Self::ClickthroughReposter => "app.bsky.feed.defs#clickthroughReposter",
Self::ClickthroughEmbed => "app.bsky.feed.defs#clickthroughEmbed",
Self::InteractionSeen => "app.bsky.feed.defs#interactionSeen",
Self::InteractionLike => "app.bsky.feed.defs#interactionLike",
Self::InteractionRepost => "app.bsky.feed.defs#interactionRepost",
Self::InteractionReply => "app.bsky.feed.defs#interactionReply",
Self::InteractionQuote => "app.bsky.feed.defs#interactionQuote",
Self::InteractionShare => "app.bsky.feed.defs#interactionShare",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"app.bsky.feed.defs#requestLess" => Self::RequestLess,
"app.bsky.feed.defs#requestMore" => Self::RequestMore,
"app.bsky.feed.defs#clickthroughItem" => Self::ClickthroughItem,
"app.bsky.feed.defs#clickthroughAuthor" => Self::ClickthroughAuthor,
"app.bsky.feed.defs#clickthroughReposter" => Self::ClickthroughReposter,
"app.bsky.feed.defs#clickthroughEmbed" => Self::ClickthroughEmbed,
"app.bsky.feed.defs#interactionSeen" => Self::InteractionSeen,
"app.bsky.feed.defs#interactionLike" => Self::InteractionLike,
"app.bsky.feed.defs#interactionRepost" => Self::InteractionRepost,
"app.bsky.feed.defs#interactionReply" => Self::InteractionReply,
"app.bsky.feed.defs#interactionQuote" => Self::InteractionQuote,
"app.bsky.feed.defs#interactionShare" => Self::InteractionShare,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for InteractionEvent<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for InteractionEvent<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for InteractionEvent<S> {
fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
where
Ser: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for InteractionEvent<S> {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = S::deserialize(deserializer)?;
Ok(Self::from_value(s))
}
}
impl<S: BosStr + Default> Default for InteractionEvent<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for InteractionEvent<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = InteractionEvent<S::Output>;
fn into_static(self) -> Self::Output {
match self {
InteractionEvent::RequestLess => InteractionEvent::RequestLess,
InteractionEvent::RequestMore => InteractionEvent::RequestMore,
InteractionEvent::ClickthroughItem => InteractionEvent::ClickthroughItem,
InteractionEvent::ClickthroughAuthor => InteractionEvent::ClickthroughAuthor,
InteractionEvent::ClickthroughReposter => {
InteractionEvent::ClickthroughReposter
}
InteractionEvent::ClickthroughEmbed => InteractionEvent::ClickthroughEmbed,
InteractionEvent::InteractionSeen => InteractionEvent::InteractionSeen,
InteractionEvent::InteractionLike => InteractionEvent::InteractionLike,
InteractionEvent::InteractionRepost => InteractionEvent::InteractionRepost,
InteractionEvent::InteractionReply => InteractionEvent::InteractionReply,
InteractionEvent::InteractionQuote => InteractionEvent::InteractionQuote,
InteractionEvent::InteractionShare => InteractionEvent::InteractionShare,
InteractionEvent::Other(v) => InteractionEvent::Other(v.into_static()),
}
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct InteractionLike;
impl core::fmt::Display for InteractionLike {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "interactionLike")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct InteractionQuote;
impl core::fmt::Display for InteractionQuote {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "interactionQuote")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct InteractionReply;
impl core::fmt::Display for InteractionReply {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "interactionReply")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct InteractionRepost;
impl core::fmt::Display for InteractionRepost {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "interactionRepost")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct InteractionSeen;
impl core::fmt::Display for InteractionSeen {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "interactionSeen")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct InteractionShare;
impl core::fmt::Display for InteractionShare {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "interactionShare")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct NotFoundPost<S: BosStr = DefaultStr> {
pub not_found: bool,
pub uri: AtUri<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct PostView<S: BosStr = DefaultStr> {
pub author: ProfileViewBasic<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub bookmark_count: Option<i64>,
pub cid: Cid<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub debug: Option<Data<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub embed: Option<PostViewEmbed<S>>,
pub indexed_at: Datetime,
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<Vec<Label<S>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub like_count: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub quote_count: Option<i64>,
pub record: Data<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub reply_count: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub repost_count: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub threadgate: Option<feed::ThreadgateView<S>>,
pub uri: AtUri<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub viewer: Option<feed::ViewerState<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub enum PostViewEmbed<S: BosStr = DefaultStr> {
#[serde(rename = "app.bsky.embed.images#view")]
ImagesView(Box<images::View<S>>),
#[serde(rename = "app.bsky.embed.video#view")]
VideoView(Box<video::View<S>>),
#[serde(rename = "app.bsky.embed.external#view")]
ExternalView(Box<external::View<S>>),
#[serde(rename = "app.bsky.embed.record#view")]
RecordView(Box<record::View<S>>),
#[serde(rename = "app.bsky.embed.recordWithMedia#view")]
RecordWithMediaView(Box<record_with_media::View<S>>),
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ReasonPin<S: BosStr = DefaultStr> {
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ReasonRepost<S: BosStr = DefaultStr> {
pub by: ProfileViewBasic<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub cid: Option<Cid<S>>,
pub indexed_at: Datetime,
#[serde(skip_serializing_if = "Option::is_none")]
pub uri: Option<AtUri<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ReplyRef<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub grandparent_author: Option<ProfileViewBasic<S>>,
pub parent: ReplyRefParent<S>,
pub root: ReplyRefRoot<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub enum ReplyRefParent<S: BosStr = DefaultStr> {
#[serde(rename = "app.bsky.feed.defs#postView")]
PostView(Box<feed::PostView<S>>),
#[serde(rename = "app.bsky.feed.defs#notFoundPost")]
NotFoundPost(Box<feed::NotFoundPost<S>>),
#[serde(rename = "app.bsky.feed.defs#blockedPost")]
BlockedPost(Box<feed::BlockedPost<S>>),
}
#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub enum ReplyRefRoot<S: BosStr = DefaultStr> {
#[serde(rename = "app.bsky.feed.defs#postView")]
PostView(Box<feed::PostView<S>>),
#[serde(rename = "app.bsky.feed.defs#notFoundPost")]
NotFoundPost(Box<feed::NotFoundPost<S>>),
#[serde(rename = "app.bsky.feed.defs#blockedPost")]
BlockedPost(Box<feed::BlockedPost<S>>),
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct RequestLess;
impl core::fmt::Display for RequestLess {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "requestLess")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct RequestMore;
impl core::fmt::Display for RequestMore {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "requestMore")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct SkeletonFeedPost<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub feed_context: Option<S>,
pub post: AtUri<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub reason: Option<SkeletonFeedPostReason<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub enum SkeletonFeedPostReason<S: BosStr = DefaultStr> {
#[serde(rename = "app.bsky.feed.defs#skeletonReasonRepost")]
SkeletonReasonRepost(Box<feed::SkeletonReasonRepost<S>>),
#[serde(rename = "app.bsky.feed.defs#skeletonReasonPin")]
SkeletonReasonPin(Box<feed::SkeletonReasonPin<S>>),
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct SkeletonReasonPin<S: BosStr = DefaultStr> {
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct SkeletonReasonRepost<S: BosStr = DefaultStr> {
pub repost: AtUri<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ThreadContext<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub root_author_like: Option<AtUri<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ThreadViewPost<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub parent: Option<ThreadViewPostParent<S>>,
pub post: feed::PostView<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub replies: Option<Vec<ThreadViewPostRepliesItem<S>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub thread_context: Option<feed::ThreadContext<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub enum ThreadViewPostParent<S: BosStr = DefaultStr> {
#[serde(rename = "app.bsky.feed.defs#threadViewPost")]
ThreadViewPost(Box<feed::ThreadViewPost<S>>),
#[serde(rename = "app.bsky.feed.defs#notFoundPost")]
NotFoundPost(Box<feed::NotFoundPost<S>>),
#[serde(rename = "app.bsky.feed.defs#blockedPost")]
BlockedPost(Box<feed::BlockedPost<S>>),
}
#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub enum ThreadViewPostRepliesItem<S: BosStr = DefaultStr> {
#[serde(rename = "app.bsky.feed.defs#threadViewPost")]
ThreadViewPost(Box<feed::ThreadViewPost<S>>),
#[serde(rename = "app.bsky.feed.defs#notFoundPost")]
NotFoundPost(Box<feed::NotFoundPost<S>>),
#[serde(rename = "app.bsky.feed.defs#blockedPost")]
BlockedPost(Box<feed::BlockedPost<S>>),
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ThreadgateView<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub cid: Option<Cid<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub lists: Option<Vec<ListViewBasic<S>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub record: Option<Data<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub uri: Option<AtUri<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ViewerState<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub bookmarked: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub embedding_disabled: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub like: Option<AtUri<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub pinned: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub reply_disabled: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub repost: Option<AtUri<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub thread_muted: Option<bool>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
impl<S: BosStr> LexiconSchema for BlockedAuthor<S> {
fn nsid() -> &'static str {
"app.bsky.feed.defs"
}
fn def_name() -> &'static str {
"blockedAuthor"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_feed_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for BlockedPost<S> {
fn nsid() -> &'static str {
"app.bsky.feed.defs"
}
fn def_name() -> &'static str {
"blockedPost"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_feed_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for FeedViewPost<S> {
fn nsid() -> &'static str {
"app.bsky.feed.defs"
}
fn def_name() -> &'static str {
"feedViewPost"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_feed_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.feed_context {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 2000usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("feed_context"),
max: 2000usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.req_id {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("req_id"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for GeneratorView<S> {
fn nsid() -> &'static str {
"app.bsky.feed.defs"
}
fn def_name() -> &'static str {
"generatorView"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_feed_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.description {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 3000usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("description"),
max: 3000usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.description {
{
let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
if count > 300usize {
return Err(ConstraintError::MaxGraphemes {
path: ValidationPath::from_field("description"),
max: 300usize,
actual: count,
});
}
}
}
if let Some(ref value) = self.like_count {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("like_count"),
min: 0i64,
actual: *value,
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for GeneratorViewerState<S> {
fn nsid() -> &'static str {
"app.bsky.feed.defs"
}
fn def_name() -> &'static str {
"generatorViewerState"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_feed_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for Interaction<S> {
fn nsid() -> &'static str {
"app.bsky.feed.defs"
}
fn def_name() -> &'static str {
"interaction"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_feed_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.feed_context {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 2000usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("feed_context"),
max: 2000usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.req_id {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("req_id"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for NotFoundPost<S> {
fn nsid() -> &'static str {
"app.bsky.feed.defs"
}
fn def_name() -> &'static str {
"notFoundPost"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_feed_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for PostView<S> {
fn nsid() -> &'static str {
"app.bsky.feed.defs"
}
fn def_name() -> &'static str {
"postView"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_feed_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ReasonPin<S> {
fn nsid() -> &'static str {
"app.bsky.feed.defs"
}
fn def_name() -> &'static str {
"reasonPin"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_feed_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ReasonRepost<S> {
fn nsid() -> &'static str {
"app.bsky.feed.defs"
}
fn def_name() -> &'static str {
"reasonRepost"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_feed_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ReplyRef<S> {
fn nsid() -> &'static str {
"app.bsky.feed.defs"
}
fn def_name() -> &'static str {
"replyRef"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_feed_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for SkeletonFeedPost<S> {
fn nsid() -> &'static str {
"app.bsky.feed.defs"
}
fn def_name() -> &'static str {
"skeletonFeedPost"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_feed_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.feed_context {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 2000usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("feed_context"),
max: 2000usize,
actual: <str>::len(value.as_ref()),
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for SkeletonReasonPin<S> {
fn nsid() -> &'static str {
"app.bsky.feed.defs"
}
fn def_name() -> &'static str {
"skeletonReasonPin"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_feed_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for SkeletonReasonRepost<S> {
fn nsid() -> &'static str {
"app.bsky.feed.defs"
}
fn def_name() -> &'static str {
"skeletonReasonRepost"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_feed_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ThreadContext<S> {
fn nsid() -> &'static str {
"app.bsky.feed.defs"
}
fn def_name() -> &'static str {
"threadContext"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_feed_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ThreadViewPost<S> {
fn nsid() -> &'static str {
"app.bsky.feed.defs"
}
fn def_name() -> &'static str {
"threadViewPost"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_feed_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ThreadgateView<S> {
fn nsid() -> &'static str {
"app.bsky.feed.defs"
}
fn def_name() -> &'static str {
"threadgateView"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_feed_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ViewerState<S> {
fn nsid() -> &'static str {
"app.bsky.feed.defs"
}
fn def_name() -> &'static str {
"viewerState"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_feed_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
pub mod blocked_author_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 Did;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Did = Unset;
}
pub struct SetDid<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetDid<St> {}
impl<St: State> State for SetDid<St> {
type Did = Set<members::did>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct did(());
}
}
pub struct BlockedAuthorBuilder<S: BosStr, St: blocked_author_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<Did<S>>, Option<actor::ViewerState<S>>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> BlockedAuthor<S> {
pub fn new() -> BlockedAuthorBuilder<S, blocked_author_state::Empty> {
BlockedAuthorBuilder::new()
}
}
impl<S: BosStr> BlockedAuthorBuilder<S, blocked_author_state::Empty> {
pub fn new() -> Self {
BlockedAuthorBuilder {
_state: PhantomData,
_fields: (None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> BlockedAuthorBuilder<S, St>
where
St: blocked_author_state::State,
St::Did: blocked_author_state::IsUnset,
{
pub fn did(
mut self,
value: impl Into<Did<S>>,
) -> BlockedAuthorBuilder<S, blocked_author_state::SetDid<St>> {
self._fields.0 = Option::Some(value.into());
BlockedAuthorBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: blocked_author_state::State> BlockedAuthorBuilder<S, St> {
pub fn viewer(mut self, value: impl Into<Option<actor::ViewerState<S>>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_viewer(mut self, value: Option<actor::ViewerState<S>>) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St> BlockedAuthorBuilder<S, St>
where
St: blocked_author_state::State,
St::Did: blocked_author_state::IsSet,
{
pub fn build(self) -> BlockedAuthor<S> {
BlockedAuthor {
did: self._fields.0.unwrap(),
viewer: self._fields.1,
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> BlockedAuthor<S> {
BlockedAuthor {
did: self._fields.0.unwrap(),
viewer: self._fields.1,
extra_data: Some(extra_data),
}
}
}
fn lexicon_doc_app_bsky_feed_defs() -> LexiconDoc<'static> {
#[allow(unused_imports)]
use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType};
use jacquard_lexicon::lexicon::*;
use alloc::collections::BTreeMap;
LexiconDoc {
lexicon: Lexicon::Lexicon1,
id: CowStr::new_static("app.bsky.feed.defs"),
defs: {
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("blockedAuthor"),
LexUserType::Object(LexObject {
required: Some(vec![SmolStr::new_static("did")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("did"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Did),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("viewer"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static(
"app.bsky.actor.defs#viewerState",
),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("blockedPost"),
LexUserType::Object(LexObject {
required: Some(
vec![
SmolStr::new_static("uri"), SmolStr::new_static("blocked"),
SmolStr::new_static("author")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("author"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#blockedAuthor"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("blocked"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("uri"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("clickthroughAuthor"),
LexUserType::Token(LexToken { ..Default::default() }),
);
map.insert(
SmolStr::new_static("clickthroughEmbed"),
LexUserType::Token(LexToken { ..Default::default() }),
);
map.insert(
SmolStr::new_static("clickthroughItem"),
LexUserType::Token(LexToken { ..Default::default() }),
);
map.insert(
SmolStr::new_static("clickthroughReposter"),
LexUserType::Token(LexToken { ..Default::default() }),
);
map.insert(
SmolStr::new_static("contentModeUnspecified"),
LexUserType::Token(LexToken { ..Default::default() }),
);
map.insert(
SmolStr::new_static("contentModeVideo"),
LexUserType::Token(LexToken { ..Default::default() }),
);
map.insert(
SmolStr::new_static("feedViewPost"),
LexUserType::Object(LexObject {
required: Some(vec![SmolStr::new_static("post")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("feedContext"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Context provided by feed generator that may be passed back alongside interactions.",
),
),
max_length: Some(2000usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("post"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#postView"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("reason"),
LexObjectProperty::Union(LexRefUnion {
refs: vec![
CowStr::new_static("#reasonRepost"),
CowStr::new_static("#reasonPin")
],
..Default::default()
}),
);
map.insert(
SmolStr::new_static("reply"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#replyRef"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("reqId"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Unique identifier per request that may be passed back alongside interactions.",
),
),
max_length: Some(100usize),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("generatorView"),
LexUserType::Object(LexObject {
required: Some(
vec![
SmolStr::new_static("uri"), SmolStr::new_static("cid"),
SmolStr::new_static("did"), SmolStr::new_static("creator"),
SmolStr::new_static("displayName"),
SmolStr::new_static("indexedAt")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("acceptsInteractions"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("avatar"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Uri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("cid"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Cid),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("contentMode"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("creator"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static(
"app.bsky.actor.defs#profileView",
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("description"),
LexObjectProperty::String(LexString {
max_length: Some(3000usize),
max_graphemes: Some(300usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("descriptionFacets"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("app.bsky.richtext.facet"),
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("did"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Did),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("displayName"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("indexedAt"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("labels"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("com.atproto.label.defs#label"),
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("likeCount"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("uri"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("viewer"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#generatorViewerState"),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("generatorViewerState"),
LexUserType::Object(LexObject {
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("like"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("interaction"),
LexUserType::Object(LexObject {
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("event"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("feedContext"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Context on a feed item that was originally supplied by the feed generator on getFeedSkeleton.",
),
),
max_length: Some(2000usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("item"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("reqId"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Unique identifier per request that may be passed back alongside interactions.",
),
),
max_length: Some(100usize),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("interactionLike"),
LexUserType::Token(LexToken { ..Default::default() }),
);
map.insert(
SmolStr::new_static("interactionQuote"),
LexUserType::Token(LexToken { ..Default::default() }),
);
map.insert(
SmolStr::new_static("interactionReply"),
LexUserType::Token(LexToken { ..Default::default() }),
);
map.insert(
SmolStr::new_static("interactionRepost"),
LexUserType::Token(LexToken { ..Default::default() }),
);
map.insert(
SmolStr::new_static("interactionSeen"),
LexUserType::Token(LexToken { ..Default::default() }),
);
map.insert(
SmolStr::new_static("interactionShare"),
LexUserType::Token(LexToken { ..Default::default() }),
);
map.insert(
SmolStr::new_static("notFoundPost"),
LexUserType::Object(LexObject {
required: Some(
vec![SmolStr::new_static("uri"), SmolStr::new_static("notFound")],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("notFound"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("uri"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("postView"),
LexUserType::Object(LexObject {
required: Some(
vec![
SmolStr::new_static("uri"), SmolStr::new_static("cid"),
SmolStr::new_static("author"), SmolStr::new_static("record"),
SmolStr::new_static("indexedAt")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("author"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static(
"app.bsky.actor.defs#profileViewBasic",
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("bookmarkCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("cid"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Cid),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("debug"),
LexObjectProperty::Unknown(LexUnknown {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("embed"),
LexObjectProperty::Union(LexRefUnion {
refs: vec![
CowStr::new_static("app.bsky.embed.images#view"),
CowStr::new_static("app.bsky.embed.video#view"),
CowStr::new_static("app.bsky.embed.external#view"),
CowStr::new_static("app.bsky.embed.record#view"),
CowStr::new_static("app.bsky.embed.recordWithMedia#view")
],
..Default::default()
}),
);
map.insert(
SmolStr::new_static("indexedAt"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("labels"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("com.atproto.label.defs#label"),
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("likeCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("quoteCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("record"),
LexObjectProperty::Unknown(LexUnknown {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("replyCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("repostCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("threadgate"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#threadgateView"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("uri"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("viewer"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#viewerState"),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("reasonPin"),
LexUserType::Object(LexObject {
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("reasonRepost"),
LexUserType::Object(LexObject {
required: Some(
vec![SmolStr::new_static("by"), SmolStr::new_static("indexedAt")],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("by"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static(
"app.bsky.actor.defs#profileViewBasic",
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("cid"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Cid),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("indexedAt"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("uri"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("replyRef"),
LexUserType::Object(LexObject {
required: Some(
vec![SmolStr::new_static("root"), SmolStr::new_static("parent")],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("grandparentAuthor"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static(
"app.bsky.actor.defs#profileViewBasic",
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("parent"),
LexObjectProperty::Union(LexRefUnion {
refs: vec![
CowStr::new_static("#postView"),
CowStr::new_static("#notFoundPost"),
CowStr::new_static("#blockedPost")
],
..Default::default()
}),
);
map.insert(
SmolStr::new_static("root"),
LexObjectProperty::Union(LexRefUnion {
refs: vec![
CowStr::new_static("#postView"),
CowStr::new_static("#notFoundPost"),
CowStr::new_static("#blockedPost")
],
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("requestLess"),
LexUserType::Token(LexToken { ..Default::default() }),
);
map.insert(
SmolStr::new_static("requestMore"),
LexUserType::Token(LexToken { ..Default::default() }),
);
map.insert(
SmolStr::new_static("skeletonFeedPost"),
LexUserType::Object(LexObject {
required: Some(vec![SmolStr::new_static("post")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("feedContext"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Context that will be passed through to client and may be passed to feed generator back alongside interactions.",
),
),
max_length: Some(2000usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("post"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("reason"),
LexObjectProperty::Union(LexRefUnion {
refs: vec![
CowStr::new_static("#skeletonReasonRepost"),
CowStr::new_static("#skeletonReasonPin")
],
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("skeletonReasonPin"),
LexUserType::Object(LexObject {
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("skeletonReasonRepost"),
LexUserType::Object(LexObject {
required: Some(vec![SmolStr::new_static("repost")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("repost"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("threadContext"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"Metadata about this post within the context of the thread it is in.",
),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("rootAuthorLike"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("threadViewPost"),
LexUserType::Object(LexObject {
required: Some(vec![SmolStr::new_static("post")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("parent"),
LexObjectProperty::Union(LexRefUnion {
refs: vec![
CowStr::new_static("#threadViewPost"),
CowStr::new_static("#notFoundPost"),
CowStr::new_static("#blockedPost")
],
..Default::default()
}),
);
map.insert(
SmolStr::new_static("post"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#postView"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("replies"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::Union(LexRefUnion {
refs: vec![
CowStr::new_static("#threadViewPost"),
CowStr::new_static("#notFoundPost"),
CowStr::new_static("#blockedPost")
],
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("threadContext"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#threadContext"),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("threadgateView"),
LexUserType::Object(LexObject {
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("cid"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Cid),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("lists"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static(
"app.bsky.graph.defs#listViewBasic",
),
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("record"),
LexObjectProperty::Unknown(LexUnknown {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("uri"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("viewerState"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"Metadata about the requesting account's relationship with the subject content. Only has meaningful content for authed requests.",
),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("bookmarked"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("embeddingDisabled"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("like"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("pinned"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("replyDisabled"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("repost"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("threadMuted"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map
},
..Default::default()
}
}
pub mod blocked_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 Author;
type Blocked;
type Uri;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Author = Unset;
type Blocked = Unset;
type Uri = Unset;
}
pub struct SetAuthor<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetAuthor<St> {}
impl<St: State> State for SetAuthor<St> {
type Author = Set<members::author>;
type Blocked = St::Blocked;
type Uri = St::Uri;
}
pub struct SetBlocked<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetBlocked<St> {}
impl<St: State> State for SetBlocked<St> {
type Author = St::Author;
type Blocked = Set<members::blocked>;
type Uri = St::Uri;
}
pub struct SetUri<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetUri<St> {}
impl<St: State> State for SetUri<St> {
type Author = St::Author;
type Blocked = St::Blocked;
type Uri = Set<members::uri>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct author(());
pub struct blocked(());
pub struct uri(());
}
}
pub struct BlockedPostBuilder<S: BosStr, St: blocked_post_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<feed::BlockedAuthor<S>>, Option<bool>, Option<AtUri<S>>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> BlockedPost<S> {
pub fn new() -> BlockedPostBuilder<S, blocked_post_state::Empty> {
BlockedPostBuilder::new()
}
}
impl<S: BosStr> BlockedPostBuilder<S, blocked_post_state::Empty> {
pub fn new() -> Self {
BlockedPostBuilder {
_state: PhantomData,
_fields: (None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> BlockedPostBuilder<S, St>
where
St: blocked_post_state::State,
St::Author: blocked_post_state::IsUnset,
{
pub fn author(
mut self,
value: impl Into<feed::BlockedAuthor<S>>,
) -> BlockedPostBuilder<S, blocked_post_state::SetAuthor<St>> {
self._fields.0 = Option::Some(value.into());
BlockedPostBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> BlockedPostBuilder<S, St>
where
St: blocked_post_state::State,
St::Blocked: blocked_post_state::IsUnset,
{
pub fn blocked(
mut self,
value: impl Into<bool>,
) -> BlockedPostBuilder<S, blocked_post_state::SetBlocked<St>> {
self._fields.1 = Option::Some(value.into());
BlockedPostBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> BlockedPostBuilder<S, St>
where
St: blocked_post_state::State,
St::Uri: blocked_post_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<AtUri<S>>,
) -> BlockedPostBuilder<S, blocked_post_state::SetUri<St>> {
self._fields.2 = Option::Some(value.into());
BlockedPostBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> BlockedPostBuilder<S, St>
where
St: blocked_post_state::State,
St::Author: blocked_post_state::IsSet,
St::Blocked: blocked_post_state::IsSet,
St::Uri: blocked_post_state::IsSet,
{
pub fn build(self) -> BlockedPost<S> {
BlockedPost {
author: self._fields.0.unwrap(),
blocked: self._fields.1.unwrap(),
uri: self._fields.2.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> BlockedPost<S> {
BlockedPost {
author: self._fields.0.unwrap(),
blocked: self._fields.1.unwrap(),
uri: self._fields.2.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod feed_view_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 Post;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Post = Unset;
}
pub struct SetPost<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetPost<St> {}
impl<St: State> State for SetPost<St> {
type Post = Set<members::post>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct post(());
}
}
pub struct FeedViewPostBuilder<S: BosStr, St: feed_view_post_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<S>,
Option<feed::PostView<S>>,
Option<FeedViewPostReason<S>>,
Option<feed::ReplyRef<S>>,
Option<S>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> FeedViewPost<S> {
pub fn new() -> FeedViewPostBuilder<S, feed_view_post_state::Empty> {
FeedViewPostBuilder::new()
}
}
impl<S: BosStr> FeedViewPostBuilder<S, feed_view_post_state::Empty> {
pub fn new() -> Self {
FeedViewPostBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St: feed_view_post_state::State> FeedViewPostBuilder<S, St> {
pub fn feed_context(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_feed_context(mut self, value: Option<S>) -> Self {
self._fields.0 = value;
self
}
}
impl<S: BosStr, St> FeedViewPostBuilder<S, St>
where
St: feed_view_post_state::State,
St::Post: feed_view_post_state::IsUnset,
{
pub fn post(
mut self,
value: impl Into<feed::PostView<S>>,
) -> FeedViewPostBuilder<S, feed_view_post_state::SetPost<St>> {
self._fields.1 = Option::Some(value.into());
FeedViewPostBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: feed_view_post_state::State> FeedViewPostBuilder<S, St> {
pub fn reason(mut self, value: impl Into<Option<FeedViewPostReason<S>>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_reason(mut self, value: Option<FeedViewPostReason<S>>) -> Self {
self._fields.2 = value;
self
}
}
impl<S: BosStr, St: feed_view_post_state::State> FeedViewPostBuilder<S, St> {
pub fn reply(mut self, value: impl Into<Option<feed::ReplyRef<S>>>) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_reply(mut self, value: Option<feed::ReplyRef<S>>) -> Self {
self._fields.3 = value;
self
}
}
impl<S: BosStr, St: feed_view_post_state::State> FeedViewPostBuilder<S, St> {
pub fn req_id(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_req_id(mut self, value: Option<S>) -> Self {
self._fields.4 = value;
self
}
}
impl<S: BosStr, St> FeedViewPostBuilder<S, St>
where
St: feed_view_post_state::State,
St::Post: feed_view_post_state::IsSet,
{
pub fn build(self) -> FeedViewPost<S> {
FeedViewPost {
feed_context: self._fields.0,
post: self._fields.1.unwrap(),
reason: self._fields.2,
reply: self._fields.3,
req_id: self._fields.4,
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> FeedViewPost<S> {
FeedViewPost {
feed_context: self._fields.0,
post: self._fields.1.unwrap(),
reason: self._fields.2,
reply: self._fields.3,
req_id: self._fields.4,
extra_data: Some(extra_data),
}
}
}
pub mod generator_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 IndexedAt;
type Did;
type Cid;
type Creator;
type DisplayName;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Uri = Unset;
type IndexedAt = Unset;
type Did = Unset;
type Cid = Unset;
type Creator = Unset;
type DisplayName = Unset;
}
pub struct SetUri<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetUri<St> {}
impl<St: State> State for SetUri<St> {
type Uri = Set<members::uri>;
type IndexedAt = St::IndexedAt;
type Did = St::Did;
type Cid = St::Cid;
type Creator = St::Creator;
type DisplayName = St::DisplayName;
}
pub struct SetIndexedAt<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetIndexedAt<St> {}
impl<St: State> State for SetIndexedAt<St> {
type Uri = St::Uri;
type IndexedAt = Set<members::indexed_at>;
type Did = St::Did;
type Cid = St::Cid;
type Creator = St::Creator;
type DisplayName = St::DisplayName;
}
pub struct SetDid<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetDid<St> {}
impl<St: State> State for SetDid<St> {
type Uri = St::Uri;
type IndexedAt = St::IndexedAt;
type Did = Set<members::did>;
type Cid = St::Cid;
type Creator = St::Creator;
type DisplayName = St::DisplayName;
}
pub struct SetCid<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetCid<St> {}
impl<St: State> State for SetCid<St> {
type Uri = St::Uri;
type IndexedAt = St::IndexedAt;
type Did = St::Did;
type Cid = Set<members::cid>;
type Creator = St::Creator;
type DisplayName = St::DisplayName;
}
pub struct SetCreator<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetCreator<St> {}
impl<St: State> State for SetCreator<St> {
type Uri = St::Uri;
type IndexedAt = St::IndexedAt;
type Did = St::Did;
type Cid = St::Cid;
type Creator = Set<members::creator>;
type DisplayName = St::DisplayName;
}
pub struct SetDisplayName<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetDisplayName<St> {}
impl<St: State> State for SetDisplayName<St> {
type Uri = St::Uri;
type IndexedAt = St::IndexedAt;
type Did = St::Did;
type Cid = St::Cid;
type Creator = St::Creator;
type DisplayName = Set<members::display_name>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct uri(());
pub struct indexed_at(());
pub struct did(());
pub struct cid(());
pub struct creator(());
pub struct display_name(());
}
}
pub struct GeneratorViewBuilder<S: BosStr, St: generator_view_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<bool>,
Option<UriValue<S>>,
Option<Cid<S>>,
Option<GeneratorViewContentMode<S>>,
Option<ProfileView<S>>,
Option<S>,
Option<Vec<Facet<S>>>,
Option<Did<S>>,
Option<S>,
Option<Datetime>,
Option<Vec<Label<S>>>,
Option<i64>,
Option<AtUri<S>>,
Option<feed::GeneratorViewerState<S>>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> GeneratorView<S> {
pub fn new() -> GeneratorViewBuilder<S, generator_view_state::Empty> {
GeneratorViewBuilder::new()
}
}
impl<S: BosStr> GeneratorViewBuilder<S, generator_view_state::Empty> {
pub fn new() -> Self {
GeneratorViewBuilder {
_state: PhantomData,
_fields: (
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
),
_type: PhantomData,
}
}
}
impl<S: BosStr, St: generator_view_state::State> GeneratorViewBuilder<S, St> {
pub fn accepts_interactions(mut self, value: impl Into<Option<bool>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_accepts_interactions(mut self, value: Option<bool>) -> Self {
self._fields.0 = value;
self
}
}
impl<S: BosStr, St: generator_view_state::State> GeneratorViewBuilder<S, St> {
pub fn avatar(mut self, value: impl Into<Option<UriValue<S>>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_avatar(mut self, value: Option<UriValue<S>>) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St> GeneratorViewBuilder<S, St>
where
St: generator_view_state::State,
St::Cid: generator_view_state::IsUnset,
{
pub fn cid(
mut self,
value: impl Into<Cid<S>>,
) -> GeneratorViewBuilder<S, generator_view_state::SetCid<St>> {
self._fields.2 = Option::Some(value.into());
GeneratorViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: generator_view_state::State> GeneratorViewBuilder<S, St> {
pub fn content_mode(
mut self,
value: impl Into<Option<GeneratorViewContentMode<S>>>,
) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_content_mode(
mut self,
value: Option<GeneratorViewContentMode<S>>,
) -> Self {
self._fields.3 = value;
self
}
}
impl<S: BosStr, St> GeneratorViewBuilder<S, St>
where
St: generator_view_state::State,
St::Creator: generator_view_state::IsUnset,
{
pub fn creator(
mut self,
value: impl Into<ProfileView<S>>,
) -> GeneratorViewBuilder<S, generator_view_state::SetCreator<St>> {
self._fields.4 = Option::Some(value.into());
GeneratorViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: generator_view_state::State> GeneratorViewBuilder<S, St> {
pub fn description(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.5 = value.into();
self
}
pub fn maybe_description(mut self, value: Option<S>) -> Self {
self._fields.5 = value;
self
}
}
impl<S: BosStr, St: generator_view_state::State> GeneratorViewBuilder<S, St> {
pub fn description_facets(
mut self,
value: impl Into<Option<Vec<Facet<S>>>>,
) -> Self {
self._fields.6 = value.into();
self
}
pub fn maybe_description_facets(mut self, value: Option<Vec<Facet<S>>>) -> Self {
self._fields.6 = value;
self
}
}
impl<S: BosStr, St> GeneratorViewBuilder<S, St>
where
St: generator_view_state::State,
St::Did: generator_view_state::IsUnset,
{
pub fn did(
mut self,
value: impl Into<Did<S>>,
) -> GeneratorViewBuilder<S, generator_view_state::SetDid<St>> {
self._fields.7 = Option::Some(value.into());
GeneratorViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> GeneratorViewBuilder<S, St>
where
St: generator_view_state::State,
St::DisplayName: generator_view_state::IsUnset,
{
pub fn display_name(
mut self,
value: impl Into<S>,
) -> GeneratorViewBuilder<S, generator_view_state::SetDisplayName<St>> {
self._fields.8 = Option::Some(value.into());
GeneratorViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> GeneratorViewBuilder<S, St>
where
St: generator_view_state::State,
St::IndexedAt: generator_view_state::IsUnset,
{
pub fn indexed_at(
mut self,
value: impl Into<Datetime>,
) -> GeneratorViewBuilder<S, generator_view_state::SetIndexedAt<St>> {
self._fields.9 = Option::Some(value.into());
GeneratorViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: generator_view_state::State> GeneratorViewBuilder<S, St> {
pub fn labels(mut self, value: impl Into<Option<Vec<Label<S>>>>) -> Self {
self._fields.10 = value.into();
self
}
pub fn maybe_labels(mut self, value: Option<Vec<Label<S>>>) -> Self {
self._fields.10 = value;
self
}
}
impl<S: BosStr, St: generator_view_state::State> GeneratorViewBuilder<S, St> {
pub fn like_count(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.11 = value.into();
self
}
pub fn maybe_like_count(mut self, value: Option<i64>) -> Self {
self._fields.11 = value;
self
}
}
impl<S: BosStr, St> GeneratorViewBuilder<S, St>
where
St: generator_view_state::State,
St::Uri: generator_view_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<AtUri<S>>,
) -> GeneratorViewBuilder<S, generator_view_state::SetUri<St>> {
self._fields.12 = Option::Some(value.into());
GeneratorViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: generator_view_state::State> GeneratorViewBuilder<S, St> {
pub fn viewer(
mut self,
value: impl Into<Option<feed::GeneratorViewerState<S>>>,
) -> Self {
self._fields.13 = value.into();
self
}
pub fn maybe_viewer(mut self, value: Option<feed::GeneratorViewerState<S>>) -> Self {
self._fields.13 = value;
self
}
}
impl<S: BosStr, St> GeneratorViewBuilder<S, St>
where
St: generator_view_state::State,
St::Uri: generator_view_state::IsSet,
St::IndexedAt: generator_view_state::IsSet,
St::Did: generator_view_state::IsSet,
St::Cid: generator_view_state::IsSet,
St::Creator: generator_view_state::IsSet,
St::DisplayName: generator_view_state::IsSet,
{
pub fn build(self) -> GeneratorView<S> {
GeneratorView {
accepts_interactions: self._fields.0,
avatar: self._fields.1,
cid: self._fields.2.unwrap(),
content_mode: self._fields.3,
creator: self._fields.4.unwrap(),
description: self._fields.5,
description_facets: self._fields.6,
did: self._fields.7.unwrap(),
display_name: self._fields.8.unwrap(),
indexed_at: self._fields.9.unwrap(),
labels: self._fields.10,
like_count: self._fields.11,
uri: self._fields.12.unwrap(),
viewer: self._fields.13,
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> GeneratorView<S> {
GeneratorView {
accepts_interactions: self._fields.0,
avatar: self._fields.1,
cid: self._fields.2.unwrap(),
content_mode: self._fields.3,
creator: self._fields.4.unwrap(),
description: self._fields.5,
description_facets: self._fields.6,
did: self._fields.7.unwrap(),
display_name: self._fields.8.unwrap(),
indexed_at: self._fields.9.unwrap(),
labels: self._fields.10,
like_count: self._fields.11,
uri: self._fields.12.unwrap(),
viewer: self._fields.13,
extra_data: Some(extra_data),
}
}
}
pub mod not_found_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 Uri;
type NotFound;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Uri = Unset;
type NotFound = Unset;
}
pub struct SetUri<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetUri<St> {}
impl<St: State> State for SetUri<St> {
type Uri = Set<members::uri>;
type NotFound = St::NotFound;
}
pub struct SetNotFound<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetNotFound<St> {}
impl<St: State> State for SetNotFound<St> {
type Uri = St::Uri;
type NotFound = Set<members::not_found>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct uri(());
pub struct not_found(());
}
}
pub struct NotFoundPostBuilder<S: BosStr, St: not_found_post_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<bool>, Option<AtUri<S>>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> NotFoundPost<S> {
pub fn new() -> NotFoundPostBuilder<S, not_found_post_state::Empty> {
NotFoundPostBuilder::new()
}
}
impl<S: BosStr> NotFoundPostBuilder<S, not_found_post_state::Empty> {
pub fn new() -> Self {
NotFoundPostBuilder {
_state: PhantomData,
_fields: (None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> NotFoundPostBuilder<S, St>
where
St: not_found_post_state::State,
St::NotFound: not_found_post_state::IsUnset,
{
pub fn not_found(
mut self,
value: impl Into<bool>,
) -> NotFoundPostBuilder<S, not_found_post_state::SetNotFound<St>> {
self._fields.0 = Option::Some(value.into());
NotFoundPostBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> NotFoundPostBuilder<S, St>
where
St: not_found_post_state::State,
St::Uri: not_found_post_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<AtUri<S>>,
) -> NotFoundPostBuilder<S, not_found_post_state::SetUri<St>> {
self._fields.1 = Option::Some(value.into());
NotFoundPostBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> NotFoundPostBuilder<S, St>
where
St: not_found_post_state::State,
St::Uri: not_found_post_state::IsSet,
St::NotFound: not_found_post_state::IsSet,
{
pub fn build(self) -> NotFoundPost<S> {
NotFoundPost {
not_found: self._fields.0.unwrap(),
uri: self._fields.1.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> NotFoundPost<S> {
NotFoundPost {
not_found: self._fields.0.unwrap(),
uri: self._fields.1.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod post_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 IndexedAt;
type Uri;
type Record;
type Cid;
type Author;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type IndexedAt = Unset;
type Uri = Unset;
type Record = Unset;
type Cid = Unset;
type Author = Unset;
}
pub struct SetIndexedAt<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetIndexedAt<St> {}
impl<St: State> State for SetIndexedAt<St> {
type IndexedAt = Set<members::indexed_at>;
type Uri = St::Uri;
type Record = St::Record;
type Cid = St::Cid;
type Author = St::Author;
}
pub struct SetUri<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetUri<St> {}
impl<St: State> State for SetUri<St> {
type IndexedAt = St::IndexedAt;
type Uri = Set<members::uri>;
type Record = St::Record;
type Cid = St::Cid;
type Author = St::Author;
}
pub struct SetRecord<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetRecord<St> {}
impl<St: State> State for SetRecord<St> {
type IndexedAt = St::IndexedAt;
type Uri = St::Uri;
type Record = Set<members::record>;
type Cid = St::Cid;
type Author = St::Author;
}
pub struct SetCid<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetCid<St> {}
impl<St: State> State for SetCid<St> {
type IndexedAt = St::IndexedAt;
type Uri = St::Uri;
type Record = St::Record;
type Cid = Set<members::cid>;
type Author = St::Author;
}
pub struct SetAuthor<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetAuthor<St> {}
impl<St: State> State for SetAuthor<St> {
type IndexedAt = St::IndexedAt;
type Uri = St::Uri;
type Record = St::Record;
type Cid = St::Cid;
type Author = Set<members::author>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct indexed_at(());
pub struct uri(());
pub struct record(());
pub struct cid(());
pub struct author(());
}
}
pub struct PostViewBuilder<S: BosStr, St: post_view_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<ProfileViewBasic<S>>,
Option<i64>,
Option<Cid<S>>,
Option<Data<S>>,
Option<PostViewEmbed<S>>,
Option<Datetime>,
Option<Vec<Label<S>>>,
Option<i64>,
Option<i64>,
Option<Data<S>>,
Option<i64>,
Option<i64>,
Option<feed::ThreadgateView<S>>,
Option<AtUri<S>>,
Option<feed::ViewerState<S>>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> PostView<S> {
pub fn new() -> PostViewBuilder<S, post_view_state::Empty> {
PostViewBuilder::new()
}
}
impl<S: BosStr> PostViewBuilder<S, post_view_state::Empty> {
pub fn new() -> Self {
PostViewBuilder {
_state: PhantomData,
_fields: (
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> PostViewBuilder<S, St>
where
St: post_view_state::State,
St::Author: post_view_state::IsUnset,
{
pub fn author(
mut self,
value: impl Into<ProfileViewBasic<S>>,
) -> PostViewBuilder<S, post_view_state::SetAuthor<St>> {
self._fields.0 = Option::Some(value.into());
PostViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: post_view_state::State> PostViewBuilder<S, St> {
pub fn bookmark_count(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_bookmark_count(mut self, value: Option<i64>) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St> PostViewBuilder<S, St>
where
St: post_view_state::State,
St::Cid: post_view_state::IsUnset,
{
pub fn cid(
mut self,
value: impl Into<Cid<S>>,
) -> PostViewBuilder<S, post_view_state::SetCid<St>> {
self._fields.2 = Option::Some(value.into());
PostViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: post_view_state::State> PostViewBuilder<S, St> {
pub fn debug(mut self, value: impl Into<Option<Data<S>>>) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_debug(mut self, value: Option<Data<S>>) -> Self {
self._fields.3 = value;
self
}
}
impl<S: BosStr, St: post_view_state::State> PostViewBuilder<S, St> {
pub fn embed(mut self, value: impl Into<Option<PostViewEmbed<S>>>) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_embed(mut self, value: Option<PostViewEmbed<S>>) -> Self {
self._fields.4 = value;
self
}
}
impl<S: BosStr, St> PostViewBuilder<S, St>
where
St: post_view_state::State,
St::IndexedAt: post_view_state::IsUnset,
{
pub fn indexed_at(
mut self,
value: impl Into<Datetime>,
) -> PostViewBuilder<S, post_view_state::SetIndexedAt<St>> {
self._fields.5 = Option::Some(value.into());
PostViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: post_view_state::State> PostViewBuilder<S, St> {
pub fn labels(mut self, value: impl Into<Option<Vec<Label<S>>>>) -> Self {
self._fields.6 = value.into();
self
}
pub fn maybe_labels(mut self, value: Option<Vec<Label<S>>>) -> Self {
self._fields.6 = value;
self
}
}
impl<S: BosStr, St: post_view_state::State> PostViewBuilder<S, St> {
pub fn like_count(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.7 = value.into();
self
}
pub fn maybe_like_count(mut self, value: Option<i64>) -> Self {
self._fields.7 = value;
self
}
}
impl<S: BosStr, St: post_view_state::State> PostViewBuilder<S, St> {
pub fn quote_count(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.8 = value.into();
self
}
pub fn maybe_quote_count(mut self, value: Option<i64>) -> Self {
self._fields.8 = value;
self
}
}
impl<S: BosStr, St> PostViewBuilder<S, St>
where
St: post_view_state::State,
St::Record: post_view_state::IsUnset,
{
pub fn record(
mut self,
value: impl Into<Data<S>>,
) -> PostViewBuilder<S, post_view_state::SetRecord<St>> {
self._fields.9 = Option::Some(value.into());
PostViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: post_view_state::State> PostViewBuilder<S, St> {
pub fn reply_count(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.10 = value.into();
self
}
pub fn maybe_reply_count(mut self, value: Option<i64>) -> Self {
self._fields.10 = value;
self
}
}
impl<S: BosStr, St: post_view_state::State> PostViewBuilder<S, St> {
pub fn repost_count(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.11 = value.into();
self
}
pub fn maybe_repost_count(mut self, value: Option<i64>) -> Self {
self._fields.11 = value;
self
}
}
impl<S: BosStr, St: post_view_state::State> PostViewBuilder<S, St> {
pub fn threadgate(
mut self,
value: impl Into<Option<feed::ThreadgateView<S>>>,
) -> Self {
self._fields.12 = value.into();
self
}
pub fn maybe_threadgate(mut self, value: Option<feed::ThreadgateView<S>>) -> Self {
self._fields.12 = value;
self
}
}
impl<S: BosStr, St> PostViewBuilder<S, St>
where
St: post_view_state::State,
St::Uri: post_view_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<AtUri<S>>,
) -> PostViewBuilder<S, post_view_state::SetUri<St>> {
self._fields.13 = Option::Some(value.into());
PostViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: post_view_state::State> PostViewBuilder<S, St> {
pub fn viewer(mut self, value: impl Into<Option<feed::ViewerState<S>>>) -> Self {
self._fields.14 = value.into();
self
}
pub fn maybe_viewer(mut self, value: Option<feed::ViewerState<S>>) -> Self {
self._fields.14 = value;
self
}
}
impl<S: BosStr, St> PostViewBuilder<S, St>
where
St: post_view_state::State,
St::IndexedAt: post_view_state::IsSet,
St::Uri: post_view_state::IsSet,
St::Record: post_view_state::IsSet,
St::Cid: post_view_state::IsSet,
St::Author: post_view_state::IsSet,
{
pub fn build(self) -> PostView<S> {
PostView {
author: self._fields.0.unwrap(),
bookmark_count: self._fields.1,
cid: self._fields.2.unwrap(),
debug: self._fields.3,
embed: self._fields.4,
indexed_at: self._fields.5.unwrap(),
labels: self._fields.6,
like_count: self._fields.7,
quote_count: self._fields.8,
record: self._fields.9.unwrap(),
reply_count: self._fields.10,
repost_count: self._fields.11,
threadgate: self._fields.12,
uri: self._fields.13.unwrap(),
viewer: self._fields.14,
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> PostView<S> {
PostView {
author: self._fields.0.unwrap(),
bookmark_count: self._fields.1,
cid: self._fields.2.unwrap(),
debug: self._fields.3,
embed: self._fields.4,
indexed_at: self._fields.5.unwrap(),
labels: self._fields.6,
like_count: self._fields.7,
quote_count: self._fields.8,
record: self._fields.9.unwrap(),
reply_count: self._fields.10,
repost_count: self._fields.11,
threadgate: self._fields.12,
uri: self._fields.13.unwrap(),
viewer: self._fields.14,
extra_data: Some(extra_data),
}
}
}
pub mod reason_repost_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 By;
type IndexedAt;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type By = Unset;
type IndexedAt = Unset;
}
pub struct SetBy<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetBy<St> {}
impl<St: State> State for SetBy<St> {
type By = Set<members::by>;
type IndexedAt = St::IndexedAt;
}
pub struct SetIndexedAt<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetIndexedAt<St> {}
impl<St: State> State for SetIndexedAt<St> {
type By = St::By;
type IndexedAt = Set<members::indexed_at>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct by(());
pub struct indexed_at(());
}
}
pub struct ReasonRepostBuilder<S: BosStr, St: reason_repost_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<ProfileViewBasic<S>>,
Option<Cid<S>>,
Option<Datetime>,
Option<AtUri<S>>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> ReasonRepost<S> {
pub fn new() -> ReasonRepostBuilder<S, reason_repost_state::Empty> {
ReasonRepostBuilder::new()
}
}
impl<S: BosStr> ReasonRepostBuilder<S, reason_repost_state::Empty> {
pub fn new() -> Self {
ReasonRepostBuilder {
_state: PhantomData,
_fields: (None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ReasonRepostBuilder<S, St>
where
St: reason_repost_state::State,
St::By: reason_repost_state::IsUnset,
{
pub fn by(
mut self,
value: impl Into<ProfileViewBasic<S>>,
) -> ReasonRepostBuilder<S, reason_repost_state::SetBy<St>> {
self._fields.0 = Option::Some(value.into());
ReasonRepostBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: reason_repost_state::State> ReasonRepostBuilder<S, St> {
pub fn cid(mut self, value: impl Into<Option<Cid<S>>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_cid(mut self, value: Option<Cid<S>>) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St> ReasonRepostBuilder<S, St>
where
St: reason_repost_state::State,
St::IndexedAt: reason_repost_state::IsUnset,
{
pub fn indexed_at(
mut self,
value: impl Into<Datetime>,
) -> ReasonRepostBuilder<S, reason_repost_state::SetIndexedAt<St>> {
self._fields.2 = Option::Some(value.into());
ReasonRepostBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: reason_repost_state::State> ReasonRepostBuilder<S, St> {
pub fn uri(mut self, value: impl Into<Option<AtUri<S>>>) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_uri(mut self, value: Option<AtUri<S>>) -> Self {
self._fields.3 = value;
self
}
}
impl<S: BosStr, St> ReasonRepostBuilder<S, St>
where
St: reason_repost_state::State,
St::By: reason_repost_state::IsSet,
St::IndexedAt: reason_repost_state::IsSet,
{
pub fn build(self) -> ReasonRepost<S> {
ReasonRepost {
by: self._fields.0.unwrap(),
cid: self._fields.1,
indexed_at: self._fields.2.unwrap(),
uri: self._fields.3,
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> ReasonRepost<S> {
ReasonRepost {
by: self._fields.0.unwrap(),
cid: self._fields.1,
indexed_at: self._fields.2.unwrap(),
uri: self._fields.3,
extra_data: Some(extra_data),
}
}
}
pub mod reply_ref_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 Parent;
type Root;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Parent = Unset;
type Root = Unset;
}
pub struct SetParent<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetParent<St> {}
impl<St: State> State for SetParent<St> {
type Parent = Set<members::parent>;
type Root = St::Root;
}
pub struct SetRoot<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetRoot<St> {}
impl<St: State> State for SetRoot<St> {
type Parent = St::Parent;
type Root = Set<members::root>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct parent(());
pub struct root(());
}
}
pub struct ReplyRefBuilder<S: BosStr, St: reply_ref_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<ProfileViewBasic<S>>,
Option<ReplyRefParent<S>>,
Option<ReplyRefRoot<S>>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> ReplyRef<S> {
pub fn new() -> ReplyRefBuilder<S, reply_ref_state::Empty> {
ReplyRefBuilder::new()
}
}
impl<S: BosStr> ReplyRefBuilder<S, reply_ref_state::Empty> {
pub fn new() -> Self {
ReplyRefBuilder {
_state: PhantomData,
_fields: (None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St: reply_ref_state::State> ReplyRefBuilder<S, St> {
pub fn grandparent_author(
mut self,
value: impl Into<Option<ProfileViewBasic<S>>>,
) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_grandparent_author(
mut self,
value: Option<ProfileViewBasic<S>>,
) -> Self {
self._fields.0 = value;
self
}
}
impl<S: BosStr, St> ReplyRefBuilder<S, St>
where
St: reply_ref_state::State,
St::Parent: reply_ref_state::IsUnset,
{
pub fn parent(
mut self,
value: impl Into<ReplyRefParent<S>>,
) -> ReplyRefBuilder<S, reply_ref_state::SetParent<St>> {
self._fields.1 = Option::Some(value.into());
ReplyRefBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ReplyRefBuilder<S, St>
where
St: reply_ref_state::State,
St::Root: reply_ref_state::IsUnset,
{
pub fn root(
mut self,
value: impl Into<ReplyRefRoot<S>>,
) -> ReplyRefBuilder<S, reply_ref_state::SetRoot<St>> {
self._fields.2 = Option::Some(value.into());
ReplyRefBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ReplyRefBuilder<S, St>
where
St: reply_ref_state::State,
St::Parent: reply_ref_state::IsSet,
St::Root: reply_ref_state::IsSet,
{
pub fn build(self) -> ReplyRef<S> {
ReplyRef {
grandparent_author: self._fields.0,
parent: self._fields.1.unwrap(),
root: self._fields.2.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> ReplyRef<S> {
ReplyRef {
grandparent_author: self._fields.0,
parent: self._fields.1.unwrap(),
root: self._fields.2.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod skeleton_feed_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 Post;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Post = Unset;
}
pub struct SetPost<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetPost<St> {}
impl<St: State> State for SetPost<St> {
type Post = Set<members::post>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct post(());
}
}
pub struct SkeletonFeedPostBuilder<S: BosStr, St: skeleton_feed_post_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<S>, Option<AtUri<S>>, Option<SkeletonFeedPostReason<S>>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> SkeletonFeedPost<S> {
pub fn new() -> SkeletonFeedPostBuilder<S, skeleton_feed_post_state::Empty> {
SkeletonFeedPostBuilder::new()
}
}
impl<S: BosStr> SkeletonFeedPostBuilder<S, skeleton_feed_post_state::Empty> {
pub fn new() -> Self {
SkeletonFeedPostBuilder {
_state: PhantomData,
_fields: (None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St: skeleton_feed_post_state::State> SkeletonFeedPostBuilder<S, St> {
pub fn feed_context(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_feed_context(mut self, value: Option<S>) -> Self {
self._fields.0 = value;
self
}
}
impl<S: BosStr, St> SkeletonFeedPostBuilder<S, St>
where
St: skeleton_feed_post_state::State,
St::Post: skeleton_feed_post_state::IsUnset,
{
pub fn post(
mut self,
value: impl Into<AtUri<S>>,
) -> SkeletonFeedPostBuilder<S, skeleton_feed_post_state::SetPost<St>> {
self._fields.1 = Option::Some(value.into());
SkeletonFeedPostBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: skeleton_feed_post_state::State> SkeletonFeedPostBuilder<S, St> {
pub fn reason(
mut self,
value: impl Into<Option<SkeletonFeedPostReason<S>>>,
) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_reason(mut self, value: Option<SkeletonFeedPostReason<S>>) -> Self {
self._fields.2 = value;
self
}
}
impl<S: BosStr, St> SkeletonFeedPostBuilder<S, St>
where
St: skeleton_feed_post_state::State,
St::Post: skeleton_feed_post_state::IsSet,
{
pub fn build(self) -> SkeletonFeedPost<S> {
SkeletonFeedPost {
feed_context: self._fields.0,
post: self._fields.1.unwrap(),
reason: self._fields.2,
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> SkeletonFeedPost<S> {
SkeletonFeedPost {
feed_context: self._fields.0,
post: self._fields.1.unwrap(),
reason: self._fields.2,
extra_data: Some(extra_data),
}
}
}
pub mod skeleton_reason_repost_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 Repost;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Repost = Unset;
}
pub struct SetRepost<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetRepost<St> {}
impl<St: State> State for SetRepost<St> {
type Repost = Set<members::repost>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct repost(());
}
}
pub struct SkeletonReasonRepostBuilder<
S: BosStr,
St: skeleton_reason_repost_state::State,
> {
_state: PhantomData<fn() -> St>,
_fields: (Option<AtUri<S>>,),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> SkeletonReasonRepost<S> {
pub fn new() -> SkeletonReasonRepostBuilder<S, skeleton_reason_repost_state::Empty> {
SkeletonReasonRepostBuilder::new()
}
}
impl<S: BosStr> SkeletonReasonRepostBuilder<S, skeleton_reason_repost_state::Empty> {
pub fn new() -> Self {
SkeletonReasonRepostBuilder {
_state: PhantomData,
_fields: (None,),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> SkeletonReasonRepostBuilder<S, St>
where
St: skeleton_reason_repost_state::State,
St::Repost: skeleton_reason_repost_state::IsUnset,
{
pub fn repost(
mut self,
value: impl Into<AtUri<S>>,
) -> SkeletonReasonRepostBuilder<S, skeleton_reason_repost_state::SetRepost<St>> {
self._fields.0 = Option::Some(value.into());
SkeletonReasonRepostBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> SkeletonReasonRepostBuilder<S, St>
where
St: skeleton_reason_repost_state::State,
St::Repost: skeleton_reason_repost_state::IsSet,
{
pub fn build(self) -> SkeletonReasonRepost<S> {
SkeletonReasonRepost {
repost: self._fields.0.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> SkeletonReasonRepost<S> {
SkeletonReasonRepost {
repost: self._fields.0.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod thread_view_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 Post;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Post = Unset;
}
pub struct SetPost<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetPost<St> {}
impl<St: State> State for SetPost<St> {
type Post = Set<members::post>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct post(());
}
}
pub struct ThreadViewPostBuilder<S: BosStr, St: thread_view_post_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<ThreadViewPostParent<S>>,
Option<feed::PostView<S>>,
Option<Vec<ThreadViewPostRepliesItem<S>>>,
Option<feed::ThreadContext<S>>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> ThreadViewPost<S> {
pub fn new() -> ThreadViewPostBuilder<S, thread_view_post_state::Empty> {
ThreadViewPostBuilder::new()
}
}
impl<S: BosStr> ThreadViewPostBuilder<S, thread_view_post_state::Empty> {
pub fn new() -> Self {
ThreadViewPostBuilder {
_state: PhantomData,
_fields: (None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St: thread_view_post_state::State> ThreadViewPostBuilder<S, St> {
pub fn parent(mut self, value: impl Into<Option<ThreadViewPostParent<S>>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_parent(mut self, value: Option<ThreadViewPostParent<S>>) -> Self {
self._fields.0 = value;
self
}
}
impl<S: BosStr, St> ThreadViewPostBuilder<S, St>
where
St: thread_view_post_state::State,
St::Post: thread_view_post_state::IsUnset,
{
pub fn post(
mut self,
value: impl Into<feed::PostView<S>>,
) -> ThreadViewPostBuilder<S, thread_view_post_state::SetPost<St>> {
self._fields.1 = Option::Some(value.into());
ThreadViewPostBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: thread_view_post_state::State> ThreadViewPostBuilder<S, St> {
pub fn replies(
mut self,
value: impl Into<Option<Vec<ThreadViewPostRepliesItem<S>>>>,
) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_replies(
mut self,
value: Option<Vec<ThreadViewPostRepliesItem<S>>>,
) -> Self {
self._fields.2 = value;
self
}
}
impl<S: BosStr, St: thread_view_post_state::State> ThreadViewPostBuilder<S, St> {
pub fn thread_context(
mut self,
value: impl Into<Option<feed::ThreadContext<S>>>,
) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_thread_context(
mut self,
value: Option<feed::ThreadContext<S>>,
) -> Self {
self._fields.3 = value;
self
}
}
impl<S: BosStr, St> ThreadViewPostBuilder<S, St>
where
St: thread_view_post_state::State,
St::Post: thread_view_post_state::IsSet,
{
pub fn build(self) -> ThreadViewPost<S> {
ThreadViewPost {
parent: self._fields.0,
post: self._fields.1.unwrap(),
replies: self._fields.2,
thread_context: self._fields.3,
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> ThreadViewPost<S> {
ThreadViewPost {
parent: self._fields.0,
post: self._fields.1.unwrap(),
replies: self._fields.2,
thread_context: self._fields.3,
extra_data: Some(extra_data),
}
}
}