Skip to main content

jacquard_api/app_bsky/
feed.rs

1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: app.bsky.feed.defs
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8//! Generated bindings for the `app.bsky.feed` Lexicon namespace/module.
9pub mod describe_feed_generator;
10pub mod generator;
11pub mod get_actor_feeds;
12pub mod get_actor_likes;
13pub mod get_author_feed;
14pub mod get_feed;
15pub mod get_feed_generator;
16pub mod get_feed_generators;
17pub mod get_feed_skeleton;
18pub mod get_likes;
19pub mod get_list_feed;
20pub mod get_post_thread;
21pub mod get_posts;
22pub mod get_quotes;
23pub mod get_reposted_by;
24pub mod get_suggested_feeds;
25pub mod get_timeline;
26pub mod like;
27pub mod post;
28pub mod postgate;
29pub mod repost;
30pub mod search_posts;
31pub mod send_interactions;
32pub mod threadgate;
33
34
35#[allow(unused_imports)]
36use alloc::collections::BTreeMap;
37
38#[allow(unused_imports)]
39use core::marker::PhantomData;
40use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr};
41
42#[allow(unused_imports)]
43use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
44use jacquard_common::deps::smol_str::SmolStr;
45use jacquard_common::types::string::{Did, AtUri, Cid, Datetime, UriValue};
46use jacquard_common::types::value::Data;
47use jacquard_derive::{IntoStatic, open_union};
48use jacquard_lexicon::lexicon::LexiconDoc;
49use jacquard_lexicon::schema::LexiconSchema;
50
51#[allow(unused_imports)]
52use jacquard_lexicon::validation::{ConstraintError, ValidationPath};
53use serde::{Serialize, Deserialize};
54use crate::app_bsky::actor::ProfileView;
55use crate::app_bsky::actor::ProfileViewBasic;
56use crate::app_bsky::graph::ListViewBasic;
57use crate::app_bsky::richtext::facet::Facet;
58use crate::com_atproto::label::Label;
59use crate::app_bsky::actor;
60use crate::app_bsky::embed::external;
61use crate::app_bsky::embed::gallery;
62use crate::app_bsky::embed::images;
63use crate::app_bsky::embed::record;
64use crate::app_bsky::embed::record_with_media;
65use crate::app_bsky::embed::video;
66use crate::app_bsky::feed;
67
68#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
69#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
70pub struct BlockedAuthor<S: BosStr = DefaultStr> {
71    pub did: Did<S>,
72    #[serde(skip_serializing_if = "Option::is_none")]
73    pub viewer: Option<actor::ViewerState<S>>,
74    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
75    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
76}
77
78
79#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
80#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
81pub struct BlockedPost<S: BosStr = DefaultStr> {
82    pub author: feed::BlockedAuthor<S>,
83    pub blocked: bool,
84    pub uri: AtUri<S>,
85    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
86    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
87}
88
89/// User clicked through to the author of the feed item
90
91#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
92pub struct ClickthroughAuthor;
93impl core::fmt::Display for ClickthroughAuthor {
94    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
95        write!(f, "clickthroughAuthor")
96    }
97}
98
99/// User clicked through to the embedded content of the feed item
100
101#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
102pub struct ClickthroughEmbed;
103impl core::fmt::Display for ClickthroughEmbed {
104    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
105        write!(f, "clickthroughEmbed")
106    }
107}
108
109/// User clicked through to the feed item
110
111#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
112pub struct ClickthroughItem;
113impl core::fmt::Display for ClickthroughItem {
114    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
115        write!(f, "clickthroughItem")
116    }
117}
118
119/// User clicked through to the reposter of the feed item
120
121#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
122pub struct ClickthroughReposter;
123impl core::fmt::Display for ClickthroughReposter {
124    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
125        write!(f, "clickthroughReposter")
126    }
127}
128
129/// Declares the feed generator returns any types of posts.
130
131#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
132pub struct ContentModeUnspecified;
133impl core::fmt::Display for ContentModeUnspecified {
134    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
135        write!(f, "contentModeUnspecified")
136    }
137}
138
139/// Declares the feed generator returns posts containing app.bsky.embed.video embeds.
140
141#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
142pub struct ContentModeVideo;
143impl core::fmt::Display for ContentModeVideo {
144    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
145        write!(f, "contentModeVideo")
146    }
147}
148
149
150#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
151#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
152pub struct FeedViewPost<S: BosStr = DefaultStr> {
153    ///Context provided by feed generator that may be passed back alongside interactions.
154    #[serde(skip_serializing_if = "Option::is_none")]
155    pub feed_context: Option<S>,
156    pub post: feed::PostView<S>,
157    #[serde(skip_serializing_if = "Option::is_none")]
158    pub reason: Option<FeedViewPostReason<S>>,
159    #[serde(skip_serializing_if = "Option::is_none")]
160    pub reply: Option<feed::ReplyRef<S>>,
161    ///Unique identifier per request that may be passed back alongside interactions.
162    #[serde(skip_serializing_if = "Option::is_none")]
163    pub req_id: Option<S>,
164    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
165    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
166}
167
168
169#[open_union]
170#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
171#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
172pub enum FeedViewPostReason<S: BosStr = DefaultStr> {
173    #[serde(rename = "app.bsky.feed.defs#reasonRepost")]
174    ReasonRepost(Box<feed::ReasonRepost<S>>),
175    #[serde(rename = "app.bsky.feed.defs#reasonPin")]
176    ReasonPin(Box<feed::ReasonPin<S>>),
177}
178
179
180#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
181#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
182pub struct GeneratorView<S: BosStr = DefaultStr> {
183    #[serde(skip_serializing_if = "Option::is_none")]
184    pub accepts_interactions: Option<bool>,
185    #[serde(skip_serializing_if = "Option::is_none")]
186    pub avatar: Option<UriValue<S>>,
187    pub cid: Cid<S>,
188    #[serde(skip_serializing_if = "Option::is_none")]
189    pub content_mode: Option<GeneratorViewContentMode<S>>,
190    pub creator: ProfileView<S>,
191    #[serde(skip_serializing_if = "Option::is_none")]
192    pub description: Option<S>,
193    #[serde(skip_serializing_if = "Option::is_none")]
194    pub description_facets: Option<Vec<Facet<S>>>,
195    pub did: Did<S>,
196    pub display_name: S,
197    pub indexed_at: Datetime,
198    #[serde(skip_serializing_if = "Option::is_none")]
199    pub labels: Option<Vec<Label<S>>>,
200    #[serde(skip_serializing_if = "Option::is_none")]
201    pub like_count: Option<i64>,
202    pub uri: AtUri<S>,
203    #[serde(skip_serializing_if = "Option::is_none")]
204    pub viewer: Option<feed::GeneratorViewerState<S>>,
205    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
206    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
207}
208
209
210#[derive(Debug, Clone, PartialEq, Eq, Hash)]
211pub enum GeneratorViewContentMode<S: BosStr = DefaultStr> {
212    ContentModeUnspecified,
213    ContentModeVideo,
214    Other(S),
215}
216
217impl<S: BosStr> GeneratorViewContentMode<S> {
218    pub fn as_str(&self) -> &str {
219        match self {
220            Self::ContentModeUnspecified => "app.bsky.feed.defs#contentModeUnspecified",
221            Self::ContentModeVideo => "app.bsky.feed.defs#contentModeVideo",
222            Self::Other(s) => s.as_ref(),
223        }
224    }
225    /// Construct from a string-like value, matching known values.
226    pub fn from_value(s: S) -> Self {
227        match s.as_ref() {
228            "app.bsky.feed.defs#contentModeUnspecified" => Self::ContentModeUnspecified,
229            "app.bsky.feed.defs#contentModeVideo" => Self::ContentModeVideo,
230            _ => Self::Other(s),
231        }
232    }
233}
234
235impl<S: BosStr> core::fmt::Display for GeneratorViewContentMode<S> {
236    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
237        write!(f, "{}", self.as_str())
238    }
239}
240
241impl<S: BosStr> AsRef<str> for GeneratorViewContentMode<S> {
242    fn as_ref(&self) -> &str {
243        self.as_str()
244    }
245}
246
247impl<S: BosStr> Serialize for GeneratorViewContentMode<S> {
248    fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
249    where
250        Ser: serde::Serializer,
251    {
252        serializer.serialize_str(self.as_str())
253    }
254}
255
256impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de>
257for GeneratorViewContentMode<S> {
258    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
259    where
260        D: serde::Deserializer<'de>,
261    {
262        let s = S::deserialize(deserializer)?;
263        Ok(Self::from_value(s))
264    }
265}
266
267impl<S: BosStr + Default> Default for GeneratorViewContentMode<S> {
268    fn default() -> Self {
269        Self::Other(Default::default())
270    }
271}
272
273impl<S: BosStr> jacquard_common::IntoStatic for GeneratorViewContentMode<S>
274where
275    S: BosStr + jacquard_common::IntoStatic,
276    S::Output: BosStr,
277{
278    type Output = GeneratorViewContentMode<S::Output>;
279    fn into_static(self) -> Self::Output {
280        match self {
281            GeneratorViewContentMode::ContentModeUnspecified => {
282                GeneratorViewContentMode::ContentModeUnspecified
283            }
284            GeneratorViewContentMode::ContentModeVideo => {
285                GeneratorViewContentMode::ContentModeVideo
286            }
287            GeneratorViewContentMode::Other(v) => {
288                GeneratorViewContentMode::Other(v.into_static())
289            }
290        }
291    }
292}
293
294
295#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
296#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
297pub struct GeneratorViewerState<S: BosStr = DefaultStr> {
298    #[serde(skip_serializing_if = "Option::is_none")]
299    pub like: Option<AtUri<S>>,
300    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
301    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
302}
303
304
305#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
306#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
307pub struct Interaction<S: BosStr = DefaultStr> {
308    #[serde(skip_serializing_if = "Option::is_none")]
309    pub event: Option<InteractionEvent<S>>,
310    ///Context on a feed item that was originally supplied by the feed generator on getFeedSkeleton.
311    #[serde(skip_serializing_if = "Option::is_none")]
312    pub feed_context: Option<S>,
313    #[serde(skip_serializing_if = "Option::is_none")]
314    pub item: Option<AtUri<S>>,
315    ///Unique identifier per request that may be passed back alongside interactions.
316    #[serde(skip_serializing_if = "Option::is_none")]
317    pub req_id: Option<S>,
318    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
319    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
320}
321
322
323#[derive(Debug, Clone, PartialEq, Eq, Hash)]
324pub enum InteractionEvent<S: BosStr = DefaultStr> {
325    RequestLess,
326    RequestMore,
327    ClickthroughItem,
328    ClickthroughAuthor,
329    ClickthroughReposter,
330    ClickthroughEmbed,
331    InteractionSeen,
332    InteractionLike,
333    InteractionRepost,
334    InteractionReply,
335    InteractionQuote,
336    InteractionShare,
337    Other(S),
338}
339
340impl<S: BosStr> InteractionEvent<S> {
341    pub fn as_str(&self) -> &str {
342        match self {
343            Self::RequestLess => "app.bsky.feed.defs#requestLess",
344            Self::RequestMore => "app.bsky.feed.defs#requestMore",
345            Self::ClickthroughItem => "app.bsky.feed.defs#clickthroughItem",
346            Self::ClickthroughAuthor => "app.bsky.feed.defs#clickthroughAuthor",
347            Self::ClickthroughReposter => "app.bsky.feed.defs#clickthroughReposter",
348            Self::ClickthroughEmbed => "app.bsky.feed.defs#clickthroughEmbed",
349            Self::InteractionSeen => "app.bsky.feed.defs#interactionSeen",
350            Self::InteractionLike => "app.bsky.feed.defs#interactionLike",
351            Self::InteractionRepost => "app.bsky.feed.defs#interactionRepost",
352            Self::InteractionReply => "app.bsky.feed.defs#interactionReply",
353            Self::InteractionQuote => "app.bsky.feed.defs#interactionQuote",
354            Self::InteractionShare => "app.bsky.feed.defs#interactionShare",
355            Self::Other(s) => s.as_ref(),
356        }
357    }
358    /// Construct from a string-like value, matching known values.
359    pub fn from_value(s: S) -> Self {
360        match s.as_ref() {
361            "app.bsky.feed.defs#requestLess" => Self::RequestLess,
362            "app.bsky.feed.defs#requestMore" => Self::RequestMore,
363            "app.bsky.feed.defs#clickthroughItem" => Self::ClickthroughItem,
364            "app.bsky.feed.defs#clickthroughAuthor" => Self::ClickthroughAuthor,
365            "app.bsky.feed.defs#clickthroughReposter" => Self::ClickthroughReposter,
366            "app.bsky.feed.defs#clickthroughEmbed" => Self::ClickthroughEmbed,
367            "app.bsky.feed.defs#interactionSeen" => Self::InteractionSeen,
368            "app.bsky.feed.defs#interactionLike" => Self::InteractionLike,
369            "app.bsky.feed.defs#interactionRepost" => Self::InteractionRepost,
370            "app.bsky.feed.defs#interactionReply" => Self::InteractionReply,
371            "app.bsky.feed.defs#interactionQuote" => Self::InteractionQuote,
372            "app.bsky.feed.defs#interactionShare" => Self::InteractionShare,
373            _ => Self::Other(s),
374        }
375    }
376}
377
378impl<S: BosStr> core::fmt::Display for InteractionEvent<S> {
379    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
380        write!(f, "{}", self.as_str())
381    }
382}
383
384impl<S: BosStr> AsRef<str> for InteractionEvent<S> {
385    fn as_ref(&self) -> &str {
386        self.as_str()
387    }
388}
389
390impl<S: BosStr> Serialize for InteractionEvent<S> {
391    fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
392    where
393        Ser: serde::Serializer,
394    {
395        serializer.serialize_str(self.as_str())
396    }
397}
398
399impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for InteractionEvent<S> {
400    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
401    where
402        D: serde::Deserializer<'de>,
403    {
404        let s = S::deserialize(deserializer)?;
405        Ok(Self::from_value(s))
406    }
407}
408
409impl<S: BosStr + Default> Default for InteractionEvent<S> {
410    fn default() -> Self {
411        Self::Other(Default::default())
412    }
413}
414
415impl<S: BosStr> jacquard_common::IntoStatic for InteractionEvent<S>
416where
417    S: BosStr + jacquard_common::IntoStatic,
418    S::Output: BosStr,
419{
420    type Output = InteractionEvent<S::Output>;
421    fn into_static(self) -> Self::Output {
422        match self {
423            InteractionEvent::RequestLess => InteractionEvent::RequestLess,
424            InteractionEvent::RequestMore => InteractionEvent::RequestMore,
425            InteractionEvent::ClickthroughItem => InteractionEvent::ClickthroughItem,
426            InteractionEvent::ClickthroughAuthor => InteractionEvent::ClickthroughAuthor,
427            InteractionEvent::ClickthroughReposter => {
428                InteractionEvent::ClickthroughReposter
429            }
430            InteractionEvent::ClickthroughEmbed => InteractionEvent::ClickthroughEmbed,
431            InteractionEvent::InteractionSeen => InteractionEvent::InteractionSeen,
432            InteractionEvent::InteractionLike => InteractionEvent::InteractionLike,
433            InteractionEvent::InteractionRepost => InteractionEvent::InteractionRepost,
434            InteractionEvent::InteractionReply => InteractionEvent::InteractionReply,
435            InteractionEvent::InteractionQuote => InteractionEvent::InteractionQuote,
436            InteractionEvent::InteractionShare => InteractionEvent::InteractionShare,
437            InteractionEvent::Other(v) => InteractionEvent::Other(v.into_static()),
438        }
439    }
440}
441
442/// User liked the feed item
443
444#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
445pub struct InteractionLike;
446impl core::fmt::Display for InteractionLike {
447    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
448        write!(f, "interactionLike")
449    }
450}
451
452/// User quoted the feed item
453
454#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
455pub struct InteractionQuote;
456impl core::fmt::Display for InteractionQuote {
457    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
458        write!(f, "interactionQuote")
459    }
460}
461
462/// User replied to the feed item
463
464#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
465pub struct InteractionReply;
466impl core::fmt::Display for InteractionReply {
467    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
468        write!(f, "interactionReply")
469    }
470}
471
472/// User reposted the feed item
473
474#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
475pub struct InteractionRepost;
476impl core::fmt::Display for InteractionRepost {
477    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
478        write!(f, "interactionRepost")
479    }
480}
481
482/// Feed item was seen by user
483
484#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
485pub struct InteractionSeen;
486impl core::fmt::Display for InteractionSeen {
487    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
488        write!(f, "interactionSeen")
489    }
490}
491
492/// User shared the feed item
493
494#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
495pub struct InteractionShare;
496impl core::fmt::Display for InteractionShare {
497    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
498        write!(f, "interactionShare")
499    }
500}
501
502
503#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
504#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
505pub struct NotFoundPost<S: BosStr = DefaultStr> {
506    pub not_found: bool,
507    pub uri: AtUri<S>,
508    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
509    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
510}
511
512
513#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
514#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
515pub struct PostView<S: BosStr = DefaultStr> {
516    pub author: ProfileViewBasic<S>,
517    #[serde(skip_serializing_if = "Option::is_none")]
518    pub bookmark_count: Option<i64>,
519    pub cid: Cid<S>,
520    ///Debug information for internal development
521    #[serde(skip_serializing_if = "Option::is_none")]
522    pub debug: Option<Data<S>>,
523    #[serde(skip_serializing_if = "Option::is_none")]
524    pub embed: Option<PostViewEmbed<S>>,
525    pub indexed_at: Datetime,
526    #[serde(skip_serializing_if = "Option::is_none")]
527    pub labels: Option<Vec<Label<S>>>,
528    #[serde(skip_serializing_if = "Option::is_none")]
529    pub like_count: Option<i64>,
530    #[serde(skip_serializing_if = "Option::is_none")]
531    pub quote_count: Option<i64>,
532    pub record: Data<S>,
533    #[serde(skip_serializing_if = "Option::is_none")]
534    pub reply_count: Option<i64>,
535    #[serde(skip_serializing_if = "Option::is_none")]
536    pub repost_count: Option<i64>,
537    #[serde(skip_serializing_if = "Option::is_none")]
538    pub threadgate: Option<feed::ThreadgateView<S>>,
539    pub uri: AtUri<S>,
540    #[serde(skip_serializing_if = "Option::is_none")]
541    pub viewer: Option<feed::ViewerState<S>>,
542    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
543    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
544}
545
546
547#[open_union]
548#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
549#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
550pub enum PostViewEmbed<S: BosStr = DefaultStr> {
551    #[serde(rename = "app.bsky.embed.images#view")]
552    ImagesView(Box<images::View<S>>),
553    #[serde(rename = "app.bsky.embed.video#view")]
554    VideoView(Box<video::View<S>>),
555    #[serde(rename = "app.bsky.embed.gallery#view")]
556    GalleryView(Box<gallery::View<S>>),
557    #[serde(rename = "app.bsky.embed.external#view")]
558    ExternalView(Box<external::View<S>>),
559    #[serde(rename = "app.bsky.embed.record#view")]
560    RecordView(Box<record::View<S>>),
561    #[serde(rename = "app.bsky.embed.recordWithMedia#view")]
562    RecordWithMediaView(Box<record_with_media::View<S>>),
563}
564
565
566#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
567#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
568pub struct ReasonPin<S: BosStr = DefaultStr> {
569    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
570    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
571}
572
573
574#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
575#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
576pub struct ReasonRepost<S: BosStr = DefaultStr> {
577    pub by: ProfileViewBasic<S>,
578    #[serde(skip_serializing_if = "Option::is_none")]
579    pub cid: Option<Cid<S>>,
580    pub indexed_at: Datetime,
581    #[serde(skip_serializing_if = "Option::is_none")]
582    pub uri: Option<AtUri<S>>,
583    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
584    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
585}
586
587
588#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
589#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
590pub struct ReplyRef<S: BosStr = DefaultStr> {
591    ///When parent is a reply to another post, this is the author of that post.
592    #[serde(skip_serializing_if = "Option::is_none")]
593    pub grandparent_author: Option<ProfileViewBasic<S>>,
594    pub parent: ReplyRefParent<S>,
595    pub root: ReplyRefRoot<S>,
596    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
597    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
598}
599
600
601#[open_union]
602#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
603#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
604pub enum ReplyRefParent<S: BosStr = DefaultStr> {
605    #[serde(rename = "app.bsky.feed.defs#postView")]
606    PostView(Box<feed::PostView<S>>),
607    #[serde(rename = "app.bsky.feed.defs#notFoundPost")]
608    NotFoundPost(Box<feed::NotFoundPost<S>>),
609    #[serde(rename = "app.bsky.feed.defs#blockedPost")]
610    BlockedPost(Box<feed::BlockedPost<S>>),
611}
612
613
614#[open_union]
615#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
616#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
617pub enum ReplyRefRoot<S: BosStr = DefaultStr> {
618    #[serde(rename = "app.bsky.feed.defs#postView")]
619    PostView(Box<feed::PostView<S>>),
620    #[serde(rename = "app.bsky.feed.defs#notFoundPost")]
621    NotFoundPost(Box<feed::NotFoundPost<S>>),
622    #[serde(rename = "app.bsky.feed.defs#blockedPost")]
623    BlockedPost(Box<feed::BlockedPost<S>>),
624}
625
626/// Request that less content like the given feed item be shown in the feed
627
628#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
629pub struct RequestLess;
630impl core::fmt::Display for RequestLess {
631    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
632        write!(f, "requestLess")
633    }
634}
635
636/// Request that more content like the given feed item be shown in the feed
637
638#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
639pub struct RequestMore;
640impl core::fmt::Display for RequestMore {
641    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
642        write!(f, "requestMore")
643    }
644}
645
646
647#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
648#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
649pub struct SkeletonFeedPost<S: BosStr = DefaultStr> {
650    ///Context that will be passed through to client and may be passed to feed generator back alongside interactions.
651    #[serde(skip_serializing_if = "Option::is_none")]
652    pub feed_context: Option<S>,
653    pub post: AtUri<S>,
654    #[serde(skip_serializing_if = "Option::is_none")]
655    pub reason: Option<SkeletonFeedPostReason<S>>,
656    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
657    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
658}
659
660
661#[open_union]
662#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
663#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
664pub enum SkeletonFeedPostReason<S: BosStr = DefaultStr> {
665    #[serde(rename = "app.bsky.feed.defs#skeletonReasonRepost")]
666    SkeletonReasonRepost(Box<feed::SkeletonReasonRepost<S>>),
667    #[serde(rename = "app.bsky.feed.defs#skeletonReasonPin")]
668    SkeletonReasonPin(Box<feed::SkeletonReasonPin<S>>),
669}
670
671
672#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
673#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
674pub struct SkeletonReasonPin<S: BosStr = DefaultStr> {
675    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
676    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
677}
678
679
680#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
681#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
682pub struct SkeletonReasonRepost<S: BosStr = DefaultStr> {
683    pub repost: AtUri<S>,
684    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
685    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
686}
687
688/// Metadata about this post within the context of the thread it is in.
689
690#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
691#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
692pub struct ThreadContext<S: BosStr = DefaultStr> {
693    #[serde(skip_serializing_if = "Option::is_none")]
694    pub root_author_like: Option<AtUri<S>>,
695    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
696    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
697}
698
699
700#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
701#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
702pub struct ThreadViewPost<S: BosStr = DefaultStr> {
703    #[serde(skip_serializing_if = "Option::is_none")]
704    pub parent: Option<ThreadViewPostParent<S>>,
705    pub post: feed::PostView<S>,
706    #[serde(skip_serializing_if = "Option::is_none")]
707    pub replies: Option<Vec<ThreadViewPostRepliesItem<S>>>,
708    #[serde(skip_serializing_if = "Option::is_none")]
709    pub thread_context: Option<feed::ThreadContext<S>>,
710    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
711    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
712}
713
714
715#[open_union]
716#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
717#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
718pub enum ThreadViewPostParent<S: BosStr = DefaultStr> {
719    #[serde(rename = "app.bsky.feed.defs#threadViewPost")]
720    ThreadViewPost(Box<feed::ThreadViewPost<S>>),
721    #[serde(rename = "app.bsky.feed.defs#notFoundPost")]
722    NotFoundPost(Box<feed::NotFoundPost<S>>),
723    #[serde(rename = "app.bsky.feed.defs#blockedPost")]
724    BlockedPost(Box<feed::BlockedPost<S>>),
725}
726
727
728#[open_union]
729#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
730#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
731pub enum ThreadViewPostRepliesItem<S: BosStr = DefaultStr> {
732    #[serde(rename = "app.bsky.feed.defs#threadViewPost")]
733    ThreadViewPost(Box<feed::ThreadViewPost<S>>),
734    #[serde(rename = "app.bsky.feed.defs#notFoundPost")]
735    NotFoundPost(Box<feed::NotFoundPost<S>>),
736    #[serde(rename = "app.bsky.feed.defs#blockedPost")]
737    BlockedPost(Box<feed::BlockedPost<S>>),
738}
739
740
741#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
742#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
743pub struct ThreadgateView<S: BosStr = DefaultStr> {
744    #[serde(skip_serializing_if = "Option::is_none")]
745    pub cid: Option<Cid<S>>,
746    #[serde(skip_serializing_if = "Option::is_none")]
747    pub lists: Option<Vec<ListViewBasic<S>>>,
748    #[serde(skip_serializing_if = "Option::is_none")]
749    pub record: Option<Data<S>>,
750    #[serde(skip_serializing_if = "Option::is_none")]
751    pub uri: Option<AtUri<S>>,
752    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
753    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
754}
755
756/// Metadata about the requesting account's relationship with the subject content. Only has meaningful content for authed requests.
757
758#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
759#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
760pub struct ViewerState<S: BosStr = DefaultStr> {
761    #[serde(skip_serializing_if = "Option::is_none")]
762    pub bookmarked: Option<bool>,
763    #[serde(skip_serializing_if = "Option::is_none")]
764    pub embedding_disabled: Option<bool>,
765    #[serde(skip_serializing_if = "Option::is_none")]
766    pub like: Option<AtUri<S>>,
767    #[serde(skip_serializing_if = "Option::is_none")]
768    pub pinned: Option<bool>,
769    #[serde(skip_serializing_if = "Option::is_none")]
770    pub reply_disabled: Option<bool>,
771    #[serde(skip_serializing_if = "Option::is_none")]
772    pub repost: Option<AtUri<S>>,
773    #[serde(skip_serializing_if = "Option::is_none")]
774    pub thread_muted: Option<bool>,
775    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
776    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
777}
778
779impl<S: BosStr> LexiconSchema for BlockedAuthor<S> {
780    fn nsid() -> &'static str {
781        "app.bsky.feed.defs"
782    }
783    fn def_name() -> &'static str {
784        "blockedAuthor"
785    }
786    fn lexicon_doc() -> LexiconDoc<'static> {
787        lexicon_doc_app_bsky_feed_defs()
788    }
789    fn validate(&self) -> Result<(), ConstraintError> {
790        Ok(())
791    }
792}
793
794impl<S: BosStr> LexiconSchema for BlockedPost<S> {
795    fn nsid() -> &'static str {
796        "app.bsky.feed.defs"
797    }
798    fn def_name() -> &'static str {
799        "blockedPost"
800    }
801    fn lexicon_doc() -> LexiconDoc<'static> {
802        lexicon_doc_app_bsky_feed_defs()
803    }
804    fn validate(&self) -> Result<(), ConstraintError> {
805        Ok(())
806    }
807}
808
809impl<S: BosStr> LexiconSchema for FeedViewPost<S> {
810    fn nsid() -> &'static str {
811        "app.bsky.feed.defs"
812    }
813    fn def_name() -> &'static str {
814        "feedViewPost"
815    }
816    fn lexicon_doc() -> LexiconDoc<'static> {
817        lexicon_doc_app_bsky_feed_defs()
818    }
819    fn validate(&self) -> Result<(), ConstraintError> {
820        if let Some(ref value) = self.feed_context {
821            #[allow(unused_comparisons)]
822            if <str>::len(value.as_ref()) > 2000usize {
823                return Err(ConstraintError::MaxLength {
824                    path: ValidationPath::from_field("feed_context"),
825                    max: 2000usize,
826                    actual: <str>::len(value.as_ref()),
827                });
828            }
829        }
830        if let Some(ref value) = self.req_id {
831            #[allow(unused_comparisons)]
832            if <str>::len(value.as_ref()) > 100usize {
833                return Err(ConstraintError::MaxLength {
834                    path: ValidationPath::from_field("req_id"),
835                    max: 100usize,
836                    actual: <str>::len(value.as_ref()),
837                });
838            }
839        }
840        Ok(())
841    }
842}
843
844impl<S: BosStr> LexiconSchema for GeneratorView<S> {
845    fn nsid() -> &'static str {
846        "app.bsky.feed.defs"
847    }
848    fn def_name() -> &'static str {
849        "generatorView"
850    }
851    fn lexicon_doc() -> LexiconDoc<'static> {
852        lexicon_doc_app_bsky_feed_defs()
853    }
854    fn validate(&self) -> Result<(), ConstraintError> {
855        if let Some(ref value) = self.description {
856            #[allow(unused_comparisons)]
857            if <str>::len(value.as_ref()) > 3000usize {
858                return Err(ConstraintError::MaxLength {
859                    path: ValidationPath::from_field("description"),
860                    max: 3000usize,
861                    actual: <str>::len(value.as_ref()),
862                });
863            }
864        }
865        if let Some(ref value) = self.description {
866            {
867                let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
868                if count > 300usize {
869                    return Err(ConstraintError::MaxGraphemes {
870                        path: ValidationPath::from_field("description"),
871                        max: 300usize,
872                        actual: count,
873                    });
874                }
875            }
876        }
877        if let Some(ref value) = self.like_count {
878            if *value < 0i64 {
879                return Err(ConstraintError::Minimum {
880                    path: ValidationPath::from_field("like_count"),
881                    min: 0i64,
882                    actual: *value,
883                });
884            }
885        }
886        Ok(())
887    }
888}
889
890impl<S: BosStr> LexiconSchema for GeneratorViewerState<S> {
891    fn nsid() -> &'static str {
892        "app.bsky.feed.defs"
893    }
894    fn def_name() -> &'static str {
895        "generatorViewerState"
896    }
897    fn lexicon_doc() -> LexiconDoc<'static> {
898        lexicon_doc_app_bsky_feed_defs()
899    }
900    fn validate(&self) -> Result<(), ConstraintError> {
901        Ok(())
902    }
903}
904
905impl<S: BosStr> LexiconSchema for Interaction<S> {
906    fn nsid() -> &'static str {
907        "app.bsky.feed.defs"
908    }
909    fn def_name() -> &'static str {
910        "interaction"
911    }
912    fn lexicon_doc() -> LexiconDoc<'static> {
913        lexicon_doc_app_bsky_feed_defs()
914    }
915    fn validate(&self) -> Result<(), ConstraintError> {
916        if let Some(ref value) = self.feed_context {
917            #[allow(unused_comparisons)]
918            if <str>::len(value.as_ref()) > 2000usize {
919                return Err(ConstraintError::MaxLength {
920                    path: ValidationPath::from_field("feed_context"),
921                    max: 2000usize,
922                    actual: <str>::len(value.as_ref()),
923                });
924            }
925        }
926        if let Some(ref value) = self.req_id {
927            #[allow(unused_comparisons)]
928            if <str>::len(value.as_ref()) > 100usize {
929                return Err(ConstraintError::MaxLength {
930                    path: ValidationPath::from_field("req_id"),
931                    max: 100usize,
932                    actual: <str>::len(value.as_ref()),
933                });
934            }
935        }
936        Ok(())
937    }
938}
939
940impl<S: BosStr> LexiconSchema for NotFoundPost<S> {
941    fn nsid() -> &'static str {
942        "app.bsky.feed.defs"
943    }
944    fn def_name() -> &'static str {
945        "notFoundPost"
946    }
947    fn lexicon_doc() -> LexiconDoc<'static> {
948        lexicon_doc_app_bsky_feed_defs()
949    }
950    fn validate(&self) -> Result<(), ConstraintError> {
951        Ok(())
952    }
953}
954
955impl<S: BosStr> LexiconSchema for PostView<S> {
956    fn nsid() -> &'static str {
957        "app.bsky.feed.defs"
958    }
959    fn def_name() -> &'static str {
960        "postView"
961    }
962    fn lexicon_doc() -> LexiconDoc<'static> {
963        lexicon_doc_app_bsky_feed_defs()
964    }
965    fn validate(&self) -> Result<(), ConstraintError> {
966        Ok(())
967    }
968}
969
970impl<S: BosStr> LexiconSchema for ReasonPin<S> {
971    fn nsid() -> &'static str {
972        "app.bsky.feed.defs"
973    }
974    fn def_name() -> &'static str {
975        "reasonPin"
976    }
977    fn lexicon_doc() -> LexiconDoc<'static> {
978        lexicon_doc_app_bsky_feed_defs()
979    }
980    fn validate(&self) -> Result<(), ConstraintError> {
981        Ok(())
982    }
983}
984
985impl<S: BosStr> LexiconSchema for ReasonRepost<S> {
986    fn nsid() -> &'static str {
987        "app.bsky.feed.defs"
988    }
989    fn def_name() -> &'static str {
990        "reasonRepost"
991    }
992    fn lexicon_doc() -> LexiconDoc<'static> {
993        lexicon_doc_app_bsky_feed_defs()
994    }
995    fn validate(&self) -> Result<(), ConstraintError> {
996        Ok(())
997    }
998}
999
1000impl<S: BosStr> LexiconSchema for ReplyRef<S> {
1001    fn nsid() -> &'static str {
1002        "app.bsky.feed.defs"
1003    }
1004    fn def_name() -> &'static str {
1005        "replyRef"
1006    }
1007    fn lexicon_doc() -> LexiconDoc<'static> {
1008        lexicon_doc_app_bsky_feed_defs()
1009    }
1010    fn validate(&self) -> Result<(), ConstraintError> {
1011        Ok(())
1012    }
1013}
1014
1015impl<S: BosStr> LexiconSchema for SkeletonFeedPost<S> {
1016    fn nsid() -> &'static str {
1017        "app.bsky.feed.defs"
1018    }
1019    fn def_name() -> &'static str {
1020        "skeletonFeedPost"
1021    }
1022    fn lexicon_doc() -> LexiconDoc<'static> {
1023        lexicon_doc_app_bsky_feed_defs()
1024    }
1025    fn validate(&self) -> Result<(), ConstraintError> {
1026        if let Some(ref value) = self.feed_context {
1027            #[allow(unused_comparisons)]
1028            if <str>::len(value.as_ref()) > 2000usize {
1029                return Err(ConstraintError::MaxLength {
1030                    path: ValidationPath::from_field("feed_context"),
1031                    max: 2000usize,
1032                    actual: <str>::len(value.as_ref()),
1033                });
1034            }
1035        }
1036        Ok(())
1037    }
1038}
1039
1040impl<S: BosStr> LexiconSchema for SkeletonReasonPin<S> {
1041    fn nsid() -> &'static str {
1042        "app.bsky.feed.defs"
1043    }
1044    fn def_name() -> &'static str {
1045        "skeletonReasonPin"
1046    }
1047    fn lexicon_doc() -> LexiconDoc<'static> {
1048        lexicon_doc_app_bsky_feed_defs()
1049    }
1050    fn validate(&self) -> Result<(), ConstraintError> {
1051        Ok(())
1052    }
1053}
1054
1055impl<S: BosStr> LexiconSchema for SkeletonReasonRepost<S> {
1056    fn nsid() -> &'static str {
1057        "app.bsky.feed.defs"
1058    }
1059    fn def_name() -> &'static str {
1060        "skeletonReasonRepost"
1061    }
1062    fn lexicon_doc() -> LexiconDoc<'static> {
1063        lexicon_doc_app_bsky_feed_defs()
1064    }
1065    fn validate(&self) -> Result<(), ConstraintError> {
1066        Ok(())
1067    }
1068}
1069
1070impl<S: BosStr> LexiconSchema for ThreadContext<S> {
1071    fn nsid() -> &'static str {
1072        "app.bsky.feed.defs"
1073    }
1074    fn def_name() -> &'static str {
1075        "threadContext"
1076    }
1077    fn lexicon_doc() -> LexiconDoc<'static> {
1078        lexicon_doc_app_bsky_feed_defs()
1079    }
1080    fn validate(&self) -> Result<(), ConstraintError> {
1081        Ok(())
1082    }
1083}
1084
1085impl<S: BosStr> LexiconSchema for ThreadViewPost<S> {
1086    fn nsid() -> &'static str {
1087        "app.bsky.feed.defs"
1088    }
1089    fn def_name() -> &'static str {
1090        "threadViewPost"
1091    }
1092    fn lexicon_doc() -> LexiconDoc<'static> {
1093        lexicon_doc_app_bsky_feed_defs()
1094    }
1095    fn validate(&self) -> Result<(), ConstraintError> {
1096        Ok(())
1097    }
1098}
1099
1100impl<S: BosStr> LexiconSchema for ThreadgateView<S> {
1101    fn nsid() -> &'static str {
1102        "app.bsky.feed.defs"
1103    }
1104    fn def_name() -> &'static str {
1105        "threadgateView"
1106    }
1107    fn lexicon_doc() -> LexiconDoc<'static> {
1108        lexicon_doc_app_bsky_feed_defs()
1109    }
1110    fn validate(&self) -> Result<(), ConstraintError> {
1111        Ok(())
1112    }
1113}
1114
1115impl<S: BosStr> LexiconSchema for ViewerState<S> {
1116    fn nsid() -> &'static str {
1117        "app.bsky.feed.defs"
1118    }
1119    fn def_name() -> &'static str {
1120        "viewerState"
1121    }
1122    fn lexicon_doc() -> LexiconDoc<'static> {
1123        lexicon_doc_app_bsky_feed_defs()
1124    }
1125    fn validate(&self) -> Result<(), ConstraintError> {
1126        Ok(())
1127    }
1128}
1129
1130pub mod blocked_author_state {
1131
1132    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
1133    #[allow(unused)]
1134    use ::core::marker::PhantomData;
1135    mod sealed {
1136        pub trait Sealed {}
1137    }
1138    /// State trait tracking which required fields have been set
1139    pub trait State: sealed::Sealed {
1140        type Did;
1141    }
1142    /// Empty state - all required fields are unset
1143    pub struct Empty(());
1144    impl sealed::Sealed for Empty {}
1145    impl State for Empty {
1146        type Did = Unset;
1147    }
1148    ///State transition - sets the `did` field to Set
1149    pub struct SetDid<St: State = Empty>(PhantomData<fn() -> St>);
1150    impl<St: State> sealed::Sealed for SetDid<St> {}
1151    impl<St: State> State for SetDid<St> {
1152        type Did = Set<members::did>;
1153    }
1154    /// Marker types for field names
1155    #[allow(non_camel_case_types)]
1156    pub mod members {
1157        ///Marker type for the `did` field
1158        pub struct did(());
1159    }
1160}
1161
1162/// Builder for constructing an instance of this type.
1163pub struct BlockedAuthorBuilder<
1164    St: blocked_author_state::State,
1165    S: BosStr = DefaultStr,
1166> {
1167    _state: PhantomData<fn() -> St>,
1168    _fields: (Option<Did<S>>, Option<actor::ViewerState<S>>),
1169    _type: PhantomData<fn() -> S>,
1170}
1171
1172impl BlockedAuthor<DefaultStr> {
1173    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
1174    pub fn new() -> BlockedAuthorBuilder<blocked_author_state::Empty, DefaultStr> {
1175        BlockedAuthorBuilder::new()
1176    }
1177}
1178
1179impl<S: BosStr> BlockedAuthor<S> {
1180    /// Create a new builder for this type
1181    pub fn builder() -> BlockedAuthorBuilder<blocked_author_state::Empty, S> {
1182        BlockedAuthorBuilder::builder()
1183    }
1184}
1185
1186impl BlockedAuthorBuilder<blocked_author_state::Empty, DefaultStr> {
1187    /// Create a new builder with all fields unset, using the default string type, if needed
1188    pub fn new() -> Self {
1189        BlockedAuthorBuilder {
1190            _state: PhantomData,
1191            _fields: (None, None),
1192            _type: PhantomData,
1193        }
1194    }
1195}
1196
1197impl<S: BosStr> BlockedAuthorBuilder<blocked_author_state::Empty, S> {
1198    /// Create a new builder with all fields unset
1199    pub fn builder() -> Self {
1200        BlockedAuthorBuilder {
1201            _state: PhantomData,
1202            _fields: (None, None),
1203            _type: PhantomData,
1204        }
1205    }
1206}
1207
1208impl<St, S: BosStr> BlockedAuthorBuilder<St, S>
1209where
1210    St: blocked_author_state::State,
1211    St::Did: blocked_author_state::IsUnset,
1212{
1213    /// Set the `did` field (required)
1214    pub fn did(
1215        mut self,
1216        value: impl Into<Did<S>>,
1217    ) -> BlockedAuthorBuilder<blocked_author_state::SetDid<St>, S> {
1218        self._fields.0 = Option::Some(value.into());
1219        BlockedAuthorBuilder {
1220            _state: PhantomData,
1221            _fields: self._fields,
1222            _type: PhantomData,
1223        }
1224    }
1225}
1226
1227impl<St: blocked_author_state::State, S: BosStr> BlockedAuthorBuilder<St, S> {
1228    /// Set the `viewer` field (optional)
1229    pub fn viewer(mut self, value: impl Into<Option<actor::ViewerState<S>>>) -> Self {
1230        self._fields.1 = value.into();
1231        self
1232    }
1233    /// Set the `viewer` field to an Option value (optional)
1234    pub fn maybe_viewer(mut self, value: Option<actor::ViewerState<S>>) -> Self {
1235        self._fields.1 = value;
1236        self
1237    }
1238}
1239
1240impl<St, S: BosStr> BlockedAuthorBuilder<St, S>
1241where
1242    St: blocked_author_state::State,
1243    St::Did: blocked_author_state::IsSet,
1244{
1245    /// Build the final struct.
1246    pub fn build(self) -> BlockedAuthor<S> {
1247        BlockedAuthor {
1248            did: self._fields.0.unwrap(),
1249            viewer: self._fields.1,
1250            extra_data: Default::default(),
1251        }
1252    }
1253    /// Build the final struct with custom extra_data.
1254    pub fn build_with_data(
1255        self,
1256        extra_data: BTreeMap<SmolStr, Data<S>>,
1257    ) -> BlockedAuthor<S> {
1258        BlockedAuthor {
1259            did: self._fields.0.unwrap(),
1260            viewer: self._fields.1,
1261            extra_data: Some(extra_data),
1262        }
1263    }
1264}
1265
1266fn lexicon_doc_app_bsky_feed_defs() -> LexiconDoc<'static> {
1267    #[allow(unused_imports)]
1268    use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType};
1269    use jacquard_lexicon::lexicon::*;
1270    use alloc::collections::BTreeMap;
1271    LexiconDoc {
1272        lexicon: Lexicon::Lexicon1,
1273        id: CowStr::new_static("app.bsky.feed.defs"),
1274        defs: {
1275            let mut map = BTreeMap::new();
1276            map.insert(
1277                SmolStr::new_static("blockedAuthor"),
1278                LexUserType::Object(LexObject {
1279                    required: Some(vec![SmolStr::new_static("did")]),
1280                    properties: {
1281                        #[allow(unused_mut)]
1282                        let mut map = BTreeMap::new();
1283                        map.insert(
1284                            SmolStr::new_static("did"),
1285                            LexObjectProperty::String(LexString {
1286                                format: Some(LexStringFormat::Did),
1287                                ..Default::default()
1288                            }),
1289                        );
1290                        map.insert(
1291                            SmolStr::new_static("viewer"),
1292                            LexObjectProperty::Ref(LexRef {
1293                                r#ref: CowStr::new_static(
1294                                    "app.bsky.actor.defs#viewerState",
1295                                ),
1296                                ..Default::default()
1297                            }),
1298                        );
1299                        map
1300                    },
1301                    ..Default::default()
1302                }),
1303            );
1304            map.insert(
1305                SmolStr::new_static("blockedPost"),
1306                LexUserType::Object(LexObject {
1307                    required: Some(
1308                        vec![
1309                            SmolStr::new_static("uri"), SmolStr::new_static("blocked"),
1310                            SmolStr::new_static("author")
1311                        ],
1312                    ),
1313                    properties: {
1314                        #[allow(unused_mut)]
1315                        let mut map = BTreeMap::new();
1316                        map.insert(
1317                            SmolStr::new_static("author"),
1318                            LexObjectProperty::Ref(LexRef {
1319                                r#ref: CowStr::new_static("#blockedAuthor"),
1320                                ..Default::default()
1321                            }),
1322                        );
1323                        map.insert(
1324                            SmolStr::new_static("blocked"),
1325                            LexObjectProperty::Boolean(LexBoolean {
1326                                ..Default::default()
1327                            }),
1328                        );
1329                        map.insert(
1330                            SmolStr::new_static("uri"),
1331                            LexObjectProperty::String(LexString {
1332                                format: Some(LexStringFormat::AtUri),
1333                                ..Default::default()
1334                            }),
1335                        );
1336                        map
1337                    },
1338                    ..Default::default()
1339                }),
1340            );
1341            map.insert(
1342                SmolStr::new_static("clickthroughAuthor"),
1343                LexUserType::Token(LexToken { ..Default::default() }),
1344            );
1345            map.insert(
1346                SmolStr::new_static("clickthroughEmbed"),
1347                LexUserType::Token(LexToken { ..Default::default() }),
1348            );
1349            map.insert(
1350                SmolStr::new_static("clickthroughItem"),
1351                LexUserType::Token(LexToken { ..Default::default() }),
1352            );
1353            map.insert(
1354                SmolStr::new_static("clickthroughReposter"),
1355                LexUserType::Token(LexToken { ..Default::default() }),
1356            );
1357            map.insert(
1358                SmolStr::new_static("contentModeUnspecified"),
1359                LexUserType::Token(LexToken { ..Default::default() }),
1360            );
1361            map.insert(
1362                SmolStr::new_static("contentModeVideo"),
1363                LexUserType::Token(LexToken { ..Default::default() }),
1364            );
1365            map.insert(
1366                SmolStr::new_static("feedViewPost"),
1367                LexUserType::Object(LexObject {
1368                    required: Some(vec![SmolStr::new_static("post")]),
1369                    properties: {
1370                        #[allow(unused_mut)]
1371                        let mut map = BTreeMap::new();
1372                        map.insert(
1373                            SmolStr::new_static("feedContext"),
1374                            LexObjectProperty::String(LexString {
1375                                description: Some(
1376                                    CowStr::new_static(
1377                                        "Context provided by feed generator that may be passed back alongside interactions.",
1378                                    ),
1379                                ),
1380                                max_length: Some(2000usize),
1381                                ..Default::default()
1382                            }),
1383                        );
1384                        map.insert(
1385                            SmolStr::new_static("post"),
1386                            LexObjectProperty::Ref(LexRef {
1387                                r#ref: CowStr::new_static("#postView"),
1388                                ..Default::default()
1389                            }),
1390                        );
1391                        map.insert(
1392                            SmolStr::new_static("reason"),
1393                            LexObjectProperty::Union(LexRefUnion {
1394                                refs: vec![
1395                                    CowStr::new_static("#reasonRepost"),
1396                                    CowStr::new_static("#reasonPin")
1397                                ],
1398                                ..Default::default()
1399                            }),
1400                        );
1401                        map.insert(
1402                            SmolStr::new_static("reply"),
1403                            LexObjectProperty::Ref(LexRef {
1404                                r#ref: CowStr::new_static("#replyRef"),
1405                                ..Default::default()
1406                            }),
1407                        );
1408                        map.insert(
1409                            SmolStr::new_static("reqId"),
1410                            LexObjectProperty::String(LexString {
1411                                description: Some(
1412                                    CowStr::new_static(
1413                                        "Unique identifier per request that may be passed back alongside interactions.",
1414                                    ),
1415                                ),
1416                                max_length: Some(100usize),
1417                                ..Default::default()
1418                            }),
1419                        );
1420                        map
1421                    },
1422                    ..Default::default()
1423                }),
1424            );
1425            map.insert(
1426                SmolStr::new_static("generatorView"),
1427                LexUserType::Object(LexObject {
1428                    required: Some(
1429                        vec![
1430                            SmolStr::new_static("uri"), SmolStr::new_static("cid"),
1431                            SmolStr::new_static("did"), SmolStr::new_static("creator"),
1432                            SmolStr::new_static("displayName"),
1433                            SmolStr::new_static("indexedAt")
1434                        ],
1435                    ),
1436                    properties: {
1437                        #[allow(unused_mut)]
1438                        let mut map = BTreeMap::new();
1439                        map.insert(
1440                            SmolStr::new_static("acceptsInteractions"),
1441                            LexObjectProperty::Boolean(LexBoolean {
1442                                ..Default::default()
1443                            }),
1444                        );
1445                        map.insert(
1446                            SmolStr::new_static("avatar"),
1447                            LexObjectProperty::String(LexString {
1448                                format: Some(LexStringFormat::Uri),
1449                                ..Default::default()
1450                            }),
1451                        );
1452                        map.insert(
1453                            SmolStr::new_static("cid"),
1454                            LexObjectProperty::String(LexString {
1455                                format: Some(LexStringFormat::Cid),
1456                                ..Default::default()
1457                            }),
1458                        );
1459                        map.insert(
1460                            SmolStr::new_static("contentMode"),
1461                            LexObjectProperty::String(LexString { ..Default::default() }),
1462                        );
1463                        map.insert(
1464                            SmolStr::new_static("creator"),
1465                            LexObjectProperty::Ref(LexRef {
1466                                r#ref: CowStr::new_static(
1467                                    "app.bsky.actor.defs#profileView",
1468                                ),
1469                                ..Default::default()
1470                            }),
1471                        );
1472                        map.insert(
1473                            SmolStr::new_static("description"),
1474                            LexObjectProperty::String(LexString {
1475                                max_length: Some(3000usize),
1476                                max_graphemes: Some(300usize),
1477                                ..Default::default()
1478                            }),
1479                        );
1480                        map.insert(
1481                            SmolStr::new_static("descriptionFacets"),
1482                            LexObjectProperty::Array(LexArray {
1483                                items: LexArrayItem::Ref(LexRef {
1484                                    r#ref: CowStr::new_static("app.bsky.richtext.facet"),
1485                                    ..Default::default()
1486                                }),
1487                                ..Default::default()
1488                            }),
1489                        );
1490                        map.insert(
1491                            SmolStr::new_static("did"),
1492                            LexObjectProperty::String(LexString {
1493                                format: Some(LexStringFormat::Did),
1494                                ..Default::default()
1495                            }),
1496                        );
1497                        map.insert(
1498                            SmolStr::new_static("displayName"),
1499                            LexObjectProperty::String(LexString { ..Default::default() }),
1500                        );
1501                        map.insert(
1502                            SmolStr::new_static("indexedAt"),
1503                            LexObjectProperty::String(LexString {
1504                                format: Some(LexStringFormat::Datetime),
1505                                ..Default::default()
1506                            }),
1507                        );
1508                        map.insert(
1509                            SmolStr::new_static("labels"),
1510                            LexObjectProperty::Array(LexArray {
1511                                items: LexArrayItem::Ref(LexRef {
1512                                    r#ref: CowStr::new_static("com.atproto.label.defs#label"),
1513                                    ..Default::default()
1514                                }),
1515                                ..Default::default()
1516                            }),
1517                        );
1518                        map.insert(
1519                            SmolStr::new_static("likeCount"),
1520                            LexObjectProperty::Integer(LexInteger {
1521                                minimum: Some(0i64),
1522                                ..Default::default()
1523                            }),
1524                        );
1525                        map.insert(
1526                            SmolStr::new_static("uri"),
1527                            LexObjectProperty::String(LexString {
1528                                format: Some(LexStringFormat::AtUri),
1529                                ..Default::default()
1530                            }),
1531                        );
1532                        map.insert(
1533                            SmolStr::new_static("viewer"),
1534                            LexObjectProperty::Ref(LexRef {
1535                                r#ref: CowStr::new_static("#generatorViewerState"),
1536                                ..Default::default()
1537                            }),
1538                        );
1539                        map
1540                    },
1541                    ..Default::default()
1542                }),
1543            );
1544            map.insert(
1545                SmolStr::new_static("generatorViewerState"),
1546                LexUserType::Object(LexObject {
1547                    properties: {
1548                        #[allow(unused_mut)]
1549                        let mut map = BTreeMap::new();
1550                        map.insert(
1551                            SmolStr::new_static("like"),
1552                            LexObjectProperty::String(LexString {
1553                                format: Some(LexStringFormat::AtUri),
1554                                ..Default::default()
1555                            }),
1556                        );
1557                        map
1558                    },
1559                    ..Default::default()
1560                }),
1561            );
1562            map.insert(
1563                SmolStr::new_static("interaction"),
1564                LexUserType::Object(LexObject {
1565                    properties: {
1566                        #[allow(unused_mut)]
1567                        let mut map = BTreeMap::new();
1568                        map.insert(
1569                            SmolStr::new_static("event"),
1570                            LexObjectProperty::String(LexString { ..Default::default() }),
1571                        );
1572                        map.insert(
1573                            SmolStr::new_static("feedContext"),
1574                            LexObjectProperty::String(LexString {
1575                                description: Some(
1576                                    CowStr::new_static(
1577                                        "Context on a feed item that was originally supplied by the feed generator on getFeedSkeleton.",
1578                                    ),
1579                                ),
1580                                max_length: Some(2000usize),
1581                                ..Default::default()
1582                            }),
1583                        );
1584                        map.insert(
1585                            SmolStr::new_static("item"),
1586                            LexObjectProperty::String(LexString {
1587                                format: Some(LexStringFormat::AtUri),
1588                                ..Default::default()
1589                            }),
1590                        );
1591                        map.insert(
1592                            SmolStr::new_static("reqId"),
1593                            LexObjectProperty::String(LexString {
1594                                description: Some(
1595                                    CowStr::new_static(
1596                                        "Unique identifier per request that may be passed back alongside interactions.",
1597                                    ),
1598                                ),
1599                                max_length: Some(100usize),
1600                                ..Default::default()
1601                            }),
1602                        );
1603                        map
1604                    },
1605                    ..Default::default()
1606                }),
1607            );
1608            map.insert(
1609                SmolStr::new_static("interactionLike"),
1610                LexUserType::Token(LexToken { ..Default::default() }),
1611            );
1612            map.insert(
1613                SmolStr::new_static("interactionQuote"),
1614                LexUserType::Token(LexToken { ..Default::default() }),
1615            );
1616            map.insert(
1617                SmolStr::new_static("interactionReply"),
1618                LexUserType::Token(LexToken { ..Default::default() }),
1619            );
1620            map.insert(
1621                SmolStr::new_static("interactionRepost"),
1622                LexUserType::Token(LexToken { ..Default::default() }),
1623            );
1624            map.insert(
1625                SmolStr::new_static("interactionSeen"),
1626                LexUserType::Token(LexToken { ..Default::default() }),
1627            );
1628            map.insert(
1629                SmolStr::new_static("interactionShare"),
1630                LexUserType::Token(LexToken { ..Default::default() }),
1631            );
1632            map.insert(
1633                SmolStr::new_static("notFoundPost"),
1634                LexUserType::Object(LexObject {
1635                    required: Some(
1636                        vec![SmolStr::new_static("uri"), SmolStr::new_static("notFound")],
1637                    ),
1638                    properties: {
1639                        #[allow(unused_mut)]
1640                        let mut map = BTreeMap::new();
1641                        map.insert(
1642                            SmolStr::new_static("notFound"),
1643                            LexObjectProperty::Boolean(LexBoolean {
1644                                ..Default::default()
1645                            }),
1646                        );
1647                        map.insert(
1648                            SmolStr::new_static("uri"),
1649                            LexObjectProperty::String(LexString {
1650                                format: Some(LexStringFormat::AtUri),
1651                                ..Default::default()
1652                            }),
1653                        );
1654                        map
1655                    },
1656                    ..Default::default()
1657                }),
1658            );
1659            map.insert(
1660                SmolStr::new_static("postView"),
1661                LexUserType::Object(LexObject {
1662                    required: Some(
1663                        vec![
1664                            SmolStr::new_static("uri"), SmolStr::new_static("cid"),
1665                            SmolStr::new_static("author"), SmolStr::new_static("record"),
1666                            SmolStr::new_static("indexedAt")
1667                        ],
1668                    ),
1669                    properties: {
1670                        #[allow(unused_mut)]
1671                        let mut map = BTreeMap::new();
1672                        map.insert(
1673                            SmolStr::new_static("author"),
1674                            LexObjectProperty::Ref(LexRef {
1675                                r#ref: CowStr::new_static(
1676                                    "app.bsky.actor.defs#profileViewBasic",
1677                                ),
1678                                ..Default::default()
1679                            }),
1680                        );
1681                        map.insert(
1682                            SmolStr::new_static("bookmarkCount"),
1683                            LexObjectProperty::Integer(LexInteger {
1684                                ..Default::default()
1685                            }),
1686                        );
1687                        map.insert(
1688                            SmolStr::new_static("cid"),
1689                            LexObjectProperty::String(LexString {
1690                                format: Some(LexStringFormat::Cid),
1691                                ..Default::default()
1692                            }),
1693                        );
1694                        map.insert(
1695                            SmolStr::new_static("debug"),
1696                            LexObjectProperty::Unknown(LexUnknown {
1697                                ..Default::default()
1698                            }),
1699                        );
1700                        map.insert(
1701                            SmolStr::new_static("embed"),
1702                            LexObjectProperty::Union(LexRefUnion {
1703                                refs: vec![
1704                                    CowStr::new_static("app.bsky.embed.images#view"),
1705                                    CowStr::new_static("app.bsky.embed.video#view"),
1706                                    CowStr::new_static("app.bsky.embed.gallery#view"),
1707                                    CowStr::new_static("app.bsky.embed.external#view"),
1708                                    CowStr::new_static("app.bsky.embed.record#view"),
1709                                    CowStr::new_static("app.bsky.embed.recordWithMedia#view")
1710                                ],
1711                                ..Default::default()
1712                            }),
1713                        );
1714                        map.insert(
1715                            SmolStr::new_static("indexedAt"),
1716                            LexObjectProperty::String(LexString {
1717                                format: Some(LexStringFormat::Datetime),
1718                                ..Default::default()
1719                            }),
1720                        );
1721                        map.insert(
1722                            SmolStr::new_static("labels"),
1723                            LexObjectProperty::Array(LexArray {
1724                                items: LexArrayItem::Ref(LexRef {
1725                                    r#ref: CowStr::new_static("com.atproto.label.defs#label"),
1726                                    ..Default::default()
1727                                }),
1728                                ..Default::default()
1729                            }),
1730                        );
1731                        map.insert(
1732                            SmolStr::new_static("likeCount"),
1733                            LexObjectProperty::Integer(LexInteger {
1734                                ..Default::default()
1735                            }),
1736                        );
1737                        map.insert(
1738                            SmolStr::new_static("quoteCount"),
1739                            LexObjectProperty::Integer(LexInteger {
1740                                ..Default::default()
1741                            }),
1742                        );
1743                        map.insert(
1744                            SmolStr::new_static("record"),
1745                            LexObjectProperty::Unknown(LexUnknown {
1746                                ..Default::default()
1747                            }),
1748                        );
1749                        map.insert(
1750                            SmolStr::new_static("replyCount"),
1751                            LexObjectProperty::Integer(LexInteger {
1752                                ..Default::default()
1753                            }),
1754                        );
1755                        map.insert(
1756                            SmolStr::new_static("repostCount"),
1757                            LexObjectProperty::Integer(LexInteger {
1758                                ..Default::default()
1759                            }),
1760                        );
1761                        map.insert(
1762                            SmolStr::new_static("threadgate"),
1763                            LexObjectProperty::Ref(LexRef {
1764                                r#ref: CowStr::new_static("#threadgateView"),
1765                                ..Default::default()
1766                            }),
1767                        );
1768                        map.insert(
1769                            SmolStr::new_static("uri"),
1770                            LexObjectProperty::String(LexString {
1771                                format: Some(LexStringFormat::AtUri),
1772                                ..Default::default()
1773                            }),
1774                        );
1775                        map.insert(
1776                            SmolStr::new_static("viewer"),
1777                            LexObjectProperty::Ref(LexRef {
1778                                r#ref: CowStr::new_static("#viewerState"),
1779                                ..Default::default()
1780                            }),
1781                        );
1782                        map
1783                    },
1784                    ..Default::default()
1785                }),
1786            );
1787            map.insert(
1788                SmolStr::new_static("reasonPin"),
1789                LexUserType::Object(LexObject {
1790                    properties: {
1791                        #[allow(unused_mut)]
1792                        let mut map = BTreeMap::new();
1793                        map
1794                    },
1795                    ..Default::default()
1796                }),
1797            );
1798            map.insert(
1799                SmolStr::new_static("reasonRepost"),
1800                LexUserType::Object(LexObject {
1801                    required: Some(
1802                        vec![SmolStr::new_static("by"), SmolStr::new_static("indexedAt")],
1803                    ),
1804                    properties: {
1805                        #[allow(unused_mut)]
1806                        let mut map = BTreeMap::new();
1807                        map.insert(
1808                            SmolStr::new_static("by"),
1809                            LexObjectProperty::Ref(LexRef {
1810                                r#ref: CowStr::new_static(
1811                                    "app.bsky.actor.defs#profileViewBasic",
1812                                ),
1813                                ..Default::default()
1814                            }),
1815                        );
1816                        map.insert(
1817                            SmolStr::new_static("cid"),
1818                            LexObjectProperty::String(LexString {
1819                                format: Some(LexStringFormat::Cid),
1820                                ..Default::default()
1821                            }),
1822                        );
1823                        map.insert(
1824                            SmolStr::new_static("indexedAt"),
1825                            LexObjectProperty::String(LexString {
1826                                format: Some(LexStringFormat::Datetime),
1827                                ..Default::default()
1828                            }),
1829                        );
1830                        map.insert(
1831                            SmolStr::new_static("uri"),
1832                            LexObjectProperty::String(LexString {
1833                                format: Some(LexStringFormat::AtUri),
1834                                ..Default::default()
1835                            }),
1836                        );
1837                        map
1838                    },
1839                    ..Default::default()
1840                }),
1841            );
1842            map.insert(
1843                SmolStr::new_static("replyRef"),
1844                LexUserType::Object(LexObject {
1845                    required: Some(
1846                        vec![SmolStr::new_static("root"), SmolStr::new_static("parent")],
1847                    ),
1848                    properties: {
1849                        #[allow(unused_mut)]
1850                        let mut map = BTreeMap::new();
1851                        map.insert(
1852                            SmolStr::new_static("grandparentAuthor"),
1853                            LexObjectProperty::Ref(LexRef {
1854                                r#ref: CowStr::new_static(
1855                                    "app.bsky.actor.defs#profileViewBasic",
1856                                ),
1857                                ..Default::default()
1858                            }),
1859                        );
1860                        map.insert(
1861                            SmolStr::new_static("parent"),
1862                            LexObjectProperty::Union(LexRefUnion {
1863                                refs: vec![
1864                                    CowStr::new_static("#postView"),
1865                                    CowStr::new_static("#notFoundPost"),
1866                                    CowStr::new_static("#blockedPost")
1867                                ],
1868                                ..Default::default()
1869                            }),
1870                        );
1871                        map.insert(
1872                            SmolStr::new_static("root"),
1873                            LexObjectProperty::Union(LexRefUnion {
1874                                refs: vec![
1875                                    CowStr::new_static("#postView"),
1876                                    CowStr::new_static("#notFoundPost"),
1877                                    CowStr::new_static("#blockedPost")
1878                                ],
1879                                ..Default::default()
1880                            }),
1881                        );
1882                        map
1883                    },
1884                    ..Default::default()
1885                }),
1886            );
1887            map.insert(
1888                SmolStr::new_static("requestLess"),
1889                LexUserType::Token(LexToken { ..Default::default() }),
1890            );
1891            map.insert(
1892                SmolStr::new_static("requestMore"),
1893                LexUserType::Token(LexToken { ..Default::default() }),
1894            );
1895            map.insert(
1896                SmolStr::new_static("skeletonFeedPost"),
1897                LexUserType::Object(LexObject {
1898                    required: Some(vec![SmolStr::new_static("post")]),
1899                    properties: {
1900                        #[allow(unused_mut)]
1901                        let mut map = BTreeMap::new();
1902                        map.insert(
1903                            SmolStr::new_static("feedContext"),
1904                            LexObjectProperty::String(LexString {
1905                                description: Some(
1906                                    CowStr::new_static(
1907                                        "Context that will be passed through to client and may be passed to feed generator back alongside interactions.",
1908                                    ),
1909                                ),
1910                                max_length: Some(2000usize),
1911                                ..Default::default()
1912                            }),
1913                        );
1914                        map.insert(
1915                            SmolStr::new_static("post"),
1916                            LexObjectProperty::String(LexString {
1917                                format: Some(LexStringFormat::AtUri),
1918                                ..Default::default()
1919                            }),
1920                        );
1921                        map.insert(
1922                            SmolStr::new_static("reason"),
1923                            LexObjectProperty::Union(LexRefUnion {
1924                                refs: vec![
1925                                    CowStr::new_static("#skeletonReasonRepost"),
1926                                    CowStr::new_static("#skeletonReasonPin")
1927                                ],
1928                                ..Default::default()
1929                            }),
1930                        );
1931                        map
1932                    },
1933                    ..Default::default()
1934                }),
1935            );
1936            map.insert(
1937                SmolStr::new_static("skeletonReasonPin"),
1938                LexUserType::Object(LexObject {
1939                    properties: {
1940                        #[allow(unused_mut)]
1941                        let mut map = BTreeMap::new();
1942                        map
1943                    },
1944                    ..Default::default()
1945                }),
1946            );
1947            map.insert(
1948                SmolStr::new_static("skeletonReasonRepost"),
1949                LexUserType::Object(LexObject {
1950                    required: Some(vec![SmolStr::new_static("repost")]),
1951                    properties: {
1952                        #[allow(unused_mut)]
1953                        let mut map = BTreeMap::new();
1954                        map.insert(
1955                            SmolStr::new_static("repost"),
1956                            LexObjectProperty::String(LexString {
1957                                format: Some(LexStringFormat::AtUri),
1958                                ..Default::default()
1959                            }),
1960                        );
1961                        map
1962                    },
1963                    ..Default::default()
1964                }),
1965            );
1966            map.insert(
1967                SmolStr::new_static("threadContext"),
1968                LexUserType::Object(LexObject {
1969                    description: Some(
1970                        CowStr::new_static(
1971                            "Metadata about this post within the context of the thread it is in.",
1972                        ),
1973                    ),
1974                    properties: {
1975                        #[allow(unused_mut)]
1976                        let mut map = BTreeMap::new();
1977                        map.insert(
1978                            SmolStr::new_static("rootAuthorLike"),
1979                            LexObjectProperty::String(LexString {
1980                                format: Some(LexStringFormat::AtUri),
1981                                ..Default::default()
1982                            }),
1983                        );
1984                        map
1985                    },
1986                    ..Default::default()
1987                }),
1988            );
1989            map.insert(
1990                SmolStr::new_static("threadViewPost"),
1991                LexUserType::Object(LexObject {
1992                    required: Some(vec![SmolStr::new_static("post")]),
1993                    properties: {
1994                        #[allow(unused_mut)]
1995                        let mut map = BTreeMap::new();
1996                        map.insert(
1997                            SmolStr::new_static("parent"),
1998                            LexObjectProperty::Union(LexRefUnion {
1999                                refs: vec![
2000                                    CowStr::new_static("#threadViewPost"),
2001                                    CowStr::new_static("#notFoundPost"),
2002                                    CowStr::new_static("#blockedPost")
2003                                ],
2004                                ..Default::default()
2005                            }),
2006                        );
2007                        map.insert(
2008                            SmolStr::new_static("post"),
2009                            LexObjectProperty::Ref(LexRef {
2010                                r#ref: CowStr::new_static("#postView"),
2011                                ..Default::default()
2012                            }),
2013                        );
2014                        map.insert(
2015                            SmolStr::new_static("replies"),
2016                            LexObjectProperty::Array(LexArray {
2017                                items: LexArrayItem::Union(LexRefUnion {
2018                                    refs: vec![
2019                                        CowStr::new_static("#threadViewPost"),
2020                                        CowStr::new_static("#notFoundPost"),
2021                                        CowStr::new_static("#blockedPost")
2022                                    ],
2023                                    ..Default::default()
2024                                }),
2025                                ..Default::default()
2026                            }),
2027                        );
2028                        map.insert(
2029                            SmolStr::new_static("threadContext"),
2030                            LexObjectProperty::Ref(LexRef {
2031                                r#ref: CowStr::new_static("#threadContext"),
2032                                ..Default::default()
2033                            }),
2034                        );
2035                        map
2036                    },
2037                    ..Default::default()
2038                }),
2039            );
2040            map.insert(
2041                SmolStr::new_static("threadgateView"),
2042                LexUserType::Object(LexObject {
2043                    properties: {
2044                        #[allow(unused_mut)]
2045                        let mut map = BTreeMap::new();
2046                        map.insert(
2047                            SmolStr::new_static("cid"),
2048                            LexObjectProperty::String(LexString {
2049                                format: Some(LexStringFormat::Cid),
2050                                ..Default::default()
2051                            }),
2052                        );
2053                        map.insert(
2054                            SmolStr::new_static("lists"),
2055                            LexObjectProperty::Array(LexArray {
2056                                items: LexArrayItem::Ref(LexRef {
2057                                    r#ref: CowStr::new_static(
2058                                        "app.bsky.graph.defs#listViewBasic",
2059                                    ),
2060                                    ..Default::default()
2061                                }),
2062                                ..Default::default()
2063                            }),
2064                        );
2065                        map.insert(
2066                            SmolStr::new_static("record"),
2067                            LexObjectProperty::Unknown(LexUnknown {
2068                                ..Default::default()
2069                            }),
2070                        );
2071                        map.insert(
2072                            SmolStr::new_static("uri"),
2073                            LexObjectProperty::String(LexString {
2074                                format: Some(LexStringFormat::AtUri),
2075                                ..Default::default()
2076                            }),
2077                        );
2078                        map
2079                    },
2080                    ..Default::default()
2081                }),
2082            );
2083            map.insert(
2084                SmolStr::new_static("viewerState"),
2085                LexUserType::Object(LexObject {
2086                    description: Some(
2087                        CowStr::new_static(
2088                            "Metadata about the requesting account's relationship with the subject content. Only has meaningful content for authed requests.",
2089                        ),
2090                    ),
2091                    properties: {
2092                        #[allow(unused_mut)]
2093                        let mut map = BTreeMap::new();
2094                        map.insert(
2095                            SmolStr::new_static("bookmarked"),
2096                            LexObjectProperty::Boolean(LexBoolean {
2097                                ..Default::default()
2098                            }),
2099                        );
2100                        map.insert(
2101                            SmolStr::new_static("embeddingDisabled"),
2102                            LexObjectProperty::Boolean(LexBoolean {
2103                                ..Default::default()
2104                            }),
2105                        );
2106                        map.insert(
2107                            SmolStr::new_static("like"),
2108                            LexObjectProperty::String(LexString {
2109                                format: Some(LexStringFormat::AtUri),
2110                                ..Default::default()
2111                            }),
2112                        );
2113                        map.insert(
2114                            SmolStr::new_static("pinned"),
2115                            LexObjectProperty::Boolean(LexBoolean {
2116                                ..Default::default()
2117                            }),
2118                        );
2119                        map.insert(
2120                            SmolStr::new_static("replyDisabled"),
2121                            LexObjectProperty::Boolean(LexBoolean {
2122                                ..Default::default()
2123                            }),
2124                        );
2125                        map.insert(
2126                            SmolStr::new_static("repost"),
2127                            LexObjectProperty::String(LexString {
2128                                format: Some(LexStringFormat::AtUri),
2129                                ..Default::default()
2130                            }),
2131                        );
2132                        map.insert(
2133                            SmolStr::new_static("threadMuted"),
2134                            LexObjectProperty::Boolean(LexBoolean {
2135                                ..Default::default()
2136                            }),
2137                        );
2138                        map
2139                    },
2140                    ..Default::default()
2141                }),
2142            );
2143            map
2144        },
2145        ..Default::default()
2146    }
2147}
2148
2149pub mod blocked_post_state {
2150
2151    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
2152    #[allow(unused)]
2153    use ::core::marker::PhantomData;
2154    mod sealed {
2155        pub trait Sealed {}
2156    }
2157    /// State trait tracking which required fields have been set
2158    pub trait State: sealed::Sealed {
2159        type Author;
2160        type Blocked;
2161        type Uri;
2162    }
2163    /// Empty state - all required fields are unset
2164    pub struct Empty(());
2165    impl sealed::Sealed for Empty {}
2166    impl State for Empty {
2167        type Author = Unset;
2168        type Blocked = Unset;
2169        type Uri = Unset;
2170    }
2171    ///State transition - sets the `author` field to Set
2172    pub struct SetAuthor<St: State = Empty>(PhantomData<fn() -> St>);
2173    impl<St: State> sealed::Sealed for SetAuthor<St> {}
2174    impl<St: State> State for SetAuthor<St> {
2175        type Author = Set<members::author>;
2176        type Blocked = St::Blocked;
2177        type Uri = St::Uri;
2178    }
2179    ///State transition - sets the `blocked` field to Set
2180    pub struct SetBlocked<St: State = Empty>(PhantomData<fn() -> St>);
2181    impl<St: State> sealed::Sealed for SetBlocked<St> {}
2182    impl<St: State> State for SetBlocked<St> {
2183        type Author = St::Author;
2184        type Blocked = Set<members::blocked>;
2185        type Uri = St::Uri;
2186    }
2187    ///State transition - sets the `uri` field to Set
2188    pub struct SetUri<St: State = Empty>(PhantomData<fn() -> St>);
2189    impl<St: State> sealed::Sealed for SetUri<St> {}
2190    impl<St: State> State for SetUri<St> {
2191        type Author = St::Author;
2192        type Blocked = St::Blocked;
2193        type Uri = Set<members::uri>;
2194    }
2195    /// Marker types for field names
2196    #[allow(non_camel_case_types)]
2197    pub mod members {
2198        ///Marker type for the `author` field
2199        pub struct author(());
2200        ///Marker type for the `blocked` field
2201        pub struct blocked(());
2202        ///Marker type for the `uri` field
2203        pub struct uri(());
2204    }
2205}
2206
2207/// Builder for constructing an instance of this type.
2208pub struct BlockedPostBuilder<St: blocked_post_state::State, S: BosStr = DefaultStr> {
2209    _state: PhantomData<fn() -> St>,
2210    _fields: (Option<feed::BlockedAuthor<S>>, Option<bool>, Option<AtUri<S>>),
2211    _type: PhantomData<fn() -> S>,
2212}
2213
2214impl BlockedPost<DefaultStr> {
2215    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
2216    pub fn new() -> BlockedPostBuilder<blocked_post_state::Empty, DefaultStr> {
2217        BlockedPostBuilder::new()
2218    }
2219}
2220
2221impl<S: BosStr> BlockedPost<S> {
2222    /// Create a new builder for this type
2223    pub fn builder() -> BlockedPostBuilder<blocked_post_state::Empty, S> {
2224        BlockedPostBuilder::builder()
2225    }
2226}
2227
2228impl BlockedPostBuilder<blocked_post_state::Empty, DefaultStr> {
2229    /// Create a new builder with all fields unset, using the default string type, if needed
2230    pub fn new() -> Self {
2231        BlockedPostBuilder {
2232            _state: PhantomData,
2233            _fields: (None, None, None),
2234            _type: PhantomData,
2235        }
2236    }
2237}
2238
2239impl<S: BosStr> BlockedPostBuilder<blocked_post_state::Empty, S> {
2240    /// Create a new builder with all fields unset
2241    pub fn builder() -> Self {
2242        BlockedPostBuilder {
2243            _state: PhantomData,
2244            _fields: (None, None, None),
2245            _type: PhantomData,
2246        }
2247    }
2248}
2249
2250impl<St, S: BosStr> BlockedPostBuilder<St, S>
2251where
2252    St: blocked_post_state::State,
2253    St::Author: blocked_post_state::IsUnset,
2254{
2255    /// Set the `author` field (required)
2256    pub fn author(
2257        mut self,
2258        value: impl Into<feed::BlockedAuthor<S>>,
2259    ) -> BlockedPostBuilder<blocked_post_state::SetAuthor<St>, S> {
2260        self._fields.0 = Option::Some(value.into());
2261        BlockedPostBuilder {
2262            _state: PhantomData,
2263            _fields: self._fields,
2264            _type: PhantomData,
2265        }
2266    }
2267}
2268
2269impl<St, S: BosStr> BlockedPostBuilder<St, S>
2270where
2271    St: blocked_post_state::State,
2272    St::Blocked: blocked_post_state::IsUnset,
2273{
2274    /// Set the `blocked` field (required)
2275    pub fn blocked(
2276        mut self,
2277        value: impl Into<bool>,
2278    ) -> BlockedPostBuilder<blocked_post_state::SetBlocked<St>, S> {
2279        self._fields.1 = Option::Some(value.into());
2280        BlockedPostBuilder {
2281            _state: PhantomData,
2282            _fields: self._fields,
2283            _type: PhantomData,
2284        }
2285    }
2286}
2287
2288impl<St, S: BosStr> BlockedPostBuilder<St, S>
2289where
2290    St: blocked_post_state::State,
2291    St::Uri: blocked_post_state::IsUnset,
2292{
2293    /// Set the `uri` field (required)
2294    pub fn uri(
2295        mut self,
2296        value: impl Into<AtUri<S>>,
2297    ) -> BlockedPostBuilder<blocked_post_state::SetUri<St>, S> {
2298        self._fields.2 = Option::Some(value.into());
2299        BlockedPostBuilder {
2300            _state: PhantomData,
2301            _fields: self._fields,
2302            _type: PhantomData,
2303        }
2304    }
2305}
2306
2307impl<St, S: BosStr> BlockedPostBuilder<St, S>
2308where
2309    St: blocked_post_state::State,
2310    St::Author: blocked_post_state::IsSet,
2311    St::Blocked: blocked_post_state::IsSet,
2312    St::Uri: blocked_post_state::IsSet,
2313{
2314    /// Build the final struct.
2315    pub fn build(self) -> BlockedPost<S> {
2316        BlockedPost {
2317            author: self._fields.0.unwrap(),
2318            blocked: self._fields.1.unwrap(),
2319            uri: self._fields.2.unwrap(),
2320            extra_data: Default::default(),
2321        }
2322    }
2323    /// Build the final struct with custom extra_data.
2324    pub fn build_with_data(
2325        self,
2326        extra_data: BTreeMap<SmolStr, Data<S>>,
2327    ) -> BlockedPost<S> {
2328        BlockedPost {
2329            author: self._fields.0.unwrap(),
2330            blocked: self._fields.1.unwrap(),
2331            uri: self._fields.2.unwrap(),
2332            extra_data: Some(extra_data),
2333        }
2334    }
2335}
2336
2337pub mod feed_view_post_state {
2338
2339    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
2340    #[allow(unused)]
2341    use ::core::marker::PhantomData;
2342    mod sealed {
2343        pub trait Sealed {}
2344    }
2345    /// State trait tracking which required fields have been set
2346    pub trait State: sealed::Sealed {
2347        type Post;
2348    }
2349    /// Empty state - all required fields are unset
2350    pub struct Empty(());
2351    impl sealed::Sealed for Empty {}
2352    impl State for Empty {
2353        type Post = Unset;
2354    }
2355    ///State transition - sets the `post` field to Set
2356    pub struct SetPost<St: State = Empty>(PhantomData<fn() -> St>);
2357    impl<St: State> sealed::Sealed for SetPost<St> {}
2358    impl<St: State> State for SetPost<St> {
2359        type Post = Set<members::post>;
2360    }
2361    /// Marker types for field names
2362    #[allow(non_camel_case_types)]
2363    pub mod members {
2364        ///Marker type for the `post` field
2365        pub struct post(());
2366    }
2367}
2368
2369/// Builder for constructing an instance of this type.
2370pub struct FeedViewPostBuilder<St: feed_view_post_state::State, S: BosStr = DefaultStr> {
2371    _state: PhantomData<fn() -> St>,
2372    _fields: (
2373        Option<S>,
2374        Option<feed::PostView<S>>,
2375        Option<FeedViewPostReason<S>>,
2376        Option<feed::ReplyRef<S>>,
2377        Option<S>,
2378    ),
2379    _type: PhantomData<fn() -> S>,
2380}
2381
2382impl FeedViewPost<DefaultStr> {
2383    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
2384    pub fn new() -> FeedViewPostBuilder<feed_view_post_state::Empty, DefaultStr> {
2385        FeedViewPostBuilder::new()
2386    }
2387}
2388
2389impl<S: BosStr> FeedViewPost<S> {
2390    /// Create a new builder for this type
2391    pub fn builder() -> FeedViewPostBuilder<feed_view_post_state::Empty, S> {
2392        FeedViewPostBuilder::builder()
2393    }
2394}
2395
2396impl FeedViewPostBuilder<feed_view_post_state::Empty, DefaultStr> {
2397    /// Create a new builder with all fields unset, using the default string type, if needed
2398    pub fn new() -> Self {
2399        FeedViewPostBuilder {
2400            _state: PhantomData,
2401            _fields: (None, None, None, None, None),
2402            _type: PhantomData,
2403        }
2404    }
2405}
2406
2407impl<S: BosStr> FeedViewPostBuilder<feed_view_post_state::Empty, S> {
2408    /// Create a new builder with all fields unset
2409    pub fn builder() -> Self {
2410        FeedViewPostBuilder {
2411            _state: PhantomData,
2412            _fields: (None, None, None, None, None),
2413            _type: PhantomData,
2414        }
2415    }
2416}
2417
2418impl<St: feed_view_post_state::State, S: BosStr> FeedViewPostBuilder<St, S> {
2419    /// Set the `feedContext` field (optional)
2420    pub fn feed_context(mut self, value: impl Into<Option<S>>) -> Self {
2421        self._fields.0 = value.into();
2422        self
2423    }
2424    /// Set the `feedContext` field to an Option value (optional)
2425    pub fn maybe_feed_context(mut self, value: Option<S>) -> Self {
2426        self._fields.0 = value;
2427        self
2428    }
2429}
2430
2431impl<St, S: BosStr> FeedViewPostBuilder<St, S>
2432where
2433    St: feed_view_post_state::State,
2434    St::Post: feed_view_post_state::IsUnset,
2435{
2436    /// Set the `post` field (required)
2437    pub fn post(
2438        mut self,
2439        value: impl Into<feed::PostView<S>>,
2440    ) -> FeedViewPostBuilder<feed_view_post_state::SetPost<St>, S> {
2441        self._fields.1 = Option::Some(value.into());
2442        FeedViewPostBuilder {
2443            _state: PhantomData,
2444            _fields: self._fields,
2445            _type: PhantomData,
2446        }
2447    }
2448}
2449
2450impl<St: feed_view_post_state::State, S: BosStr> FeedViewPostBuilder<St, S> {
2451    /// Set the `reason` field (optional)
2452    pub fn reason(mut self, value: impl Into<Option<FeedViewPostReason<S>>>) -> Self {
2453        self._fields.2 = value.into();
2454        self
2455    }
2456    /// Set the `reason` field to an Option value (optional)
2457    pub fn maybe_reason(mut self, value: Option<FeedViewPostReason<S>>) -> Self {
2458        self._fields.2 = value;
2459        self
2460    }
2461}
2462
2463impl<St: feed_view_post_state::State, S: BosStr> FeedViewPostBuilder<St, S> {
2464    /// Set the `reply` field (optional)
2465    pub fn reply(mut self, value: impl Into<Option<feed::ReplyRef<S>>>) -> Self {
2466        self._fields.3 = value.into();
2467        self
2468    }
2469    /// Set the `reply` field to an Option value (optional)
2470    pub fn maybe_reply(mut self, value: Option<feed::ReplyRef<S>>) -> Self {
2471        self._fields.3 = value;
2472        self
2473    }
2474}
2475
2476impl<St: feed_view_post_state::State, S: BosStr> FeedViewPostBuilder<St, S> {
2477    /// Set the `reqId` field (optional)
2478    pub fn req_id(mut self, value: impl Into<Option<S>>) -> Self {
2479        self._fields.4 = value.into();
2480        self
2481    }
2482    /// Set the `reqId` field to an Option value (optional)
2483    pub fn maybe_req_id(mut self, value: Option<S>) -> Self {
2484        self._fields.4 = value;
2485        self
2486    }
2487}
2488
2489impl<St, S: BosStr> FeedViewPostBuilder<St, S>
2490where
2491    St: feed_view_post_state::State,
2492    St::Post: feed_view_post_state::IsSet,
2493{
2494    /// Build the final struct.
2495    pub fn build(self) -> FeedViewPost<S> {
2496        FeedViewPost {
2497            feed_context: self._fields.0,
2498            post: self._fields.1.unwrap(),
2499            reason: self._fields.2,
2500            reply: self._fields.3,
2501            req_id: self._fields.4,
2502            extra_data: Default::default(),
2503        }
2504    }
2505    /// Build the final struct with custom extra_data.
2506    pub fn build_with_data(
2507        self,
2508        extra_data: BTreeMap<SmolStr, Data<S>>,
2509    ) -> FeedViewPost<S> {
2510        FeedViewPost {
2511            feed_context: self._fields.0,
2512            post: self._fields.1.unwrap(),
2513            reason: self._fields.2,
2514            reply: self._fields.3,
2515            req_id: self._fields.4,
2516            extra_data: Some(extra_data),
2517        }
2518    }
2519}
2520
2521pub mod generator_view_state {
2522
2523    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
2524    #[allow(unused)]
2525    use ::core::marker::PhantomData;
2526    mod sealed {
2527        pub trait Sealed {}
2528    }
2529    /// State trait tracking which required fields have been set
2530    pub trait State: sealed::Sealed {
2531        type Cid;
2532        type Creator;
2533        type Did;
2534        type DisplayName;
2535        type IndexedAt;
2536        type Uri;
2537    }
2538    /// Empty state - all required fields are unset
2539    pub struct Empty(());
2540    impl sealed::Sealed for Empty {}
2541    impl State for Empty {
2542        type Cid = Unset;
2543        type Creator = Unset;
2544        type Did = Unset;
2545        type DisplayName = Unset;
2546        type IndexedAt = Unset;
2547        type Uri = Unset;
2548    }
2549    ///State transition - sets the `cid` field to Set
2550    pub struct SetCid<St: State = Empty>(PhantomData<fn() -> St>);
2551    impl<St: State> sealed::Sealed for SetCid<St> {}
2552    impl<St: State> State for SetCid<St> {
2553        type Cid = Set<members::cid>;
2554        type Creator = St::Creator;
2555        type Did = St::Did;
2556        type DisplayName = St::DisplayName;
2557        type IndexedAt = St::IndexedAt;
2558        type Uri = St::Uri;
2559    }
2560    ///State transition - sets the `creator` field to Set
2561    pub struct SetCreator<St: State = Empty>(PhantomData<fn() -> St>);
2562    impl<St: State> sealed::Sealed for SetCreator<St> {}
2563    impl<St: State> State for SetCreator<St> {
2564        type Cid = St::Cid;
2565        type Creator = Set<members::creator>;
2566        type Did = St::Did;
2567        type DisplayName = St::DisplayName;
2568        type IndexedAt = St::IndexedAt;
2569        type Uri = St::Uri;
2570    }
2571    ///State transition - sets the `did` field to Set
2572    pub struct SetDid<St: State = Empty>(PhantomData<fn() -> St>);
2573    impl<St: State> sealed::Sealed for SetDid<St> {}
2574    impl<St: State> State for SetDid<St> {
2575        type Cid = St::Cid;
2576        type Creator = St::Creator;
2577        type Did = Set<members::did>;
2578        type DisplayName = St::DisplayName;
2579        type IndexedAt = St::IndexedAt;
2580        type Uri = St::Uri;
2581    }
2582    ///State transition - sets the `display_name` field to Set
2583    pub struct SetDisplayName<St: State = Empty>(PhantomData<fn() -> St>);
2584    impl<St: State> sealed::Sealed for SetDisplayName<St> {}
2585    impl<St: State> State for SetDisplayName<St> {
2586        type Cid = St::Cid;
2587        type Creator = St::Creator;
2588        type Did = St::Did;
2589        type DisplayName = Set<members::display_name>;
2590        type IndexedAt = St::IndexedAt;
2591        type Uri = St::Uri;
2592    }
2593    ///State transition - sets the `indexed_at` field to Set
2594    pub struct SetIndexedAt<St: State = Empty>(PhantomData<fn() -> St>);
2595    impl<St: State> sealed::Sealed for SetIndexedAt<St> {}
2596    impl<St: State> State for SetIndexedAt<St> {
2597        type Cid = St::Cid;
2598        type Creator = St::Creator;
2599        type Did = St::Did;
2600        type DisplayName = St::DisplayName;
2601        type IndexedAt = Set<members::indexed_at>;
2602        type Uri = St::Uri;
2603    }
2604    ///State transition - sets the `uri` field to Set
2605    pub struct SetUri<St: State = Empty>(PhantomData<fn() -> St>);
2606    impl<St: State> sealed::Sealed for SetUri<St> {}
2607    impl<St: State> State for SetUri<St> {
2608        type Cid = St::Cid;
2609        type Creator = St::Creator;
2610        type Did = St::Did;
2611        type DisplayName = St::DisplayName;
2612        type IndexedAt = St::IndexedAt;
2613        type Uri = Set<members::uri>;
2614    }
2615    /// Marker types for field names
2616    #[allow(non_camel_case_types)]
2617    pub mod members {
2618        ///Marker type for the `cid` field
2619        pub struct cid(());
2620        ///Marker type for the `creator` field
2621        pub struct creator(());
2622        ///Marker type for the `did` field
2623        pub struct did(());
2624        ///Marker type for the `display_name` field
2625        pub struct display_name(());
2626        ///Marker type for the `indexed_at` field
2627        pub struct indexed_at(());
2628        ///Marker type for the `uri` field
2629        pub struct uri(());
2630    }
2631}
2632
2633/// Builder for constructing an instance of this type.
2634pub struct GeneratorViewBuilder<
2635    St: generator_view_state::State,
2636    S: BosStr = DefaultStr,
2637> {
2638    _state: PhantomData<fn() -> St>,
2639    _fields: (
2640        Option<bool>,
2641        Option<UriValue<S>>,
2642        Option<Cid<S>>,
2643        Option<GeneratorViewContentMode<S>>,
2644        Option<ProfileView<S>>,
2645        Option<S>,
2646        Option<Vec<Facet<S>>>,
2647        Option<Did<S>>,
2648        Option<S>,
2649        Option<Datetime>,
2650        Option<Vec<Label<S>>>,
2651        Option<i64>,
2652        Option<AtUri<S>>,
2653        Option<feed::GeneratorViewerState<S>>,
2654    ),
2655    _type: PhantomData<fn() -> S>,
2656}
2657
2658impl GeneratorView<DefaultStr> {
2659    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
2660    pub fn new() -> GeneratorViewBuilder<generator_view_state::Empty, DefaultStr> {
2661        GeneratorViewBuilder::new()
2662    }
2663}
2664
2665impl<S: BosStr> GeneratorView<S> {
2666    /// Create a new builder for this type
2667    pub fn builder() -> GeneratorViewBuilder<generator_view_state::Empty, S> {
2668        GeneratorViewBuilder::builder()
2669    }
2670}
2671
2672impl GeneratorViewBuilder<generator_view_state::Empty, DefaultStr> {
2673    /// Create a new builder with all fields unset, using the default string type, if needed
2674    pub fn new() -> Self {
2675        GeneratorViewBuilder {
2676            _state: PhantomData,
2677            _fields: (
2678                None,
2679                None,
2680                None,
2681                None,
2682                None,
2683                None,
2684                None,
2685                None,
2686                None,
2687                None,
2688                None,
2689                None,
2690                None,
2691                None,
2692            ),
2693            _type: PhantomData,
2694        }
2695    }
2696}
2697
2698impl<S: BosStr> GeneratorViewBuilder<generator_view_state::Empty, S> {
2699    /// Create a new builder with all fields unset
2700    pub fn builder() -> Self {
2701        GeneratorViewBuilder {
2702            _state: PhantomData,
2703            _fields: (
2704                None,
2705                None,
2706                None,
2707                None,
2708                None,
2709                None,
2710                None,
2711                None,
2712                None,
2713                None,
2714                None,
2715                None,
2716                None,
2717                None,
2718            ),
2719            _type: PhantomData,
2720        }
2721    }
2722}
2723
2724impl<St: generator_view_state::State, S: BosStr> GeneratorViewBuilder<St, S> {
2725    /// Set the `acceptsInteractions` field (optional)
2726    pub fn accepts_interactions(mut self, value: impl Into<Option<bool>>) -> Self {
2727        self._fields.0 = value.into();
2728        self
2729    }
2730    /// Set the `acceptsInteractions` field to an Option value (optional)
2731    pub fn maybe_accepts_interactions(mut self, value: Option<bool>) -> Self {
2732        self._fields.0 = value;
2733        self
2734    }
2735}
2736
2737impl<St: generator_view_state::State, S: BosStr> GeneratorViewBuilder<St, S> {
2738    /// Set the `avatar` field (optional)
2739    pub fn avatar(mut self, value: impl Into<Option<UriValue<S>>>) -> Self {
2740        self._fields.1 = value.into();
2741        self
2742    }
2743    /// Set the `avatar` field to an Option value (optional)
2744    pub fn maybe_avatar(mut self, value: Option<UriValue<S>>) -> Self {
2745        self._fields.1 = value;
2746        self
2747    }
2748}
2749
2750impl<St, S: BosStr> GeneratorViewBuilder<St, S>
2751where
2752    St: generator_view_state::State,
2753    St::Cid: generator_view_state::IsUnset,
2754{
2755    /// Set the `cid` field (required)
2756    pub fn cid(
2757        mut self,
2758        value: impl Into<Cid<S>>,
2759    ) -> GeneratorViewBuilder<generator_view_state::SetCid<St>, S> {
2760        self._fields.2 = Option::Some(value.into());
2761        GeneratorViewBuilder {
2762            _state: PhantomData,
2763            _fields: self._fields,
2764            _type: PhantomData,
2765        }
2766    }
2767}
2768
2769impl<St: generator_view_state::State, S: BosStr> GeneratorViewBuilder<St, S> {
2770    /// Set the `contentMode` field (optional)
2771    pub fn content_mode(
2772        mut self,
2773        value: impl Into<Option<GeneratorViewContentMode<S>>>,
2774    ) -> Self {
2775        self._fields.3 = value.into();
2776        self
2777    }
2778    /// Set the `contentMode` field to an Option value (optional)
2779    pub fn maybe_content_mode(
2780        mut self,
2781        value: Option<GeneratorViewContentMode<S>>,
2782    ) -> Self {
2783        self._fields.3 = value;
2784        self
2785    }
2786}
2787
2788impl<St, S: BosStr> GeneratorViewBuilder<St, S>
2789where
2790    St: generator_view_state::State,
2791    St::Creator: generator_view_state::IsUnset,
2792{
2793    /// Set the `creator` field (required)
2794    pub fn creator(
2795        mut self,
2796        value: impl Into<ProfileView<S>>,
2797    ) -> GeneratorViewBuilder<generator_view_state::SetCreator<St>, S> {
2798        self._fields.4 = Option::Some(value.into());
2799        GeneratorViewBuilder {
2800            _state: PhantomData,
2801            _fields: self._fields,
2802            _type: PhantomData,
2803        }
2804    }
2805}
2806
2807impl<St: generator_view_state::State, S: BosStr> GeneratorViewBuilder<St, S> {
2808    /// Set the `description` field (optional)
2809    pub fn description(mut self, value: impl Into<Option<S>>) -> Self {
2810        self._fields.5 = value.into();
2811        self
2812    }
2813    /// Set the `description` field to an Option value (optional)
2814    pub fn maybe_description(mut self, value: Option<S>) -> Self {
2815        self._fields.5 = value;
2816        self
2817    }
2818}
2819
2820impl<St: generator_view_state::State, S: BosStr> GeneratorViewBuilder<St, S> {
2821    /// Set the `descriptionFacets` field (optional)
2822    pub fn description_facets(
2823        mut self,
2824        value: impl Into<Option<Vec<Facet<S>>>>,
2825    ) -> Self {
2826        self._fields.6 = value.into();
2827        self
2828    }
2829    /// Set the `descriptionFacets` field to an Option value (optional)
2830    pub fn maybe_description_facets(mut self, value: Option<Vec<Facet<S>>>) -> Self {
2831        self._fields.6 = value;
2832        self
2833    }
2834}
2835
2836impl<St, S: BosStr> GeneratorViewBuilder<St, S>
2837where
2838    St: generator_view_state::State,
2839    St::Did: generator_view_state::IsUnset,
2840{
2841    /// Set the `did` field (required)
2842    pub fn did(
2843        mut self,
2844        value: impl Into<Did<S>>,
2845    ) -> GeneratorViewBuilder<generator_view_state::SetDid<St>, S> {
2846        self._fields.7 = Option::Some(value.into());
2847        GeneratorViewBuilder {
2848            _state: PhantomData,
2849            _fields: self._fields,
2850            _type: PhantomData,
2851        }
2852    }
2853}
2854
2855impl<St, S: BosStr> GeneratorViewBuilder<St, S>
2856where
2857    St: generator_view_state::State,
2858    St::DisplayName: generator_view_state::IsUnset,
2859{
2860    /// Set the `displayName` field (required)
2861    pub fn display_name(
2862        mut self,
2863        value: impl Into<S>,
2864    ) -> GeneratorViewBuilder<generator_view_state::SetDisplayName<St>, S> {
2865        self._fields.8 = Option::Some(value.into());
2866        GeneratorViewBuilder {
2867            _state: PhantomData,
2868            _fields: self._fields,
2869            _type: PhantomData,
2870        }
2871    }
2872}
2873
2874impl<St, S: BosStr> GeneratorViewBuilder<St, S>
2875where
2876    St: generator_view_state::State,
2877    St::IndexedAt: generator_view_state::IsUnset,
2878{
2879    /// Set the `indexedAt` field (required)
2880    pub fn indexed_at(
2881        mut self,
2882        value: impl Into<Datetime>,
2883    ) -> GeneratorViewBuilder<generator_view_state::SetIndexedAt<St>, S> {
2884        self._fields.9 = Option::Some(value.into());
2885        GeneratorViewBuilder {
2886            _state: PhantomData,
2887            _fields: self._fields,
2888            _type: PhantomData,
2889        }
2890    }
2891}
2892
2893impl<St: generator_view_state::State, S: BosStr> GeneratorViewBuilder<St, S> {
2894    /// Set the `labels` field (optional)
2895    pub fn labels(mut self, value: impl Into<Option<Vec<Label<S>>>>) -> Self {
2896        self._fields.10 = value.into();
2897        self
2898    }
2899    /// Set the `labels` field to an Option value (optional)
2900    pub fn maybe_labels(mut self, value: Option<Vec<Label<S>>>) -> Self {
2901        self._fields.10 = value;
2902        self
2903    }
2904}
2905
2906impl<St: generator_view_state::State, S: BosStr> GeneratorViewBuilder<St, S> {
2907    /// Set the `likeCount` field (optional)
2908    pub fn like_count(mut self, value: impl Into<Option<i64>>) -> Self {
2909        self._fields.11 = value.into();
2910        self
2911    }
2912    /// Set the `likeCount` field to an Option value (optional)
2913    pub fn maybe_like_count(mut self, value: Option<i64>) -> Self {
2914        self._fields.11 = value;
2915        self
2916    }
2917}
2918
2919impl<St, S: BosStr> GeneratorViewBuilder<St, S>
2920where
2921    St: generator_view_state::State,
2922    St::Uri: generator_view_state::IsUnset,
2923{
2924    /// Set the `uri` field (required)
2925    pub fn uri(
2926        mut self,
2927        value: impl Into<AtUri<S>>,
2928    ) -> GeneratorViewBuilder<generator_view_state::SetUri<St>, S> {
2929        self._fields.12 = Option::Some(value.into());
2930        GeneratorViewBuilder {
2931            _state: PhantomData,
2932            _fields: self._fields,
2933            _type: PhantomData,
2934        }
2935    }
2936}
2937
2938impl<St: generator_view_state::State, S: BosStr> GeneratorViewBuilder<St, S> {
2939    /// Set the `viewer` field (optional)
2940    pub fn viewer(
2941        mut self,
2942        value: impl Into<Option<feed::GeneratorViewerState<S>>>,
2943    ) -> Self {
2944        self._fields.13 = value.into();
2945        self
2946    }
2947    /// Set the `viewer` field to an Option value (optional)
2948    pub fn maybe_viewer(mut self, value: Option<feed::GeneratorViewerState<S>>) -> Self {
2949        self._fields.13 = value;
2950        self
2951    }
2952}
2953
2954impl<St, S: BosStr> GeneratorViewBuilder<St, S>
2955where
2956    St: generator_view_state::State,
2957    St::Cid: generator_view_state::IsSet,
2958    St::Creator: generator_view_state::IsSet,
2959    St::Did: generator_view_state::IsSet,
2960    St::DisplayName: generator_view_state::IsSet,
2961    St::IndexedAt: generator_view_state::IsSet,
2962    St::Uri: generator_view_state::IsSet,
2963{
2964    /// Build the final struct.
2965    pub fn build(self) -> GeneratorView<S> {
2966        GeneratorView {
2967            accepts_interactions: self._fields.0,
2968            avatar: self._fields.1,
2969            cid: self._fields.2.unwrap(),
2970            content_mode: self._fields.3,
2971            creator: self._fields.4.unwrap(),
2972            description: self._fields.5,
2973            description_facets: self._fields.6,
2974            did: self._fields.7.unwrap(),
2975            display_name: self._fields.8.unwrap(),
2976            indexed_at: self._fields.9.unwrap(),
2977            labels: self._fields.10,
2978            like_count: self._fields.11,
2979            uri: self._fields.12.unwrap(),
2980            viewer: self._fields.13,
2981            extra_data: Default::default(),
2982        }
2983    }
2984    /// Build the final struct with custom extra_data.
2985    pub fn build_with_data(
2986        self,
2987        extra_data: BTreeMap<SmolStr, Data<S>>,
2988    ) -> GeneratorView<S> {
2989        GeneratorView {
2990            accepts_interactions: self._fields.0,
2991            avatar: self._fields.1,
2992            cid: self._fields.2.unwrap(),
2993            content_mode: self._fields.3,
2994            creator: self._fields.4.unwrap(),
2995            description: self._fields.5,
2996            description_facets: self._fields.6,
2997            did: self._fields.7.unwrap(),
2998            display_name: self._fields.8.unwrap(),
2999            indexed_at: self._fields.9.unwrap(),
3000            labels: self._fields.10,
3001            like_count: self._fields.11,
3002            uri: self._fields.12.unwrap(),
3003            viewer: self._fields.13,
3004            extra_data: Some(extra_data),
3005        }
3006    }
3007}
3008
3009pub mod not_found_post_state {
3010
3011    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
3012    #[allow(unused)]
3013    use ::core::marker::PhantomData;
3014    mod sealed {
3015        pub trait Sealed {}
3016    }
3017    /// State trait tracking which required fields have been set
3018    pub trait State: sealed::Sealed {
3019        type NotFound;
3020        type Uri;
3021    }
3022    /// Empty state - all required fields are unset
3023    pub struct Empty(());
3024    impl sealed::Sealed for Empty {}
3025    impl State for Empty {
3026        type NotFound = Unset;
3027        type Uri = Unset;
3028    }
3029    ///State transition - sets the `not_found` field to Set
3030    pub struct SetNotFound<St: State = Empty>(PhantomData<fn() -> St>);
3031    impl<St: State> sealed::Sealed for SetNotFound<St> {}
3032    impl<St: State> State for SetNotFound<St> {
3033        type NotFound = Set<members::not_found>;
3034        type Uri = St::Uri;
3035    }
3036    ///State transition - sets the `uri` field to Set
3037    pub struct SetUri<St: State = Empty>(PhantomData<fn() -> St>);
3038    impl<St: State> sealed::Sealed for SetUri<St> {}
3039    impl<St: State> State for SetUri<St> {
3040        type NotFound = St::NotFound;
3041        type Uri = Set<members::uri>;
3042    }
3043    /// Marker types for field names
3044    #[allow(non_camel_case_types)]
3045    pub mod members {
3046        ///Marker type for the `not_found` field
3047        pub struct not_found(());
3048        ///Marker type for the `uri` field
3049        pub struct uri(());
3050    }
3051}
3052
3053/// Builder for constructing an instance of this type.
3054pub struct NotFoundPostBuilder<St: not_found_post_state::State, S: BosStr = DefaultStr> {
3055    _state: PhantomData<fn() -> St>,
3056    _fields: (Option<bool>, Option<AtUri<S>>),
3057    _type: PhantomData<fn() -> S>,
3058}
3059
3060impl NotFoundPost<DefaultStr> {
3061    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
3062    pub fn new() -> NotFoundPostBuilder<not_found_post_state::Empty, DefaultStr> {
3063        NotFoundPostBuilder::new()
3064    }
3065}
3066
3067impl<S: BosStr> NotFoundPost<S> {
3068    /// Create a new builder for this type
3069    pub fn builder() -> NotFoundPostBuilder<not_found_post_state::Empty, S> {
3070        NotFoundPostBuilder::builder()
3071    }
3072}
3073
3074impl NotFoundPostBuilder<not_found_post_state::Empty, DefaultStr> {
3075    /// Create a new builder with all fields unset, using the default string type, if needed
3076    pub fn new() -> Self {
3077        NotFoundPostBuilder {
3078            _state: PhantomData,
3079            _fields: (None, None),
3080            _type: PhantomData,
3081        }
3082    }
3083}
3084
3085impl<S: BosStr> NotFoundPostBuilder<not_found_post_state::Empty, S> {
3086    /// Create a new builder with all fields unset
3087    pub fn builder() -> Self {
3088        NotFoundPostBuilder {
3089            _state: PhantomData,
3090            _fields: (None, None),
3091            _type: PhantomData,
3092        }
3093    }
3094}
3095
3096impl<St, S: BosStr> NotFoundPostBuilder<St, S>
3097where
3098    St: not_found_post_state::State,
3099    St::NotFound: not_found_post_state::IsUnset,
3100{
3101    /// Set the `notFound` field (required)
3102    pub fn not_found(
3103        mut self,
3104        value: impl Into<bool>,
3105    ) -> NotFoundPostBuilder<not_found_post_state::SetNotFound<St>, S> {
3106        self._fields.0 = Option::Some(value.into());
3107        NotFoundPostBuilder {
3108            _state: PhantomData,
3109            _fields: self._fields,
3110            _type: PhantomData,
3111        }
3112    }
3113}
3114
3115impl<St, S: BosStr> NotFoundPostBuilder<St, S>
3116where
3117    St: not_found_post_state::State,
3118    St::Uri: not_found_post_state::IsUnset,
3119{
3120    /// Set the `uri` field (required)
3121    pub fn uri(
3122        mut self,
3123        value: impl Into<AtUri<S>>,
3124    ) -> NotFoundPostBuilder<not_found_post_state::SetUri<St>, S> {
3125        self._fields.1 = Option::Some(value.into());
3126        NotFoundPostBuilder {
3127            _state: PhantomData,
3128            _fields: self._fields,
3129            _type: PhantomData,
3130        }
3131    }
3132}
3133
3134impl<St, S: BosStr> NotFoundPostBuilder<St, S>
3135where
3136    St: not_found_post_state::State,
3137    St::NotFound: not_found_post_state::IsSet,
3138    St::Uri: not_found_post_state::IsSet,
3139{
3140    /// Build the final struct.
3141    pub fn build(self) -> NotFoundPost<S> {
3142        NotFoundPost {
3143            not_found: self._fields.0.unwrap(),
3144            uri: self._fields.1.unwrap(),
3145            extra_data: Default::default(),
3146        }
3147    }
3148    /// Build the final struct with custom extra_data.
3149    pub fn build_with_data(
3150        self,
3151        extra_data: BTreeMap<SmolStr, Data<S>>,
3152    ) -> NotFoundPost<S> {
3153        NotFoundPost {
3154            not_found: self._fields.0.unwrap(),
3155            uri: self._fields.1.unwrap(),
3156            extra_data: Some(extra_data),
3157        }
3158    }
3159}
3160
3161pub mod post_view_state {
3162
3163    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
3164    #[allow(unused)]
3165    use ::core::marker::PhantomData;
3166    mod sealed {
3167        pub trait Sealed {}
3168    }
3169    /// State trait tracking which required fields have been set
3170    pub trait State: sealed::Sealed {
3171        type Author;
3172        type Cid;
3173        type IndexedAt;
3174        type Record;
3175        type Uri;
3176    }
3177    /// Empty state - all required fields are unset
3178    pub struct Empty(());
3179    impl sealed::Sealed for Empty {}
3180    impl State for Empty {
3181        type Author = Unset;
3182        type Cid = Unset;
3183        type IndexedAt = Unset;
3184        type Record = Unset;
3185        type Uri = Unset;
3186    }
3187    ///State transition - sets the `author` field to Set
3188    pub struct SetAuthor<St: State = Empty>(PhantomData<fn() -> St>);
3189    impl<St: State> sealed::Sealed for SetAuthor<St> {}
3190    impl<St: State> State for SetAuthor<St> {
3191        type Author = Set<members::author>;
3192        type Cid = St::Cid;
3193        type IndexedAt = St::IndexedAt;
3194        type Record = St::Record;
3195        type Uri = St::Uri;
3196    }
3197    ///State transition - sets the `cid` field to Set
3198    pub struct SetCid<St: State = Empty>(PhantomData<fn() -> St>);
3199    impl<St: State> sealed::Sealed for SetCid<St> {}
3200    impl<St: State> State for SetCid<St> {
3201        type Author = St::Author;
3202        type Cid = Set<members::cid>;
3203        type IndexedAt = St::IndexedAt;
3204        type Record = St::Record;
3205        type Uri = St::Uri;
3206    }
3207    ///State transition - sets the `indexed_at` field to Set
3208    pub struct SetIndexedAt<St: State = Empty>(PhantomData<fn() -> St>);
3209    impl<St: State> sealed::Sealed for SetIndexedAt<St> {}
3210    impl<St: State> State for SetIndexedAt<St> {
3211        type Author = St::Author;
3212        type Cid = St::Cid;
3213        type IndexedAt = Set<members::indexed_at>;
3214        type Record = St::Record;
3215        type Uri = St::Uri;
3216    }
3217    ///State transition - sets the `record` field to Set
3218    pub struct SetRecord<St: State = Empty>(PhantomData<fn() -> St>);
3219    impl<St: State> sealed::Sealed for SetRecord<St> {}
3220    impl<St: State> State for SetRecord<St> {
3221        type Author = St::Author;
3222        type Cid = St::Cid;
3223        type IndexedAt = St::IndexedAt;
3224        type Record = Set<members::record>;
3225        type Uri = St::Uri;
3226    }
3227    ///State transition - sets the `uri` field to Set
3228    pub struct SetUri<St: State = Empty>(PhantomData<fn() -> St>);
3229    impl<St: State> sealed::Sealed for SetUri<St> {}
3230    impl<St: State> State for SetUri<St> {
3231        type Author = St::Author;
3232        type Cid = St::Cid;
3233        type IndexedAt = St::IndexedAt;
3234        type Record = St::Record;
3235        type Uri = Set<members::uri>;
3236    }
3237    /// Marker types for field names
3238    #[allow(non_camel_case_types)]
3239    pub mod members {
3240        ///Marker type for the `author` field
3241        pub struct author(());
3242        ///Marker type for the `cid` field
3243        pub struct cid(());
3244        ///Marker type for the `indexed_at` field
3245        pub struct indexed_at(());
3246        ///Marker type for the `record` field
3247        pub struct record(());
3248        ///Marker type for the `uri` field
3249        pub struct uri(());
3250    }
3251}
3252
3253/// Builder for constructing an instance of this type.
3254pub struct PostViewBuilder<St: post_view_state::State, S: BosStr = DefaultStr> {
3255    _state: PhantomData<fn() -> St>,
3256    _fields: (
3257        Option<ProfileViewBasic<S>>,
3258        Option<i64>,
3259        Option<Cid<S>>,
3260        Option<Data<S>>,
3261        Option<PostViewEmbed<S>>,
3262        Option<Datetime>,
3263        Option<Vec<Label<S>>>,
3264        Option<i64>,
3265        Option<i64>,
3266        Option<Data<S>>,
3267        Option<i64>,
3268        Option<i64>,
3269        Option<feed::ThreadgateView<S>>,
3270        Option<AtUri<S>>,
3271        Option<feed::ViewerState<S>>,
3272    ),
3273    _type: PhantomData<fn() -> S>,
3274}
3275
3276impl PostView<DefaultStr> {
3277    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
3278    pub fn new() -> PostViewBuilder<post_view_state::Empty, DefaultStr> {
3279        PostViewBuilder::new()
3280    }
3281}
3282
3283impl<S: BosStr> PostView<S> {
3284    /// Create a new builder for this type
3285    pub fn builder() -> PostViewBuilder<post_view_state::Empty, S> {
3286        PostViewBuilder::builder()
3287    }
3288}
3289
3290impl PostViewBuilder<post_view_state::Empty, DefaultStr> {
3291    /// Create a new builder with all fields unset, using the default string type, if needed
3292    pub fn new() -> Self {
3293        PostViewBuilder {
3294            _state: PhantomData,
3295            _fields: (
3296                None,
3297                None,
3298                None,
3299                None,
3300                None,
3301                None,
3302                None,
3303                None,
3304                None,
3305                None,
3306                None,
3307                None,
3308                None,
3309                None,
3310                None,
3311            ),
3312            _type: PhantomData,
3313        }
3314    }
3315}
3316
3317impl<S: BosStr> PostViewBuilder<post_view_state::Empty, S> {
3318    /// Create a new builder with all fields unset
3319    pub fn builder() -> Self {
3320        PostViewBuilder {
3321            _state: PhantomData,
3322            _fields: (
3323                None,
3324                None,
3325                None,
3326                None,
3327                None,
3328                None,
3329                None,
3330                None,
3331                None,
3332                None,
3333                None,
3334                None,
3335                None,
3336                None,
3337                None,
3338            ),
3339            _type: PhantomData,
3340        }
3341    }
3342}
3343
3344impl<St, S: BosStr> PostViewBuilder<St, S>
3345where
3346    St: post_view_state::State,
3347    St::Author: post_view_state::IsUnset,
3348{
3349    /// Set the `author` field (required)
3350    pub fn author(
3351        mut self,
3352        value: impl Into<ProfileViewBasic<S>>,
3353    ) -> PostViewBuilder<post_view_state::SetAuthor<St>, S> {
3354        self._fields.0 = Option::Some(value.into());
3355        PostViewBuilder {
3356            _state: PhantomData,
3357            _fields: self._fields,
3358            _type: PhantomData,
3359        }
3360    }
3361}
3362
3363impl<St: post_view_state::State, S: BosStr> PostViewBuilder<St, S> {
3364    /// Set the `bookmarkCount` field (optional)
3365    pub fn bookmark_count(mut self, value: impl Into<Option<i64>>) -> Self {
3366        self._fields.1 = value.into();
3367        self
3368    }
3369    /// Set the `bookmarkCount` field to an Option value (optional)
3370    pub fn maybe_bookmark_count(mut self, value: Option<i64>) -> Self {
3371        self._fields.1 = value;
3372        self
3373    }
3374}
3375
3376impl<St, S: BosStr> PostViewBuilder<St, S>
3377where
3378    St: post_view_state::State,
3379    St::Cid: post_view_state::IsUnset,
3380{
3381    /// Set the `cid` field (required)
3382    pub fn cid(
3383        mut self,
3384        value: impl Into<Cid<S>>,
3385    ) -> PostViewBuilder<post_view_state::SetCid<St>, S> {
3386        self._fields.2 = Option::Some(value.into());
3387        PostViewBuilder {
3388            _state: PhantomData,
3389            _fields: self._fields,
3390            _type: PhantomData,
3391        }
3392    }
3393}
3394
3395impl<St: post_view_state::State, S: BosStr> PostViewBuilder<St, S> {
3396    /// Set the `debug` field (optional)
3397    pub fn debug(mut self, value: impl Into<Option<Data<S>>>) -> Self {
3398        self._fields.3 = value.into();
3399        self
3400    }
3401    /// Set the `debug` field to an Option value (optional)
3402    pub fn maybe_debug(mut self, value: Option<Data<S>>) -> Self {
3403        self._fields.3 = value;
3404        self
3405    }
3406}
3407
3408impl<St: post_view_state::State, S: BosStr> PostViewBuilder<St, S> {
3409    /// Set the `embed` field (optional)
3410    pub fn embed(mut self, value: impl Into<Option<PostViewEmbed<S>>>) -> Self {
3411        self._fields.4 = value.into();
3412        self
3413    }
3414    /// Set the `embed` field to an Option value (optional)
3415    pub fn maybe_embed(mut self, value: Option<PostViewEmbed<S>>) -> Self {
3416        self._fields.4 = value;
3417        self
3418    }
3419}
3420
3421impl<St, S: BosStr> PostViewBuilder<St, S>
3422where
3423    St: post_view_state::State,
3424    St::IndexedAt: post_view_state::IsUnset,
3425{
3426    /// Set the `indexedAt` field (required)
3427    pub fn indexed_at(
3428        mut self,
3429        value: impl Into<Datetime>,
3430    ) -> PostViewBuilder<post_view_state::SetIndexedAt<St>, S> {
3431        self._fields.5 = Option::Some(value.into());
3432        PostViewBuilder {
3433            _state: PhantomData,
3434            _fields: self._fields,
3435            _type: PhantomData,
3436        }
3437    }
3438}
3439
3440impl<St: post_view_state::State, S: BosStr> PostViewBuilder<St, S> {
3441    /// Set the `labels` field (optional)
3442    pub fn labels(mut self, value: impl Into<Option<Vec<Label<S>>>>) -> Self {
3443        self._fields.6 = value.into();
3444        self
3445    }
3446    /// Set the `labels` field to an Option value (optional)
3447    pub fn maybe_labels(mut self, value: Option<Vec<Label<S>>>) -> Self {
3448        self._fields.6 = value;
3449        self
3450    }
3451}
3452
3453impl<St: post_view_state::State, S: BosStr> PostViewBuilder<St, S> {
3454    /// Set the `likeCount` field (optional)
3455    pub fn like_count(mut self, value: impl Into<Option<i64>>) -> Self {
3456        self._fields.7 = value.into();
3457        self
3458    }
3459    /// Set the `likeCount` field to an Option value (optional)
3460    pub fn maybe_like_count(mut self, value: Option<i64>) -> Self {
3461        self._fields.7 = value;
3462        self
3463    }
3464}
3465
3466impl<St: post_view_state::State, S: BosStr> PostViewBuilder<St, S> {
3467    /// Set the `quoteCount` field (optional)
3468    pub fn quote_count(mut self, value: impl Into<Option<i64>>) -> Self {
3469        self._fields.8 = value.into();
3470        self
3471    }
3472    /// Set the `quoteCount` field to an Option value (optional)
3473    pub fn maybe_quote_count(mut self, value: Option<i64>) -> Self {
3474        self._fields.8 = value;
3475        self
3476    }
3477}
3478
3479impl<St, S: BosStr> PostViewBuilder<St, S>
3480where
3481    St: post_view_state::State,
3482    St::Record: post_view_state::IsUnset,
3483{
3484    /// Set the `record` field (required)
3485    pub fn record(
3486        mut self,
3487        value: impl Into<Data<S>>,
3488    ) -> PostViewBuilder<post_view_state::SetRecord<St>, S> {
3489        self._fields.9 = Option::Some(value.into());
3490        PostViewBuilder {
3491            _state: PhantomData,
3492            _fields: self._fields,
3493            _type: PhantomData,
3494        }
3495    }
3496}
3497
3498impl<St: post_view_state::State, S: BosStr> PostViewBuilder<St, S> {
3499    /// Set the `replyCount` field (optional)
3500    pub fn reply_count(mut self, value: impl Into<Option<i64>>) -> Self {
3501        self._fields.10 = value.into();
3502        self
3503    }
3504    /// Set the `replyCount` field to an Option value (optional)
3505    pub fn maybe_reply_count(mut self, value: Option<i64>) -> Self {
3506        self._fields.10 = value;
3507        self
3508    }
3509}
3510
3511impl<St: post_view_state::State, S: BosStr> PostViewBuilder<St, S> {
3512    /// Set the `repostCount` field (optional)
3513    pub fn repost_count(mut self, value: impl Into<Option<i64>>) -> Self {
3514        self._fields.11 = value.into();
3515        self
3516    }
3517    /// Set the `repostCount` field to an Option value (optional)
3518    pub fn maybe_repost_count(mut self, value: Option<i64>) -> Self {
3519        self._fields.11 = value;
3520        self
3521    }
3522}
3523
3524impl<St: post_view_state::State, S: BosStr> PostViewBuilder<St, S> {
3525    /// Set the `threadgate` field (optional)
3526    pub fn threadgate(
3527        mut self,
3528        value: impl Into<Option<feed::ThreadgateView<S>>>,
3529    ) -> Self {
3530        self._fields.12 = value.into();
3531        self
3532    }
3533    /// Set the `threadgate` field to an Option value (optional)
3534    pub fn maybe_threadgate(mut self, value: Option<feed::ThreadgateView<S>>) -> Self {
3535        self._fields.12 = value;
3536        self
3537    }
3538}
3539
3540impl<St, S: BosStr> PostViewBuilder<St, S>
3541where
3542    St: post_view_state::State,
3543    St::Uri: post_view_state::IsUnset,
3544{
3545    /// Set the `uri` field (required)
3546    pub fn uri(
3547        mut self,
3548        value: impl Into<AtUri<S>>,
3549    ) -> PostViewBuilder<post_view_state::SetUri<St>, S> {
3550        self._fields.13 = Option::Some(value.into());
3551        PostViewBuilder {
3552            _state: PhantomData,
3553            _fields: self._fields,
3554            _type: PhantomData,
3555        }
3556    }
3557}
3558
3559impl<St: post_view_state::State, S: BosStr> PostViewBuilder<St, S> {
3560    /// Set the `viewer` field (optional)
3561    pub fn viewer(mut self, value: impl Into<Option<feed::ViewerState<S>>>) -> Self {
3562        self._fields.14 = value.into();
3563        self
3564    }
3565    /// Set the `viewer` field to an Option value (optional)
3566    pub fn maybe_viewer(mut self, value: Option<feed::ViewerState<S>>) -> Self {
3567        self._fields.14 = value;
3568        self
3569    }
3570}
3571
3572impl<St, S: BosStr> PostViewBuilder<St, S>
3573where
3574    St: post_view_state::State,
3575    St::Author: post_view_state::IsSet,
3576    St::Cid: post_view_state::IsSet,
3577    St::IndexedAt: post_view_state::IsSet,
3578    St::Record: post_view_state::IsSet,
3579    St::Uri: post_view_state::IsSet,
3580{
3581    /// Build the final struct.
3582    pub fn build(self) -> PostView<S> {
3583        PostView {
3584            author: self._fields.0.unwrap(),
3585            bookmark_count: self._fields.1,
3586            cid: self._fields.2.unwrap(),
3587            debug: self._fields.3,
3588            embed: self._fields.4,
3589            indexed_at: self._fields.5.unwrap(),
3590            labels: self._fields.6,
3591            like_count: self._fields.7,
3592            quote_count: self._fields.8,
3593            record: self._fields.9.unwrap(),
3594            reply_count: self._fields.10,
3595            repost_count: self._fields.11,
3596            threadgate: self._fields.12,
3597            uri: self._fields.13.unwrap(),
3598            viewer: self._fields.14,
3599            extra_data: Default::default(),
3600        }
3601    }
3602    /// Build the final struct with custom extra_data.
3603    pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> PostView<S> {
3604        PostView {
3605            author: self._fields.0.unwrap(),
3606            bookmark_count: self._fields.1,
3607            cid: self._fields.2.unwrap(),
3608            debug: self._fields.3,
3609            embed: self._fields.4,
3610            indexed_at: self._fields.5.unwrap(),
3611            labels: self._fields.6,
3612            like_count: self._fields.7,
3613            quote_count: self._fields.8,
3614            record: self._fields.9.unwrap(),
3615            reply_count: self._fields.10,
3616            repost_count: self._fields.11,
3617            threadgate: self._fields.12,
3618            uri: self._fields.13.unwrap(),
3619            viewer: self._fields.14,
3620            extra_data: Some(extra_data),
3621        }
3622    }
3623}
3624
3625pub mod reason_repost_state {
3626
3627    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
3628    #[allow(unused)]
3629    use ::core::marker::PhantomData;
3630    mod sealed {
3631        pub trait Sealed {}
3632    }
3633    /// State trait tracking which required fields have been set
3634    pub trait State: sealed::Sealed {
3635        type By;
3636        type IndexedAt;
3637    }
3638    /// Empty state - all required fields are unset
3639    pub struct Empty(());
3640    impl sealed::Sealed for Empty {}
3641    impl State for Empty {
3642        type By = Unset;
3643        type IndexedAt = Unset;
3644    }
3645    ///State transition - sets the `by` field to Set
3646    pub struct SetBy<St: State = Empty>(PhantomData<fn() -> St>);
3647    impl<St: State> sealed::Sealed for SetBy<St> {}
3648    impl<St: State> State for SetBy<St> {
3649        type By = Set<members::by>;
3650        type IndexedAt = St::IndexedAt;
3651    }
3652    ///State transition - sets the `indexed_at` field to Set
3653    pub struct SetIndexedAt<St: State = Empty>(PhantomData<fn() -> St>);
3654    impl<St: State> sealed::Sealed for SetIndexedAt<St> {}
3655    impl<St: State> State for SetIndexedAt<St> {
3656        type By = St::By;
3657        type IndexedAt = Set<members::indexed_at>;
3658    }
3659    /// Marker types for field names
3660    #[allow(non_camel_case_types)]
3661    pub mod members {
3662        ///Marker type for the `by` field
3663        pub struct by(());
3664        ///Marker type for the `indexed_at` field
3665        pub struct indexed_at(());
3666    }
3667}
3668
3669/// Builder for constructing an instance of this type.
3670pub struct ReasonRepostBuilder<St: reason_repost_state::State, S: BosStr = DefaultStr> {
3671    _state: PhantomData<fn() -> St>,
3672    _fields: (
3673        Option<ProfileViewBasic<S>>,
3674        Option<Cid<S>>,
3675        Option<Datetime>,
3676        Option<AtUri<S>>,
3677    ),
3678    _type: PhantomData<fn() -> S>,
3679}
3680
3681impl ReasonRepost<DefaultStr> {
3682    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
3683    pub fn new() -> ReasonRepostBuilder<reason_repost_state::Empty, DefaultStr> {
3684        ReasonRepostBuilder::new()
3685    }
3686}
3687
3688impl<S: BosStr> ReasonRepost<S> {
3689    /// Create a new builder for this type
3690    pub fn builder() -> ReasonRepostBuilder<reason_repost_state::Empty, S> {
3691        ReasonRepostBuilder::builder()
3692    }
3693}
3694
3695impl ReasonRepostBuilder<reason_repost_state::Empty, DefaultStr> {
3696    /// Create a new builder with all fields unset, using the default string type, if needed
3697    pub fn new() -> Self {
3698        ReasonRepostBuilder {
3699            _state: PhantomData,
3700            _fields: (None, None, None, None),
3701            _type: PhantomData,
3702        }
3703    }
3704}
3705
3706impl<S: BosStr> ReasonRepostBuilder<reason_repost_state::Empty, S> {
3707    /// Create a new builder with all fields unset
3708    pub fn builder() -> Self {
3709        ReasonRepostBuilder {
3710            _state: PhantomData,
3711            _fields: (None, None, None, None),
3712            _type: PhantomData,
3713        }
3714    }
3715}
3716
3717impl<St, S: BosStr> ReasonRepostBuilder<St, S>
3718where
3719    St: reason_repost_state::State,
3720    St::By: reason_repost_state::IsUnset,
3721{
3722    /// Set the `by` field (required)
3723    pub fn by(
3724        mut self,
3725        value: impl Into<ProfileViewBasic<S>>,
3726    ) -> ReasonRepostBuilder<reason_repost_state::SetBy<St>, S> {
3727        self._fields.0 = Option::Some(value.into());
3728        ReasonRepostBuilder {
3729            _state: PhantomData,
3730            _fields: self._fields,
3731            _type: PhantomData,
3732        }
3733    }
3734}
3735
3736impl<St: reason_repost_state::State, S: BosStr> ReasonRepostBuilder<St, S> {
3737    /// Set the `cid` field (optional)
3738    pub fn cid(mut self, value: impl Into<Option<Cid<S>>>) -> Self {
3739        self._fields.1 = value.into();
3740        self
3741    }
3742    /// Set the `cid` field to an Option value (optional)
3743    pub fn maybe_cid(mut self, value: Option<Cid<S>>) -> Self {
3744        self._fields.1 = value;
3745        self
3746    }
3747}
3748
3749impl<St, S: BosStr> ReasonRepostBuilder<St, S>
3750where
3751    St: reason_repost_state::State,
3752    St::IndexedAt: reason_repost_state::IsUnset,
3753{
3754    /// Set the `indexedAt` field (required)
3755    pub fn indexed_at(
3756        mut self,
3757        value: impl Into<Datetime>,
3758    ) -> ReasonRepostBuilder<reason_repost_state::SetIndexedAt<St>, S> {
3759        self._fields.2 = Option::Some(value.into());
3760        ReasonRepostBuilder {
3761            _state: PhantomData,
3762            _fields: self._fields,
3763            _type: PhantomData,
3764        }
3765    }
3766}
3767
3768impl<St: reason_repost_state::State, S: BosStr> ReasonRepostBuilder<St, S> {
3769    /// Set the `uri` field (optional)
3770    pub fn uri(mut self, value: impl Into<Option<AtUri<S>>>) -> Self {
3771        self._fields.3 = value.into();
3772        self
3773    }
3774    /// Set the `uri` field to an Option value (optional)
3775    pub fn maybe_uri(mut self, value: Option<AtUri<S>>) -> Self {
3776        self._fields.3 = value;
3777        self
3778    }
3779}
3780
3781impl<St, S: BosStr> ReasonRepostBuilder<St, S>
3782where
3783    St: reason_repost_state::State,
3784    St::By: reason_repost_state::IsSet,
3785    St::IndexedAt: reason_repost_state::IsSet,
3786{
3787    /// Build the final struct.
3788    pub fn build(self) -> ReasonRepost<S> {
3789        ReasonRepost {
3790            by: self._fields.0.unwrap(),
3791            cid: self._fields.1,
3792            indexed_at: self._fields.2.unwrap(),
3793            uri: self._fields.3,
3794            extra_data: Default::default(),
3795        }
3796    }
3797    /// Build the final struct with custom extra_data.
3798    pub fn build_with_data(
3799        self,
3800        extra_data: BTreeMap<SmolStr, Data<S>>,
3801    ) -> ReasonRepost<S> {
3802        ReasonRepost {
3803            by: self._fields.0.unwrap(),
3804            cid: self._fields.1,
3805            indexed_at: self._fields.2.unwrap(),
3806            uri: self._fields.3,
3807            extra_data: Some(extra_data),
3808        }
3809    }
3810}
3811
3812pub mod reply_ref_state {
3813
3814    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
3815    #[allow(unused)]
3816    use ::core::marker::PhantomData;
3817    mod sealed {
3818        pub trait Sealed {}
3819    }
3820    /// State trait tracking which required fields have been set
3821    pub trait State: sealed::Sealed {
3822        type Parent;
3823        type Root;
3824    }
3825    /// Empty state - all required fields are unset
3826    pub struct Empty(());
3827    impl sealed::Sealed for Empty {}
3828    impl State for Empty {
3829        type Parent = Unset;
3830        type Root = Unset;
3831    }
3832    ///State transition - sets the `parent` field to Set
3833    pub struct SetParent<St: State = Empty>(PhantomData<fn() -> St>);
3834    impl<St: State> sealed::Sealed for SetParent<St> {}
3835    impl<St: State> State for SetParent<St> {
3836        type Parent = Set<members::parent>;
3837        type Root = St::Root;
3838    }
3839    ///State transition - sets the `root` field to Set
3840    pub struct SetRoot<St: State = Empty>(PhantomData<fn() -> St>);
3841    impl<St: State> sealed::Sealed for SetRoot<St> {}
3842    impl<St: State> State for SetRoot<St> {
3843        type Parent = St::Parent;
3844        type Root = Set<members::root>;
3845    }
3846    /// Marker types for field names
3847    #[allow(non_camel_case_types)]
3848    pub mod members {
3849        ///Marker type for the `parent` field
3850        pub struct parent(());
3851        ///Marker type for the `root` field
3852        pub struct root(());
3853    }
3854}
3855
3856/// Builder for constructing an instance of this type.
3857pub struct ReplyRefBuilder<St: reply_ref_state::State, S: BosStr = DefaultStr> {
3858    _state: PhantomData<fn() -> St>,
3859    _fields: (
3860        Option<ProfileViewBasic<S>>,
3861        Option<ReplyRefParent<S>>,
3862        Option<ReplyRefRoot<S>>,
3863    ),
3864    _type: PhantomData<fn() -> S>,
3865}
3866
3867impl ReplyRef<DefaultStr> {
3868    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
3869    pub fn new() -> ReplyRefBuilder<reply_ref_state::Empty, DefaultStr> {
3870        ReplyRefBuilder::new()
3871    }
3872}
3873
3874impl<S: BosStr> ReplyRef<S> {
3875    /// Create a new builder for this type
3876    pub fn builder() -> ReplyRefBuilder<reply_ref_state::Empty, S> {
3877        ReplyRefBuilder::builder()
3878    }
3879}
3880
3881impl ReplyRefBuilder<reply_ref_state::Empty, DefaultStr> {
3882    /// Create a new builder with all fields unset, using the default string type, if needed
3883    pub fn new() -> Self {
3884        ReplyRefBuilder {
3885            _state: PhantomData,
3886            _fields: (None, None, None),
3887            _type: PhantomData,
3888        }
3889    }
3890}
3891
3892impl<S: BosStr> ReplyRefBuilder<reply_ref_state::Empty, S> {
3893    /// Create a new builder with all fields unset
3894    pub fn builder() -> Self {
3895        ReplyRefBuilder {
3896            _state: PhantomData,
3897            _fields: (None, None, None),
3898            _type: PhantomData,
3899        }
3900    }
3901}
3902
3903impl<St: reply_ref_state::State, S: BosStr> ReplyRefBuilder<St, S> {
3904    /// Set the `grandparentAuthor` field (optional)
3905    pub fn grandparent_author(
3906        mut self,
3907        value: impl Into<Option<ProfileViewBasic<S>>>,
3908    ) -> Self {
3909        self._fields.0 = value.into();
3910        self
3911    }
3912    /// Set the `grandparentAuthor` field to an Option value (optional)
3913    pub fn maybe_grandparent_author(
3914        mut self,
3915        value: Option<ProfileViewBasic<S>>,
3916    ) -> Self {
3917        self._fields.0 = value;
3918        self
3919    }
3920}
3921
3922impl<St, S: BosStr> ReplyRefBuilder<St, S>
3923where
3924    St: reply_ref_state::State,
3925    St::Parent: reply_ref_state::IsUnset,
3926{
3927    /// Set the `parent` field (required)
3928    pub fn parent(
3929        mut self,
3930        value: impl Into<ReplyRefParent<S>>,
3931    ) -> ReplyRefBuilder<reply_ref_state::SetParent<St>, S> {
3932        self._fields.1 = Option::Some(value.into());
3933        ReplyRefBuilder {
3934            _state: PhantomData,
3935            _fields: self._fields,
3936            _type: PhantomData,
3937        }
3938    }
3939}
3940
3941impl<St, S: BosStr> ReplyRefBuilder<St, S>
3942where
3943    St: reply_ref_state::State,
3944    St::Root: reply_ref_state::IsUnset,
3945{
3946    /// Set the `root` field (required)
3947    pub fn root(
3948        mut self,
3949        value: impl Into<ReplyRefRoot<S>>,
3950    ) -> ReplyRefBuilder<reply_ref_state::SetRoot<St>, S> {
3951        self._fields.2 = Option::Some(value.into());
3952        ReplyRefBuilder {
3953            _state: PhantomData,
3954            _fields: self._fields,
3955            _type: PhantomData,
3956        }
3957    }
3958}
3959
3960impl<St, S: BosStr> ReplyRefBuilder<St, S>
3961where
3962    St: reply_ref_state::State,
3963    St::Parent: reply_ref_state::IsSet,
3964    St::Root: reply_ref_state::IsSet,
3965{
3966    /// Build the final struct.
3967    pub fn build(self) -> ReplyRef<S> {
3968        ReplyRef {
3969            grandparent_author: self._fields.0,
3970            parent: self._fields.1.unwrap(),
3971            root: self._fields.2.unwrap(),
3972            extra_data: Default::default(),
3973        }
3974    }
3975    /// Build the final struct with custom extra_data.
3976    pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> ReplyRef<S> {
3977        ReplyRef {
3978            grandparent_author: self._fields.0,
3979            parent: self._fields.1.unwrap(),
3980            root: self._fields.2.unwrap(),
3981            extra_data: Some(extra_data),
3982        }
3983    }
3984}
3985
3986pub mod skeleton_feed_post_state {
3987
3988    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
3989    #[allow(unused)]
3990    use ::core::marker::PhantomData;
3991    mod sealed {
3992        pub trait Sealed {}
3993    }
3994    /// State trait tracking which required fields have been set
3995    pub trait State: sealed::Sealed {
3996        type Post;
3997    }
3998    /// Empty state - all required fields are unset
3999    pub struct Empty(());
4000    impl sealed::Sealed for Empty {}
4001    impl State for Empty {
4002        type Post = Unset;
4003    }
4004    ///State transition - sets the `post` field to Set
4005    pub struct SetPost<St: State = Empty>(PhantomData<fn() -> St>);
4006    impl<St: State> sealed::Sealed for SetPost<St> {}
4007    impl<St: State> State for SetPost<St> {
4008        type Post = Set<members::post>;
4009    }
4010    /// Marker types for field names
4011    #[allow(non_camel_case_types)]
4012    pub mod members {
4013        ///Marker type for the `post` field
4014        pub struct post(());
4015    }
4016}
4017
4018/// Builder for constructing an instance of this type.
4019pub struct SkeletonFeedPostBuilder<
4020    St: skeleton_feed_post_state::State,
4021    S: BosStr = DefaultStr,
4022> {
4023    _state: PhantomData<fn() -> St>,
4024    _fields: (Option<S>, Option<AtUri<S>>, Option<SkeletonFeedPostReason<S>>),
4025    _type: PhantomData<fn() -> S>,
4026}
4027
4028impl SkeletonFeedPost<DefaultStr> {
4029    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
4030    pub fn new() -> SkeletonFeedPostBuilder<
4031        skeleton_feed_post_state::Empty,
4032        DefaultStr,
4033    > {
4034        SkeletonFeedPostBuilder::new()
4035    }
4036}
4037
4038impl<S: BosStr> SkeletonFeedPost<S> {
4039    /// Create a new builder for this type
4040    pub fn builder() -> SkeletonFeedPostBuilder<skeleton_feed_post_state::Empty, S> {
4041        SkeletonFeedPostBuilder::builder()
4042    }
4043}
4044
4045impl SkeletonFeedPostBuilder<skeleton_feed_post_state::Empty, DefaultStr> {
4046    /// Create a new builder with all fields unset, using the default string type, if needed
4047    pub fn new() -> Self {
4048        SkeletonFeedPostBuilder {
4049            _state: PhantomData,
4050            _fields: (None, None, None),
4051            _type: PhantomData,
4052        }
4053    }
4054}
4055
4056impl<S: BosStr> SkeletonFeedPostBuilder<skeleton_feed_post_state::Empty, S> {
4057    /// Create a new builder with all fields unset
4058    pub fn builder() -> Self {
4059        SkeletonFeedPostBuilder {
4060            _state: PhantomData,
4061            _fields: (None, None, None),
4062            _type: PhantomData,
4063        }
4064    }
4065}
4066
4067impl<St: skeleton_feed_post_state::State, S: BosStr> SkeletonFeedPostBuilder<St, S> {
4068    /// Set the `feedContext` field (optional)
4069    pub fn feed_context(mut self, value: impl Into<Option<S>>) -> Self {
4070        self._fields.0 = value.into();
4071        self
4072    }
4073    /// Set the `feedContext` field to an Option value (optional)
4074    pub fn maybe_feed_context(mut self, value: Option<S>) -> Self {
4075        self._fields.0 = value;
4076        self
4077    }
4078}
4079
4080impl<St, S: BosStr> SkeletonFeedPostBuilder<St, S>
4081where
4082    St: skeleton_feed_post_state::State,
4083    St::Post: skeleton_feed_post_state::IsUnset,
4084{
4085    /// Set the `post` field (required)
4086    pub fn post(
4087        mut self,
4088        value: impl Into<AtUri<S>>,
4089    ) -> SkeletonFeedPostBuilder<skeleton_feed_post_state::SetPost<St>, S> {
4090        self._fields.1 = Option::Some(value.into());
4091        SkeletonFeedPostBuilder {
4092            _state: PhantomData,
4093            _fields: self._fields,
4094            _type: PhantomData,
4095        }
4096    }
4097}
4098
4099impl<St: skeleton_feed_post_state::State, S: BosStr> SkeletonFeedPostBuilder<St, S> {
4100    /// Set the `reason` field (optional)
4101    pub fn reason(
4102        mut self,
4103        value: impl Into<Option<SkeletonFeedPostReason<S>>>,
4104    ) -> Self {
4105        self._fields.2 = value.into();
4106        self
4107    }
4108    /// Set the `reason` field to an Option value (optional)
4109    pub fn maybe_reason(mut self, value: Option<SkeletonFeedPostReason<S>>) -> Self {
4110        self._fields.2 = value;
4111        self
4112    }
4113}
4114
4115impl<St, S: BosStr> SkeletonFeedPostBuilder<St, S>
4116where
4117    St: skeleton_feed_post_state::State,
4118    St::Post: skeleton_feed_post_state::IsSet,
4119{
4120    /// Build the final struct.
4121    pub fn build(self) -> SkeletonFeedPost<S> {
4122        SkeletonFeedPost {
4123            feed_context: self._fields.0,
4124            post: self._fields.1.unwrap(),
4125            reason: self._fields.2,
4126            extra_data: Default::default(),
4127        }
4128    }
4129    /// Build the final struct with custom extra_data.
4130    pub fn build_with_data(
4131        self,
4132        extra_data: BTreeMap<SmolStr, Data<S>>,
4133    ) -> SkeletonFeedPost<S> {
4134        SkeletonFeedPost {
4135            feed_context: self._fields.0,
4136            post: self._fields.1.unwrap(),
4137            reason: self._fields.2,
4138            extra_data: Some(extra_data),
4139        }
4140    }
4141}
4142
4143pub mod skeleton_reason_repost_state {
4144
4145    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
4146    #[allow(unused)]
4147    use ::core::marker::PhantomData;
4148    mod sealed {
4149        pub trait Sealed {}
4150    }
4151    /// State trait tracking which required fields have been set
4152    pub trait State: sealed::Sealed {
4153        type Repost;
4154    }
4155    /// Empty state - all required fields are unset
4156    pub struct Empty(());
4157    impl sealed::Sealed for Empty {}
4158    impl State for Empty {
4159        type Repost = Unset;
4160    }
4161    ///State transition - sets the `repost` field to Set
4162    pub struct SetRepost<St: State = Empty>(PhantomData<fn() -> St>);
4163    impl<St: State> sealed::Sealed for SetRepost<St> {}
4164    impl<St: State> State for SetRepost<St> {
4165        type Repost = Set<members::repost>;
4166    }
4167    /// Marker types for field names
4168    #[allow(non_camel_case_types)]
4169    pub mod members {
4170        ///Marker type for the `repost` field
4171        pub struct repost(());
4172    }
4173}
4174
4175/// Builder for constructing an instance of this type.
4176pub struct SkeletonReasonRepostBuilder<
4177    St: skeleton_reason_repost_state::State,
4178    S: BosStr = DefaultStr,
4179> {
4180    _state: PhantomData<fn() -> St>,
4181    _fields: (Option<AtUri<S>>,),
4182    _type: PhantomData<fn() -> S>,
4183}
4184
4185impl SkeletonReasonRepost<DefaultStr> {
4186    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
4187    pub fn new() -> SkeletonReasonRepostBuilder<
4188        skeleton_reason_repost_state::Empty,
4189        DefaultStr,
4190    > {
4191        SkeletonReasonRepostBuilder::new()
4192    }
4193}
4194
4195impl<S: BosStr> SkeletonReasonRepost<S> {
4196    /// Create a new builder for this type
4197    pub fn builder() -> SkeletonReasonRepostBuilder<
4198        skeleton_reason_repost_state::Empty,
4199        S,
4200    > {
4201        SkeletonReasonRepostBuilder::builder()
4202    }
4203}
4204
4205impl SkeletonReasonRepostBuilder<skeleton_reason_repost_state::Empty, DefaultStr> {
4206    /// Create a new builder with all fields unset, using the default string type, if needed
4207    pub fn new() -> Self {
4208        SkeletonReasonRepostBuilder {
4209            _state: PhantomData,
4210            _fields: (None,),
4211            _type: PhantomData,
4212        }
4213    }
4214}
4215
4216impl<S: BosStr> SkeletonReasonRepostBuilder<skeleton_reason_repost_state::Empty, S> {
4217    /// Create a new builder with all fields unset
4218    pub fn builder() -> Self {
4219        SkeletonReasonRepostBuilder {
4220            _state: PhantomData,
4221            _fields: (None,),
4222            _type: PhantomData,
4223        }
4224    }
4225}
4226
4227impl<St, S: BosStr> SkeletonReasonRepostBuilder<St, S>
4228where
4229    St: skeleton_reason_repost_state::State,
4230    St::Repost: skeleton_reason_repost_state::IsUnset,
4231{
4232    /// Set the `repost` field (required)
4233    pub fn repost(
4234        mut self,
4235        value: impl Into<AtUri<S>>,
4236    ) -> SkeletonReasonRepostBuilder<skeleton_reason_repost_state::SetRepost<St>, S> {
4237        self._fields.0 = Option::Some(value.into());
4238        SkeletonReasonRepostBuilder {
4239            _state: PhantomData,
4240            _fields: self._fields,
4241            _type: PhantomData,
4242        }
4243    }
4244}
4245
4246impl<St, S: BosStr> SkeletonReasonRepostBuilder<St, S>
4247where
4248    St: skeleton_reason_repost_state::State,
4249    St::Repost: skeleton_reason_repost_state::IsSet,
4250{
4251    /// Build the final struct.
4252    pub fn build(self) -> SkeletonReasonRepost<S> {
4253        SkeletonReasonRepost {
4254            repost: self._fields.0.unwrap(),
4255            extra_data: Default::default(),
4256        }
4257    }
4258    /// Build the final struct with custom extra_data.
4259    pub fn build_with_data(
4260        self,
4261        extra_data: BTreeMap<SmolStr, Data<S>>,
4262    ) -> SkeletonReasonRepost<S> {
4263        SkeletonReasonRepost {
4264            repost: self._fields.0.unwrap(),
4265            extra_data: Some(extra_data),
4266        }
4267    }
4268}
4269
4270pub mod thread_view_post_state {
4271
4272    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
4273    #[allow(unused)]
4274    use ::core::marker::PhantomData;
4275    mod sealed {
4276        pub trait Sealed {}
4277    }
4278    /// State trait tracking which required fields have been set
4279    pub trait State: sealed::Sealed {
4280        type Post;
4281    }
4282    /// Empty state - all required fields are unset
4283    pub struct Empty(());
4284    impl sealed::Sealed for Empty {}
4285    impl State for Empty {
4286        type Post = Unset;
4287    }
4288    ///State transition - sets the `post` field to Set
4289    pub struct SetPost<St: State = Empty>(PhantomData<fn() -> St>);
4290    impl<St: State> sealed::Sealed for SetPost<St> {}
4291    impl<St: State> State for SetPost<St> {
4292        type Post = Set<members::post>;
4293    }
4294    /// Marker types for field names
4295    #[allow(non_camel_case_types)]
4296    pub mod members {
4297        ///Marker type for the `post` field
4298        pub struct post(());
4299    }
4300}
4301
4302/// Builder for constructing an instance of this type.
4303pub struct ThreadViewPostBuilder<
4304    St: thread_view_post_state::State,
4305    S: BosStr = DefaultStr,
4306> {
4307    _state: PhantomData<fn() -> St>,
4308    _fields: (
4309        Option<ThreadViewPostParent<S>>,
4310        Option<feed::PostView<S>>,
4311        Option<Vec<ThreadViewPostRepliesItem<S>>>,
4312        Option<feed::ThreadContext<S>>,
4313    ),
4314    _type: PhantomData<fn() -> S>,
4315}
4316
4317impl ThreadViewPost<DefaultStr> {
4318    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
4319    pub fn new() -> ThreadViewPostBuilder<thread_view_post_state::Empty, DefaultStr> {
4320        ThreadViewPostBuilder::new()
4321    }
4322}
4323
4324impl<S: BosStr> ThreadViewPost<S> {
4325    /// Create a new builder for this type
4326    pub fn builder() -> ThreadViewPostBuilder<thread_view_post_state::Empty, S> {
4327        ThreadViewPostBuilder::builder()
4328    }
4329}
4330
4331impl ThreadViewPostBuilder<thread_view_post_state::Empty, DefaultStr> {
4332    /// Create a new builder with all fields unset, using the default string type, if needed
4333    pub fn new() -> Self {
4334        ThreadViewPostBuilder {
4335            _state: PhantomData,
4336            _fields: (None, None, None, None),
4337            _type: PhantomData,
4338        }
4339    }
4340}
4341
4342impl<S: BosStr> ThreadViewPostBuilder<thread_view_post_state::Empty, S> {
4343    /// Create a new builder with all fields unset
4344    pub fn builder() -> Self {
4345        ThreadViewPostBuilder {
4346            _state: PhantomData,
4347            _fields: (None, None, None, None),
4348            _type: PhantomData,
4349        }
4350    }
4351}
4352
4353impl<St: thread_view_post_state::State, S: BosStr> ThreadViewPostBuilder<St, S> {
4354    /// Set the `parent` field (optional)
4355    pub fn parent(mut self, value: impl Into<Option<ThreadViewPostParent<S>>>) -> Self {
4356        self._fields.0 = value.into();
4357        self
4358    }
4359    /// Set the `parent` field to an Option value (optional)
4360    pub fn maybe_parent(mut self, value: Option<ThreadViewPostParent<S>>) -> Self {
4361        self._fields.0 = value;
4362        self
4363    }
4364}
4365
4366impl<St, S: BosStr> ThreadViewPostBuilder<St, S>
4367where
4368    St: thread_view_post_state::State,
4369    St::Post: thread_view_post_state::IsUnset,
4370{
4371    /// Set the `post` field (required)
4372    pub fn post(
4373        mut self,
4374        value: impl Into<feed::PostView<S>>,
4375    ) -> ThreadViewPostBuilder<thread_view_post_state::SetPost<St>, S> {
4376        self._fields.1 = Option::Some(value.into());
4377        ThreadViewPostBuilder {
4378            _state: PhantomData,
4379            _fields: self._fields,
4380            _type: PhantomData,
4381        }
4382    }
4383}
4384
4385impl<St: thread_view_post_state::State, S: BosStr> ThreadViewPostBuilder<St, S> {
4386    /// Set the `replies` field (optional)
4387    pub fn replies(
4388        mut self,
4389        value: impl Into<Option<Vec<ThreadViewPostRepliesItem<S>>>>,
4390    ) -> Self {
4391        self._fields.2 = value.into();
4392        self
4393    }
4394    /// Set the `replies` field to an Option value (optional)
4395    pub fn maybe_replies(
4396        mut self,
4397        value: Option<Vec<ThreadViewPostRepliesItem<S>>>,
4398    ) -> Self {
4399        self._fields.2 = value;
4400        self
4401    }
4402}
4403
4404impl<St: thread_view_post_state::State, S: BosStr> ThreadViewPostBuilder<St, S> {
4405    /// Set the `threadContext` field (optional)
4406    pub fn thread_context(
4407        mut self,
4408        value: impl Into<Option<feed::ThreadContext<S>>>,
4409    ) -> Self {
4410        self._fields.3 = value.into();
4411        self
4412    }
4413    /// Set the `threadContext` field to an Option value (optional)
4414    pub fn maybe_thread_context(
4415        mut self,
4416        value: Option<feed::ThreadContext<S>>,
4417    ) -> Self {
4418        self._fields.3 = value;
4419        self
4420    }
4421}
4422
4423impl<St, S: BosStr> ThreadViewPostBuilder<St, S>
4424where
4425    St: thread_view_post_state::State,
4426    St::Post: thread_view_post_state::IsSet,
4427{
4428    /// Build the final struct.
4429    pub fn build(self) -> ThreadViewPost<S> {
4430        ThreadViewPost {
4431            parent: self._fields.0,
4432            post: self._fields.1.unwrap(),
4433            replies: self._fields.2,
4434            thread_context: self._fields.3,
4435            extra_data: Default::default(),
4436        }
4437    }
4438    /// Build the final struct with custom extra_data.
4439    pub fn build_with_data(
4440        self,
4441        extra_data: BTreeMap<SmolStr, Data<S>>,
4442    ) -> ThreadViewPost<S> {
4443        ThreadViewPost {
4444            parent: self._fields.0,
4445            post: self._fields.1.unwrap(),
4446            replies: self._fields.2,
4447            thread_context: self._fields.3,
4448            extra_data: Some(extra_data),
4449        }
4450    }
4451}