Skip to main content

jacquard_api/app_bsky/
notification.rs

1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: app.bsky.notification.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.notification` Lexicon namespace/module.
9pub mod declaration;
10pub mod get_preferences;
11pub mod get_unread_count;
12pub mod list_activity_subscriptions;
13pub mod list_notifications;
14pub mod put_activity_subscription;
15pub mod put_preferences;
16pub mod put_preferences_v2;
17pub mod register_push;
18pub mod unregister_push;
19pub mod update_seen;
20
21
22#[allow(unused_imports)]
23use alloc::collections::BTreeMap;
24
25#[allow(unused_imports)]
26use core::marker::PhantomData;
27use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr};
28
29#[allow(unused_imports)]
30use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
31use jacquard_common::deps::smol_str::SmolStr;
32use jacquard_common::types::string::Did;
33use jacquard_common::types::value::Data;
34use jacquard_derive::IntoStatic;
35use jacquard_lexicon::lexicon::LexiconDoc;
36use jacquard_lexicon::schema::LexiconSchema;
37
38#[allow(unused_imports)]
39use jacquard_lexicon::validation::{ConstraintError, ValidationPath};
40use serde::{Serialize, Deserialize};
41use crate::app_bsky::notification;
42
43#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
44#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
45pub struct ActivitySubscription<S: BosStr = DefaultStr> {
46    pub post: bool,
47    pub reply: bool,
48    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
49    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
50}
51
52
53#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
54#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
55pub struct ChatPreference<S: BosStr = DefaultStr> {
56    pub include: ChatPreferenceInclude<S>,
57    pub push: bool,
58    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
59    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
60}
61
62
63#[derive(Debug, Clone, PartialEq, Eq, Hash)]
64pub enum ChatPreferenceInclude<S: BosStr = DefaultStr> {
65    All,
66    Accepted,
67    Other(S),
68}
69
70impl<S: BosStr> ChatPreferenceInclude<S> {
71    pub fn as_str(&self) -> &str {
72        match self {
73            Self::All => "all",
74            Self::Accepted => "accepted",
75            Self::Other(s) => s.as_ref(),
76        }
77    }
78    /// Construct from a string-like value, matching known values.
79    pub fn from_value(s: S) -> Self {
80        match s.as_ref() {
81            "all" => Self::All,
82            "accepted" => Self::Accepted,
83            _ => Self::Other(s),
84        }
85    }
86}
87
88impl<S: BosStr> core::fmt::Display for ChatPreferenceInclude<S> {
89    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
90        write!(f, "{}", self.as_str())
91    }
92}
93
94impl<S: BosStr> AsRef<str> for ChatPreferenceInclude<S> {
95    fn as_ref(&self) -> &str {
96        self.as_str()
97    }
98}
99
100impl<S: BosStr> Serialize for ChatPreferenceInclude<S> {
101    fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
102    where
103        Ser: serde::Serializer,
104    {
105        serializer.serialize_str(self.as_str())
106    }
107}
108
109impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for ChatPreferenceInclude<S> {
110    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
111    where
112        D: serde::Deserializer<'de>,
113    {
114        let s = S::deserialize(deserializer)?;
115        Ok(Self::from_value(s))
116    }
117}
118
119impl<S: BosStr + Default> Default for ChatPreferenceInclude<S> {
120    fn default() -> Self {
121        Self::Other(Default::default())
122    }
123}
124
125impl<S: BosStr> jacquard_common::IntoStatic for ChatPreferenceInclude<S>
126where
127    S: BosStr + jacquard_common::IntoStatic,
128    S::Output: BosStr,
129{
130    type Output = ChatPreferenceInclude<S::Output>;
131    fn into_static(self) -> Self::Output {
132        match self {
133            ChatPreferenceInclude::All => ChatPreferenceInclude::All,
134            ChatPreferenceInclude::Accepted => ChatPreferenceInclude::Accepted,
135            ChatPreferenceInclude::Other(v) => {
136                ChatPreferenceInclude::Other(v.into_static())
137            }
138        }
139    }
140}
141
142
143#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
144#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
145pub struct FilterablePreference<S: BosStr = DefaultStr> {
146    pub include: FilterablePreferenceInclude<S>,
147    pub list: bool,
148    pub push: bool,
149    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
150    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
151}
152
153
154#[derive(Debug, Clone, PartialEq, Eq, Hash)]
155pub enum FilterablePreferenceInclude<S: BosStr = DefaultStr> {
156    All,
157    Follows,
158    Other(S),
159}
160
161impl<S: BosStr> FilterablePreferenceInclude<S> {
162    pub fn as_str(&self) -> &str {
163        match self {
164            Self::All => "all",
165            Self::Follows => "follows",
166            Self::Other(s) => s.as_ref(),
167        }
168    }
169    /// Construct from a string-like value, matching known values.
170    pub fn from_value(s: S) -> Self {
171        match s.as_ref() {
172            "all" => Self::All,
173            "follows" => Self::Follows,
174            _ => Self::Other(s),
175        }
176    }
177}
178
179impl<S: BosStr> core::fmt::Display for FilterablePreferenceInclude<S> {
180    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
181        write!(f, "{}", self.as_str())
182    }
183}
184
185impl<S: BosStr> AsRef<str> for FilterablePreferenceInclude<S> {
186    fn as_ref(&self) -> &str {
187        self.as_str()
188    }
189}
190
191impl<S: BosStr> Serialize for FilterablePreferenceInclude<S> {
192    fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
193    where
194        Ser: serde::Serializer,
195    {
196        serializer.serialize_str(self.as_str())
197    }
198}
199
200impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de>
201for FilterablePreferenceInclude<S> {
202    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
203    where
204        D: serde::Deserializer<'de>,
205    {
206        let s = S::deserialize(deserializer)?;
207        Ok(Self::from_value(s))
208    }
209}
210
211impl<S: BosStr + Default> Default for FilterablePreferenceInclude<S> {
212    fn default() -> Self {
213        Self::Other(Default::default())
214    }
215}
216
217impl<S: BosStr> jacquard_common::IntoStatic for FilterablePreferenceInclude<S>
218where
219    S: BosStr + jacquard_common::IntoStatic,
220    S::Output: BosStr,
221{
222    type Output = FilterablePreferenceInclude<S::Output>;
223    fn into_static(self) -> Self::Output {
224        match self {
225            FilterablePreferenceInclude::All => FilterablePreferenceInclude::All,
226            FilterablePreferenceInclude::Follows => FilterablePreferenceInclude::Follows,
227            FilterablePreferenceInclude::Other(v) => {
228                FilterablePreferenceInclude::Other(v.into_static())
229            }
230        }
231    }
232}
233
234
235#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
236#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
237pub struct Preference<S: BosStr = DefaultStr> {
238    pub list: bool,
239    pub push: bool,
240    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
241    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
242}
243
244
245#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
246#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
247pub struct Preferences<S: BosStr = DefaultStr> {
248    pub chat: notification::ChatPreference<S>,
249    pub follow: notification::FilterablePreference<S>,
250    pub like: notification::FilterablePreference<S>,
251    pub like_via_repost: notification::FilterablePreference<S>,
252    pub mention: notification::FilterablePreference<S>,
253    pub quote: notification::FilterablePreference<S>,
254    pub reply: notification::FilterablePreference<S>,
255    pub repost: notification::FilterablePreference<S>,
256    pub repost_via_repost: notification::FilterablePreference<S>,
257    pub starterpack_joined: notification::Preference<S>,
258    pub subscribed_post: notification::Preference<S>,
259    pub unverified: notification::Preference<S>,
260    pub verified: notification::Preference<S>,
261    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
262    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
263}
264
265
266#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
267#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
268pub struct RecordDeleted<S: BosStr = DefaultStr> {
269    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
270    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
271}
272
273/// Object used to store activity subscription data in stash.
274
275#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
276#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
277pub struct SubjectActivitySubscription<S: BosStr = DefaultStr> {
278    pub activity_subscription: notification::ActivitySubscription<S>,
279    pub subject: Did<S>,
280    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
281    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
282}
283
284impl<S: BosStr> LexiconSchema for ActivitySubscription<S> {
285    fn nsid() -> &'static str {
286        "app.bsky.notification.defs"
287    }
288    fn def_name() -> &'static str {
289        "activitySubscription"
290    }
291    fn lexicon_doc() -> LexiconDoc<'static> {
292        lexicon_doc_app_bsky_notification_defs()
293    }
294    fn validate(&self) -> Result<(), ConstraintError> {
295        Ok(())
296    }
297}
298
299impl<S: BosStr> LexiconSchema for ChatPreference<S> {
300    fn nsid() -> &'static str {
301        "app.bsky.notification.defs"
302    }
303    fn def_name() -> &'static str {
304        "chatPreference"
305    }
306    fn lexicon_doc() -> LexiconDoc<'static> {
307        lexicon_doc_app_bsky_notification_defs()
308    }
309    fn validate(&self) -> Result<(), ConstraintError> {
310        Ok(())
311    }
312}
313
314impl<S: BosStr> LexiconSchema for FilterablePreference<S> {
315    fn nsid() -> &'static str {
316        "app.bsky.notification.defs"
317    }
318    fn def_name() -> &'static str {
319        "filterablePreference"
320    }
321    fn lexicon_doc() -> LexiconDoc<'static> {
322        lexicon_doc_app_bsky_notification_defs()
323    }
324    fn validate(&self) -> Result<(), ConstraintError> {
325        Ok(())
326    }
327}
328
329impl<S: BosStr> LexiconSchema for Preference<S> {
330    fn nsid() -> &'static str {
331        "app.bsky.notification.defs"
332    }
333    fn def_name() -> &'static str {
334        "preference"
335    }
336    fn lexicon_doc() -> LexiconDoc<'static> {
337        lexicon_doc_app_bsky_notification_defs()
338    }
339    fn validate(&self) -> Result<(), ConstraintError> {
340        Ok(())
341    }
342}
343
344impl<S: BosStr> LexiconSchema for Preferences<S> {
345    fn nsid() -> &'static str {
346        "app.bsky.notification.defs"
347    }
348    fn def_name() -> &'static str {
349        "preferences"
350    }
351    fn lexicon_doc() -> LexiconDoc<'static> {
352        lexicon_doc_app_bsky_notification_defs()
353    }
354    fn validate(&self) -> Result<(), ConstraintError> {
355        Ok(())
356    }
357}
358
359impl<S: BosStr> LexiconSchema for RecordDeleted<S> {
360    fn nsid() -> &'static str {
361        "app.bsky.notification.defs"
362    }
363    fn def_name() -> &'static str {
364        "recordDeleted"
365    }
366    fn lexicon_doc() -> LexiconDoc<'static> {
367        lexicon_doc_app_bsky_notification_defs()
368    }
369    fn validate(&self) -> Result<(), ConstraintError> {
370        Ok(())
371    }
372}
373
374impl<S: BosStr> LexiconSchema for SubjectActivitySubscription<S> {
375    fn nsid() -> &'static str {
376        "app.bsky.notification.defs"
377    }
378    fn def_name() -> &'static str {
379        "subjectActivitySubscription"
380    }
381    fn lexicon_doc() -> LexiconDoc<'static> {
382        lexicon_doc_app_bsky_notification_defs()
383    }
384    fn validate(&self) -> Result<(), ConstraintError> {
385        Ok(())
386    }
387}
388
389pub mod activity_subscription_state {
390
391    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
392    #[allow(unused)]
393    use ::core::marker::PhantomData;
394    mod sealed {
395        pub trait Sealed {}
396    }
397    /// State trait tracking which required fields have been set
398    pub trait State: sealed::Sealed {
399        type Post;
400        type Reply;
401    }
402    /// Empty state - all required fields are unset
403    pub struct Empty(());
404    impl sealed::Sealed for Empty {}
405    impl State for Empty {
406        type Post = Unset;
407        type Reply = Unset;
408    }
409    ///State transition - sets the `post` field to Set
410    pub struct SetPost<St: State = Empty>(PhantomData<fn() -> St>);
411    impl<St: State> sealed::Sealed for SetPost<St> {}
412    impl<St: State> State for SetPost<St> {
413        type Post = Set<members::post>;
414        type Reply = St::Reply;
415    }
416    ///State transition - sets the `reply` field to Set
417    pub struct SetReply<St: State = Empty>(PhantomData<fn() -> St>);
418    impl<St: State> sealed::Sealed for SetReply<St> {}
419    impl<St: State> State for SetReply<St> {
420        type Post = St::Post;
421        type Reply = Set<members::reply>;
422    }
423    /// Marker types for field names
424    #[allow(non_camel_case_types)]
425    pub mod members {
426        ///Marker type for the `post` field
427        pub struct post(());
428        ///Marker type for the `reply` field
429        pub struct reply(());
430    }
431}
432
433/// Builder for constructing an instance of this type.
434pub struct ActivitySubscriptionBuilder<
435    St: activity_subscription_state::State,
436    S: BosStr = DefaultStr,
437> {
438    _state: PhantomData<fn() -> St>,
439    _fields: (Option<bool>, Option<bool>),
440    _type: PhantomData<fn() -> S>,
441}
442
443impl ActivitySubscription<DefaultStr> {
444    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
445    pub fn new() -> ActivitySubscriptionBuilder<
446        activity_subscription_state::Empty,
447        DefaultStr,
448    > {
449        ActivitySubscriptionBuilder::new()
450    }
451}
452
453impl<S: BosStr> ActivitySubscription<S> {
454    /// Create a new builder for this type
455    pub fn builder() -> ActivitySubscriptionBuilder<
456        activity_subscription_state::Empty,
457        S,
458    > {
459        ActivitySubscriptionBuilder::builder()
460    }
461}
462
463impl ActivitySubscriptionBuilder<activity_subscription_state::Empty, DefaultStr> {
464    /// Create a new builder with all fields unset, using the default string type, if needed
465    pub fn new() -> Self {
466        ActivitySubscriptionBuilder {
467            _state: PhantomData,
468            _fields: (None, None),
469            _type: PhantomData,
470        }
471    }
472}
473
474impl<S: BosStr> ActivitySubscriptionBuilder<activity_subscription_state::Empty, S> {
475    /// Create a new builder with all fields unset
476    pub fn builder() -> Self {
477        ActivitySubscriptionBuilder {
478            _state: PhantomData,
479            _fields: (None, None),
480            _type: PhantomData,
481        }
482    }
483}
484
485impl<St, S: BosStr> ActivitySubscriptionBuilder<St, S>
486where
487    St: activity_subscription_state::State,
488    St::Post: activity_subscription_state::IsUnset,
489{
490    /// Set the `post` field (required)
491    pub fn post(
492        mut self,
493        value: impl Into<bool>,
494    ) -> ActivitySubscriptionBuilder<activity_subscription_state::SetPost<St>, S> {
495        self._fields.0 = Option::Some(value.into());
496        ActivitySubscriptionBuilder {
497            _state: PhantomData,
498            _fields: self._fields,
499            _type: PhantomData,
500        }
501    }
502}
503
504impl<St, S: BosStr> ActivitySubscriptionBuilder<St, S>
505where
506    St: activity_subscription_state::State,
507    St::Reply: activity_subscription_state::IsUnset,
508{
509    /// Set the `reply` field (required)
510    pub fn reply(
511        mut self,
512        value: impl Into<bool>,
513    ) -> ActivitySubscriptionBuilder<activity_subscription_state::SetReply<St>, S> {
514        self._fields.1 = Option::Some(value.into());
515        ActivitySubscriptionBuilder {
516            _state: PhantomData,
517            _fields: self._fields,
518            _type: PhantomData,
519        }
520    }
521}
522
523impl<St, S: BosStr> ActivitySubscriptionBuilder<St, S>
524where
525    St: activity_subscription_state::State,
526    St::Post: activity_subscription_state::IsSet,
527    St::Reply: activity_subscription_state::IsSet,
528{
529    /// Build the final struct.
530    pub fn build(self) -> ActivitySubscription<S> {
531        ActivitySubscription {
532            post: self._fields.0.unwrap(),
533            reply: self._fields.1.unwrap(),
534            extra_data: Default::default(),
535        }
536    }
537    /// Build the final struct with custom extra_data.
538    pub fn build_with_data(
539        self,
540        extra_data: BTreeMap<SmolStr, Data<S>>,
541    ) -> ActivitySubscription<S> {
542        ActivitySubscription {
543            post: self._fields.0.unwrap(),
544            reply: self._fields.1.unwrap(),
545            extra_data: Some(extra_data),
546        }
547    }
548}
549
550fn lexicon_doc_app_bsky_notification_defs() -> LexiconDoc<'static> {
551    #[allow(unused_imports)]
552    use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType};
553    use jacquard_lexicon::lexicon::*;
554    use alloc::collections::BTreeMap;
555    LexiconDoc {
556        lexicon: Lexicon::Lexicon1,
557        id: CowStr::new_static("app.bsky.notification.defs"),
558        defs: {
559            let mut map = BTreeMap::new();
560            map.insert(
561                SmolStr::new_static("activitySubscription"),
562                LexUserType::Object(LexObject {
563                    required: Some(
564                        vec![SmolStr::new_static("post"), SmolStr::new_static("reply")],
565                    ),
566                    properties: {
567                        #[allow(unused_mut)]
568                        let mut map = BTreeMap::new();
569                        map.insert(
570                            SmolStr::new_static("post"),
571                            LexObjectProperty::Boolean(LexBoolean {
572                                ..Default::default()
573                            }),
574                        );
575                        map.insert(
576                            SmolStr::new_static("reply"),
577                            LexObjectProperty::Boolean(LexBoolean {
578                                ..Default::default()
579                            }),
580                        );
581                        map
582                    },
583                    ..Default::default()
584                }),
585            );
586            map.insert(
587                SmolStr::new_static("chatPreference"),
588                LexUserType::Object(LexObject {
589                    required: Some(
590                        vec![SmolStr::new_static("include"), SmolStr::new_static("push")],
591                    ),
592                    properties: {
593                        #[allow(unused_mut)]
594                        let mut map = BTreeMap::new();
595                        map.insert(
596                            SmolStr::new_static("include"),
597                            LexObjectProperty::String(LexString { ..Default::default() }),
598                        );
599                        map.insert(
600                            SmolStr::new_static("push"),
601                            LexObjectProperty::Boolean(LexBoolean {
602                                ..Default::default()
603                            }),
604                        );
605                        map
606                    },
607                    ..Default::default()
608                }),
609            );
610            map.insert(
611                SmolStr::new_static("filterablePreference"),
612                LexUserType::Object(LexObject {
613                    required: Some(
614                        vec![
615                            SmolStr::new_static("include"), SmolStr::new_static("list"),
616                            SmolStr::new_static("push")
617                        ],
618                    ),
619                    properties: {
620                        #[allow(unused_mut)]
621                        let mut map = BTreeMap::new();
622                        map.insert(
623                            SmolStr::new_static("include"),
624                            LexObjectProperty::String(LexString { ..Default::default() }),
625                        );
626                        map.insert(
627                            SmolStr::new_static("list"),
628                            LexObjectProperty::Boolean(LexBoolean {
629                                ..Default::default()
630                            }),
631                        );
632                        map.insert(
633                            SmolStr::new_static("push"),
634                            LexObjectProperty::Boolean(LexBoolean {
635                                ..Default::default()
636                            }),
637                        );
638                        map
639                    },
640                    ..Default::default()
641                }),
642            );
643            map.insert(
644                SmolStr::new_static("preference"),
645                LexUserType::Object(LexObject {
646                    required: Some(
647                        vec![SmolStr::new_static("list"), SmolStr::new_static("push")],
648                    ),
649                    properties: {
650                        #[allow(unused_mut)]
651                        let mut map = BTreeMap::new();
652                        map.insert(
653                            SmolStr::new_static("list"),
654                            LexObjectProperty::Boolean(LexBoolean {
655                                ..Default::default()
656                            }),
657                        );
658                        map.insert(
659                            SmolStr::new_static("push"),
660                            LexObjectProperty::Boolean(LexBoolean {
661                                ..Default::default()
662                            }),
663                        );
664                        map
665                    },
666                    ..Default::default()
667                }),
668            );
669            map.insert(
670                SmolStr::new_static("preferences"),
671                LexUserType::Object(LexObject {
672                    required: Some(
673                        vec![
674                            SmolStr::new_static("chat"), SmolStr::new_static("follow"),
675                            SmolStr::new_static("like"),
676                            SmolStr::new_static("likeViaRepost"),
677                            SmolStr::new_static("mention"), SmolStr::new_static("quote"),
678                            SmolStr::new_static("reply"), SmolStr::new_static("repost"),
679                            SmolStr::new_static("repostViaRepost"),
680                            SmolStr::new_static("starterpackJoined"),
681                            SmolStr::new_static("subscribedPost"),
682                            SmolStr::new_static("unverified"),
683                            SmolStr::new_static("verified")
684                        ],
685                    ),
686                    properties: {
687                        #[allow(unused_mut)]
688                        let mut map = BTreeMap::new();
689                        map.insert(
690                            SmolStr::new_static("chat"),
691                            LexObjectProperty::Ref(LexRef {
692                                r#ref: CowStr::new_static("#chatPreference"),
693                                ..Default::default()
694                            }),
695                        );
696                        map.insert(
697                            SmolStr::new_static("follow"),
698                            LexObjectProperty::Ref(LexRef {
699                                r#ref: CowStr::new_static("#filterablePreference"),
700                                ..Default::default()
701                            }),
702                        );
703                        map.insert(
704                            SmolStr::new_static("like"),
705                            LexObjectProperty::Ref(LexRef {
706                                r#ref: CowStr::new_static("#filterablePreference"),
707                                ..Default::default()
708                            }),
709                        );
710                        map.insert(
711                            SmolStr::new_static("likeViaRepost"),
712                            LexObjectProperty::Ref(LexRef {
713                                r#ref: CowStr::new_static("#filterablePreference"),
714                                ..Default::default()
715                            }),
716                        );
717                        map.insert(
718                            SmolStr::new_static("mention"),
719                            LexObjectProperty::Ref(LexRef {
720                                r#ref: CowStr::new_static("#filterablePreference"),
721                                ..Default::default()
722                            }),
723                        );
724                        map.insert(
725                            SmolStr::new_static("quote"),
726                            LexObjectProperty::Ref(LexRef {
727                                r#ref: CowStr::new_static("#filterablePreference"),
728                                ..Default::default()
729                            }),
730                        );
731                        map.insert(
732                            SmolStr::new_static("reply"),
733                            LexObjectProperty::Ref(LexRef {
734                                r#ref: CowStr::new_static("#filterablePreference"),
735                                ..Default::default()
736                            }),
737                        );
738                        map.insert(
739                            SmolStr::new_static("repost"),
740                            LexObjectProperty::Ref(LexRef {
741                                r#ref: CowStr::new_static("#filterablePreference"),
742                                ..Default::default()
743                            }),
744                        );
745                        map.insert(
746                            SmolStr::new_static("repostViaRepost"),
747                            LexObjectProperty::Ref(LexRef {
748                                r#ref: CowStr::new_static("#filterablePreference"),
749                                ..Default::default()
750                            }),
751                        );
752                        map.insert(
753                            SmolStr::new_static("starterpackJoined"),
754                            LexObjectProperty::Ref(LexRef {
755                                r#ref: CowStr::new_static("#preference"),
756                                ..Default::default()
757                            }),
758                        );
759                        map.insert(
760                            SmolStr::new_static("subscribedPost"),
761                            LexObjectProperty::Ref(LexRef {
762                                r#ref: CowStr::new_static("#preference"),
763                                ..Default::default()
764                            }),
765                        );
766                        map.insert(
767                            SmolStr::new_static("unverified"),
768                            LexObjectProperty::Ref(LexRef {
769                                r#ref: CowStr::new_static("#preference"),
770                                ..Default::default()
771                            }),
772                        );
773                        map.insert(
774                            SmolStr::new_static("verified"),
775                            LexObjectProperty::Ref(LexRef {
776                                r#ref: CowStr::new_static("#preference"),
777                                ..Default::default()
778                            }),
779                        );
780                        map
781                    },
782                    ..Default::default()
783                }),
784            );
785            map.insert(
786                SmolStr::new_static("recordDeleted"),
787                LexUserType::Object(LexObject {
788                    properties: {
789                        #[allow(unused_mut)]
790                        let mut map = BTreeMap::new();
791                        map
792                    },
793                    ..Default::default()
794                }),
795            );
796            map.insert(
797                SmolStr::new_static("subjectActivitySubscription"),
798                LexUserType::Object(LexObject {
799                    description: Some(
800                        CowStr::new_static(
801                            "Object used to store activity subscription data in stash.",
802                        ),
803                    ),
804                    required: Some(
805                        vec![
806                            SmolStr::new_static("subject"),
807                            SmolStr::new_static("activitySubscription")
808                        ],
809                    ),
810                    properties: {
811                        #[allow(unused_mut)]
812                        let mut map = BTreeMap::new();
813                        map.insert(
814                            SmolStr::new_static("activitySubscription"),
815                            LexObjectProperty::Ref(LexRef {
816                                r#ref: CowStr::new_static("#activitySubscription"),
817                                ..Default::default()
818                            }),
819                        );
820                        map.insert(
821                            SmolStr::new_static("subject"),
822                            LexObjectProperty::String(LexString {
823                                format: Some(LexStringFormat::Did),
824                                ..Default::default()
825                            }),
826                        );
827                        map
828                    },
829                    ..Default::default()
830                }),
831            );
832            map
833        },
834        ..Default::default()
835    }
836}
837
838pub mod chat_preference_state {
839
840    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
841    #[allow(unused)]
842    use ::core::marker::PhantomData;
843    mod sealed {
844        pub trait Sealed {}
845    }
846    /// State trait tracking which required fields have been set
847    pub trait State: sealed::Sealed {
848        type Include;
849        type Push;
850    }
851    /// Empty state - all required fields are unset
852    pub struct Empty(());
853    impl sealed::Sealed for Empty {}
854    impl State for Empty {
855        type Include = Unset;
856        type Push = Unset;
857    }
858    ///State transition - sets the `include` field to Set
859    pub struct SetInclude<St: State = Empty>(PhantomData<fn() -> St>);
860    impl<St: State> sealed::Sealed for SetInclude<St> {}
861    impl<St: State> State for SetInclude<St> {
862        type Include = Set<members::include>;
863        type Push = St::Push;
864    }
865    ///State transition - sets the `push` field to Set
866    pub struct SetPush<St: State = Empty>(PhantomData<fn() -> St>);
867    impl<St: State> sealed::Sealed for SetPush<St> {}
868    impl<St: State> State for SetPush<St> {
869        type Include = St::Include;
870        type Push = Set<members::push>;
871    }
872    /// Marker types for field names
873    #[allow(non_camel_case_types)]
874    pub mod members {
875        ///Marker type for the `include` field
876        pub struct include(());
877        ///Marker type for the `push` field
878        pub struct push(());
879    }
880}
881
882/// Builder for constructing an instance of this type.
883pub struct ChatPreferenceBuilder<
884    St: chat_preference_state::State,
885    S: BosStr = DefaultStr,
886> {
887    _state: PhantomData<fn() -> St>,
888    _fields: (Option<ChatPreferenceInclude<S>>, Option<bool>),
889    _type: PhantomData<fn() -> S>,
890}
891
892impl ChatPreference<DefaultStr> {
893    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
894    pub fn new() -> ChatPreferenceBuilder<chat_preference_state::Empty, DefaultStr> {
895        ChatPreferenceBuilder::new()
896    }
897}
898
899impl<S: BosStr> ChatPreference<S> {
900    /// Create a new builder for this type
901    pub fn builder() -> ChatPreferenceBuilder<chat_preference_state::Empty, S> {
902        ChatPreferenceBuilder::builder()
903    }
904}
905
906impl ChatPreferenceBuilder<chat_preference_state::Empty, DefaultStr> {
907    /// Create a new builder with all fields unset, using the default string type, if needed
908    pub fn new() -> Self {
909        ChatPreferenceBuilder {
910            _state: PhantomData,
911            _fields: (None, None),
912            _type: PhantomData,
913        }
914    }
915}
916
917impl<S: BosStr> ChatPreferenceBuilder<chat_preference_state::Empty, S> {
918    /// Create a new builder with all fields unset
919    pub fn builder() -> Self {
920        ChatPreferenceBuilder {
921            _state: PhantomData,
922            _fields: (None, None),
923            _type: PhantomData,
924        }
925    }
926}
927
928impl<St, S: BosStr> ChatPreferenceBuilder<St, S>
929where
930    St: chat_preference_state::State,
931    St::Include: chat_preference_state::IsUnset,
932{
933    /// Set the `include` field (required)
934    pub fn include(
935        mut self,
936        value: impl Into<ChatPreferenceInclude<S>>,
937    ) -> ChatPreferenceBuilder<chat_preference_state::SetInclude<St>, S> {
938        self._fields.0 = Option::Some(value.into());
939        ChatPreferenceBuilder {
940            _state: PhantomData,
941            _fields: self._fields,
942            _type: PhantomData,
943        }
944    }
945}
946
947impl<St, S: BosStr> ChatPreferenceBuilder<St, S>
948where
949    St: chat_preference_state::State,
950    St::Push: chat_preference_state::IsUnset,
951{
952    /// Set the `push` field (required)
953    pub fn push(
954        mut self,
955        value: impl Into<bool>,
956    ) -> ChatPreferenceBuilder<chat_preference_state::SetPush<St>, S> {
957        self._fields.1 = Option::Some(value.into());
958        ChatPreferenceBuilder {
959            _state: PhantomData,
960            _fields: self._fields,
961            _type: PhantomData,
962        }
963    }
964}
965
966impl<St, S: BosStr> ChatPreferenceBuilder<St, S>
967where
968    St: chat_preference_state::State,
969    St::Include: chat_preference_state::IsSet,
970    St::Push: chat_preference_state::IsSet,
971{
972    /// Build the final struct.
973    pub fn build(self) -> ChatPreference<S> {
974        ChatPreference {
975            include: self._fields.0.unwrap(),
976            push: self._fields.1.unwrap(),
977            extra_data: Default::default(),
978        }
979    }
980    /// Build the final struct with custom extra_data.
981    pub fn build_with_data(
982        self,
983        extra_data: BTreeMap<SmolStr, Data<S>>,
984    ) -> ChatPreference<S> {
985        ChatPreference {
986            include: self._fields.0.unwrap(),
987            push: self._fields.1.unwrap(),
988            extra_data: Some(extra_data),
989        }
990    }
991}
992
993pub mod filterable_preference_state {
994
995    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
996    #[allow(unused)]
997    use ::core::marker::PhantomData;
998    mod sealed {
999        pub trait Sealed {}
1000    }
1001    /// State trait tracking which required fields have been set
1002    pub trait State: sealed::Sealed {
1003        type Include;
1004        type List;
1005        type Push;
1006    }
1007    /// Empty state - all required fields are unset
1008    pub struct Empty(());
1009    impl sealed::Sealed for Empty {}
1010    impl State for Empty {
1011        type Include = Unset;
1012        type List = Unset;
1013        type Push = Unset;
1014    }
1015    ///State transition - sets the `include` field to Set
1016    pub struct SetInclude<St: State = Empty>(PhantomData<fn() -> St>);
1017    impl<St: State> sealed::Sealed for SetInclude<St> {}
1018    impl<St: State> State for SetInclude<St> {
1019        type Include = Set<members::include>;
1020        type List = St::List;
1021        type Push = St::Push;
1022    }
1023    ///State transition - sets the `list` field to Set
1024    pub struct SetList<St: State = Empty>(PhantomData<fn() -> St>);
1025    impl<St: State> sealed::Sealed for SetList<St> {}
1026    impl<St: State> State for SetList<St> {
1027        type Include = St::Include;
1028        type List = Set<members::list>;
1029        type Push = St::Push;
1030    }
1031    ///State transition - sets the `push` field to Set
1032    pub struct SetPush<St: State = Empty>(PhantomData<fn() -> St>);
1033    impl<St: State> sealed::Sealed for SetPush<St> {}
1034    impl<St: State> State for SetPush<St> {
1035        type Include = St::Include;
1036        type List = St::List;
1037        type Push = Set<members::push>;
1038    }
1039    /// Marker types for field names
1040    #[allow(non_camel_case_types)]
1041    pub mod members {
1042        ///Marker type for the `include` field
1043        pub struct include(());
1044        ///Marker type for the `list` field
1045        pub struct list(());
1046        ///Marker type for the `push` field
1047        pub struct push(());
1048    }
1049}
1050
1051/// Builder for constructing an instance of this type.
1052pub struct FilterablePreferenceBuilder<
1053    St: filterable_preference_state::State,
1054    S: BosStr = DefaultStr,
1055> {
1056    _state: PhantomData<fn() -> St>,
1057    _fields: (Option<FilterablePreferenceInclude<S>>, Option<bool>, Option<bool>),
1058    _type: PhantomData<fn() -> S>,
1059}
1060
1061impl FilterablePreference<DefaultStr> {
1062    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
1063    pub fn new() -> FilterablePreferenceBuilder<
1064        filterable_preference_state::Empty,
1065        DefaultStr,
1066    > {
1067        FilterablePreferenceBuilder::new()
1068    }
1069}
1070
1071impl<S: BosStr> FilterablePreference<S> {
1072    /// Create a new builder for this type
1073    pub fn builder() -> FilterablePreferenceBuilder<
1074        filterable_preference_state::Empty,
1075        S,
1076    > {
1077        FilterablePreferenceBuilder::builder()
1078    }
1079}
1080
1081impl FilterablePreferenceBuilder<filterable_preference_state::Empty, DefaultStr> {
1082    /// Create a new builder with all fields unset, using the default string type, if needed
1083    pub fn new() -> Self {
1084        FilterablePreferenceBuilder {
1085            _state: PhantomData,
1086            _fields: (None, None, None),
1087            _type: PhantomData,
1088        }
1089    }
1090}
1091
1092impl<S: BosStr> FilterablePreferenceBuilder<filterable_preference_state::Empty, S> {
1093    /// Create a new builder with all fields unset
1094    pub fn builder() -> Self {
1095        FilterablePreferenceBuilder {
1096            _state: PhantomData,
1097            _fields: (None, None, None),
1098            _type: PhantomData,
1099        }
1100    }
1101}
1102
1103impl<St, S: BosStr> FilterablePreferenceBuilder<St, S>
1104where
1105    St: filterable_preference_state::State,
1106    St::Include: filterable_preference_state::IsUnset,
1107{
1108    /// Set the `include` field (required)
1109    pub fn include(
1110        mut self,
1111        value: impl Into<FilterablePreferenceInclude<S>>,
1112    ) -> FilterablePreferenceBuilder<filterable_preference_state::SetInclude<St>, S> {
1113        self._fields.0 = Option::Some(value.into());
1114        FilterablePreferenceBuilder {
1115            _state: PhantomData,
1116            _fields: self._fields,
1117            _type: PhantomData,
1118        }
1119    }
1120}
1121
1122impl<St, S: BosStr> FilterablePreferenceBuilder<St, S>
1123where
1124    St: filterable_preference_state::State,
1125    St::List: filterable_preference_state::IsUnset,
1126{
1127    /// Set the `list` field (required)
1128    pub fn list(
1129        mut self,
1130        value: impl Into<bool>,
1131    ) -> FilterablePreferenceBuilder<filterable_preference_state::SetList<St>, S> {
1132        self._fields.1 = Option::Some(value.into());
1133        FilterablePreferenceBuilder {
1134            _state: PhantomData,
1135            _fields: self._fields,
1136            _type: PhantomData,
1137        }
1138    }
1139}
1140
1141impl<St, S: BosStr> FilterablePreferenceBuilder<St, S>
1142where
1143    St: filterable_preference_state::State,
1144    St::Push: filterable_preference_state::IsUnset,
1145{
1146    /// Set the `push` field (required)
1147    pub fn push(
1148        mut self,
1149        value: impl Into<bool>,
1150    ) -> FilterablePreferenceBuilder<filterable_preference_state::SetPush<St>, S> {
1151        self._fields.2 = Option::Some(value.into());
1152        FilterablePreferenceBuilder {
1153            _state: PhantomData,
1154            _fields: self._fields,
1155            _type: PhantomData,
1156        }
1157    }
1158}
1159
1160impl<St, S: BosStr> FilterablePreferenceBuilder<St, S>
1161where
1162    St: filterable_preference_state::State,
1163    St::Include: filterable_preference_state::IsSet,
1164    St::List: filterable_preference_state::IsSet,
1165    St::Push: filterable_preference_state::IsSet,
1166{
1167    /// Build the final struct.
1168    pub fn build(self) -> FilterablePreference<S> {
1169        FilterablePreference {
1170            include: self._fields.0.unwrap(),
1171            list: self._fields.1.unwrap(),
1172            push: self._fields.2.unwrap(),
1173            extra_data: Default::default(),
1174        }
1175    }
1176    /// Build the final struct with custom extra_data.
1177    pub fn build_with_data(
1178        self,
1179        extra_data: BTreeMap<SmolStr, Data<S>>,
1180    ) -> FilterablePreference<S> {
1181        FilterablePreference {
1182            include: self._fields.0.unwrap(),
1183            list: self._fields.1.unwrap(),
1184            push: self._fields.2.unwrap(),
1185            extra_data: Some(extra_data),
1186        }
1187    }
1188}
1189
1190pub mod preference_state {
1191
1192    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
1193    #[allow(unused)]
1194    use ::core::marker::PhantomData;
1195    mod sealed {
1196        pub trait Sealed {}
1197    }
1198    /// State trait tracking which required fields have been set
1199    pub trait State: sealed::Sealed {
1200        type List;
1201        type Push;
1202    }
1203    /// Empty state - all required fields are unset
1204    pub struct Empty(());
1205    impl sealed::Sealed for Empty {}
1206    impl State for Empty {
1207        type List = Unset;
1208        type Push = Unset;
1209    }
1210    ///State transition - sets the `list` field to Set
1211    pub struct SetList<St: State = Empty>(PhantomData<fn() -> St>);
1212    impl<St: State> sealed::Sealed for SetList<St> {}
1213    impl<St: State> State for SetList<St> {
1214        type List = Set<members::list>;
1215        type Push = St::Push;
1216    }
1217    ///State transition - sets the `push` field to Set
1218    pub struct SetPush<St: State = Empty>(PhantomData<fn() -> St>);
1219    impl<St: State> sealed::Sealed for SetPush<St> {}
1220    impl<St: State> State for SetPush<St> {
1221        type List = St::List;
1222        type Push = Set<members::push>;
1223    }
1224    /// Marker types for field names
1225    #[allow(non_camel_case_types)]
1226    pub mod members {
1227        ///Marker type for the `list` field
1228        pub struct list(());
1229        ///Marker type for the `push` field
1230        pub struct push(());
1231    }
1232}
1233
1234/// Builder for constructing an instance of this type.
1235pub struct PreferenceBuilder<St: preference_state::State, S: BosStr = DefaultStr> {
1236    _state: PhantomData<fn() -> St>,
1237    _fields: (Option<bool>, Option<bool>),
1238    _type: PhantomData<fn() -> S>,
1239}
1240
1241impl Preference<DefaultStr> {
1242    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
1243    pub fn new() -> PreferenceBuilder<preference_state::Empty, DefaultStr> {
1244        PreferenceBuilder::new()
1245    }
1246}
1247
1248impl<S: BosStr> Preference<S> {
1249    /// Create a new builder for this type
1250    pub fn builder() -> PreferenceBuilder<preference_state::Empty, S> {
1251        PreferenceBuilder::builder()
1252    }
1253}
1254
1255impl PreferenceBuilder<preference_state::Empty, DefaultStr> {
1256    /// Create a new builder with all fields unset, using the default string type, if needed
1257    pub fn new() -> Self {
1258        PreferenceBuilder {
1259            _state: PhantomData,
1260            _fields: (None, None),
1261            _type: PhantomData,
1262        }
1263    }
1264}
1265
1266impl<S: BosStr> PreferenceBuilder<preference_state::Empty, S> {
1267    /// Create a new builder with all fields unset
1268    pub fn builder() -> Self {
1269        PreferenceBuilder {
1270            _state: PhantomData,
1271            _fields: (None, None),
1272            _type: PhantomData,
1273        }
1274    }
1275}
1276
1277impl<St, S: BosStr> PreferenceBuilder<St, S>
1278where
1279    St: preference_state::State,
1280    St::List: preference_state::IsUnset,
1281{
1282    /// Set the `list` field (required)
1283    pub fn list(
1284        mut self,
1285        value: impl Into<bool>,
1286    ) -> PreferenceBuilder<preference_state::SetList<St>, S> {
1287        self._fields.0 = Option::Some(value.into());
1288        PreferenceBuilder {
1289            _state: PhantomData,
1290            _fields: self._fields,
1291            _type: PhantomData,
1292        }
1293    }
1294}
1295
1296impl<St, S: BosStr> PreferenceBuilder<St, S>
1297where
1298    St: preference_state::State,
1299    St::Push: preference_state::IsUnset,
1300{
1301    /// Set the `push` field (required)
1302    pub fn push(
1303        mut self,
1304        value: impl Into<bool>,
1305    ) -> PreferenceBuilder<preference_state::SetPush<St>, S> {
1306        self._fields.1 = Option::Some(value.into());
1307        PreferenceBuilder {
1308            _state: PhantomData,
1309            _fields: self._fields,
1310            _type: PhantomData,
1311        }
1312    }
1313}
1314
1315impl<St, S: BosStr> PreferenceBuilder<St, S>
1316where
1317    St: preference_state::State,
1318    St::List: preference_state::IsSet,
1319    St::Push: preference_state::IsSet,
1320{
1321    /// Build the final struct.
1322    pub fn build(self) -> Preference<S> {
1323        Preference {
1324            list: self._fields.0.unwrap(),
1325            push: self._fields.1.unwrap(),
1326            extra_data: Default::default(),
1327        }
1328    }
1329    /// Build the final struct with custom extra_data.
1330    pub fn build_with_data(
1331        self,
1332        extra_data: BTreeMap<SmolStr, Data<S>>,
1333    ) -> Preference<S> {
1334        Preference {
1335            list: self._fields.0.unwrap(),
1336            push: self._fields.1.unwrap(),
1337            extra_data: Some(extra_data),
1338        }
1339    }
1340}
1341
1342pub mod preferences_state {
1343
1344    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
1345    #[allow(unused)]
1346    use ::core::marker::PhantomData;
1347    mod sealed {
1348        pub trait Sealed {}
1349    }
1350    /// State trait tracking which required fields have been set
1351    pub trait State: sealed::Sealed {
1352        type Chat;
1353        type Follow;
1354        type Like;
1355        type LikeViaRepost;
1356        type Mention;
1357        type Quote;
1358        type Reply;
1359        type Repost;
1360        type RepostViaRepost;
1361        type StarterpackJoined;
1362        type SubscribedPost;
1363        type Unverified;
1364        type Verified;
1365    }
1366    /// Empty state - all required fields are unset
1367    pub struct Empty(());
1368    impl sealed::Sealed for Empty {}
1369    impl State for Empty {
1370        type Chat = Unset;
1371        type Follow = Unset;
1372        type Like = Unset;
1373        type LikeViaRepost = Unset;
1374        type Mention = Unset;
1375        type Quote = Unset;
1376        type Reply = Unset;
1377        type Repost = Unset;
1378        type RepostViaRepost = Unset;
1379        type StarterpackJoined = Unset;
1380        type SubscribedPost = Unset;
1381        type Unverified = Unset;
1382        type Verified = Unset;
1383    }
1384    ///State transition - sets the `chat` field to Set
1385    pub struct SetChat<St: State = Empty>(PhantomData<fn() -> St>);
1386    impl<St: State> sealed::Sealed for SetChat<St> {}
1387    impl<St: State> State for SetChat<St> {
1388        type Chat = Set<members::chat>;
1389        type Follow = St::Follow;
1390        type Like = St::Like;
1391        type LikeViaRepost = St::LikeViaRepost;
1392        type Mention = St::Mention;
1393        type Quote = St::Quote;
1394        type Reply = St::Reply;
1395        type Repost = St::Repost;
1396        type RepostViaRepost = St::RepostViaRepost;
1397        type StarterpackJoined = St::StarterpackJoined;
1398        type SubscribedPost = St::SubscribedPost;
1399        type Unverified = St::Unverified;
1400        type Verified = St::Verified;
1401    }
1402    ///State transition - sets the `follow` field to Set
1403    pub struct SetFollow<St: State = Empty>(PhantomData<fn() -> St>);
1404    impl<St: State> sealed::Sealed for SetFollow<St> {}
1405    impl<St: State> State for SetFollow<St> {
1406        type Chat = St::Chat;
1407        type Follow = Set<members::follow>;
1408        type Like = St::Like;
1409        type LikeViaRepost = St::LikeViaRepost;
1410        type Mention = St::Mention;
1411        type Quote = St::Quote;
1412        type Reply = St::Reply;
1413        type Repost = St::Repost;
1414        type RepostViaRepost = St::RepostViaRepost;
1415        type StarterpackJoined = St::StarterpackJoined;
1416        type SubscribedPost = St::SubscribedPost;
1417        type Unverified = St::Unverified;
1418        type Verified = St::Verified;
1419    }
1420    ///State transition - sets the `like` field to Set
1421    pub struct SetLike<St: State = Empty>(PhantomData<fn() -> St>);
1422    impl<St: State> sealed::Sealed for SetLike<St> {}
1423    impl<St: State> State for SetLike<St> {
1424        type Chat = St::Chat;
1425        type Follow = St::Follow;
1426        type Like = Set<members::like>;
1427        type LikeViaRepost = St::LikeViaRepost;
1428        type Mention = St::Mention;
1429        type Quote = St::Quote;
1430        type Reply = St::Reply;
1431        type Repost = St::Repost;
1432        type RepostViaRepost = St::RepostViaRepost;
1433        type StarterpackJoined = St::StarterpackJoined;
1434        type SubscribedPost = St::SubscribedPost;
1435        type Unverified = St::Unverified;
1436        type Verified = St::Verified;
1437    }
1438    ///State transition - sets the `like_via_repost` field to Set
1439    pub struct SetLikeViaRepost<St: State = Empty>(PhantomData<fn() -> St>);
1440    impl<St: State> sealed::Sealed for SetLikeViaRepost<St> {}
1441    impl<St: State> State for SetLikeViaRepost<St> {
1442        type Chat = St::Chat;
1443        type Follow = St::Follow;
1444        type Like = St::Like;
1445        type LikeViaRepost = Set<members::like_via_repost>;
1446        type Mention = St::Mention;
1447        type Quote = St::Quote;
1448        type Reply = St::Reply;
1449        type Repost = St::Repost;
1450        type RepostViaRepost = St::RepostViaRepost;
1451        type StarterpackJoined = St::StarterpackJoined;
1452        type SubscribedPost = St::SubscribedPost;
1453        type Unverified = St::Unverified;
1454        type Verified = St::Verified;
1455    }
1456    ///State transition - sets the `mention` field to Set
1457    pub struct SetMention<St: State = Empty>(PhantomData<fn() -> St>);
1458    impl<St: State> sealed::Sealed for SetMention<St> {}
1459    impl<St: State> State for SetMention<St> {
1460        type Chat = St::Chat;
1461        type Follow = St::Follow;
1462        type Like = St::Like;
1463        type LikeViaRepost = St::LikeViaRepost;
1464        type Mention = Set<members::mention>;
1465        type Quote = St::Quote;
1466        type Reply = St::Reply;
1467        type Repost = St::Repost;
1468        type RepostViaRepost = St::RepostViaRepost;
1469        type StarterpackJoined = St::StarterpackJoined;
1470        type SubscribedPost = St::SubscribedPost;
1471        type Unverified = St::Unverified;
1472        type Verified = St::Verified;
1473    }
1474    ///State transition - sets the `quote` field to Set
1475    pub struct SetQuote<St: State = Empty>(PhantomData<fn() -> St>);
1476    impl<St: State> sealed::Sealed for SetQuote<St> {}
1477    impl<St: State> State for SetQuote<St> {
1478        type Chat = St::Chat;
1479        type Follow = St::Follow;
1480        type Like = St::Like;
1481        type LikeViaRepost = St::LikeViaRepost;
1482        type Mention = St::Mention;
1483        type Quote = Set<members::quote>;
1484        type Reply = St::Reply;
1485        type Repost = St::Repost;
1486        type RepostViaRepost = St::RepostViaRepost;
1487        type StarterpackJoined = St::StarterpackJoined;
1488        type SubscribedPost = St::SubscribedPost;
1489        type Unverified = St::Unverified;
1490        type Verified = St::Verified;
1491    }
1492    ///State transition - sets the `reply` field to Set
1493    pub struct SetReply<St: State = Empty>(PhantomData<fn() -> St>);
1494    impl<St: State> sealed::Sealed for SetReply<St> {}
1495    impl<St: State> State for SetReply<St> {
1496        type Chat = St::Chat;
1497        type Follow = St::Follow;
1498        type Like = St::Like;
1499        type LikeViaRepost = St::LikeViaRepost;
1500        type Mention = St::Mention;
1501        type Quote = St::Quote;
1502        type Reply = Set<members::reply>;
1503        type Repost = St::Repost;
1504        type RepostViaRepost = St::RepostViaRepost;
1505        type StarterpackJoined = St::StarterpackJoined;
1506        type SubscribedPost = St::SubscribedPost;
1507        type Unverified = St::Unverified;
1508        type Verified = St::Verified;
1509    }
1510    ///State transition - sets the `repost` field to Set
1511    pub struct SetRepost<St: State = Empty>(PhantomData<fn() -> St>);
1512    impl<St: State> sealed::Sealed for SetRepost<St> {}
1513    impl<St: State> State for SetRepost<St> {
1514        type Chat = St::Chat;
1515        type Follow = St::Follow;
1516        type Like = St::Like;
1517        type LikeViaRepost = St::LikeViaRepost;
1518        type Mention = St::Mention;
1519        type Quote = St::Quote;
1520        type Reply = St::Reply;
1521        type Repost = Set<members::repost>;
1522        type RepostViaRepost = St::RepostViaRepost;
1523        type StarterpackJoined = St::StarterpackJoined;
1524        type SubscribedPost = St::SubscribedPost;
1525        type Unverified = St::Unverified;
1526        type Verified = St::Verified;
1527    }
1528    ///State transition - sets the `repost_via_repost` field to Set
1529    pub struct SetRepostViaRepost<St: State = Empty>(PhantomData<fn() -> St>);
1530    impl<St: State> sealed::Sealed for SetRepostViaRepost<St> {}
1531    impl<St: State> State for SetRepostViaRepost<St> {
1532        type Chat = St::Chat;
1533        type Follow = St::Follow;
1534        type Like = St::Like;
1535        type LikeViaRepost = St::LikeViaRepost;
1536        type Mention = St::Mention;
1537        type Quote = St::Quote;
1538        type Reply = St::Reply;
1539        type Repost = St::Repost;
1540        type RepostViaRepost = Set<members::repost_via_repost>;
1541        type StarterpackJoined = St::StarterpackJoined;
1542        type SubscribedPost = St::SubscribedPost;
1543        type Unverified = St::Unverified;
1544        type Verified = St::Verified;
1545    }
1546    ///State transition - sets the `starterpack_joined` field to Set
1547    pub struct SetStarterpackJoined<St: State = Empty>(PhantomData<fn() -> St>);
1548    impl<St: State> sealed::Sealed for SetStarterpackJoined<St> {}
1549    impl<St: State> State for SetStarterpackJoined<St> {
1550        type Chat = St::Chat;
1551        type Follow = St::Follow;
1552        type Like = St::Like;
1553        type LikeViaRepost = St::LikeViaRepost;
1554        type Mention = St::Mention;
1555        type Quote = St::Quote;
1556        type Reply = St::Reply;
1557        type Repost = St::Repost;
1558        type RepostViaRepost = St::RepostViaRepost;
1559        type StarterpackJoined = Set<members::starterpack_joined>;
1560        type SubscribedPost = St::SubscribedPost;
1561        type Unverified = St::Unverified;
1562        type Verified = St::Verified;
1563    }
1564    ///State transition - sets the `subscribed_post` field to Set
1565    pub struct SetSubscribedPost<St: State = Empty>(PhantomData<fn() -> St>);
1566    impl<St: State> sealed::Sealed for SetSubscribedPost<St> {}
1567    impl<St: State> State for SetSubscribedPost<St> {
1568        type Chat = St::Chat;
1569        type Follow = St::Follow;
1570        type Like = St::Like;
1571        type LikeViaRepost = St::LikeViaRepost;
1572        type Mention = St::Mention;
1573        type Quote = St::Quote;
1574        type Reply = St::Reply;
1575        type Repost = St::Repost;
1576        type RepostViaRepost = St::RepostViaRepost;
1577        type StarterpackJoined = St::StarterpackJoined;
1578        type SubscribedPost = Set<members::subscribed_post>;
1579        type Unverified = St::Unverified;
1580        type Verified = St::Verified;
1581    }
1582    ///State transition - sets the `unverified` field to Set
1583    pub struct SetUnverified<St: State = Empty>(PhantomData<fn() -> St>);
1584    impl<St: State> sealed::Sealed for SetUnverified<St> {}
1585    impl<St: State> State for SetUnverified<St> {
1586        type Chat = St::Chat;
1587        type Follow = St::Follow;
1588        type Like = St::Like;
1589        type LikeViaRepost = St::LikeViaRepost;
1590        type Mention = St::Mention;
1591        type Quote = St::Quote;
1592        type Reply = St::Reply;
1593        type Repost = St::Repost;
1594        type RepostViaRepost = St::RepostViaRepost;
1595        type StarterpackJoined = St::StarterpackJoined;
1596        type SubscribedPost = St::SubscribedPost;
1597        type Unverified = Set<members::unverified>;
1598        type Verified = St::Verified;
1599    }
1600    ///State transition - sets the `verified` field to Set
1601    pub struct SetVerified<St: State = Empty>(PhantomData<fn() -> St>);
1602    impl<St: State> sealed::Sealed for SetVerified<St> {}
1603    impl<St: State> State for SetVerified<St> {
1604        type Chat = St::Chat;
1605        type Follow = St::Follow;
1606        type Like = St::Like;
1607        type LikeViaRepost = St::LikeViaRepost;
1608        type Mention = St::Mention;
1609        type Quote = St::Quote;
1610        type Reply = St::Reply;
1611        type Repost = St::Repost;
1612        type RepostViaRepost = St::RepostViaRepost;
1613        type StarterpackJoined = St::StarterpackJoined;
1614        type SubscribedPost = St::SubscribedPost;
1615        type Unverified = St::Unverified;
1616        type Verified = Set<members::verified>;
1617    }
1618    /// Marker types for field names
1619    #[allow(non_camel_case_types)]
1620    pub mod members {
1621        ///Marker type for the `chat` field
1622        pub struct chat(());
1623        ///Marker type for the `follow` field
1624        pub struct follow(());
1625        ///Marker type for the `like` field
1626        pub struct like(());
1627        ///Marker type for the `like_via_repost` field
1628        pub struct like_via_repost(());
1629        ///Marker type for the `mention` field
1630        pub struct mention(());
1631        ///Marker type for the `quote` field
1632        pub struct quote(());
1633        ///Marker type for the `reply` field
1634        pub struct reply(());
1635        ///Marker type for the `repost` field
1636        pub struct repost(());
1637        ///Marker type for the `repost_via_repost` field
1638        pub struct repost_via_repost(());
1639        ///Marker type for the `starterpack_joined` field
1640        pub struct starterpack_joined(());
1641        ///Marker type for the `subscribed_post` field
1642        pub struct subscribed_post(());
1643        ///Marker type for the `unverified` field
1644        pub struct unverified(());
1645        ///Marker type for the `verified` field
1646        pub struct verified(());
1647    }
1648}
1649
1650/// Builder for constructing an instance of this type.
1651pub struct PreferencesBuilder<St: preferences_state::State, S: BosStr = DefaultStr> {
1652    _state: PhantomData<fn() -> St>,
1653    _fields: (
1654        Option<notification::ChatPreference<S>>,
1655        Option<notification::FilterablePreference<S>>,
1656        Option<notification::FilterablePreference<S>>,
1657        Option<notification::FilterablePreference<S>>,
1658        Option<notification::FilterablePreference<S>>,
1659        Option<notification::FilterablePreference<S>>,
1660        Option<notification::FilterablePreference<S>>,
1661        Option<notification::FilterablePreference<S>>,
1662        Option<notification::FilterablePreference<S>>,
1663        Option<notification::Preference<S>>,
1664        Option<notification::Preference<S>>,
1665        Option<notification::Preference<S>>,
1666        Option<notification::Preference<S>>,
1667    ),
1668    _type: PhantomData<fn() -> S>,
1669}
1670
1671impl Preferences<DefaultStr> {
1672    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
1673    pub fn new() -> PreferencesBuilder<preferences_state::Empty, DefaultStr> {
1674        PreferencesBuilder::new()
1675    }
1676}
1677
1678impl<S: BosStr> Preferences<S> {
1679    /// Create a new builder for this type
1680    pub fn builder() -> PreferencesBuilder<preferences_state::Empty, S> {
1681        PreferencesBuilder::builder()
1682    }
1683}
1684
1685impl PreferencesBuilder<preferences_state::Empty, DefaultStr> {
1686    /// Create a new builder with all fields unset, using the default string type, if needed
1687    pub fn new() -> Self {
1688        PreferencesBuilder {
1689            _state: PhantomData,
1690            _fields: (
1691                None,
1692                None,
1693                None,
1694                None,
1695                None,
1696                None,
1697                None,
1698                None,
1699                None,
1700                None,
1701                None,
1702                None,
1703                None,
1704            ),
1705            _type: PhantomData,
1706        }
1707    }
1708}
1709
1710impl<S: BosStr> PreferencesBuilder<preferences_state::Empty, S> {
1711    /// Create a new builder with all fields unset
1712    pub fn builder() -> Self {
1713        PreferencesBuilder {
1714            _state: PhantomData,
1715            _fields: (
1716                None,
1717                None,
1718                None,
1719                None,
1720                None,
1721                None,
1722                None,
1723                None,
1724                None,
1725                None,
1726                None,
1727                None,
1728                None,
1729            ),
1730            _type: PhantomData,
1731        }
1732    }
1733}
1734
1735impl<St, S: BosStr> PreferencesBuilder<St, S>
1736where
1737    St: preferences_state::State,
1738    St::Chat: preferences_state::IsUnset,
1739{
1740    /// Set the `chat` field (required)
1741    pub fn chat(
1742        mut self,
1743        value: impl Into<notification::ChatPreference<S>>,
1744    ) -> PreferencesBuilder<preferences_state::SetChat<St>, S> {
1745        self._fields.0 = Option::Some(value.into());
1746        PreferencesBuilder {
1747            _state: PhantomData,
1748            _fields: self._fields,
1749            _type: PhantomData,
1750        }
1751    }
1752}
1753
1754impl<St, S: BosStr> PreferencesBuilder<St, S>
1755where
1756    St: preferences_state::State,
1757    St::Follow: preferences_state::IsUnset,
1758{
1759    /// Set the `follow` field (required)
1760    pub fn follow(
1761        mut self,
1762        value: impl Into<notification::FilterablePreference<S>>,
1763    ) -> PreferencesBuilder<preferences_state::SetFollow<St>, S> {
1764        self._fields.1 = Option::Some(value.into());
1765        PreferencesBuilder {
1766            _state: PhantomData,
1767            _fields: self._fields,
1768            _type: PhantomData,
1769        }
1770    }
1771}
1772
1773impl<St, S: BosStr> PreferencesBuilder<St, S>
1774where
1775    St: preferences_state::State,
1776    St::Like: preferences_state::IsUnset,
1777{
1778    /// Set the `like` field (required)
1779    pub fn like(
1780        mut self,
1781        value: impl Into<notification::FilterablePreference<S>>,
1782    ) -> PreferencesBuilder<preferences_state::SetLike<St>, S> {
1783        self._fields.2 = Option::Some(value.into());
1784        PreferencesBuilder {
1785            _state: PhantomData,
1786            _fields: self._fields,
1787            _type: PhantomData,
1788        }
1789    }
1790}
1791
1792impl<St, S: BosStr> PreferencesBuilder<St, S>
1793where
1794    St: preferences_state::State,
1795    St::LikeViaRepost: preferences_state::IsUnset,
1796{
1797    /// Set the `likeViaRepost` field (required)
1798    pub fn like_via_repost(
1799        mut self,
1800        value: impl Into<notification::FilterablePreference<S>>,
1801    ) -> PreferencesBuilder<preferences_state::SetLikeViaRepost<St>, S> {
1802        self._fields.3 = Option::Some(value.into());
1803        PreferencesBuilder {
1804            _state: PhantomData,
1805            _fields: self._fields,
1806            _type: PhantomData,
1807        }
1808    }
1809}
1810
1811impl<St, S: BosStr> PreferencesBuilder<St, S>
1812where
1813    St: preferences_state::State,
1814    St::Mention: preferences_state::IsUnset,
1815{
1816    /// Set the `mention` field (required)
1817    pub fn mention(
1818        mut self,
1819        value: impl Into<notification::FilterablePreference<S>>,
1820    ) -> PreferencesBuilder<preferences_state::SetMention<St>, S> {
1821        self._fields.4 = Option::Some(value.into());
1822        PreferencesBuilder {
1823            _state: PhantomData,
1824            _fields: self._fields,
1825            _type: PhantomData,
1826        }
1827    }
1828}
1829
1830impl<St, S: BosStr> PreferencesBuilder<St, S>
1831where
1832    St: preferences_state::State,
1833    St::Quote: preferences_state::IsUnset,
1834{
1835    /// Set the `quote` field (required)
1836    pub fn quote(
1837        mut self,
1838        value: impl Into<notification::FilterablePreference<S>>,
1839    ) -> PreferencesBuilder<preferences_state::SetQuote<St>, S> {
1840        self._fields.5 = Option::Some(value.into());
1841        PreferencesBuilder {
1842            _state: PhantomData,
1843            _fields: self._fields,
1844            _type: PhantomData,
1845        }
1846    }
1847}
1848
1849impl<St, S: BosStr> PreferencesBuilder<St, S>
1850where
1851    St: preferences_state::State,
1852    St::Reply: preferences_state::IsUnset,
1853{
1854    /// Set the `reply` field (required)
1855    pub fn reply(
1856        mut self,
1857        value: impl Into<notification::FilterablePreference<S>>,
1858    ) -> PreferencesBuilder<preferences_state::SetReply<St>, S> {
1859        self._fields.6 = Option::Some(value.into());
1860        PreferencesBuilder {
1861            _state: PhantomData,
1862            _fields: self._fields,
1863            _type: PhantomData,
1864        }
1865    }
1866}
1867
1868impl<St, S: BosStr> PreferencesBuilder<St, S>
1869where
1870    St: preferences_state::State,
1871    St::Repost: preferences_state::IsUnset,
1872{
1873    /// Set the `repost` field (required)
1874    pub fn repost(
1875        mut self,
1876        value: impl Into<notification::FilterablePreference<S>>,
1877    ) -> PreferencesBuilder<preferences_state::SetRepost<St>, S> {
1878        self._fields.7 = Option::Some(value.into());
1879        PreferencesBuilder {
1880            _state: PhantomData,
1881            _fields: self._fields,
1882            _type: PhantomData,
1883        }
1884    }
1885}
1886
1887impl<St, S: BosStr> PreferencesBuilder<St, S>
1888where
1889    St: preferences_state::State,
1890    St::RepostViaRepost: preferences_state::IsUnset,
1891{
1892    /// Set the `repostViaRepost` field (required)
1893    pub fn repost_via_repost(
1894        mut self,
1895        value: impl Into<notification::FilterablePreference<S>>,
1896    ) -> PreferencesBuilder<preferences_state::SetRepostViaRepost<St>, S> {
1897        self._fields.8 = Option::Some(value.into());
1898        PreferencesBuilder {
1899            _state: PhantomData,
1900            _fields: self._fields,
1901            _type: PhantomData,
1902        }
1903    }
1904}
1905
1906impl<St, S: BosStr> PreferencesBuilder<St, S>
1907where
1908    St: preferences_state::State,
1909    St::StarterpackJoined: preferences_state::IsUnset,
1910{
1911    /// Set the `starterpackJoined` field (required)
1912    pub fn starterpack_joined(
1913        mut self,
1914        value: impl Into<notification::Preference<S>>,
1915    ) -> PreferencesBuilder<preferences_state::SetStarterpackJoined<St>, S> {
1916        self._fields.9 = Option::Some(value.into());
1917        PreferencesBuilder {
1918            _state: PhantomData,
1919            _fields: self._fields,
1920            _type: PhantomData,
1921        }
1922    }
1923}
1924
1925impl<St, S: BosStr> PreferencesBuilder<St, S>
1926where
1927    St: preferences_state::State,
1928    St::SubscribedPost: preferences_state::IsUnset,
1929{
1930    /// Set the `subscribedPost` field (required)
1931    pub fn subscribed_post(
1932        mut self,
1933        value: impl Into<notification::Preference<S>>,
1934    ) -> PreferencesBuilder<preferences_state::SetSubscribedPost<St>, S> {
1935        self._fields.10 = Option::Some(value.into());
1936        PreferencesBuilder {
1937            _state: PhantomData,
1938            _fields: self._fields,
1939            _type: PhantomData,
1940        }
1941    }
1942}
1943
1944impl<St, S: BosStr> PreferencesBuilder<St, S>
1945where
1946    St: preferences_state::State,
1947    St::Unverified: preferences_state::IsUnset,
1948{
1949    /// Set the `unverified` field (required)
1950    pub fn unverified(
1951        mut self,
1952        value: impl Into<notification::Preference<S>>,
1953    ) -> PreferencesBuilder<preferences_state::SetUnverified<St>, S> {
1954        self._fields.11 = Option::Some(value.into());
1955        PreferencesBuilder {
1956            _state: PhantomData,
1957            _fields: self._fields,
1958            _type: PhantomData,
1959        }
1960    }
1961}
1962
1963impl<St, S: BosStr> PreferencesBuilder<St, S>
1964where
1965    St: preferences_state::State,
1966    St::Verified: preferences_state::IsUnset,
1967{
1968    /// Set the `verified` field (required)
1969    pub fn verified(
1970        mut self,
1971        value: impl Into<notification::Preference<S>>,
1972    ) -> PreferencesBuilder<preferences_state::SetVerified<St>, S> {
1973        self._fields.12 = Option::Some(value.into());
1974        PreferencesBuilder {
1975            _state: PhantomData,
1976            _fields: self._fields,
1977            _type: PhantomData,
1978        }
1979    }
1980}
1981
1982impl<St, S: BosStr> PreferencesBuilder<St, S>
1983where
1984    St: preferences_state::State,
1985    St::Chat: preferences_state::IsSet,
1986    St::Follow: preferences_state::IsSet,
1987    St::Like: preferences_state::IsSet,
1988    St::LikeViaRepost: preferences_state::IsSet,
1989    St::Mention: preferences_state::IsSet,
1990    St::Quote: preferences_state::IsSet,
1991    St::Reply: preferences_state::IsSet,
1992    St::Repost: preferences_state::IsSet,
1993    St::RepostViaRepost: preferences_state::IsSet,
1994    St::StarterpackJoined: preferences_state::IsSet,
1995    St::SubscribedPost: preferences_state::IsSet,
1996    St::Unverified: preferences_state::IsSet,
1997    St::Verified: preferences_state::IsSet,
1998{
1999    /// Build the final struct.
2000    pub fn build(self) -> Preferences<S> {
2001        Preferences {
2002            chat: self._fields.0.unwrap(),
2003            follow: self._fields.1.unwrap(),
2004            like: self._fields.2.unwrap(),
2005            like_via_repost: self._fields.3.unwrap(),
2006            mention: self._fields.4.unwrap(),
2007            quote: self._fields.5.unwrap(),
2008            reply: self._fields.6.unwrap(),
2009            repost: self._fields.7.unwrap(),
2010            repost_via_repost: self._fields.8.unwrap(),
2011            starterpack_joined: self._fields.9.unwrap(),
2012            subscribed_post: self._fields.10.unwrap(),
2013            unverified: self._fields.11.unwrap(),
2014            verified: self._fields.12.unwrap(),
2015            extra_data: Default::default(),
2016        }
2017    }
2018    /// Build the final struct with custom extra_data.
2019    pub fn build_with_data(
2020        self,
2021        extra_data: BTreeMap<SmolStr, Data<S>>,
2022    ) -> Preferences<S> {
2023        Preferences {
2024            chat: self._fields.0.unwrap(),
2025            follow: self._fields.1.unwrap(),
2026            like: self._fields.2.unwrap(),
2027            like_via_repost: self._fields.3.unwrap(),
2028            mention: self._fields.4.unwrap(),
2029            quote: self._fields.5.unwrap(),
2030            reply: self._fields.6.unwrap(),
2031            repost: self._fields.7.unwrap(),
2032            repost_via_repost: self._fields.8.unwrap(),
2033            starterpack_joined: self._fields.9.unwrap(),
2034            subscribed_post: self._fields.10.unwrap(),
2035            unverified: self._fields.11.unwrap(),
2036            verified: self._fields.12.unwrap(),
2037            extra_data: Some(extra_data),
2038        }
2039    }
2040}
2041
2042pub mod subject_activity_subscription_state {
2043
2044    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
2045    #[allow(unused)]
2046    use ::core::marker::PhantomData;
2047    mod sealed {
2048        pub trait Sealed {}
2049    }
2050    /// State trait tracking which required fields have been set
2051    pub trait State: sealed::Sealed {
2052        type ActivitySubscription;
2053        type Subject;
2054    }
2055    /// Empty state - all required fields are unset
2056    pub struct Empty(());
2057    impl sealed::Sealed for Empty {}
2058    impl State for Empty {
2059        type ActivitySubscription = Unset;
2060        type Subject = Unset;
2061    }
2062    ///State transition - sets the `activity_subscription` field to Set
2063    pub struct SetActivitySubscription<St: State = Empty>(PhantomData<fn() -> St>);
2064    impl<St: State> sealed::Sealed for SetActivitySubscription<St> {}
2065    impl<St: State> State for SetActivitySubscription<St> {
2066        type ActivitySubscription = Set<members::activity_subscription>;
2067        type Subject = St::Subject;
2068    }
2069    ///State transition - sets the `subject` field to Set
2070    pub struct SetSubject<St: State = Empty>(PhantomData<fn() -> St>);
2071    impl<St: State> sealed::Sealed for SetSubject<St> {}
2072    impl<St: State> State for SetSubject<St> {
2073        type ActivitySubscription = St::ActivitySubscription;
2074        type Subject = Set<members::subject>;
2075    }
2076    /// Marker types for field names
2077    #[allow(non_camel_case_types)]
2078    pub mod members {
2079        ///Marker type for the `activity_subscription` field
2080        pub struct activity_subscription(());
2081        ///Marker type for the `subject` field
2082        pub struct subject(());
2083    }
2084}
2085
2086/// Builder for constructing an instance of this type.
2087pub struct SubjectActivitySubscriptionBuilder<
2088    St: subject_activity_subscription_state::State,
2089    S: BosStr = DefaultStr,
2090> {
2091    _state: PhantomData<fn() -> St>,
2092    _fields: (Option<notification::ActivitySubscription<S>>, Option<Did<S>>),
2093    _type: PhantomData<fn() -> S>,
2094}
2095
2096impl SubjectActivitySubscription<DefaultStr> {
2097    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
2098    pub fn new() -> SubjectActivitySubscriptionBuilder<
2099        subject_activity_subscription_state::Empty,
2100        DefaultStr,
2101    > {
2102        SubjectActivitySubscriptionBuilder::new()
2103    }
2104}
2105
2106impl<S: BosStr> SubjectActivitySubscription<S> {
2107    /// Create a new builder for this type
2108    pub fn builder() -> SubjectActivitySubscriptionBuilder<
2109        subject_activity_subscription_state::Empty,
2110        S,
2111    > {
2112        SubjectActivitySubscriptionBuilder::builder()
2113    }
2114}
2115
2116impl SubjectActivitySubscriptionBuilder<
2117    subject_activity_subscription_state::Empty,
2118    DefaultStr,
2119> {
2120    /// Create a new builder with all fields unset, using the default string type, if needed
2121    pub fn new() -> Self {
2122        SubjectActivitySubscriptionBuilder {
2123            _state: PhantomData,
2124            _fields: (None, None),
2125            _type: PhantomData,
2126        }
2127    }
2128}
2129
2130impl<
2131    S: BosStr,
2132> SubjectActivitySubscriptionBuilder<subject_activity_subscription_state::Empty, S> {
2133    /// Create a new builder with all fields unset
2134    pub fn builder() -> Self {
2135        SubjectActivitySubscriptionBuilder {
2136            _state: PhantomData,
2137            _fields: (None, None),
2138            _type: PhantomData,
2139        }
2140    }
2141}
2142
2143impl<St, S: BosStr> SubjectActivitySubscriptionBuilder<St, S>
2144where
2145    St: subject_activity_subscription_state::State,
2146    St::ActivitySubscription: subject_activity_subscription_state::IsUnset,
2147{
2148    /// Set the `activitySubscription` field (required)
2149    pub fn activity_subscription(
2150        mut self,
2151        value: impl Into<notification::ActivitySubscription<S>>,
2152    ) -> SubjectActivitySubscriptionBuilder<
2153        subject_activity_subscription_state::SetActivitySubscription<St>,
2154        S,
2155    > {
2156        self._fields.0 = Option::Some(value.into());
2157        SubjectActivitySubscriptionBuilder {
2158            _state: PhantomData,
2159            _fields: self._fields,
2160            _type: PhantomData,
2161        }
2162    }
2163}
2164
2165impl<St, S: BosStr> SubjectActivitySubscriptionBuilder<St, S>
2166where
2167    St: subject_activity_subscription_state::State,
2168    St::Subject: subject_activity_subscription_state::IsUnset,
2169{
2170    /// Set the `subject` field (required)
2171    pub fn subject(
2172        mut self,
2173        value: impl Into<Did<S>>,
2174    ) -> SubjectActivitySubscriptionBuilder<
2175        subject_activity_subscription_state::SetSubject<St>,
2176        S,
2177    > {
2178        self._fields.1 = Option::Some(value.into());
2179        SubjectActivitySubscriptionBuilder {
2180            _state: PhantomData,
2181            _fields: self._fields,
2182            _type: PhantomData,
2183        }
2184    }
2185}
2186
2187impl<St, S: BosStr> SubjectActivitySubscriptionBuilder<St, S>
2188where
2189    St: subject_activity_subscription_state::State,
2190    St::ActivitySubscription: subject_activity_subscription_state::IsSet,
2191    St::Subject: subject_activity_subscription_state::IsSet,
2192{
2193    /// Build the final struct.
2194    pub fn build(self) -> SubjectActivitySubscription<S> {
2195        SubjectActivitySubscription {
2196            activity_subscription: self._fields.0.unwrap(),
2197            subject: self._fields.1.unwrap(),
2198            extra_data: Default::default(),
2199        }
2200    }
2201    /// Build the final struct with custom extra_data.
2202    pub fn build_with_data(
2203        self,
2204        extra_data: BTreeMap<SmolStr, Data<S>>,
2205    ) -> SubjectActivitySubscription<S> {
2206        SubjectActivitySubscription {
2207            activity_subscription: self._fields.0.unwrap(),
2208            subject: self._fields.1.unwrap(),
2209            extra_data: Some(extra_data),
2210        }
2211    }
2212}