Skip to main content

jacquard_api/com_atproto/
admin.rs

1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: com.atproto.admin.defs
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8pub mod delete_account;
9pub mod disable_account_invites;
10pub mod disable_invite_codes;
11pub mod enable_account_invites;
12pub mod get_account_info;
13pub mod get_account_infos;
14pub mod get_invite_codes;
15pub mod get_subject_status;
16pub mod search_accounts;
17pub mod send_email;
18pub mod update_account_email;
19pub mod update_account_handle;
20pub mod update_account_password;
21pub mod update_account_signing_key;
22pub mod update_subject_status;
23
24
25#[allow(unused_imports)]
26use alloc::collections::BTreeMap;
27
28#[allow(unused_imports)]
29use core::marker::PhantomData;
30use jacquard_common::CowStr;
31
32#[allow(unused_imports)]
33use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
34use jacquard_common::types::string::{Did, Handle, AtUri, Cid, Datetime};
35use jacquard_common::types::value::Data;
36use jacquard_derive::{IntoStatic, lexicon};
37use jacquard_lexicon::lexicon::LexiconDoc;
38use jacquard_lexicon::schema::LexiconSchema;
39
40#[allow(unused_imports)]
41use jacquard_lexicon::validation::{ConstraintError, ValidationPath};
42use serde::{Serialize, Deserialize};
43use crate::com_atproto::server::InviteCode;
44use crate::com_atproto::admin;
45
46#[lexicon]
47#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
48#[serde(rename_all = "camelCase")]
49pub struct AccountView<'a> {
50    #[serde(skip_serializing_if = "Option::is_none")]
51    pub deactivated_at: Option<Datetime>,
52    #[serde(borrow)]
53    pub did: Did<'a>,
54    #[serde(skip_serializing_if = "Option::is_none")]
55    #[serde(borrow)]
56    pub email: Option<CowStr<'a>>,
57    #[serde(skip_serializing_if = "Option::is_none")]
58    pub email_confirmed_at: Option<Datetime>,
59    #[serde(borrow)]
60    pub handle: Handle<'a>,
61    pub indexed_at: Datetime,
62    #[serde(skip_serializing_if = "Option::is_none")]
63    #[serde(borrow)]
64    pub invite_note: Option<CowStr<'a>>,
65    #[serde(skip_serializing_if = "Option::is_none")]
66    #[serde(borrow)]
67    pub invited_by: Option<InviteCode<'a>>,
68    #[serde(skip_serializing_if = "Option::is_none")]
69    #[serde(borrow)]
70    pub invites: Option<Vec<InviteCode<'a>>>,
71    #[serde(skip_serializing_if = "Option::is_none")]
72    pub invites_disabled: Option<bool>,
73    #[serde(skip_serializing_if = "Option::is_none")]
74    #[serde(borrow)]
75    pub related_records: Option<Vec<Data<'a>>>,
76    #[serde(skip_serializing_if = "Option::is_none")]
77    #[serde(borrow)]
78    pub threat_signatures: Option<Vec<admin::ThreatSignature<'a>>>,
79}
80
81
82#[lexicon]
83#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
84#[serde(rename_all = "camelCase")]
85pub struct RepoBlobRef<'a> {
86    #[serde(borrow)]
87    pub cid: Cid<'a>,
88    #[serde(borrow)]
89    pub did: Did<'a>,
90    #[serde(skip_serializing_if = "Option::is_none")]
91    #[serde(borrow)]
92    pub record_uri: Option<AtUri<'a>>,
93}
94
95
96#[lexicon]
97#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
98#[serde(rename_all = "camelCase")]
99pub struct RepoRef<'a> {
100    #[serde(borrow)]
101    pub did: Did<'a>,
102}
103
104
105#[lexicon]
106#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
107#[serde(rename_all = "camelCase")]
108pub struct StatusAttr<'a> {
109    pub applied: bool,
110    #[serde(skip_serializing_if = "Option::is_none")]
111    #[serde(borrow)]
112    pub r#ref: Option<CowStr<'a>>,
113}
114
115
116#[lexicon]
117#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
118#[serde(rename_all = "camelCase")]
119pub struct ThreatSignature<'a> {
120    #[serde(borrow)]
121    pub property: CowStr<'a>,
122    #[serde(borrow)]
123    pub value: CowStr<'a>,
124}
125
126impl<'a> LexiconSchema for AccountView<'a> {
127    fn nsid() -> &'static str {
128        "com.atproto.admin.defs"
129    }
130    fn def_name() -> &'static str {
131        "accountView"
132    }
133    fn lexicon_doc() -> LexiconDoc<'static> {
134        lexicon_doc_com_atproto_admin_defs()
135    }
136    fn validate(&self) -> Result<(), ConstraintError> {
137        Ok(())
138    }
139}
140
141impl<'a> LexiconSchema for RepoBlobRef<'a> {
142    fn nsid() -> &'static str {
143        "com.atproto.admin.defs"
144    }
145    fn def_name() -> &'static str {
146        "repoBlobRef"
147    }
148    fn lexicon_doc() -> LexiconDoc<'static> {
149        lexicon_doc_com_atproto_admin_defs()
150    }
151    fn validate(&self) -> Result<(), ConstraintError> {
152        Ok(())
153    }
154}
155
156impl<'a> LexiconSchema for RepoRef<'a> {
157    fn nsid() -> &'static str {
158        "com.atproto.admin.defs"
159    }
160    fn def_name() -> &'static str {
161        "repoRef"
162    }
163    fn lexicon_doc() -> LexiconDoc<'static> {
164        lexicon_doc_com_atproto_admin_defs()
165    }
166    fn validate(&self) -> Result<(), ConstraintError> {
167        Ok(())
168    }
169}
170
171impl<'a> LexiconSchema for StatusAttr<'a> {
172    fn nsid() -> &'static str {
173        "com.atproto.admin.defs"
174    }
175    fn def_name() -> &'static str {
176        "statusAttr"
177    }
178    fn lexicon_doc() -> LexiconDoc<'static> {
179        lexicon_doc_com_atproto_admin_defs()
180    }
181    fn validate(&self) -> Result<(), ConstraintError> {
182        Ok(())
183    }
184}
185
186impl<'a> LexiconSchema for ThreatSignature<'a> {
187    fn nsid() -> &'static str {
188        "com.atproto.admin.defs"
189    }
190    fn def_name() -> &'static str {
191        "threatSignature"
192    }
193    fn lexicon_doc() -> LexiconDoc<'static> {
194        lexicon_doc_com_atproto_admin_defs()
195    }
196    fn validate(&self) -> Result<(), ConstraintError> {
197        Ok(())
198    }
199}
200
201pub mod account_view_state {
202
203    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
204    #[allow(unused)]
205    use ::core::marker::PhantomData;
206    mod sealed {
207        pub trait Sealed {}
208    }
209    /// State trait tracking which required fields have been set
210    pub trait State: sealed::Sealed {
211        type Handle;
212        type IndexedAt;
213        type Did;
214    }
215    /// Empty state - all required fields are unset
216    pub struct Empty(());
217    impl sealed::Sealed for Empty {}
218    impl State for Empty {
219        type Handle = Unset;
220        type IndexedAt = Unset;
221        type Did = Unset;
222    }
223    ///State transition - sets the `handle` field to Set
224    pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>);
225    impl<S: State> sealed::Sealed for SetHandle<S> {}
226    impl<S: State> State for SetHandle<S> {
227        type Handle = Set<members::handle>;
228        type IndexedAt = S::IndexedAt;
229        type Did = S::Did;
230    }
231    ///State transition - sets the `indexed_at` field to Set
232    pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>);
233    impl<S: State> sealed::Sealed for SetIndexedAt<S> {}
234    impl<S: State> State for SetIndexedAt<S> {
235        type Handle = S::Handle;
236        type IndexedAt = Set<members::indexed_at>;
237        type Did = S::Did;
238    }
239    ///State transition - sets the `did` field to Set
240    pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>);
241    impl<S: State> sealed::Sealed for SetDid<S> {}
242    impl<S: State> State for SetDid<S> {
243        type Handle = S::Handle;
244        type IndexedAt = S::IndexedAt;
245        type Did = Set<members::did>;
246    }
247    /// Marker types for field names
248    #[allow(non_camel_case_types)]
249    pub mod members {
250        ///Marker type for the `handle` field
251        pub struct handle(());
252        ///Marker type for the `indexed_at` field
253        pub struct indexed_at(());
254        ///Marker type for the `did` field
255        pub struct did(());
256    }
257}
258
259/// Builder for constructing an instance of this type
260pub struct AccountViewBuilder<'a, S: account_view_state::State> {
261    _state: PhantomData<fn() -> S>,
262    _fields: (
263        Option<Datetime>,
264        Option<Did<'a>>,
265        Option<CowStr<'a>>,
266        Option<Datetime>,
267        Option<Handle<'a>>,
268        Option<Datetime>,
269        Option<CowStr<'a>>,
270        Option<InviteCode<'a>>,
271        Option<Vec<InviteCode<'a>>>,
272        Option<bool>,
273        Option<Vec<Data<'a>>>,
274        Option<Vec<admin::ThreatSignature<'a>>>,
275    ),
276    _lifetime: PhantomData<&'a ()>,
277}
278
279impl<'a> AccountView<'a> {
280    /// Create a new builder for this type
281    pub fn new() -> AccountViewBuilder<'a, account_view_state::Empty> {
282        AccountViewBuilder::new()
283    }
284}
285
286impl<'a> AccountViewBuilder<'a, account_view_state::Empty> {
287    /// Create a new builder with all fields unset
288    pub fn new() -> Self {
289        AccountViewBuilder {
290            _state: PhantomData,
291            _fields: (
292                None,
293                None,
294                None,
295                None,
296                None,
297                None,
298                None,
299                None,
300                None,
301                None,
302                None,
303                None,
304            ),
305            _lifetime: PhantomData,
306        }
307    }
308}
309
310impl<'a, S: account_view_state::State> AccountViewBuilder<'a, S> {
311    /// Set the `deactivatedAt` field (optional)
312    pub fn deactivated_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
313        self._fields.0 = value.into();
314        self
315    }
316    /// Set the `deactivatedAt` field to an Option value (optional)
317    pub fn maybe_deactivated_at(mut self, value: Option<Datetime>) -> Self {
318        self._fields.0 = value;
319        self
320    }
321}
322
323impl<'a, S> AccountViewBuilder<'a, S>
324where
325    S: account_view_state::State,
326    S::Did: account_view_state::IsUnset,
327{
328    /// Set the `did` field (required)
329    pub fn did(
330        mut self,
331        value: impl Into<Did<'a>>,
332    ) -> AccountViewBuilder<'a, account_view_state::SetDid<S>> {
333        self._fields.1 = Option::Some(value.into());
334        AccountViewBuilder {
335            _state: PhantomData,
336            _fields: self._fields,
337            _lifetime: PhantomData,
338        }
339    }
340}
341
342impl<'a, S: account_view_state::State> AccountViewBuilder<'a, S> {
343    /// Set the `email` field (optional)
344    pub fn email(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
345        self._fields.2 = value.into();
346        self
347    }
348    /// Set the `email` field to an Option value (optional)
349    pub fn maybe_email(mut self, value: Option<CowStr<'a>>) -> Self {
350        self._fields.2 = value;
351        self
352    }
353}
354
355impl<'a, S: account_view_state::State> AccountViewBuilder<'a, S> {
356    /// Set the `emailConfirmedAt` field (optional)
357    pub fn email_confirmed_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
358        self._fields.3 = value.into();
359        self
360    }
361    /// Set the `emailConfirmedAt` field to an Option value (optional)
362    pub fn maybe_email_confirmed_at(mut self, value: Option<Datetime>) -> Self {
363        self._fields.3 = value;
364        self
365    }
366}
367
368impl<'a, S> AccountViewBuilder<'a, S>
369where
370    S: account_view_state::State,
371    S::Handle: account_view_state::IsUnset,
372{
373    /// Set the `handle` field (required)
374    pub fn handle(
375        mut self,
376        value: impl Into<Handle<'a>>,
377    ) -> AccountViewBuilder<'a, account_view_state::SetHandle<S>> {
378        self._fields.4 = Option::Some(value.into());
379        AccountViewBuilder {
380            _state: PhantomData,
381            _fields: self._fields,
382            _lifetime: PhantomData,
383        }
384    }
385}
386
387impl<'a, S> AccountViewBuilder<'a, S>
388where
389    S: account_view_state::State,
390    S::IndexedAt: account_view_state::IsUnset,
391{
392    /// Set the `indexedAt` field (required)
393    pub fn indexed_at(
394        mut self,
395        value: impl Into<Datetime>,
396    ) -> AccountViewBuilder<'a, account_view_state::SetIndexedAt<S>> {
397        self._fields.5 = Option::Some(value.into());
398        AccountViewBuilder {
399            _state: PhantomData,
400            _fields: self._fields,
401            _lifetime: PhantomData,
402        }
403    }
404}
405
406impl<'a, S: account_view_state::State> AccountViewBuilder<'a, S> {
407    /// Set the `inviteNote` field (optional)
408    pub fn invite_note(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
409        self._fields.6 = value.into();
410        self
411    }
412    /// Set the `inviteNote` field to an Option value (optional)
413    pub fn maybe_invite_note(mut self, value: Option<CowStr<'a>>) -> Self {
414        self._fields.6 = value;
415        self
416    }
417}
418
419impl<'a, S: account_view_state::State> AccountViewBuilder<'a, S> {
420    /// Set the `invitedBy` field (optional)
421    pub fn invited_by(mut self, value: impl Into<Option<InviteCode<'a>>>) -> Self {
422        self._fields.7 = value.into();
423        self
424    }
425    /// Set the `invitedBy` field to an Option value (optional)
426    pub fn maybe_invited_by(mut self, value: Option<InviteCode<'a>>) -> Self {
427        self._fields.7 = value;
428        self
429    }
430}
431
432impl<'a, S: account_view_state::State> AccountViewBuilder<'a, S> {
433    /// Set the `invites` field (optional)
434    pub fn invites(mut self, value: impl Into<Option<Vec<InviteCode<'a>>>>) -> Self {
435        self._fields.8 = value.into();
436        self
437    }
438    /// Set the `invites` field to an Option value (optional)
439    pub fn maybe_invites(mut self, value: Option<Vec<InviteCode<'a>>>) -> Self {
440        self._fields.8 = value;
441        self
442    }
443}
444
445impl<'a, S: account_view_state::State> AccountViewBuilder<'a, S> {
446    /// Set the `invitesDisabled` field (optional)
447    pub fn invites_disabled(mut self, value: impl Into<Option<bool>>) -> Self {
448        self._fields.9 = value.into();
449        self
450    }
451    /// Set the `invitesDisabled` field to an Option value (optional)
452    pub fn maybe_invites_disabled(mut self, value: Option<bool>) -> Self {
453        self._fields.9 = value;
454        self
455    }
456}
457
458impl<'a, S: account_view_state::State> AccountViewBuilder<'a, S> {
459    /// Set the `relatedRecords` field (optional)
460    pub fn related_records(mut self, value: impl Into<Option<Vec<Data<'a>>>>) -> Self {
461        self._fields.10 = value.into();
462        self
463    }
464    /// Set the `relatedRecords` field to an Option value (optional)
465    pub fn maybe_related_records(mut self, value: Option<Vec<Data<'a>>>) -> Self {
466        self._fields.10 = value;
467        self
468    }
469}
470
471impl<'a, S: account_view_state::State> AccountViewBuilder<'a, S> {
472    /// Set the `threatSignatures` field (optional)
473    pub fn threat_signatures(
474        mut self,
475        value: impl Into<Option<Vec<admin::ThreatSignature<'a>>>>,
476    ) -> Self {
477        self._fields.11 = value.into();
478        self
479    }
480    /// Set the `threatSignatures` field to an Option value (optional)
481    pub fn maybe_threat_signatures(
482        mut self,
483        value: Option<Vec<admin::ThreatSignature<'a>>>,
484    ) -> Self {
485        self._fields.11 = value;
486        self
487    }
488}
489
490impl<'a, S> AccountViewBuilder<'a, S>
491where
492    S: account_view_state::State,
493    S::Handle: account_view_state::IsSet,
494    S::IndexedAt: account_view_state::IsSet,
495    S::Did: account_view_state::IsSet,
496{
497    /// Build the final struct
498    pub fn build(self) -> AccountView<'a> {
499        AccountView {
500            deactivated_at: self._fields.0,
501            did: self._fields.1.unwrap(),
502            email: self._fields.2,
503            email_confirmed_at: self._fields.3,
504            handle: self._fields.4.unwrap(),
505            indexed_at: self._fields.5.unwrap(),
506            invite_note: self._fields.6,
507            invited_by: self._fields.7,
508            invites: self._fields.8,
509            invites_disabled: self._fields.9,
510            related_records: self._fields.10,
511            threat_signatures: self._fields.11,
512            extra_data: Default::default(),
513        }
514    }
515    /// Build the final struct with custom extra_data
516    pub fn build_with_data(
517        self,
518        extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
519    ) -> AccountView<'a> {
520        AccountView {
521            deactivated_at: self._fields.0,
522            did: self._fields.1.unwrap(),
523            email: self._fields.2,
524            email_confirmed_at: self._fields.3,
525            handle: self._fields.4.unwrap(),
526            indexed_at: self._fields.5.unwrap(),
527            invite_note: self._fields.6,
528            invited_by: self._fields.7,
529            invites: self._fields.8,
530            invites_disabled: self._fields.9,
531            related_records: self._fields.10,
532            threat_signatures: self._fields.11,
533            extra_data: Some(extra_data),
534        }
535    }
536}
537
538fn lexicon_doc_com_atproto_admin_defs() -> LexiconDoc<'static> {
539    #[allow(unused_imports)]
540    use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType};
541    use jacquard_lexicon::lexicon::*;
542    use alloc::collections::BTreeMap;
543    LexiconDoc {
544        lexicon: Lexicon::Lexicon1,
545        id: CowStr::new_static("com.atproto.admin.defs"),
546        defs: {
547            let mut map = BTreeMap::new();
548            map.insert(
549                SmolStr::new_static("accountView"),
550                LexUserType::Object(LexObject {
551                    required: Some(
552                        vec![
553                            SmolStr::new_static("did"), SmolStr::new_static("handle"),
554                            SmolStr::new_static("indexedAt")
555                        ],
556                    ),
557                    properties: {
558                        #[allow(unused_mut)]
559                        let mut map = BTreeMap::new();
560                        map.insert(
561                            SmolStr::new_static("deactivatedAt"),
562                            LexObjectProperty::String(LexString {
563                                format: Some(LexStringFormat::Datetime),
564                                ..Default::default()
565                            }),
566                        );
567                        map.insert(
568                            SmolStr::new_static("did"),
569                            LexObjectProperty::String(LexString {
570                                format: Some(LexStringFormat::Did),
571                                ..Default::default()
572                            }),
573                        );
574                        map.insert(
575                            SmolStr::new_static("email"),
576                            LexObjectProperty::String(LexString { ..Default::default() }),
577                        );
578                        map.insert(
579                            SmolStr::new_static("emailConfirmedAt"),
580                            LexObjectProperty::String(LexString {
581                                format: Some(LexStringFormat::Datetime),
582                                ..Default::default()
583                            }),
584                        );
585                        map.insert(
586                            SmolStr::new_static("handle"),
587                            LexObjectProperty::String(LexString {
588                                format: Some(LexStringFormat::Handle),
589                                ..Default::default()
590                            }),
591                        );
592                        map.insert(
593                            SmolStr::new_static("indexedAt"),
594                            LexObjectProperty::String(LexString {
595                                format: Some(LexStringFormat::Datetime),
596                                ..Default::default()
597                            }),
598                        );
599                        map.insert(
600                            SmolStr::new_static("inviteNote"),
601                            LexObjectProperty::String(LexString { ..Default::default() }),
602                        );
603                        map.insert(
604                            SmolStr::new_static("invitedBy"),
605                            LexObjectProperty::Ref(LexRef {
606                                r#ref: CowStr::new_static(
607                                    "com.atproto.server.defs#inviteCode",
608                                ),
609                                ..Default::default()
610                            }),
611                        );
612                        map.insert(
613                            SmolStr::new_static("invites"),
614                            LexObjectProperty::Array(LexArray {
615                                items: LexArrayItem::Ref(LexRef {
616                                    r#ref: CowStr::new_static(
617                                        "com.atproto.server.defs#inviteCode",
618                                    ),
619                                    ..Default::default()
620                                }),
621                                ..Default::default()
622                            }),
623                        );
624                        map.insert(
625                            SmolStr::new_static("invitesDisabled"),
626                            LexObjectProperty::Boolean(LexBoolean {
627                                ..Default::default()
628                            }),
629                        );
630                        map.insert(
631                            SmolStr::new_static("relatedRecords"),
632                            LexObjectProperty::Array(LexArray {
633                                items: LexArrayItem::Unknown(LexUnknown {
634                                    ..Default::default()
635                                }),
636                                ..Default::default()
637                            }),
638                        );
639                        map.insert(
640                            SmolStr::new_static("threatSignatures"),
641                            LexObjectProperty::Array(LexArray {
642                                items: LexArrayItem::Ref(LexRef {
643                                    r#ref: CowStr::new_static("#threatSignature"),
644                                    ..Default::default()
645                                }),
646                                ..Default::default()
647                            }),
648                        );
649                        map
650                    },
651                    ..Default::default()
652                }),
653            );
654            map.insert(
655                SmolStr::new_static("repoBlobRef"),
656                LexUserType::Object(LexObject {
657                    required: Some(
658                        vec![SmolStr::new_static("did"), SmolStr::new_static("cid")],
659                    ),
660                    properties: {
661                        #[allow(unused_mut)]
662                        let mut map = BTreeMap::new();
663                        map.insert(
664                            SmolStr::new_static("cid"),
665                            LexObjectProperty::String(LexString {
666                                format: Some(LexStringFormat::Cid),
667                                ..Default::default()
668                            }),
669                        );
670                        map.insert(
671                            SmolStr::new_static("did"),
672                            LexObjectProperty::String(LexString {
673                                format: Some(LexStringFormat::Did),
674                                ..Default::default()
675                            }),
676                        );
677                        map.insert(
678                            SmolStr::new_static("recordUri"),
679                            LexObjectProperty::String(LexString {
680                                format: Some(LexStringFormat::AtUri),
681                                ..Default::default()
682                            }),
683                        );
684                        map
685                    },
686                    ..Default::default()
687                }),
688            );
689            map.insert(
690                SmolStr::new_static("repoRef"),
691                LexUserType::Object(LexObject {
692                    required: Some(vec![SmolStr::new_static("did")]),
693                    properties: {
694                        #[allow(unused_mut)]
695                        let mut map = BTreeMap::new();
696                        map.insert(
697                            SmolStr::new_static("did"),
698                            LexObjectProperty::String(LexString {
699                                format: Some(LexStringFormat::Did),
700                                ..Default::default()
701                            }),
702                        );
703                        map
704                    },
705                    ..Default::default()
706                }),
707            );
708            map.insert(
709                SmolStr::new_static("statusAttr"),
710                LexUserType::Object(LexObject {
711                    required: Some(vec![SmolStr::new_static("applied")]),
712                    properties: {
713                        #[allow(unused_mut)]
714                        let mut map = BTreeMap::new();
715                        map.insert(
716                            SmolStr::new_static("applied"),
717                            LexObjectProperty::Boolean(LexBoolean {
718                                ..Default::default()
719                            }),
720                        );
721                        map.insert(
722                            SmolStr::new_static("ref"),
723                            LexObjectProperty::String(LexString { ..Default::default() }),
724                        );
725                        map
726                    },
727                    ..Default::default()
728                }),
729            );
730            map.insert(
731                SmolStr::new_static("threatSignature"),
732                LexUserType::Object(LexObject {
733                    required: Some(
734                        vec![
735                            SmolStr::new_static("property"), SmolStr::new_static("value")
736                        ],
737                    ),
738                    properties: {
739                        #[allow(unused_mut)]
740                        let mut map = BTreeMap::new();
741                        map.insert(
742                            SmolStr::new_static("property"),
743                            LexObjectProperty::String(LexString { ..Default::default() }),
744                        );
745                        map.insert(
746                            SmolStr::new_static("value"),
747                            LexObjectProperty::String(LexString { ..Default::default() }),
748                        );
749                        map
750                    },
751                    ..Default::default()
752                }),
753            );
754            map
755        },
756        ..Default::default()
757    }
758}
759
760pub mod repo_blob_ref_state {
761
762    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
763    #[allow(unused)]
764    use ::core::marker::PhantomData;
765    mod sealed {
766        pub trait Sealed {}
767    }
768    /// State trait tracking which required fields have been set
769    pub trait State: sealed::Sealed {
770        type Did;
771        type Cid;
772    }
773    /// Empty state - all required fields are unset
774    pub struct Empty(());
775    impl sealed::Sealed for Empty {}
776    impl State for Empty {
777        type Did = Unset;
778        type Cid = Unset;
779    }
780    ///State transition - sets the `did` field to Set
781    pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>);
782    impl<S: State> sealed::Sealed for SetDid<S> {}
783    impl<S: State> State for SetDid<S> {
784        type Did = Set<members::did>;
785        type Cid = S::Cid;
786    }
787    ///State transition - sets the `cid` field to Set
788    pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>);
789    impl<S: State> sealed::Sealed for SetCid<S> {}
790    impl<S: State> State for SetCid<S> {
791        type Did = S::Did;
792        type Cid = Set<members::cid>;
793    }
794    /// Marker types for field names
795    #[allow(non_camel_case_types)]
796    pub mod members {
797        ///Marker type for the `did` field
798        pub struct did(());
799        ///Marker type for the `cid` field
800        pub struct cid(());
801    }
802}
803
804/// Builder for constructing an instance of this type
805pub struct RepoBlobRefBuilder<'a, S: repo_blob_ref_state::State> {
806    _state: PhantomData<fn() -> S>,
807    _fields: (Option<Cid<'a>>, Option<Did<'a>>, Option<AtUri<'a>>),
808    _lifetime: PhantomData<&'a ()>,
809}
810
811impl<'a> RepoBlobRef<'a> {
812    /// Create a new builder for this type
813    pub fn new() -> RepoBlobRefBuilder<'a, repo_blob_ref_state::Empty> {
814        RepoBlobRefBuilder::new()
815    }
816}
817
818impl<'a> RepoBlobRefBuilder<'a, repo_blob_ref_state::Empty> {
819    /// Create a new builder with all fields unset
820    pub fn new() -> Self {
821        RepoBlobRefBuilder {
822            _state: PhantomData,
823            _fields: (None, None, None),
824            _lifetime: PhantomData,
825        }
826    }
827}
828
829impl<'a, S> RepoBlobRefBuilder<'a, S>
830where
831    S: repo_blob_ref_state::State,
832    S::Cid: repo_blob_ref_state::IsUnset,
833{
834    /// Set the `cid` field (required)
835    pub fn cid(
836        mut self,
837        value: impl Into<Cid<'a>>,
838    ) -> RepoBlobRefBuilder<'a, repo_blob_ref_state::SetCid<S>> {
839        self._fields.0 = Option::Some(value.into());
840        RepoBlobRefBuilder {
841            _state: PhantomData,
842            _fields: self._fields,
843            _lifetime: PhantomData,
844        }
845    }
846}
847
848impl<'a, S> RepoBlobRefBuilder<'a, S>
849where
850    S: repo_blob_ref_state::State,
851    S::Did: repo_blob_ref_state::IsUnset,
852{
853    /// Set the `did` field (required)
854    pub fn did(
855        mut self,
856        value: impl Into<Did<'a>>,
857    ) -> RepoBlobRefBuilder<'a, repo_blob_ref_state::SetDid<S>> {
858        self._fields.1 = Option::Some(value.into());
859        RepoBlobRefBuilder {
860            _state: PhantomData,
861            _fields: self._fields,
862            _lifetime: PhantomData,
863        }
864    }
865}
866
867impl<'a, S: repo_blob_ref_state::State> RepoBlobRefBuilder<'a, S> {
868    /// Set the `recordUri` field (optional)
869    pub fn record_uri(mut self, value: impl Into<Option<AtUri<'a>>>) -> Self {
870        self._fields.2 = value.into();
871        self
872    }
873    /// Set the `recordUri` field to an Option value (optional)
874    pub fn maybe_record_uri(mut self, value: Option<AtUri<'a>>) -> Self {
875        self._fields.2 = value;
876        self
877    }
878}
879
880impl<'a, S> RepoBlobRefBuilder<'a, S>
881where
882    S: repo_blob_ref_state::State,
883    S::Did: repo_blob_ref_state::IsSet,
884    S::Cid: repo_blob_ref_state::IsSet,
885{
886    /// Build the final struct
887    pub fn build(self) -> RepoBlobRef<'a> {
888        RepoBlobRef {
889            cid: self._fields.0.unwrap(),
890            did: self._fields.1.unwrap(),
891            record_uri: self._fields.2,
892            extra_data: Default::default(),
893        }
894    }
895    /// Build the final struct with custom extra_data
896    pub fn build_with_data(
897        self,
898        extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
899    ) -> RepoBlobRef<'a> {
900        RepoBlobRef {
901            cid: self._fields.0.unwrap(),
902            did: self._fields.1.unwrap(),
903            record_uri: self._fields.2,
904            extra_data: Some(extra_data),
905        }
906    }
907}
908
909pub mod repo_ref_state {
910
911    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
912    #[allow(unused)]
913    use ::core::marker::PhantomData;
914    mod sealed {
915        pub trait Sealed {}
916    }
917    /// State trait tracking which required fields have been set
918    pub trait State: sealed::Sealed {
919        type Did;
920    }
921    /// Empty state - all required fields are unset
922    pub struct Empty(());
923    impl sealed::Sealed for Empty {}
924    impl State for Empty {
925        type Did = Unset;
926    }
927    ///State transition - sets the `did` field to Set
928    pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>);
929    impl<S: State> sealed::Sealed for SetDid<S> {}
930    impl<S: State> State for SetDid<S> {
931        type Did = Set<members::did>;
932    }
933    /// Marker types for field names
934    #[allow(non_camel_case_types)]
935    pub mod members {
936        ///Marker type for the `did` field
937        pub struct did(());
938    }
939}
940
941/// Builder for constructing an instance of this type
942pub struct RepoRefBuilder<'a, S: repo_ref_state::State> {
943    _state: PhantomData<fn() -> S>,
944    _fields: (Option<Did<'a>>,),
945    _lifetime: PhantomData<&'a ()>,
946}
947
948impl<'a> RepoRef<'a> {
949    /// Create a new builder for this type
950    pub fn new() -> RepoRefBuilder<'a, repo_ref_state::Empty> {
951        RepoRefBuilder::new()
952    }
953}
954
955impl<'a> RepoRefBuilder<'a, repo_ref_state::Empty> {
956    /// Create a new builder with all fields unset
957    pub fn new() -> Self {
958        RepoRefBuilder {
959            _state: PhantomData,
960            _fields: (None,),
961            _lifetime: PhantomData,
962        }
963    }
964}
965
966impl<'a, S> RepoRefBuilder<'a, S>
967where
968    S: repo_ref_state::State,
969    S::Did: repo_ref_state::IsUnset,
970{
971    /// Set the `did` field (required)
972    pub fn did(
973        mut self,
974        value: impl Into<Did<'a>>,
975    ) -> RepoRefBuilder<'a, repo_ref_state::SetDid<S>> {
976        self._fields.0 = Option::Some(value.into());
977        RepoRefBuilder {
978            _state: PhantomData,
979            _fields: self._fields,
980            _lifetime: PhantomData,
981        }
982    }
983}
984
985impl<'a, S> RepoRefBuilder<'a, S>
986where
987    S: repo_ref_state::State,
988    S::Did: repo_ref_state::IsSet,
989{
990    /// Build the final struct
991    pub fn build(self) -> RepoRef<'a> {
992        RepoRef {
993            did: self._fields.0.unwrap(),
994            extra_data: Default::default(),
995        }
996    }
997    /// Build the final struct with custom extra_data
998    pub fn build_with_data(
999        self,
1000        extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
1001    ) -> RepoRef<'a> {
1002        RepoRef {
1003            did: self._fields.0.unwrap(),
1004            extra_data: Some(extra_data),
1005        }
1006    }
1007}
1008
1009pub mod status_attr_state {
1010
1011    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
1012    #[allow(unused)]
1013    use ::core::marker::PhantomData;
1014    mod sealed {
1015        pub trait Sealed {}
1016    }
1017    /// State trait tracking which required fields have been set
1018    pub trait State: sealed::Sealed {
1019        type Applied;
1020    }
1021    /// Empty state - all required fields are unset
1022    pub struct Empty(());
1023    impl sealed::Sealed for Empty {}
1024    impl State for Empty {
1025        type Applied = Unset;
1026    }
1027    ///State transition - sets the `applied` field to Set
1028    pub struct SetApplied<S: State = Empty>(PhantomData<fn() -> S>);
1029    impl<S: State> sealed::Sealed for SetApplied<S> {}
1030    impl<S: State> State for SetApplied<S> {
1031        type Applied = Set<members::applied>;
1032    }
1033    /// Marker types for field names
1034    #[allow(non_camel_case_types)]
1035    pub mod members {
1036        ///Marker type for the `applied` field
1037        pub struct applied(());
1038    }
1039}
1040
1041/// Builder for constructing an instance of this type
1042pub struct StatusAttrBuilder<'a, S: status_attr_state::State> {
1043    _state: PhantomData<fn() -> S>,
1044    _fields: (Option<bool>, Option<CowStr<'a>>),
1045    _lifetime: PhantomData<&'a ()>,
1046}
1047
1048impl<'a> StatusAttr<'a> {
1049    /// Create a new builder for this type
1050    pub fn new() -> StatusAttrBuilder<'a, status_attr_state::Empty> {
1051        StatusAttrBuilder::new()
1052    }
1053}
1054
1055impl<'a> StatusAttrBuilder<'a, status_attr_state::Empty> {
1056    /// Create a new builder with all fields unset
1057    pub fn new() -> Self {
1058        StatusAttrBuilder {
1059            _state: PhantomData,
1060            _fields: (None, None),
1061            _lifetime: PhantomData,
1062        }
1063    }
1064}
1065
1066impl<'a, S> StatusAttrBuilder<'a, S>
1067where
1068    S: status_attr_state::State,
1069    S::Applied: status_attr_state::IsUnset,
1070{
1071    /// Set the `applied` field (required)
1072    pub fn applied(
1073        mut self,
1074        value: impl Into<bool>,
1075    ) -> StatusAttrBuilder<'a, status_attr_state::SetApplied<S>> {
1076        self._fields.0 = Option::Some(value.into());
1077        StatusAttrBuilder {
1078            _state: PhantomData,
1079            _fields: self._fields,
1080            _lifetime: PhantomData,
1081        }
1082    }
1083}
1084
1085impl<'a, S: status_attr_state::State> StatusAttrBuilder<'a, S> {
1086    /// Set the `ref` field (optional)
1087    pub fn r#ref(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
1088        self._fields.1 = value.into();
1089        self
1090    }
1091    /// Set the `ref` field to an Option value (optional)
1092    pub fn maybe_ref(mut self, value: Option<CowStr<'a>>) -> Self {
1093        self._fields.1 = value;
1094        self
1095    }
1096}
1097
1098impl<'a, S> StatusAttrBuilder<'a, S>
1099where
1100    S: status_attr_state::State,
1101    S::Applied: status_attr_state::IsSet,
1102{
1103    /// Build the final struct
1104    pub fn build(self) -> StatusAttr<'a> {
1105        StatusAttr {
1106            applied: self._fields.0.unwrap(),
1107            r#ref: self._fields.1,
1108            extra_data: Default::default(),
1109        }
1110    }
1111    /// Build the final struct with custom extra_data
1112    pub fn build_with_data(
1113        self,
1114        extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
1115    ) -> StatusAttr<'a> {
1116        StatusAttr {
1117            applied: self._fields.0.unwrap(),
1118            r#ref: self._fields.1,
1119            extra_data: Some(extra_data),
1120        }
1121    }
1122}