1pub mod cancel_scheduled_actions;
9pub mod emit_event;
10pub mod get_account_timeline;
11pub mod get_event;
12pub mod get_record;
13pub mod get_records;
14pub mod get_repo;
15pub mod get_reporter_stats;
16pub mod get_repos;
17pub mod get_subjects;
18pub mod list_scheduled_actions;
19pub mod query_events;
20pub mod query_statuses;
21pub mod schedule_action;
22pub mod search_repos;
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, UriValue};
35use jacquard_common::types::value::Data;
36use jacquard_derive::{IntoStatic, lexicon, open_union};
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::app_bsky::ageassurance::Access;
44use crate::chat_bsky::convo::MessageRef;
45use crate::com_atproto::admin::RepoRef;
46use crate::com_atproto::admin::ThreatSignature;
47use crate::com_atproto::label::Label;
48use crate::com_atproto::moderation::ReasonType;
49use crate::com_atproto::moderation::SubjectType;
50use crate::com_atproto::repo::strong_ref::StrongRef;
51use crate::com_atproto::server::InviteCode;
52use crate::tools_ozone::moderation;
53#[lexicon]
56#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
57#[serde(rename_all = "camelCase")]
58pub struct AccountEvent<'a> {
59 pub active: bool,
61 #[serde(skip_serializing_if = "Option::is_none")]
62 #[serde(borrow)]
63 pub comment: Option<CowStr<'a>>,
64 #[serde(skip_serializing_if = "Option::is_none")]
65 #[serde(borrow)]
66 pub status: Option<AccountEventStatus<'a>>,
67 pub timestamp: Datetime,
68}
69
70
71#[derive(Debug, Clone, PartialEq, Eq, Hash)]
72pub enum AccountEventStatus<'a> {
73 Unknown,
74 Deactivated,
75 Deleted,
76 Takendown,
77 Suspended,
78 Tombstoned,
79 Other(CowStr<'a>),
80}
81
82impl<'a> AccountEventStatus<'a> {
83 pub fn as_str(&self) -> &str {
84 match self {
85 Self::Unknown => "unknown",
86 Self::Deactivated => "deactivated",
87 Self::Deleted => "deleted",
88 Self::Takendown => "takendown",
89 Self::Suspended => "suspended",
90 Self::Tombstoned => "tombstoned",
91 Self::Other(s) => s.as_ref(),
92 }
93 }
94}
95
96impl<'a> From<&'a str> for AccountEventStatus<'a> {
97 fn from(s: &'a str) -> Self {
98 match s {
99 "unknown" => Self::Unknown,
100 "deactivated" => Self::Deactivated,
101 "deleted" => Self::Deleted,
102 "takendown" => Self::Takendown,
103 "suspended" => Self::Suspended,
104 "tombstoned" => Self::Tombstoned,
105 _ => Self::Other(CowStr::from(s)),
106 }
107 }
108}
109
110impl<'a> From<String> for AccountEventStatus<'a> {
111 fn from(s: String) -> Self {
112 match s.as_str() {
113 "unknown" => Self::Unknown,
114 "deactivated" => Self::Deactivated,
115 "deleted" => Self::Deleted,
116 "takendown" => Self::Takendown,
117 "suspended" => Self::Suspended,
118 "tombstoned" => Self::Tombstoned,
119 _ => Self::Other(CowStr::from(s)),
120 }
121 }
122}
123
124impl<'a> core::fmt::Display for AccountEventStatus<'a> {
125 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
126 write!(f, "{}", self.as_str())
127 }
128}
129
130impl<'a> AsRef<str> for AccountEventStatus<'a> {
131 fn as_ref(&self) -> &str {
132 self.as_str()
133 }
134}
135
136impl<'a> serde::Serialize for AccountEventStatus<'a> {
137 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
138 where
139 S: serde::Serializer,
140 {
141 serializer.serialize_str(self.as_str())
142 }
143}
144
145impl<'de, 'a> serde::Deserialize<'de> for AccountEventStatus<'a>
146where
147 'de: 'a,
148{
149 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
150 where
151 D: serde::Deserializer<'de>,
152 {
153 let s = <&'de str>::deserialize(deserializer)?;
154 Ok(Self::from(s))
155 }
156}
157
158impl<'a> Default for AccountEventStatus<'a> {
159 fn default() -> Self {
160 Self::Other(Default::default())
161 }
162}
163
164impl jacquard_common::IntoStatic for AccountEventStatus<'_> {
165 type Output = AccountEventStatus<'static>;
166 fn into_static(self) -> Self::Output {
167 match self {
168 AccountEventStatus::Unknown => AccountEventStatus::Unknown,
169 AccountEventStatus::Deactivated => AccountEventStatus::Deactivated,
170 AccountEventStatus::Deleted => AccountEventStatus::Deleted,
171 AccountEventStatus::Takendown => AccountEventStatus::Takendown,
172 AccountEventStatus::Suspended => AccountEventStatus::Suspended,
173 AccountEventStatus::Tombstoned => AccountEventStatus::Tombstoned,
174 AccountEventStatus::Other(v) => AccountEventStatus::Other(v.into_static()),
175 }
176 }
177}
178
179
180#[lexicon]
181#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
182#[serde(rename_all = "camelCase")]
183pub struct AccountHosting<'a> {
184 #[serde(skip_serializing_if = "Option::is_none")]
185 pub created_at: Option<Datetime>,
186 #[serde(skip_serializing_if = "Option::is_none")]
187 pub deactivated_at: Option<Datetime>,
188 #[serde(skip_serializing_if = "Option::is_none")]
189 pub deleted_at: Option<Datetime>,
190 #[serde(skip_serializing_if = "Option::is_none")]
191 pub reactivated_at: Option<Datetime>,
192 #[serde(borrow)]
193 pub status: AccountHostingStatus<'a>,
194 #[serde(skip_serializing_if = "Option::is_none")]
195 pub updated_at: Option<Datetime>,
196}
197
198
199#[derive(Debug, Clone, PartialEq, Eq, Hash)]
200pub enum AccountHostingStatus<'a> {
201 Takendown,
202 Suspended,
203 Deleted,
204 Deactivated,
205 Unknown,
206 Other(CowStr<'a>),
207}
208
209impl<'a> AccountHostingStatus<'a> {
210 pub fn as_str(&self) -> &str {
211 match self {
212 Self::Takendown => "takendown",
213 Self::Suspended => "suspended",
214 Self::Deleted => "deleted",
215 Self::Deactivated => "deactivated",
216 Self::Unknown => "unknown",
217 Self::Other(s) => s.as_ref(),
218 }
219 }
220}
221
222impl<'a> From<&'a str> for AccountHostingStatus<'a> {
223 fn from(s: &'a str) -> Self {
224 match s {
225 "takendown" => Self::Takendown,
226 "suspended" => Self::Suspended,
227 "deleted" => Self::Deleted,
228 "deactivated" => Self::Deactivated,
229 "unknown" => Self::Unknown,
230 _ => Self::Other(CowStr::from(s)),
231 }
232 }
233}
234
235impl<'a> From<String> for AccountHostingStatus<'a> {
236 fn from(s: String) -> Self {
237 match s.as_str() {
238 "takendown" => Self::Takendown,
239 "suspended" => Self::Suspended,
240 "deleted" => Self::Deleted,
241 "deactivated" => Self::Deactivated,
242 "unknown" => Self::Unknown,
243 _ => Self::Other(CowStr::from(s)),
244 }
245 }
246}
247
248impl<'a> core::fmt::Display for AccountHostingStatus<'a> {
249 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
250 write!(f, "{}", self.as_str())
251 }
252}
253
254impl<'a> AsRef<str> for AccountHostingStatus<'a> {
255 fn as_ref(&self) -> &str {
256 self.as_str()
257 }
258}
259
260impl<'a> serde::Serialize for AccountHostingStatus<'a> {
261 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
262 where
263 S: serde::Serializer,
264 {
265 serializer.serialize_str(self.as_str())
266 }
267}
268
269impl<'de, 'a> serde::Deserialize<'de> for AccountHostingStatus<'a>
270where
271 'de: 'a,
272{
273 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
274 where
275 D: serde::Deserializer<'de>,
276 {
277 let s = <&'de str>::deserialize(deserializer)?;
278 Ok(Self::from(s))
279 }
280}
281
282impl<'a> Default for AccountHostingStatus<'a> {
283 fn default() -> Self {
284 Self::Other(Default::default())
285 }
286}
287
288impl jacquard_common::IntoStatic for AccountHostingStatus<'_> {
289 type Output = AccountHostingStatus<'static>;
290 fn into_static(self) -> Self::Output {
291 match self {
292 AccountHostingStatus::Takendown => AccountHostingStatus::Takendown,
293 AccountHostingStatus::Suspended => AccountHostingStatus::Suspended,
294 AccountHostingStatus::Deleted => AccountHostingStatus::Deleted,
295 AccountHostingStatus::Deactivated => AccountHostingStatus::Deactivated,
296 AccountHostingStatus::Unknown => AccountHostingStatus::Unknown,
297 AccountHostingStatus::Other(v) => {
298 AccountHostingStatus::Other(v.into_static())
299 }
300 }
301 }
302}
303
304#[lexicon]
307#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
308#[serde(rename_all = "camelCase")]
309pub struct AccountStats<'a> {
310 #[serde(skip_serializing_if = "Option::is_none")]
312 pub appeal_count: Option<i64>,
313 #[serde(skip_serializing_if = "Option::is_none")]
315 pub escalate_count: Option<i64>,
316 #[serde(skip_serializing_if = "Option::is_none")]
318 pub report_count: Option<i64>,
319 #[serde(skip_serializing_if = "Option::is_none")]
321 pub suspend_count: Option<i64>,
322 #[serde(skip_serializing_if = "Option::is_none")]
324 pub takedown_count: Option<i64>,
325}
326
327#[lexicon]
330#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
331#[serde(rename_all = "camelCase")]
332pub struct AccountStrike<'a> {
333 #[serde(skip_serializing_if = "Option::is_none")]
335 pub active_strike_count: Option<i64>,
336 #[serde(skip_serializing_if = "Option::is_none")]
338 pub first_strike_at: Option<Datetime>,
339 #[serde(skip_serializing_if = "Option::is_none")]
341 pub last_strike_at: Option<Datetime>,
342 #[serde(skip_serializing_if = "Option::is_none")]
344 pub total_strike_count: Option<i64>,
345}
346
347#[lexicon]
350#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
351#[serde(rename_all = "camelCase")]
352pub struct AgeAssuranceEvent<'a> {
353 #[serde(skip_serializing_if = "Option::is_none")]
354 #[serde(borrow)]
355 pub access: Option<Access<'a>>,
356 #[serde(borrow)]
358 pub attempt_id: CowStr<'a>,
359 #[serde(skip_serializing_if = "Option::is_none")]
361 #[serde(borrow)]
362 pub complete_ip: Option<CowStr<'a>>,
363 #[serde(skip_serializing_if = "Option::is_none")]
365 #[serde(borrow)]
366 pub complete_ua: Option<CowStr<'a>>,
367 #[serde(skip_serializing_if = "Option::is_none")]
369 #[serde(borrow)]
370 pub country_code: Option<CowStr<'a>>,
371 pub created_at: Datetime,
373 #[serde(skip_serializing_if = "Option::is_none")]
375 #[serde(borrow)]
376 pub init_ip: Option<CowStr<'a>>,
377 #[serde(skip_serializing_if = "Option::is_none")]
379 #[serde(borrow)]
380 pub init_ua: Option<CowStr<'a>>,
381 #[serde(skip_serializing_if = "Option::is_none")]
383 #[serde(borrow)]
384 pub region_code: Option<CowStr<'a>>,
385 #[serde(borrow)]
387 pub status: AgeAssuranceEventStatus<'a>,
388}
389
390#[derive(Debug, Clone, PartialEq, Eq, Hash)]
393pub enum AgeAssuranceEventStatus<'a> {
394 Unknown,
395 Pending,
396 Assured,
397 Other(CowStr<'a>),
398}
399
400impl<'a> AgeAssuranceEventStatus<'a> {
401 pub fn as_str(&self) -> &str {
402 match self {
403 Self::Unknown => "unknown",
404 Self::Pending => "pending",
405 Self::Assured => "assured",
406 Self::Other(s) => s.as_ref(),
407 }
408 }
409}
410
411impl<'a> From<&'a str> for AgeAssuranceEventStatus<'a> {
412 fn from(s: &'a str) -> Self {
413 match s {
414 "unknown" => Self::Unknown,
415 "pending" => Self::Pending,
416 "assured" => Self::Assured,
417 _ => Self::Other(CowStr::from(s)),
418 }
419 }
420}
421
422impl<'a> From<String> for AgeAssuranceEventStatus<'a> {
423 fn from(s: String) -> Self {
424 match s.as_str() {
425 "unknown" => Self::Unknown,
426 "pending" => Self::Pending,
427 "assured" => Self::Assured,
428 _ => Self::Other(CowStr::from(s)),
429 }
430 }
431}
432
433impl<'a> core::fmt::Display for AgeAssuranceEventStatus<'a> {
434 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
435 write!(f, "{}", self.as_str())
436 }
437}
438
439impl<'a> AsRef<str> for AgeAssuranceEventStatus<'a> {
440 fn as_ref(&self) -> &str {
441 self.as_str()
442 }
443}
444
445impl<'a> serde::Serialize for AgeAssuranceEventStatus<'a> {
446 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
447 where
448 S: serde::Serializer,
449 {
450 serializer.serialize_str(self.as_str())
451 }
452}
453
454impl<'de, 'a> serde::Deserialize<'de> for AgeAssuranceEventStatus<'a>
455where
456 'de: 'a,
457{
458 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
459 where
460 D: serde::Deserializer<'de>,
461 {
462 let s = <&'de str>::deserialize(deserializer)?;
463 Ok(Self::from(s))
464 }
465}
466
467impl<'a> Default for AgeAssuranceEventStatus<'a> {
468 fn default() -> Self {
469 Self::Other(Default::default())
470 }
471}
472
473impl jacquard_common::IntoStatic for AgeAssuranceEventStatus<'_> {
474 type Output = AgeAssuranceEventStatus<'static>;
475 fn into_static(self) -> Self::Output {
476 match self {
477 AgeAssuranceEventStatus::Unknown => AgeAssuranceEventStatus::Unknown,
478 AgeAssuranceEventStatus::Pending => AgeAssuranceEventStatus::Pending,
479 AgeAssuranceEventStatus::Assured => AgeAssuranceEventStatus::Assured,
480 AgeAssuranceEventStatus::Other(v) => {
481 AgeAssuranceEventStatus::Other(v.into_static())
482 }
483 }
484 }
485}
486
487#[lexicon]
490#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
491#[serde(rename_all = "camelCase")]
492pub struct AgeAssuranceOverrideEvent<'a> {
493 #[serde(skip_serializing_if = "Option::is_none")]
494 #[serde(borrow)]
495 pub access: Option<Access<'a>>,
496 #[serde(borrow)]
498 pub comment: CowStr<'a>,
499 #[serde(borrow)]
501 pub status: AgeAssuranceOverrideEventStatus<'a>,
502}
503
504#[derive(Debug, Clone, PartialEq, Eq, Hash)]
507pub enum AgeAssuranceOverrideEventStatus<'a> {
508 Assured,
509 Reset,
510 Blocked,
511 Other(CowStr<'a>),
512}
513
514impl<'a> AgeAssuranceOverrideEventStatus<'a> {
515 pub fn as_str(&self) -> &str {
516 match self {
517 Self::Assured => "assured",
518 Self::Reset => "reset",
519 Self::Blocked => "blocked",
520 Self::Other(s) => s.as_ref(),
521 }
522 }
523}
524
525impl<'a> From<&'a str> for AgeAssuranceOverrideEventStatus<'a> {
526 fn from(s: &'a str) -> Self {
527 match s {
528 "assured" => Self::Assured,
529 "reset" => Self::Reset,
530 "blocked" => Self::Blocked,
531 _ => Self::Other(CowStr::from(s)),
532 }
533 }
534}
535
536impl<'a> From<String> for AgeAssuranceOverrideEventStatus<'a> {
537 fn from(s: String) -> Self {
538 match s.as_str() {
539 "assured" => Self::Assured,
540 "reset" => Self::Reset,
541 "blocked" => Self::Blocked,
542 _ => Self::Other(CowStr::from(s)),
543 }
544 }
545}
546
547impl<'a> core::fmt::Display for AgeAssuranceOverrideEventStatus<'a> {
548 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
549 write!(f, "{}", self.as_str())
550 }
551}
552
553impl<'a> AsRef<str> for AgeAssuranceOverrideEventStatus<'a> {
554 fn as_ref(&self) -> &str {
555 self.as_str()
556 }
557}
558
559impl<'a> serde::Serialize for AgeAssuranceOverrideEventStatus<'a> {
560 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
561 where
562 S: serde::Serializer,
563 {
564 serializer.serialize_str(self.as_str())
565 }
566}
567
568impl<'de, 'a> serde::Deserialize<'de> for AgeAssuranceOverrideEventStatus<'a>
569where
570 'de: 'a,
571{
572 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
573 where
574 D: serde::Deserializer<'de>,
575 {
576 let s = <&'de str>::deserialize(deserializer)?;
577 Ok(Self::from(s))
578 }
579}
580
581impl<'a> Default for AgeAssuranceOverrideEventStatus<'a> {
582 fn default() -> Self {
583 Self::Other(Default::default())
584 }
585}
586
587impl jacquard_common::IntoStatic for AgeAssuranceOverrideEventStatus<'_> {
588 type Output = AgeAssuranceOverrideEventStatus<'static>;
589 fn into_static(self) -> Self::Output {
590 match self {
591 AgeAssuranceOverrideEventStatus::Assured => {
592 AgeAssuranceOverrideEventStatus::Assured
593 }
594 AgeAssuranceOverrideEventStatus::Reset => {
595 AgeAssuranceOverrideEventStatus::Reset
596 }
597 AgeAssuranceOverrideEventStatus::Blocked => {
598 AgeAssuranceOverrideEventStatus::Blocked
599 }
600 AgeAssuranceOverrideEventStatus::Other(v) => {
601 AgeAssuranceOverrideEventStatus::Other(v.into_static())
602 }
603 }
604 }
605}
606
607#[lexicon]
610#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
611#[serde(rename_all = "camelCase")]
612pub struct AgeAssurancePurgeEvent<'a> {
613 #[serde(borrow)]
615 pub comment: CowStr<'a>,
616}
617
618
619#[lexicon]
620#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
621#[serde(rename_all = "camelCase")]
622pub struct BlobView<'a> {
623 #[serde(borrow)]
624 pub cid: Cid<'a>,
625 pub created_at: Datetime,
626 #[serde(skip_serializing_if = "Option::is_none")]
627 #[serde(borrow)]
628 pub details: Option<BlobViewDetails<'a>>,
629 #[serde(borrow)]
630 pub mime_type: CowStr<'a>,
631 #[serde(skip_serializing_if = "Option::is_none")]
632 #[serde(borrow)]
633 pub moderation: Option<moderation::Moderation<'a>>,
634 pub size: i64,
635}
636
637
638#[open_union]
639#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
640#[serde(tag = "$type", bound(deserialize = "'de: 'a"))]
641pub enum BlobViewDetails<'a> {
642 #[serde(rename = "tools.ozone.moderation.defs#imageDetails")]
643 ImageDetails(Box<moderation::ImageDetails<'a>>),
644 #[serde(rename = "tools.ozone.moderation.defs#videoDetails")]
645 VideoDetails(Box<moderation::VideoDetails<'a>>),
646}
647
648#[lexicon]
651#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
652#[serde(rename_all = "camelCase")]
653pub struct CancelScheduledTakedownEvent<'a> {
654 #[serde(skip_serializing_if = "Option::is_none")]
655 #[serde(borrow)]
656 pub comment: Option<CowStr<'a>>,
657}
658
659#[lexicon]
662#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
663#[serde(rename_all = "camelCase")]
664pub struct IdentityEvent<'a> {
665 #[serde(skip_serializing_if = "Option::is_none")]
666 #[serde(borrow)]
667 pub comment: Option<CowStr<'a>>,
668 #[serde(skip_serializing_if = "Option::is_none")]
669 #[serde(borrow)]
670 pub handle: Option<Handle<'a>>,
671 #[serde(skip_serializing_if = "Option::is_none")]
672 #[serde(borrow)]
673 pub pds_host: Option<UriValue<'a>>,
674 pub timestamp: Datetime,
675 #[serde(skip_serializing_if = "Option::is_none")]
676 pub tombstone: Option<bool>,
677}
678
679
680#[lexicon]
681#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
682#[serde(rename_all = "camelCase")]
683pub struct ImageDetails<'a> {
684 pub height: i64,
685 pub width: i64,
686}
687
688
689#[lexicon]
690#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
691#[serde(rename_all = "camelCase")]
692pub struct ModEventAcknowledge<'a> {
693 #[serde(skip_serializing_if = "Option::is_none")]
695 pub acknowledge_account_subjects: Option<bool>,
696 #[serde(skip_serializing_if = "Option::is_none")]
697 #[serde(borrow)]
698 pub comment: Option<CowStr<'a>>,
699}
700
701#[lexicon]
704#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
705#[serde(rename_all = "camelCase")]
706pub struct ModEventComment<'a> {
707 #[serde(skip_serializing_if = "Option::is_none")]
708 #[serde(borrow)]
709 pub comment: Option<CowStr<'a>>,
710 #[serde(skip_serializing_if = "Option::is_none")]
712 pub sticky: Option<bool>,
713}
714
715#[lexicon]
718#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
719#[serde(rename_all = "camelCase")]
720pub struct ModEventDivert<'a> {
721 #[serde(skip_serializing_if = "Option::is_none")]
722 #[serde(borrow)]
723 pub comment: Option<CowStr<'a>>,
724}
725
726#[lexicon]
729#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
730#[serde(rename_all = "camelCase")]
731pub struct ModEventEmail<'a> {
732 #[serde(skip_serializing_if = "Option::is_none")]
734 #[serde(borrow)]
735 pub comment: Option<CowStr<'a>>,
736 #[serde(skip_serializing_if = "Option::is_none")]
738 #[serde(borrow)]
739 pub content: Option<CowStr<'a>>,
740 #[serde(skip_serializing_if = "Option::is_none")]
742 pub is_delivered: Option<bool>,
743 #[serde(skip_serializing_if = "Option::is_none")]
745 #[serde(borrow)]
746 pub policies: Option<Vec<CowStr<'a>>>,
747 #[serde(skip_serializing_if = "Option::is_none")]
749 #[serde(borrow)]
750 pub severity_level: Option<CowStr<'a>>,
751 #[serde(skip_serializing_if = "Option::is_none")]
753 pub strike_count: Option<i64>,
754 #[serde(skip_serializing_if = "Option::is_none")]
756 pub strike_expires_at: Option<Datetime>,
757 #[serde(borrow)]
759 pub subject_line: CowStr<'a>,
760}
761
762
763#[lexicon]
764#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
765#[serde(rename_all = "camelCase")]
766pub struct ModEventEscalate<'a> {
767 #[serde(skip_serializing_if = "Option::is_none")]
768 #[serde(borrow)]
769 pub comment: Option<CowStr<'a>>,
770}
771
772#[lexicon]
775#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
776#[serde(rename_all = "camelCase")]
777pub struct ModEventLabel<'a> {
778 #[serde(skip_serializing_if = "Option::is_none")]
779 #[serde(borrow)]
780 pub comment: Option<CowStr<'a>>,
781 #[serde(borrow)]
782 pub create_label_vals: Vec<CowStr<'a>>,
783 #[serde(skip_serializing_if = "Option::is_none")]
785 pub duration_in_hours: Option<i64>,
786 #[serde(borrow)]
787 pub negate_label_vals: Vec<CowStr<'a>>,
788}
789
790#[lexicon]
793#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
794#[serde(rename_all = "camelCase")]
795pub struct ModEventMute<'a> {
796 #[serde(skip_serializing_if = "Option::is_none")]
797 #[serde(borrow)]
798 pub comment: Option<CowStr<'a>>,
799 pub duration_in_hours: i64,
801}
802
803#[lexicon]
806#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
807#[serde(rename_all = "camelCase")]
808pub struct ModEventMuteReporter<'a> {
809 #[serde(skip_serializing_if = "Option::is_none")]
810 #[serde(borrow)]
811 pub comment: Option<CowStr<'a>>,
812 #[serde(skip_serializing_if = "Option::is_none")]
814 pub duration_in_hours: Option<i64>,
815}
816
817#[lexicon]
820#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
821#[serde(rename_all = "camelCase")]
822pub struct ModEventPriorityScore<'a> {
823 #[serde(skip_serializing_if = "Option::is_none")]
824 #[serde(borrow)]
825 pub comment: Option<CowStr<'a>>,
826 pub score: i64,
827}
828
829#[lexicon]
832#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
833#[serde(rename_all = "camelCase")]
834pub struct ModEventReport<'a> {
835 #[serde(skip_serializing_if = "Option::is_none")]
836 #[serde(borrow)]
837 pub comment: Option<CowStr<'a>>,
838 #[serde(skip_serializing_if = "Option::is_none")]
840 pub is_reporter_muted: Option<bool>,
841 #[serde(borrow)]
842 pub report_type: ReasonType<'a>,
843}
844
845#[lexicon]
848#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
849#[serde(rename_all = "camelCase")]
850pub struct ModEventResolveAppeal<'a> {
851 #[serde(skip_serializing_if = "Option::is_none")]
853 #[serde(borrow)]
854 pub comment: Option<CowStr<'a>>,
855}
856
857#[lexicon]
860#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
861#[serde(rename_all = "camelCase")]
862pub struct ModEventReverseTakedown<'a> {
863 #[serde(skip_serializing_if = "Option::is_none")]
865 #[serde(borrow)]
866 pub comment: Option<CowStr<'a>>,
867 #[serde(skip_serializing_if = "Option::is_none")]
869 #[serde(borrow)]
870 pub policies: Option<Vec<CowStr<'a>>>,
871 #[serde(skip_serializing_if = "Option::is_none")]
873 #[serde(borrow)]
874 pub severity_level: Option<CowStr<'a>>,
875 #[serde(skip_serializing_if = "Option::is_none")]
877 pub strike_count: Option<i64>,
878}
879
880#[lexicon]
883#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
884#[serde(rename_all = "camelCase")]
885pub struct ModEventTag<'a> {
886 #[serde(borrow)]
888 pub add: Vec<CowStr<'a>>,
889 #[serde(skip_serializing_if = "Option::is_none")]
891 #[serde(borrow)]
892 pub comment: Option<CowStr<'a>>,
893 #[serde(borrow)]
895 pub remove: Vec<CowStr<'a>>,
896}
897
898#[lexicon]
901#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
902#[serde(rename_all = "camelCase")]
903pub struct ModEventTakedown<'a> {
904 #[serde(skip_serializing_if = "Option::is_none")]
906 pub acknowledge_account_subjects: Option<bool>,
907 #[serde(skip_serializing_if = "Option::is_none")]
908 #[serde(borrow)]
909 pub comment: Option<CowStr<'a>>,
910 #[serde(skip_serializing_if = "Option::is_none")]
912 pub duration_in_hours: Option<i64>,
913 #[serde(skip_serializing_if = "Option::is_none")]
915 #[serde(borrow)]
916 pub policies: Option<Vec<CowStr<'a>>>,
917 #[serde(skip_serializing_if = "Option::is_none")]
919 #[serde(borrow)]
920 pub severity_level: Option<CowStr<'a>>,
921 #[serde(skip_serializing_if = "Option::is_none")]
923 pub strike_count: Option<i64>,
924 #[serde(skip_serializing_if = "Option::is_none")]
926 pub strike_expires_at: Option<Datetime>,
927 #[serde(skip_serializing_if = "Option::is_none")]
929 #[serde(borrow)]
930 pub target_services: Option<Vec<CowStr<'a>>>,
931}
932
933#[lexicon]
936#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
937#[serde(rename_all = "camelCase")]
938pub struct ModEventUnmute<'a> {
939 #[serde(skip_serializing_if = "Option::is_none")]
941 #[serde(borrow)]
942 pub comment: Option<CowStr<'a>>,
943}
944
945#[lexicon]
948#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
949#[serde(rename_all = "camelCase")]
950pub struct ModEventUnmuteReporter<'a> {
951 #[serde(skip_serializing_if = "Option::is_none")]
953 #[serde(borrow)]
954 pub comment: Option<CowStr<'a>>,
955}
956
957
958#[lexicon]
959#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
960#[serde(rename_all = "camelCase")]
961pub struct ModEventView<'a> {
962 pub created_at: Datetime,
963 #[serde(borrow)]
964 pub created_by: Did<'a>,
965 #[serde(skip_serializing_if = "Option::is_none")]
966 #[serde(borrow)]
967 pub creator_handle: Option<CowStr<'a>>,
968 #[serde(borrow)]
969 pub event: ModEventViewEvent<'a>,
970 pub id: i64,
971 #[serde(skip_serializing_if = "Option::is_none")]
972 #[serde(borrow)]
973 pub mod_tool: Option<moderation::ModTool<'a>>,
974 #[serde(borrow)]
975 pub subject: ModEventViewSubject<'a>,
976 #[serde(borrow)]
977 pub subject_blob_cids: Vec<CowStr<'a>>,
978 #[serde(skip_serializing_if = "Option::is_none")]
979 #[serde(borrow)]
980 pub subject_handle: Option<CowStr<'a>>,
981}
982
983
984#[open_union]
985#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
986#[serde(tag = "$type", bound(deserialize = "'de: 'a"))]
987pub enum ModEventViewEvent<'a> {
988 #[serde(rename = "tools.ozone.moderation.defs#modEventTakedown")]
989 ModEventTakedown(Box<moderation::ModEventTakedown<'a>>),
990 #[serde(rename = "tools.ozone.moderation.defs#modEventReverseTakedown")]
991 ModEventReverseTakedown(Box<moderation::ModEventReverseTakedown<'a>>),
992 #[serde(rename = "tools.ozone.moderation.defs#modEventComment")]
993 ModEventComment(Box<moderation::ModEventComment<'a>>),
994 #[serde(rename = "tools.ozone.moderation.defs#modEventReport")]
995 ModEventReport(Box<moderation::ModEventReport<'a>>),
996 #[serde(rename = "tools.ozone.moderation.defs#modEventLabel")]
997 ModEventLabel(Box<moderation::ModEventLabel<'a>>),
998 #[serde(rename = "tools.ozone.moderation.defs#modEventAcknowledge")]
999 ModEventAcknowledge(Box<moderation::ModEventAcknowledge<'a>>),
1000 #[serde(rename = "tools.ozone.moderation.defs#modEventEscalate")]
1001 ModEventEscalate(Box<moderation::ModEventEscalate<'a>>),
1002 #[serde(rename = "tools.ozone.moderation.defs#modEventMute")]
1003 ModEventMute(Box<moderation::ModEventMute<'a>>),
1004 #[serde(rename = "tools.ozone.moderation.defs#modEventUnmute")]
1005 ModEventUnmute(Box<moderation::ModEventUnmute<'a>>),
1006 #[serde(rename = "tools.ozone.moderation.defs#modEventMuteReporter")]
1007 ModEventMuteReporter(Box<moderation::ModEventMuteReporter<'a>>),
1008 #[serde(rename = "tools.ozone.moderation.defs#modEventUnmuteReporter")]
1009 ModEventUnmuteReporter(Box<moderation::ModEventUnmuteReporter<'a>>),
1010 #[serde(rename = "tools.ozone.moderation.defs#modEventEmail")]
1011 ModEventEmail(Box<moderation::ModEventEmail<'a>>),
1012 #[serde(rename = "tools.ozone.moderation.defs#modEventResolveAppeal")]
1013 ModEventResolveAppeal(Box<moderation::ModEventResolveAppeal<'a>>),
1014 #[serde(rename = "tools.ozone.moderation.defs#modEventDivert")]
1015 ModEventDivert(Box<moderation::ModEventDivert<'a>>),
1016 #[serde(rename = "tools.ozone.moderation.defs#modEventTag")]
1017 ModEventTag(Box<moderation::ModEventTag<'a>>),
1018 #[serde(rename = "tools.ozone.moderation.defs#accountEvent")]
1019 AccountEvent(Box<moderation::AccountEvent<'a>>),
1020 #[serde(rename = "tools.ozone.moderation.defs#identityEvent")]
1021 IdentityEvent(Box<moderation::IdentityEvent<'a>>),
1022 #[serde(rename = "tools.ozone.moderation.defs#recordEvent")]
1023 RecordEvent(Box<moderation::RecordEvent<'a>>),
1024 #[serde(rename = "tools.ozone.moderation.defs#modEventPriorityScore")]
1025 ModEventPriorityScore(Box<moderation::ModEventPriorityScore<'a>>),
1026 #[serde(rename = "tools.ozone.moderation.defs#ageAssuranceEvent")]
1027 AgeAssuranceEvent(Box<moderation::AgeAssuranceEvent<'a>>),
1028 #[serde(rename = "tools.ozone.moderation.defs#ageAssuranceOverrideEvent")]
1029 AgeAssuranceOverrideEvent(Box<moderation::AgeAssuranceOverrideEvent<'a>>),
1030 #[serde(rename = "tools.ozone.moderation.defs#ageAssurancePurgeEvent")]
1031 AgeAssurancePurgeEvent(Box<moderation::AgeAssurancePurgeEvent<'a>>),
1032 #[serde(rename = "tools.ozone.moderation.defs#revokeAccountCredentialsEvent")]
1033 RevokeAccountCredentialsEvent(Box<moderation::RevokeAccountCredentialsEvent<'a>>),
1034 #[serde(rename = "tools.ozone.moderation.defs#scheduleTakedownEvent")]
1035 ScheduleTakedownEvent(Box<moderation::ScheduleTakedownEvent<'a>>),
1036 #[serde(rename = "tools.ozone.moderation.defs#cancelScheduledTakedownEvent")]
1037 CancelScheduledTakedownEvent(Box<moderation::CancelScheduledTakedownEvent<'a>>),
1038}
1039
1040
1041#[open_union]
1042#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
1043#[serde(tag = "$type", bound(deserialize = "'de: 'a"))]
1044pub enum ModEventViewSubject<'a> {
1045 #[serde(rename = "com.atproto.admin.defs#repoRef")]
1046 RepoRef(Box<RepoRef<'a>>),
1047 #[serde(rename = "com.atproto.repo.strongRef")]
1048 StrongRef(Box<StrongRef<'a>>),
1049 #[serde(rename = "chat.bsky.convo.defs#messageRef")]
1050 MessageRef(Box<MessageRef<'a>>),
1051}
1052
1053
1054#[lexicon]
1055#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
1056#[serde(rename_all = "camelCase")]
1057pub struct ModEventViewDetail<'a> {
1058 pub created_at: Datetime,
1059 #[serde(borrow)]
1060 pub created_by: Did<'a>,
1061 #[serde(borrow)]
1062 pub event: ModEventViewDetailEvent<'a>,
1063 pub id: i64,
1064 #[serde(skip_serializing_if = "Option::is_none")]
1065 #[serde(borrow)]
1066 pub mod_tool: Option<moderation::ModTool<'a>>,
1067 #[serde(borrow)]
1068 pub subject: ModEventViewDetailSubject<'a>,
1069 #[serde(borrow)]
1070 pub subject_blobs: Vec<moderation::BlobView<'a>>,
1071}
1072
1073
1074#[open_union]
1075#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
1076#[serde(tag = "$type", bound(deserialize = "'de: 'a"))]
1077pub enum ModEventViewDetailEvent<'a> {
1078 #[serde(rename = "tools.ozone.moderation.defs#modEventTakedown")]
1079 ModEventTakedown(Box<moderation::ModEventTakedown<'a>>),
1080 #[serde(rename = "tools.ozone.moderation.defs#modEventReverseTakedown")]
1081 ModEventReverseTakedown(Box<moderation::ModEventReverseTakedown<'a>>),
1082 #[serde(rename = "tools.ozone.moderation.defs#modEventComment")]
1083 ModEventComment(Box<moderation::ModEventComment<'a>>),
1084 #[serde(rename = "tools.ozone.moderation.defs#modEventReport")]
1085 ModEventReport(Box<moderation::ModEventReport<'a>>),
1086 #[serde(rename = "tools.ozone.moderation.defs#modEventLabel")]
1087 ModEventLabel(Box<moderation::ModEventLabel<'a>>),
1088 #[serde(rename = "tools.ozone.moderation.defs#modEventAcknowledge")]
1089 ModEventAcknowledge(Box<moderation::ModEventAcknowledge<'a>>),
1090 #[serde(rename = "tools.ozone.moderation.defs#modEventEscalate")]
1091 ModEventEscalate(Box<moderation::ModEventEscalate<'a>>),
1092 #[serde(rename = "tools.ozone.moderation.defs#modEventMute")]
1093 ModEventMute(Box<moderation::ModEventMute<'a>>),
1094 #[serde(rename = "tools.ozone.moderation.defs#modEventUnmute")]
1095 ModEventUnmute(Box<moderation::ModEventUnmute<'a>>),
1096 #[serde(rename = "tools.ozone.moderation.defs#modEventMuteReporter")]
1097 ModEventMuteReporter(Box<moderation::ModEventMuteReporter<'a>>),
1098 #[serde(rename = "tools.ozone.moderation.defs#modEventUnmuteReporter")]
1099 ModEventUnmuteReporter(Box<moderation::ModEventUnmuteReporter<'a>>),
1100 #[serde(rename = "tools.ozone.moderation.defs#modEventEmail")]
1101 ModEventEmail(Box<moderation::ModEventEmail<'a>>),
1102 #[serde(rename = "tools.ozone.moderation.defs#modEventResolveAppeal")]
1103 ModEventResolveAppeal(Box<moderation::ModEventResolveAppeal<'a>>),
1104 #[serde(rename = "tools.ozone.moderation.defs#modEventDivert")]
1105 ModEventDivert(Box<moderation::ModEventDivert<'a>>),
1106 #[serde(rename = "tools.ozone.moderation.defs#modEventTag")]
1107 ModEventTag(Box<moderation::ModEventTag<'a>>),
1108 #[serde(rename = "tools.ozone.moderation.defs#accountEvent")]
1109 AccountEvent(Box<moderation::AccountEvent<'a>>),
1110 #[serde(rename = "tools.ozone.moderation.defs#identityEvent")]
1111 IdentityEvent(Box<moderation::IdentityEvent<'a>>),
1112 #[serde(rename = "tools.ozone.moderation.defs#recordEvent")]
1113 RecordEvent(Box<moderation::RecordEvent<'a>>),
1114 #[serde(rename = "tools.ozone.moderation.defs#modEventPriorityScore")]
1115 ModEventPriorityScore(Box<moderation::ModEventPriorityScore<'a>>),
1116 #[serde(rename = "tools.ozone.moderation.defs#ageAssuranceEvent")]
1117 AgeAssuranceEvent(Box<moderation::AgeAssuranceEvent<'a>>),
1118 #[serde(rename = "tools.ozone.moderation.defs#ageAssuranceOverrideEvent")]
1119 AgeAssuranceOverrideEvent(Box<moderation::AgeAssuranceOverrideEvent<'a>>),
1120 #[serde(rename = "tools.ozone.moderation.defs#ageAssurancePurgeEvent")]
1121 AgeAssurancePurgeEvent(Box<moderation::AgeAssurancePurgeEvent<'a>>),
1122 #[serde(rename = "tools.ozone.moderation.defs#revokeAccountCredentialsEvent")]
1123 RevokeAccountCredentialsEvent(Box<moderation::RevokeAccountCredentialsEvent<'a>>),
1124 #[serde(rename = "tools.ozone.moderation.defs#scheduleTakedownEvent")]
1125 ScheduleTakedownEvent(Box<moderation::ScheduleTakedownEvent<'a>>),
1126 #[serde(rename = "tools.ozone.moderation.defs#cancelScheduledTakedownEvent")]
1127 CancelScheduledTakedownEvent(Box<moderation::CancelScheduledTakedownEvent<'a>>),
1128}
1129
1130
1131#[open_union]
1132#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
1133#[serde(tag = "$type", bound(deserialize = "'de: 'a"))]
1134pub enum ModEventViewDetailSubject<'a> {
1135 #[serde(rename = "tools.ozone.moderation.defs#repoView")]
1136 RepoView(Box<moderation::RepoView<'a>>),
1137 #[serde(rename = "tools.ozone.moderation.defs#repoViewNotFound")]
1138 RepoViewNotFound(Box<moderation::RepoViewNotFound<'a>>),
1139 #[serde(rename = "tools.ozone.moderation.defs#recordView")]
1140 RecordView(Box<moderation::RecordView<'a>>),
1141 #[serde(rename = "tools.ozone.moderation.defs#recordViewNotFound")]
1142 RecordViewNotFound(Box<moderation::RecordViewNotFound<'a>>),
1143}
1144
1145#[lexicon]
1148#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
1149#[serde(rename_all = "camelCase")]
1150pub struct ModTool<'a> {
1151 #[serde(skip_serializing_if = "Option::is_none")]
1153 #[serde(borrow)]
1154 pub meta: Option<Data<'a>>,
1155 #[serde(borrow)]
1157 pub name: CowStr<'a>,
1158}
1159
1160
1161#[lexicon]
1162#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
1163#[serde(rename_all = "camelCase")]
1164pub struct Moderation<'a> {
1165 #[serde(skip_serializing_if = "Option::is_none")]
1166 #[serde(borrow)]
1167 pub subject_status: Option<moderation::SubjectStatusView<'a>>,
1168}
1169
1170
1171#[lexicon]
1172#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
1173#[serde(rename_all = "camelCase")]
1174pub struct ModerationDetail<'a> {
1175 #[serde(skip_serializing_if = "Option::is_none")]
1176 #[serde(borrow)]
1177 pub subject_status: Option<moderation::SubjectStatusView<'a>>,
1178}
1179
1180#[lexicon]
1183#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
1184#[serde(rename_all = "camelCase")]
1185pub struct RecordEvent<'a> {
1186 #[serde(skip_serializing_if = "Option::is_none")]
1187 #[serde(borrow)]
1188 pub cid: Option<Cid<'a>>,
1189 #[serde(skip_serializing_if = "Option::is_none")]
1190 #[serde(borrow)]
1191 pub comment: Option<CowStr<'a>>,
1192 #[serde(borrow)]
1193 pub op: RecordEventOp<'a>,
1194 pub timestamp: Datetime,
1195}
1196
1197
1198#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1199pub enum RecordEventOp<'a> {
1200 Create,
1201 Update,
1202 Delete,
1203 Other(CowStr<'a>),
1204}
1205
1206impl<'a> RecordEventOp<'a> {
1207 pub fn as_str(&self) -> &str {
1208 match self {
1209 Self::Create => "create",
1210 Self::Update => "update",
1211 Self::Delete => "delete",
1212 Self::Other(s) => s.as_ref(),
1213 }
1214 }
1215}
1216
1217impl<'a> From<&'a str> for RecordEventOp<'a> {
1218 fn from(s: &'a str) -> Self {
1219 match s {
1220 "create" => Self::Create,
1221 "update" => Self::Update,
1222 "delete" => Self::Delete,
1223 _ => Self::Other(CowStr::from(s)),
1224 }
1225 }
1226}
1227
1228impl<'a> From<String> for RecordEventOp<'a> {
1229 fn from(s: String) -> Self {
1230 match s.as_str() {
1231 "create" => Self::Create,
1232 "update" => Self::Update,
1233 "delete" => Self::Delete,
1234 _ => Self::Other(CowStr::from(s)),
1235 }
1236 }
1237}
1238
1239impl<'a> core::fmt::Display for RecordEventOp<'a> {
1240 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1241 write!(f, "{}", self.as_str())
1242 }
1243}
1244
1245impl<'a> AsRef<str> for RecordEventOp<'a> {
1246 fn as_ref(&self) -> &str {
1247 self.as_str()
1248 }
1249}
1250
1251impl<'a> serde::Serialize for RecordEventOp<'a> {
1252 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1253 where
1254 S: serde::Serializer,
1255 {
1256 serializer.serialize_str(self.as_str())
1257 }
1258}
1259
1260impl<'de, 'a> serde::Deserialize<'de> for RecordEventOp<'a>
1261where
1262 'de: 'a,
1263{
1264 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1265 where
1266 D: serde::Deserializer<'de>,
1267 {
1268 let s = <&'de str>::deserialize(deserializer)?;
1269 Ok(Self::from(s))
1270 }
1271}
1272
1273impl<'a> Default for RecordEventOp<'a> {
1274 fn default() -> Self {
1275 Self::Other(Default::default())
1276 }
1277}
1278
1279impl jacquard_common::IntoStatic for RecordEventOp<'_> {
1280 type Output = RecordEventOp<'static>;
1281 fn into_static(self) -> Self::Output {
1282 match self {
1283 RecordEventOp::Create => RecordEventOp::Create,
1284 RecordEventOp::Update => RecordEventOp::Update,
1285 RecordEventOp::Delete => RecordEventOp::Delete,
1286 RecordEventOp::Other(v) => RecordEventOp::Other(v.into_static()),
1287 }
1288 }
1289}
1290
1291
1292#[lexicon]
1293#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
1294#[serde(rename_all = "camelCase")]
1295pub struct RecordHosting<'a> {
1296 #[serde(skip_serializing_if = "Option::is_none")]
1297 pub created_at: Option<Datetime>,
1298 #[serde(skip_serializing_if = "Option::is_none")]
1299 pub deleted_at: Option<Datetime>,
1300 #[serde(borrow)]
1301 pub status: RecordHostingStatus<'a>,
1302 #[serde(skip_serializing_if = "Option::is_none")]
1303 pub updated_at: Option<Datetime>,
1304}
1305
1306
1307#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1308pub enum RecordHostingStatus<'a> {
1309 Deleted,
1310 Unknown,
1311 Other(CowStr<'a>),
1312}
1313
1314impl<'a> RecordHostingStatus<'a> {
1315 pub fn as_str(&self) -> &str {
1316 match self {
1317 Self::Deleted => "deleted",
1318 Self::Unknown => "unknown",
1319 Self::Other(s) => s.as_ref(),
1320 }
1321 }
1322}
1323
1324impl<'a> From<&'a str> for RecordHostingStatus<'a> {
1325 fn from(s: &'a str) -> Self {
1326 match s {
1327 "deleted" => Self::Deleted,
1328 "unknown" => Self::Unknown,
1329 _ => Self::Other(CowStr::from(s)),
1330 }
1331 }
1332}
1333
1334impl<'a> From<String> for RecordHostingStatus<'a> {
1335 fn from(s: String) -> Self {
1336 match s.as_str() {
1337 "deleted" => Self::Deleted,
1338 "unknown" => Self::Unknown,
1339 _ => Self::Other(CowStr::from(s)),
1340 }
1341 }
1342}
1343
1344impl<'a> core::fmt::Display for RecordHostingStatus<'a> {
1345 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1346 write!(f, "{}", self.as_str())
1347 }
1348}
1349
1350impl<'a> AsRef<str> for RecordHostingStatus<'a> {
1351 fn as_ref(&self) -> &str {
1352 self.as_str()
1353 }
1354}
1355
1356impl<'a> serde::Serialize for RecordHostingStatus<'a> {
1357 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1358 where
1359 S: serde::Serializer,
1360 {
1361 serializer.serialize_str(self.as_str())
1362 }
1363}
1364
1365impl<'de, 'a> serde::Deserialize<'de> for RecordHostingStatus<'a>
1366where
1367 'de: 'a,
1368{
1369 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1370 where
1371 D: serde::Deserializer<'de>,
1372 {
1373 let s = <&'de str>::deserialize(deserializer)?;
1374 Ok(Self::from(s))
1375 }
1376}
1377
1378impl<'a> Default for RecordHostingStatus<'a> {
1379 fn default() -> Self {
1380 Self::Other(Default::default())
1381 }
1382}
1383
1384impl jacquard_common::IntoStatic for RecordHostingStatus<'_> {
1385 type Output = RecordHostingStatus<'static>;
1386 fn into_static(self) -> Self::Output {
1387 match self {
1388 RecordHostingStatus::Deleted => RecordHostingStatus::Deleted,
1389 RecordHostingStatus::Unknown => RecordHostingStatus::Unknown,
1390 RecordHostingStatus::Other(v) => RecordHostingStatus::Other(v.into_static()),
1391 }
1392 }
1393}
1394
1395
1396#[lexicon]
1397#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
1398#[serde(rename_all = "camelCase")]
1399pub struct RecordView<'a> {
1400 #[serde(borrow)]
1401 pub blob_cids: Vec<Cid<'a>>,
1402 #[serde(borrow)]
1403 pub cid: Cid<'a>,
1404 pub indexed_at: Datetime,
1405 #[serde(borrow)]
1406 pub moderation: moderation::Moderation<'a>,
1407 #[serde(borrow)]
1408 pub repo: moderation::RepoView<'a>,
1409 #[serde(borrow)]
1410 pub uri: AtUri<'a>,
1411 #[serde(borrow)]
1412 pub value: Data<'a>,
1413}
1414
1415
1416#[lexicon]
1417#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
1418#[serde(rename_all = "camelCase")]
1419pub struct RecordViewDetail<'a> {
1420 #[serde(borrow)]
1421 pub blobs: Vec<moderation::BlobView<'a>>,
1422 #[serde(borrow)]
1423 pub cid: Cid<'a>,
1424 pub indexed_at: Datetime,
1425 #[serde(skip_serializing_if = "Option::is_none")]
1426 #[serde(borrow)]
1427 pub labels: Option<Vec<Label<'a>>>,
1428 #[serde(borrow)]
1429 pub moderation: moderation::ModerationDetail<'a>,
1430 #[serde(borrow)]
1431 pub repo: moderation::RepoView<'a>,
1432 #[serde(borrow)]
1433 pub uri: AtUri<'a>,
1434 #[serde(borrow)]
1435 pub value: Data<'a>,
1436}
1437
1438
1439#[lexicon]
1440#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
1441#[serde(rename_all = "camelCase")]
1442pub struct RecordViewNotFound<'a> {
1443 #[serde(borrow)]
1444 pub uri: AtUri<'a>,
1445}
1446
1447#[lexicon]
1450#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
1451#[serde(rename_all = "camelCase")]
1452pub struct RecordsStats<'a> {
1453 #[serde(skip_serializing_if = "Option::is_none")]
1455 pub appealed_count: Option<i64>,
1456 #[serde(skip_serializing_if = "Option::is_none")]
1458 pub escalated_count: Option<i64>,
1459 #[serde(skip_serializing_if = "Option::is_none")]
1461 pub pending_count: Option<i64>,
1462 #[serde(skip_serializing_if = "Option::is_none")]
1464 pub processed_count: Option<i64>,
1465 #[serde(skip_serializing_if = "Option::is_none")]
1467 pub reported_count: Option<i64>,
1468 #[serde(skip_serializing_if = "Option::is_none")]
1470 pub subject_count: Option<i64>,
1471 #[serde(skip_serializing_if = "Option::is_none")]
1473 pub takendown_count: Option<i64>,
1474 #[serde(skip_serializing_if = "Option::is_none")]
1476 pub total_reports: Option<i64>,
1477}
1478
1479
1480#[lexicon]
1481#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
1482#[serde(rename_all = "camelCase")]
1483pub struct RepoView<'a> {
1484 #[serde(skip_serializing_if = "Option::is_none")]
1485 pub deactivated_at: Option<Datetime>,
1486 #[serde(borrow)]
1487 pub did: Did<'a>,
1488 #[serde(skip_serializing_if = "Option::is_none")]
1489 #[serde(borrow)]
1490 pub email: Option<CowStr<'a>>,
1491 #[serde(borrow)]
1492 pub handle: Handle<'a>,
1493 pub indexed_at: Datetime,
1494 #[serde(skip_serializing_if = "Option::is_none")]
1495 #[serde(borrow)]
1496 pub invite_note: Option<CowStr<'a>>,
1497 #[serde(skip_serializing_if = "Option::is_none")]
1498 #[serde(borrow)]
1499 pub invited_by: Option<InviteCode<'a>>,
1500 #[serde(skip_serializing_if = "Option::is_none")]
1501 pub invites_disabled: Option<bool>,
1502 #[serde(borrow)]
1503 pub moderation: moderation::Moderation<'a>,
1504 #[serde(borrow)]
1505 pub related_records: Vec<Data<'a>>,
1506 #[serde(skip_serializing_if = "Option::is_none")]
1507 #[serde(borrow)]
1508 pub threat_signatures: Option<Vec<ThreatSignature<'a>>>,
1509}
1510
1511
1512#[lexicon]
1513#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
1514#[serde(rename_all = "camelCase")]
1515pub struct RepoViewDetail<'a> {
1516 #[serde(skip_serializing_if = "Option::is_none")]
1517 pub deactivated_at: Option<Datetime>,
1518 #[serde(borrow)]
1519 pub did: Did<'a>,
1520 #[serde(skip_serializing_if = "Option::is_none")]
1521 #[serde(borrow)]
1522 pub email: Option<CowStr<'a>>,
1523 #[serde(skip_serializing_if = "Option::is_none")]
1524 pub email_confirmed_at: Option<Datetime>,
1525 #[serde(borrow)]
1526 pub handle: Handle<'a>,
1527 pub indexed_at: Datetime,
1528 #[serde(skip_serializing_if = "Option::is_none")]
1529 #[serde(borrow)]
1530 pub invite_note: Option<CowStr<'a>>,
1531 #[serde(skip_serializing_if = "Option::is_none")]
1532 #[serde(borrow)]
1533 pub invited_by: Option<InviteCode<'a>>,
1534 #[serde(skip_serializing_if = "Option::is_none")]
1535 #[serde(borrow)]
1536 pub invites: Option<Vec<InviteCode<'a>>>,
1537 #[serde(skip_serializing_if = "Option::is_none")]
1538 pub invites_disabled: Option<bool>,
1539 #[serde(skip_serializing_if = "Option::is_none")]
1540 #[serde(borrow)]
1541 pub labels: Option<Vec<Label<'a>>>,
1542 #[serde(borrow)]
1543 pub moderation: moderation::ModerationDetail<'a>,
1544 #[serde(borrow)]
1545 pub related_records: Vec<Data<'a>>,
1546 #[serde(skip_serializing_if = "Option::is_none")]
1547 #[serde(borrow)]
1548 pub threat_signatures: Option<Vec<ThreatSignature<'a>>>,
1549}
1550
1551
1552#[lexicon]
1553#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
1554#[serde(rename_all = "camelCase")]
1555pub struct RepoViewNotFound<'a> {
1556 #[serde(borrow)]
1557 pub did: Did<'a>,
1558}
1559
1560
1561#[lexicon]
1562#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
1563#[serde(rename_all = "camelCase")]
1564pub struct ReporterStats<'a> {
1565 pub account_report_count: i64,
1567 #[serde(borrow)]
1568 pub did: Did<'a>,
1569 pub labeled_account_count: i64,
1571 pub labeled_record_count: i64,
1573 pub record_report_count: i64,
1575 pub reported_account_count: i64,
1577 pub reported_record_count: i64,
1579 pub takendown_account_count: i64,
1581 pub takendown_record_count: i64,
1583}
1584
1585#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
1588pub struct ReviewClosed;
1589impl core::fmt::Display for ReviewClosed {
1590 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1591 write!(f, "reviewClosed")
1592 }
1593}
1594
1595#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
1598pub struct ReviewEscalated;
1599impl core::fmt::Display for ReviewEscalated {
1600 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1601 write!(f, "reviewEscalated")
1602 }
1603}
1604
1605#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
1608pub struct ReviewNone;
1609impl core::fmt::Display for ReviewNone {
1610 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1611 write!(f, "reviewNone")
1612 }
1613}
1614
1615#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
1618pub struct ReviewOpen;
1619impl core::fmt::Display for ReviewOpen {
1620 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1621 write!(f, "reviewOpen")
1622 }
1623}
1624
1625#[lexicon]
1628#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
1629#[serde(rename_all = "camelCase")]
1630pub struct RevokeAccountCredentialsEvent<'a> {
1631 #[serde(borrow)]
1633 pub comment: CowStr<'a>,
1634}
1635
1636#[lexicon]
1639#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
1640#[serde(rename_all = "camelCase")]
1641pub struct ScheduleTakedownEvent<'a> {
1642 #[serde(skip_serializing_if = "Option::is_none")]
1643 #[serde(borrow)]
1644 pub comment: Option<CowStr<'a>>,
1645 #[serde(skip_serializing_if = "Option::is_none")]
1646 pub execute_after: Option<Datetime>,
1647 #[serde(skip_serializing_if = "Option::is_none")]
1648 pub execute_at: Option<Datetime>,
1649 #[serde(skip_serializing_if = "Option::is_none")]
1650 pub execute_until: Option<Datetime>,
1651}
1652
1653#[lexicon]
1656#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
1657#[serde(rename_all = "camelCase")]
1658pub struct ScheduledActionView<'a> {
1659 #[serde(borrow)]
1661 pub action: ScheduledActionViewAction<'a>,
1662 pub created_at: Datetime,
1664 #[serde(borrow)]
1666 pub created_by: Did<'a>,
1667 #[serde(borrow)]
1669 pub did: Did<'a>,
1670 #[serde(skip_serializing_if = "Option::is_none")]
1672 #[serde(borrow)]
1673 pub event_data: Option<Data<'a>>,
1674 #[serde(skip_serializing_if = "Option::is_none")]
1676 pub execute_after: Option<Datetime>,
1677 #[serde(skip_serializing_if = "Option::is_none")]
1679 pub execute_at: Option<Datetime>,
1680 #[serde(skip_serializing_if = "Option::is_none")]
1682 pub execute_until: Option<Datetime>,
1683 #[serde(skip_serializing_if = "Option::is_none")]
1685 pub execution_event_id: Option<i64>,
1686 pub id: i64,
1688 #[serde(skip_serializing_if = "Option::is_none")]
1690 pub last_executed_at: Option<Datetime>,
1691 #[serde(skip_serializing_if = "Option::is_none")]
1693 #[serde(borrow)]
1694 pub last_failure_reason: Option<CowStr<'a>>,
1695 #[serde(skip_serializing_if = "Option::is_none")]
1697 pub randomize_execution: Option<bool>,
1698 #[serde(borrow)]
1700 pub status: ScheduledActionViewStatus<'a>,
1701 #[serde(skip_serializing_if = "Option::is_none")]
1703 pub updated_at: Option<Datetime>,
1704}
1705
1706#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1709pub enum ScheduledActionViewAction<'a> {
1710 Takedown,
1711 Other(CowStr<'a>),
1712}
1713
1714impl<'a> ScheduledActionViewAction<'a> {
1715 pub fn as_str(&self) -> &str {
1716 match self {
1717 Self::Takedown => "takedown",
1718 Self::Other(s) => s.as_ref(),
1719 }
1720 }
1721}
1722
1723impl<'a> From<&'a str> for ScheduledActionViewAction<'a> {
1724 fn from(s: &'a str) -> Self {
1725 match s {
1726 "takedown" => Self::Takedown,
1727 _ => Self::Other(CowStr::from(s)),
1728 }
1729 }
1730}
1731
1732impl<'a> From<String> for ScheduledActionViewAction<'a> {
1733 fn from(s: String) -> Self {
1734 match s.as_str() {
1735 "takedown" => Self::Takedown,
1736 _ => Self::Other(CowStr::from(s)),
1737 }
1738 }
1739}
1740
1741impl<'a> core::fmt::Display for ScheduledActionViewAction<'a> {
1742 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1743 write!(f, "{}", self.as_str())
1744 }
1745}
1746
1747impl<'a> AsRef<str> for ScheduledActionViewAction<'a> {
1748 fn as_ref(&self) -> &str {
1749 self.as_str()
1750 }
1751}
1752
1753impl<'a> serde::Serialize for ScheduledActionViewAction<'a> {
1754 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1755 where
1756 S: serde::Serializer,
1757 {
1758 serializer.serialize_str(self.as_str())
1759 }
1760}
1761
1762impl<'de, 'a> serde::Deserialize<'de> for ScheduledActionViewAction<'a>
1763where
1764 'de: 'a,
1765{
1766 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1767 where
1768 D: serde::Deserializer<'de>,
1769 {
1770 let s = <&'de str>::deserialize(deserializer)?;
1771 Ok(Self::from(s))
1772 }
1773}
1774
1775impl<'a> Default for ScheduledActionViewAction<'a> {
1776 fn default() -> Self {
1777 Self::Other(Default::default())
1778 }
1779}
1780
1781impl jacquard_common::IntoStatic for ScheduledActionViewAction<'_> {
1782 type Output = ScheduledActionViewAction<'static>;
1783 fn into_static(self) -> Self::Output {
1784 match self {
1785 ScheduledActionViewAction::Takedown => ScheduledActionViewAction::Takedown,
1786 ScheduledActionViewAction::Other(v) => {
1787 ScheduledActionViewAction::Other(v.into_static())
1788 }
1789 }
1790 }
1791}
1792
1793#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1796pub enum ScheduledActionViewStatus<'a> {
1797 Pending,
1798 Executed,
1799 Cancelled,
1800 Failed,
1801 Other(CowStr<'a>),
1802}
1803
1804impl<'a> ScheduledActionViewStatus<'a> {
1805 pub fn as_str(&self) -> &str {
1806 match self {
1807 Self::Pending => "pending",
1808 Self::Executed => "executed",
1809 Self::Cancelled => "cancelled",
1810 Self::Failed => "failed",
1811 Self::Other(s) => s.as_ref(),
1812 }
1813 }
1814}
1815
1816impl<'a> From<&'a str> for ScheduledActionViewStatus<'a> {
1817 fn from(s: &'a str) -> Self {
1818 match s {
1819 "pending" => Self::Pending,
1820 "executed" => Self::Executed,
1821 "cancelled" => Self::Cancelled,
1822 "failed" => Self::Failed,
1823 _ => Self::Other(CowStr::from(s)),
1824 }
1825 }
1826}
1827
1828impl<'a> From<String> for ScheduledActionViewStatus<'a> {
1829 fn from(s: String) -> Self {
1830 match s.as_str() {
1831 "pending" => Self::Pending,
1832 "executed" => Self::Executed,
1833 "cancelled" => Self::Cancelled,
1834 "failed" => Self::Failed,
1835 _ => Self::Other(CowStr::from(s)),
1836 }
1837 }
1838}
1839
1840impl<'a> core::fmt::Display for ScheduledActionViewStatus<'a> {
1841 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1842 write!(f, "{}", self.as_str())
1843 }
1844}
1845
1846impl<'a> AsRef<str> for ScheduledActionViewStatus<'a> {
1847 fn as_ref(&self) -> &str {
1848 self.as_str()
1849 }
1850}
1851
1852impl<'a> serde::Serialize for ScheduledActionViewStatus<'a> {
1853 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1854 where
1855 S: serde::Serializer,
1856 {
1857 serializer.serialize_str(self.as_str())
1858 }
1859}
1860
1861impl<'de, 'a> serde::Deserialize<'de> for ScheduledActionViewStatus<'a>
1862where
1863 'de: 'a,
1864{
1865 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1866 where
1867 D: serde::Deserializer<'de>,
1868 {
1869 let s = <&'de str>::deserialize(deserializer)?;
1870 Ok(Self::from(s))
1871 }
1872}
1873
1874impl<'a> Default for ScheduledActionViewStatus<'a> {
1875 fn default() -> Self {
1876 Self::Other(Default::default())
1877 }
1878}
1879
1880impl jacquard_common::IntoStatic for ScheduledActionViewStatus<'_> {
1881 type Output = ScheduledActionViewStatus<'static>;
1882 fn into_static(self) -> Self::Output {
1883 match self {
1884 ScheduledActionViewStatus::Pending => ScheduledActionViewStatus::Pending,
1885 ScheduledActionViewStatus::Executed => ScheduledActionViewStatus::Executed,
1886 ScheduledActionViewStatus::Cancelled => ScheduledActionViewStatus::Cancelled,
1887 ScheduledActionViewStatus::Failed => ScheduledActionViewStatus::Failed,
1888 ScheduledActionViewStatus::Other(v) => {
1889 ScheduledActionViewStatus::Other(v.into_static())
1890 }
1891 }
1892 }
1893}
1894
1895
1896#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1897pub enum SubjectReviewState<'a> {
1898 ToolsOzoneModerationDefsReviewOpen,
1899 ToolsOzoneModerationDefsReviewEscalated,
1900 ToolsOzoneModerationDefsReviewClosed,
1901 ToolsOzoneModerationDefsReviewNone,
1902 Other(CowStr<'a>),
1903}
1904
1905impl<'a> SubjectReviewState<'a> {
1906 pub fn as_str(&self) -> &str {
1907 match self {
1908 Self::ToolsOzoneModerationDefsReviewOpen => {
1909 "tools.ozone.moderation.defs#reviewOpen"
1910 }
1911 Self::ToolsOzoneModerationDefsReviewEscalated => {
1912 "tools.ozone.moderation.defs#reviewEscalated"
1913 }
1914 Self::ToolsOzoneModerationDefsReviewClosed => {
1915 "tools.ozone.moderation.defs#reviewClosed"
1916 }
1917 Self::ToolsOzoneModerationDefsReviewNone => {
1918 "tools.ozone.moderation.defs#reviewNone"
1919 }
1920 Self::Other(s) => s.as_ref(),
1921 }
1922 }
1923}
1924
1925impl<'a> From<&'a str> for SubjectReviewState<'a> {
1926 fn from(s: &'a str) -> Self {
1927 match s {
1928 "tools.ozone.moderation.defs#reviewOpen" => {
1929 Self::ToolsOzoneModerationDefsReviewOpen
1930 }
1931 "tools.ozone.moderation.defs#reviewEscalated" => {
1932 Self::ToolsOzoneModerationDefsReviewEscalated
1933 }
1934 "tools.ozone.moderation.defs#reviewClosed" => {
1935 Self::ToolsOzoneModerationDefsReviewClosed
1936 }
1937 "tools.ozone.moderation.defs#reviewNone" => {
1938 Self::ToolsOzoneModerationDefsReviewNone
1939 }
1940 _ => Self::Other(CowStr::from(s)),
1941 }
1942 }
1943}
1944
1945impl<'a> From<String> for SubjectReviewState<'a> {
1946 fn from(s: String) -> Self {
1947 match s.as_str() {
1948 "tools.ozone.moderation.defs#reviewOpen" => {
1949 Self::ToolsOzoneModerationDefsReviewOpen
1950 }
1951 "tools.ozone.moderation.defs#reviewEscalated" => {
1952 Self::ToolsOzoneModerationDefsReviewEscalated
1953 }
1954 "tools.ozone.moderation.defs#reviewClosed" => {
1955 Self::ToolsOzoneModerationDefsReviewClosed
1956 }
1957 "tools.ozone.moderation.defs#reviewNone" => {
1958 Self::ToolsOzoneModerationDefsReviewNone
1959 }
1960 _ => Self::Other(CowStr::from(s)),
1961 }
1962 }
1963}
1964
1965impl<'a> AsRef<str> for SubjectReviewState<'a> {
1966 fn as_ref(&self) -> &str {
1967 self.as_str()
1968 }
1969}
1970
1971impl<'a> core::fmt::Display for SubjectReviewState<'a> {
1972 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1973 write!(f, "{}", self.as_str())
1974 }
1975}
1976
1977impl<'a> serde::Serialize for SubjectReviewState<'a> {
1978 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1979 where
1980 S: serde::Serializer,
1981 {
1982 serializer.serialize_str(self.as_str())
1983 }
1984}
1985
1986impl<'de, 'a> serde::Deserialize<'de> for SubjectReviewState<'a>
1987where
1988 'de: 'a,
1989{
1990 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1991 where
1992 D: serde::Deserializer<'de>,
1993 {
1994 let s = <&'de str>::deserialize(deserializer)?;
1995 Ok(Self::from(s))
1996 }
1997}
1998
1999impl jacquard_common::IntoStatic for SubjectReviewState<'_> {
2000 type Output = SubjectReviewState<'static>;
2001 fn into_static(self) -> Self::Output {
2002 match self {
2003 SubjectReviewState::ToolsOzoneModerationDefsReviewOpen => {
2004 SubjectReviewState::ToolsOzoneModerationDefsReviewOpen
2005 }
2006 SubjectReviewState::ToolsOzoneModerationDefsReviewEscalated => {
2007 SubjectReviewState::ToolsOzoneModerationDefsReviewEscalated
2008 }
2009 SubjectReviewState::ToolsOzoneModerationDefsReviewClosed => {
2010 SubjectReviewState::ToolsOzoneModerationDefsReviewClosed
2011 }
2012 SubjectReviewState::ToolsOzoneModerationDefsReviewNone => {
2013 SubjectReviewState::ToolsOzoneModerationDefsReviewNone
2014 }
2015 SubjectReviewState::Other(v) => SubjectReviewState::Other(v.into_static()),
2016 }
2017 }
2018}
2019
2020
2021#[lexicon]
2022#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
2023#[serde(rename_all = "camelCase")]
2024pub struct SubjectStatusView<'a> {
2025 #[serde(skip_serializing_if = "Option::is_none")]
2027 #[serde(borrow)]
2028 pub account_stats: Option<moderation::AccountStats<'a>>,
2029 #[serde(skip_serializing_if = "Option::is_none")]
2031 #[serde(borrow)]
2032 pub account_strike: Option<moderation::AccountStrike<'a>>,
2033 #[serde(skip_serializing_if = "Option::is_none")]
2035 #[serde(borrow)]
2036 pub age_assurance_state: Option<SubjectStatusViewAgeAssuranceState<'a>>,
2037 #[serde(skip_serializing_if = "Option::is_none")]
2039 #[serde(borrow)]
2040 pub age_assurance_updated_by: Option<SubjectStatusViewAgeAssuranceUpdatedBy<'a>>,
2041 #[serde(skip_serializing_if = "Option::is_none")]
2043 pub appealed: Option<bool>,
2044 #[serde(skip_serializing_if = "Option::is_none")]
2046 #[serde(borrow)]
2047 pub comment: Option<CowStr<'a>>,
2048 pub created_at: Datetime,
2050 #[serde(skip_serializing_if = "Option::is_none")]
2051 #[serde(borrow)]
2052 pub hosting: Option<SubjectStatusViewHosting<'a>>,
2053 pub id: i64,
2054 #[serde(skip_serializing_if = "Option::is_none")]
2056 pub last_appealed_at: Option<Datetime>,
2057 #[serde(skip_serializing_if = "Option::is_none")]
2058 pub last_reported_at: Option<Datetime>,
2059 #[serde(skip_serializing_if = "Option::is_none")]
2060 pub last_reviewed_at: Option<Datetime>,
2061 #[serde(skip_serializing_if = "Option::is_none")]
2062 #[serde(borrow)]
2063 pub last_reviewed_by: Option<Did<'a>>,
2064 #[serde(skip_serializing_if = "Option::is_none")]
2065 pub mute_reporting_until: Option<Datetime>,
2066 #[serde(skip_serializing_if = "Option::is_none")]
2067 pub mute_until: Option<Datetime>,
2068 #[serde(skip_serializing_if = "Option::is_none")]
2070 pub priority_score: Option<i64>,
2071 #[serde(skip_serializing_if = "Option::is_none")]
2073 #[serde(borrow)]
2074 pub records_stats: Option<moderation::RecordsStats<'a>>,
2075 #[serde(borrow)]
2076 pub review_state: moderation::SubjectReviewState<'a>,
2077 #[serde(borrow)]
2078 pub subject: SubjectStatusViewSubject<'a>,
2079 #[serde(skip_serializing_if = "Option::is_none")]
2080 #[serde(borrow)]
2081 pub subject_blob_cids: Option<Vec<Cid<'a>>>,
2082 #[serde(skip_serializing_if = "Option::is_none")]
2083 #[serde(borrow)]
2084 pub subject_repo_handle: Option<CowStr<'a>>,
2085 #[serde(skip_serializing_if = "Option::is_none")]
2086 pub suspend_until: Option<Datetime>,
2087 #[serde(skip_serializing_if = "Option::is_none")]
2088 #[serde(borrow)]
2089 pub tags: Option<Vec<CowStr<'a>>>,
2090 #[serde(skip_serializing_if = "Option::is_none")]
2091 pub takendown: Option<bool>,
2092 pub updated_at: Datetime,
2094}
2095
2096#[derive(Debug, Clone, PartialEq, Eq, Hash)]
2099pub enum SubjectStatusViewAgeAssuranceState<'a> {
2100 Pending,
2101 Assured,
2102 Unknown,
2103 Reset,
2104 Blocked,
2105 Other(CowStr<'a>),
2106}
2107
2108impl<'a> SubjectStatusViewAgeAssuranceState<'a> {
2109 pub fn as_str(&self) -> &str {
2110 match self {
2111 Self::Pending => "pending",
2112 Self::Assured => "assured",
2113 Self::Unknown => "unknown",
2114 Self::Reset => "reset",
2115 Self::Blocked => "blocked",
2116 Self::Other(s) => s.as_ref(),
2117 }
2118 }
2119}
2120
2121impl<'a> From<&'a str> for SubjectStatusViewAgeAssuranceState<'a> {
2122 fn from(s: &'a str) -> Self {
2123 match s {
2124 "pending" => Self::Pending,
2125 "assured" => Self::Assured,
2126 "unknown" => Self::Unknown,
2127 "reset" => Self::Reset,
2128 "blocked" => Self::Blocked,
2129 _ => Self::Other(CowStr::from(s)),
2130 }
2131 }
2132}
2133
2134impl<'a> From<String> for SubjectStatusViewAgeAssuranceState<'a> {
2135 fn from(s: String) -> Self {
2136 match s.as_str() {
2137 "pending" => Self::Pending,
2138 "assured" => Self::Assured,
2139 "unknown" => Self::Unknown,
2140 "reset" => Self::Reset,
2141 "blocked" => Self::Blocked,
2142 _ => Self::Other(CowStr::from(s)),
2143 }
2144 }
2145}
2146
2147impl<'a> core::fmt::Display for SubjectStatusViewAgeAssuranceState<'a> {
2148 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2149 write!(f, "{}", self.as_str())
2150 }
2151}
2152
2153impl<'a> AsRef<str> for SubjectStatusViewAgeAssuranceState<'a> {
2154 fn as_ref(&self) -> &str {
2155 self.as_str()
2156 }
2157}
2158
2159impl<'a> serde::Serialize for SubjectStatusViewAgeAssuranceState<'a> {
2160 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2161 where
2162 S: serde::Serializer,
2163 {
2164 serializer.serialize_str(self.as_str())
2165 }
2166}
2167
2168impl<'de, 'a> serde::Deserialize<'de> for SubjectStatusViewAgeAssuranceState<'a>
2169where
2170 'de: 'a,
2171{
2172 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
2173 where
2174 D: serde::Deserializer<'de>,
2175 {
2176 let s = <&'de str>::deserialize(deserializer)?;
2177 Ok(Self::from(s))
2178 }
2179}
2180
2181impl<'a> Default for SubjectStatusViewAgeAssuranceState<'a> {
2182 fn default() -> Self {
2183 Self::Other(Default::default())
2184 }
2185}
2186
2187impl jacquard_common::IntoStatic for SubjectStatusViewAgeAssuranceState<'_> {
2188 type Output = SubjectStatusViewAgeAssuranceState<'static>;
2189 fn into_static(self) -> Self::Output {
2190 match self {
2191 SubjectStatusViewAgeAssuranceState::Pending => {
2192 SubjectStatusViewAgeAssuranceState::Pending
2193 }
2194 SubjectStatusViewAgeAssuranceState::Assured => {
2195 SubjectStatusViewAgeAssuranceState::Assured
2196 }
2197 SubjectStatusViewAgeAssuranceState::Unknown => {
2198 SubjectStatusViewAgeAssuranceState::Unknown
2199 }
2200 SubjectStatusViewAgeAssuranceState::Reset => {
2201 SubjectStatusViewAgeAssuranceState::Reset
2202 }
2203 SubjectStatusViewAgeAssuranceState::Blocked => {
2204 SubjectStatusViewAgeAssuranceState::Blocked
2205 }
2206 SubjectStatusViewAgeAssuranceState::Other(v) => {
2207 SubjectStatusViewAgeAssuranceState::Other(v.into_static())
2208 }
2209 }
2210 }
2211}
2212
2213#[derive(Debug, Clone, PartialEq, Eq, Hash)]
2216pub enum SubjectStatusViewAgeAssuranceUpdatedBy<'a> {
2217 Admin,
2218 User,
2219 Other(CowStr<'a>),
2220}
2221
2222impl<'a> SubjectStatusViewAgeAssuranceUpdatedBy<'a> {
2223 pub fn as_str(&self) -> &str {
2224 match self {
2225 Self::Admin => "admin",
2226 Self::User => "user",
2227 Self::Other(s) => s.as_ref(),
2228 }
2229 }
2230}
2231
2232impl<'a> From<&'a str> for SubjectStatusViewAgeAssuranceUpdatedBy<'a> {
2233 fn from(s: &'a str) -> Self {
2234 match s {
2235 "admin" => Self::Admin,
2236 "user" => Self::User,
2237 _ => Self::Other(CowStr::from(s)),
2238 }
2239 }
2240}
2241
2242impl<'a> From<String> for SubjectStatusViewAgeAssuranceUpdatedBy<'a> {
2243 fn from(s: String) -> Self {
2244 match s.as_str() {
2245 "admin" => Self::Admin,
2246 "user" => Self::User,
2247 _ => Self::Other(CowStr::from(s)),
2248 }
2249 }
2250}
2251
2252impl<'a> core::fmt::Display for SubjectStatusViewAgeAssuranceUpdatedBy<'a> {
2253 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2254 write!(f, "{}", self.as_str())
2255 }
2256}
2257
2258impl<'a> AsRef<str> for SubjectStatusViewAgeAssuranceUpdatedBy<'a> {
2259 fn as_ref(&self) -> &str {
2260 self.as_str()
2261 }
2262}
2263
2264impl<'a> serde::Serialize for SubjectStatusViewAgeAssuranceUpdatedBy<'a> {
2265 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2266 where
2267 S: serde::Serializer,
2268 {
2269 serializer.serialize_str(self.as_str())
2270 }
2271}
2272
2273impl<'de, 'a> serde::Deserialize<'de> for SubjectStatusViewAgeAssuranceUpdatedBy<'a>
2274where
2275 'de: 'a,
2276{
2277 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
2278 where
2279 D: serde::Deserializer<'de>,
2280 {
2281 let s = <&'de str>::deserialize(deserializer)?;
2282 Ok(Self::from(s))
2283 }
2284}
2285
2286impl<'a> Default for SubjectStatusViewAgeAssuranceUpdatedBy<'a> {
2287 fn default() -> Self {
2288 Self::Other(Default::default())
2289 }
2290}
2291
2292impl jacquard_common::IntoStatic for SubjectStatusViewAgeAssuranceUpdatedBy<'_> {
2293 type Output = SubjectStatusViewAgeAssuranceUpdatedBy<'static>;
2294 fn into_static(self) -> Self::Output {
2295 match self {
2296 SubjectStatusViewAgeAssuranceUpdatedBy::Admin => {
2297 SubjectStatusViewAgeAssuranceUpdatedBy::Admin
2298 }
2299 SubjectStatusViewAgeAssuranceUpdatedBy::User => {
2300 SubjectStatusViewAgeAssuranceUpdatedBy::User
2301 }
2302 SubjectStatusViewAgeAssuranceUpdatedBy::Other(v) => {
2303 SubjectStatusViewAgeAssuranceUpdatedBy::Other(v.into_static())
2304 }
2305 }
2306 }
2307}
2308
2309
2310#[open_union]
2311#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
2312#[serde(tag = "$type", bound(deserialize = "'de: 'a"))]
2313pub enum SubjectStatusViewHosting<'a> {
2314 #[serde(rename = "tools.ozone.moderation.defs#accountHosting")]
2315 AccountHosting(Box<moderation::AccountHosting<'a>>),
2316 #[serde(rename = "tools.ozone.moderation.defs#recordHosting")]
2317 RecordHosting(Box<moderation::RecordHosting<'a>>),
2318}
2319
2320
2321#[open_union]
2322#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
2323#[serde(tag = "$type", bound(deserialize = "'de: 'a"))]
2324pub enum SubjectStatusViewSubject<'a> {
2325 #[serde(rename = "com.atproto.admin.defs#repoRef")]
2326 RepoRef(Box<RepoRef<'a>>),
2327 #[serde(rename = "com.atproto.repo.strongRef")]
2328 StrongRef(Box<StrongRef<'a>>),
2329 #[serde(rename = "chat.bsky.convo.defs#messageRef")]
2330 MessageRef(Box<MessageRef<'a>>),
2331}
2332
2333#[lexicon]
2336#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
2337#[serde(rename_all = "camelCase")]
2338pub struct SubjectView<'a> {
2339 #[serde(skip_serializing_if = "Option::is_none")]
2340 #[serde(borrow)]
2341 pub profile: Option<Data<'a>>,
2342 #[serde(skip_serializing_if = "Option::is_none")]
2343 #[serde(borrow)]
2344 pub record: Option<moderation::RecordViewDetail<'a>>,
2345 #[serde(skip_serializing_if = "Option::is_none")]
2346 #[serde(borrow)]
2347 pub repo: Option<moderation::RepoViewDetail<'a>>,
2348 #[serde(skip_serializing_if = "Option::is_none")]
2349 #[serde(borrow)]
2350 pub status: Option<moderation::SubjectStatusView<'a>>,
2351 #[serde(borrow)]
2352 pub subject: CowStr<'a>,
2353 #[serde(borrow)]
2354 pub r#type: SubjectType<'a>,
2355}
2356
2357#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
2360pub struct TimelineEventPlcCreate;
2361impl core::fmt::Display for TimelineEventPlcCreate {
2362 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2363 write!(f, "timelineEventPlcCreate")
2364 }
2365}
2366
2367#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
2370pub struct TimelineEventPlcOperation;
2371impl core::fmt::Display for TimelineEventPlcOperation {
2372 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2373 write!(f, "timelineEventPlcOperation")
2374 }
2375}
2376
2377#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
2380pub struct TimelineEventPlcTombstone;
2381impl core::fmt::Display for TimelineEventPlcTombstone {
2382 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2383 write!(f, "timelineEventPlcTombstone")
2384 }
2385}
2386
2387
2388#[lexicon]
2389#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
2390#[serde(rename_all = "camelCase")]
2391pub struct VideoDetails<'a> {
2392 pub height: i64,
2393 pub length: i64,
2394 pub width: i64,
2395}
2396
2397impl<'a> LexiconSchema for AccountEvent<'a> {
2398 fn nsid() -> &'static str {
2399 "tools.ozone.moderation.defs"
2400 }
2401 fn def_name() -> &'static str {
2402 "accountEvent"
2403 }
2404 fn lexicon_doc() -> LexiconDoc<'static> {
2405 lexicon_doc_tools_ozone_moderation_defs()
2406 }
2407 fn validate(&self) -> Result<(), ConstraintError> {
2408 Ok(())
2409 }
2410}
2411
2412impl<'a> LexiconSchema for AccountHosting<'a> {
2413 fn nsid() -> &'static str {
2414 "tools.ozone.moderation.defs"
2415 }
2416 fn def_name() -> &'static str {
2417 "accountHosting"
2418 }
2419 fn lexicon_doc() -> LexiconDoc<'static> {
2420 lexicon_doc_tools_ozone_moderation_defs()
2421 }
2422 fn validate(&self) -> Result<(), ConstraintError> {
2423 Ok(())
2424 }
2425}
2426
2427impl<'a> LexiconSchema for AccountStats<'a> {
2428 fn nsid() -> &'static str {
2429 "tools.ozone.moderation.defs"
2430 }
2431 fn def_name() -> &'static str {
2432 "accountStats"
2433 }
2434 fn lexicon_doc() -> LexiconDoc<'static> {
2435 lexicon_doc_tools_ozone_moderation_defs()
2436 }
2437 fn validate(&self) -> Result<(), ConstraintError> {
2438 Ok(())
2439 }
2440}
2441
2442impl<'a> LexiconSchema for AccountStrike<'a> {
2443 fn nsid() -> &'static str {
2444 "tools.ozone.moderation.defs"
2445 }
2446 fn def_name() -> &'static str {
2447 "accountStrike"
2448 }
2449 fn lexicon_doc() -> LexiconDoc<'static> {
2450 lexicon_doc_tools_ozone_moderation_defs()
2451 }
2452 fn validate(&self) -> Result<(), ConstraintError> {
2453 Ok(())
2454 }
2455}
2456
2457impl<'a> LexiconSchema for AgeAssuranceEvent<'a> {
2458 fn nsid() -> &'static str {
2459 "tools.ozone.moderation.defs"
2460 }
2461 fn def_name() -> &'static str {
2462 "ageAssuranceEvent"
2463 }
2464 fn lexicon_doc() -> LexiconDoc<'static> {
2465 lexicon_doc_tools_ozone_moderation_defs()
2466 }
2467 fn validate(&self) -> Result<(), ConstraintError> {
2468 Ok(())
2469 }
2470}
2471
2472impl<'a> LexiconSchema for AgeAssuranceOverrideEvent<'a> {
2473 fn nsid() -> &'static str {
2474 "tools.ozone.moderation.defs"
2475 }
2476 fn def_name() -> &'static str {
2477 "ageAssuranceOverrideEvent"
2478 }
2479 fn lexicon_doc() -> LexiconDoc<'static> {
2480 lexicon_doc_tools_ozone_moderation_defs()
2481 }
2482 fn validate(&self) -> Result<(), ConstraintError> {
2483 {
2484 let value = &self.comment;
2485 #[allow(unused_comparisons)]
2486 if <str>::len(value.as_ref()) < 1usize {
2487 return Err(ConstraintError::MinLength {
2488 path: ValidationPath::from_field("comment"),
2489 min: 1usize,
2490 actual: <str>::len(value.as_ref()),
2491 });
2492 }
2493 }
2494 Ok(())
2495 }
2496}
2497
2498impl<'a> LexiconSchema for AgeAssurancePurgeEvent<'a> {
2499 fn nsid() -> &'static str {
2500 "tools.ozone.moderation.defs"
2501 }
2502 fn def_name() -> &'static str {
2503 "ageAssurancePurgeEvent"
2504 }
2505 fn lexicon_doc() -> LexiconDoc<'static> {
2506 lexicon_doc_tools_ozone_moderation_defs()
2507 }
2508 fn validate(&self) -> Result<(), ConstraintError> {
2509 {
2510 let value = &self.comment;
2511 #[allow(unused_comparisons)]
2512 if <str>::len(value.as_ref()) < 1usize {
2513 return Err(ConstraintError::MinLength {
2514 path: ValidationPath::from_field("comment"),
2515 min: 1usize,
2516 actual: <str>::len(value.as_ref()),
2517 });
2518 }
2519 }
2520 Ok(())
2521 }
2522}
2523
2524impl<'a> LexiconSchema for BlobView<'a> {
2525 fn nsid() -> &'static str {
2526 "tools.ozone.moderation.defs"
2527 }
2528 fn def_name() -> &'static str {
2529 "blobView"
2530 }
2531 fn lexicon_doc() -> LexiconDoc<'static> {
2532 lexicon_doc_tools_ozone_moderation_defs()
2533 }
2534 fn validate(&self) -> Result<(), ConstraintError> {
2535 Ok(())
2536 }
2537}
2538
2539impl<'a> LexiconSchema for CancelScheduledTakedownEvent<'a> {
2540 fn nsid() -> &'static str {
2541 "tools.ozone.moderation.defs"
2542 }
2543 fn def_name() -> &'static str {
2544 "cancelScheduledTakedownEvent"
2545 }
2546 fn lexicon_doc() -> LexiconDoc<'static> {
2547 lexicon_doc_tools_ozone_moderation_defs()
2548 }
2549 fn validate(&self) -> Result<(), ConstraintError> {
2550 Ok(())
2551 }
2552}
2553
2554impl<'a> LexiconSchema for IdentityEvent<'a> {
2555 fn nsid() -> &'static str {
2556 "tools.ozone.moderation.defs"
2557 }
2558 fn def_name() -> &'static str {
2559 "identityEvent"
2560 }
2561 fn lexicon_doc() -> LexiconDoc<'static> {
2562 lexicon_doc_tools_ozone_moderation_defs()
2563 }
2564 fn validate(&self) -> Result<(), ConstraintError> {
2565 Ok(())
2566 }
2567}
2568
2569impl<'a> LexiconSchema for ImageDetails<'a> {
2570 fn nsid() -> &'static str {
2571 "tools.ozone.moderation.defs"
2572 }
2573 fn def_name() -> &'static str {
2574 "imageDetails"
2575 }
2576 fn lexicon_doc() -> LexiconDoc<'static> {
2577 lexicon_doc_tools_ozone_moderation_defs()
2578 }
2579 fn validate(&self) -> Result<(), ConstraintError> {
2580 Ok(())
2581 }
2582}
2583
2584impl<'a> LexiconSchema for ModEventAcknowledge<'a> {
2585 fn nsid() -> &'static str {
2586 "tools.ozone.moderation.defs"
2587 }
2588 fn def_name() -> &'static str {
2589 "modEventAcknowledge"
2590 }
2591 fn lexicon_doc() -> LexiconDoc<'static> {
2592 lexicon_doc_tools_ozone_moderation_defs()
2593 }
2594 fn validate(&self) -> Result<(), ConstraintError> {
2595 Ok(())
2596 }
2597}
2598
2599impl<'a> LexiconSchema for ModEventComment<'a> {
2600 fn nsid() -> &'static str {
2601 "tools.ozone.moderation.defs"
2602 }
2603 fn def_name() -> &'static str {
2604 "modEventComment"
2605 }
2606 fn lexicon_doc() -> LexiconDoc<'static> {
2607 lexicon_doc_tools_ozone_moderation_defs()
2608 }
2609 fn validate(&self) -> Result<(), ConstraintError> {
2610 Ok(())
2611 }
2612}
2613
2614impl<'a> LexiconSchema for ModEventDivert<'a> {
2615 fn nsid() -> &'static str {
2616 "tools.ozone.moderation.defs"
2617 }
2618 fn def_name() -> &'static str {
2619 "modEventDivert"
2620 }
2621 fn lexicon_doc() -> LexiconDoc<'static> {
2622 lexicon_doc_tools_ozone_moderation_defs()
2623 }
2624 fn validate(&self) -> Result<(), ConstraintError> {
2625 Ok(())
2626 }
2627}
2628
2629impl<'a> LexiconSchema for ModEventEmail<'a> {
2630 fn nsid() -> &'static str {
2631 "tools.ozone.moderation.defs"
2632 }
2633 fn def_name() -> &'static str {
2634 "modEventEmail"
2635 }
2636 fn lexicon_doc() -> LexiconDoc<'static> {
2637 lexicon_doc_tools_ozone_moderation_defs()
2638 }
2639 fn validate(&self) -> Result<(), ConstraintError> {
2640 if let Some(ref value) = self.policies {
2641 #[allow(unused_comparisons)]
2642 if value.len() > 5usize {
2643 return Err(ConstraintError::MaxLength {
2644 path: ValidationPath::from_field("policies"),
2645 max: 5usize,
2646 actual: value.len(),
2647 });
2648 }
2649 }
2650 Ok(())
2651 }
2652}
2653
2654impl<'a> LexiconSchema for ModEventEscalate<'a> {
2655 fn nsid() -> &'static str {
2656 "tools.ozone.moderation.defs"
2657 }
2658 fn def_name() -> &'static str {
2659 "modEventEscalate"
2660 }
2661 fn lexicon_doc() -> LexiconDoc<'static> {
2662 lexicon_doc_tools_ozone_moderation_defs()
2663 }
2664 fn validate(&self) -> Result<(), ConstraintError> {
2665 Ok(())
2666 }
2667}
2668
2669impl<'a> LexiconSchema for ModEventLabel<'a> {
2670 fn nsid() -> &'static str {
2671 "tools.ozone.moderation.defs"
2672 }
2673 fn def_name() -> &'static str {
2674 "modEventLabel"
2675 }
2676 fn lexicon_doc() -> LexiconDoc<'static> {
2677 lexicon_doc_tools_ozone_moderation_defs()
2678 }
2679 fn validate(&self) -> Result<(), ConstraintError> {
2680 Ok(())
2681 }
2682}
2683
2684impl<'a> LexiconSchema for ModEventMute<'a> {
2685 fn nsid() -> &'static str {
2686 "tools.ozone.moderation.defs"
2687 }
2688 fn def_name() -> &'static str {
2689 "modEventMute"
2690 }
2691 fn lexicon_doc() -> LexiconDoc<'static> {
2692 lexicon_doc_tools_ozone_moderation_defs()
2693 }
2694 fn validate(&self) -> Result<(), ConstraintError> {
2695 Ok(())
2696 }
2697}
2698
2699impl<'a> LexiconSchema for ModEventMuteReporter<'a> {
2700 fn nsid() -> &'static str {
2701 "tools.ozone.moderation.defs"
2702 }
2703 fn def_name() -> &'static str {
2704 "modEventMuteReporter"
2705 }
2706 fn lexicon_doc() -> LexiconDoc<'static> {
2707 lexicon_doc_tools_ozone_moderation_defs()
2708 }
2709 fn validate(&self) -> Result<(), ConstraintError> {
2710 Ok(())
2711 }
2712}
2713
2714impl<'a> LexiconSchema for ModEventPriorityScore<'a> {
2715 fn nsid() -> &'static str {
2716 "tools.ozone.moderation.defs"
2717 }
2718 fn def_name() -> &'static str {
2719 "modEventPriorityScore"
2720 }
2721 fn lexicon_doc() -> LexiconDoc<'static> {
2722 lexicon_doc_tools_ozone_moderation_defs()
2723 }
2724 fn validate(&self) -> Result<(), ConstraintError> {
2725 {
2726 let value = &self.score;
2727 if *value > 100i64 {
2728 return Err(ConstraintError::Maximum {
2729 path: ValidationPath::from_field("score"),
2730 max: 100i64,
2731 actual: *value,
2732 });
2733 }
2734 }
2735 {
2736 let value = &self.score;
2737 if *value < 0i64 {
2738 return Err(ConstraintError::Minimum {
2739 path: ValidationPath::from_field("score"),
2740 min: 0i64,
2741 actual: *value,
2742 });
2743 }
2744 }
2745 Ok(())
2746 }
2747}
2748
2749impl<'a> LexiconSchema for ModEventReport<'a> {
2750 fn nsid() -> &'static str {
2751 "tools.ozone.moderation.defs"
2752 }
2753 fn def_name() -> &'static str {
2754 "modEventReport"
2755 }
2756 fn lexicon_doc() -> LexiconDoc<'static> {
2757 lexicon_doc_tools_ozone_moderation_defs()
2758 }
2759 fn validate(&self) -> Result<(), ConstraintError> {
2760 Ok(())
2761 }
2762}
2763
2764impl<'a> LexiconSchema for ModEventResolveAppeal<'a> {
2765 fn nsid() -> &'static str {
2766 "tools.ozone.moderation.defs"
2767 }
2768 fn def_name() -> &'static str {
2769 "modEventResolveAppeal"
2770 }
2771 fn lexicon_doc() -> LexiconDoc<'static> {
2772 lexicon_doc_tools_ozone_moderation_defs()
2773 }
2774 fn validate(&self) -> Result<(), ConstraintError> {
2775 Ok(())
2776 }
2777}
2778
2779impl<'a> LexiconSchema for ModEventReverseTakedown<'a> {
2780 fn nsid() -> &'static str {
2781 "tools.ozone.moderation.defs"
2782 }
2783 fn def_name() -> &'static str {
2784 "modEventReverseTakedown"
2785 }
2786 fn lexicon_doc() -> LexiconDoc<'static> {
2787 lexicon_doc_tools_ozone_moderation_defs()
2788 }
2789 fn validate(&self) -> Result<(), ConstraintError> {
2790 if let Some(ref value) = self.policies {
2791 #[allow(unused_comparisons)]
2792 if value.len() > 5usize {
2793 return Err(ConstraintError::MaxLength {
2794 path: ValidationPath::from_field("policies"),
2795 max: 5usize,
2796 actual: value.len(),
2797 });
2798 }
2799 }
2800 Ok(())
2801 }
2802}
2803
2804impl<'a> LexiconSchema for ModEventTag<'a> {
2805 fn nsid() -> &'static str {
2806 "tools.ozone.moderation.defs"
2807 }
2808 fn def_name() -> &'static str {
2809 "modEventTag"
2810 }
2811 fn lexicon_doc() -> LexiconDoc<'static> {
2812 lexicon_doc_tools_ozone_moderation_defs()
2813 }
2814 fn validate(&self) -> Result<(), ConstraintError> {
2815 Ok(())
2816 }
2817}
2818
2819impl<'a> LexiconSchema for ModEventTakedown<'a> {
2820 fn nsid() -> &'static str {
2821 "tools.ozone.moderation.defs"
2822 }
2823 fn def_name() -> &'static str {
2824 "modEventTakedown"
2825 }
2826 fn lexicon_doc() -> LexiconDoc<'static> {
2827 lexicon_doc_tools_ozone_moderation_defs()
2828 }
2829 fn validate(&self) -> Result<(), ConstraintError> {
2830 if let Some(ref value) = self.policies {
2831 #[allow(unused_comparisons)]
2832 if value.len() > 5usize {
2833 return Err(ConstraintError::MaxLength {
2834 path: ValidationPath::from_field("policies"),
2835 max: 5usize,
2836 actual: value.len(),
2837 });
2838 }
2839 }
2840 Ok(())
2841 }
2842}
2843
2844impl<'a> LexiconSchema for ModEventUnmute<'a> {
2845 fn nsid() -> &'static str {
2846 "tools.ozone.moderation.defs"
2847 }
2848 fn def_name() -> &'static str {
2849 "modEventUnmute"
2850 }
2851 fn lexicon_doc() -> LexiconDoc<'static> {
2852 lexicon_doc_tools_ozone_moderation_defs()
2853 }
2854 fn validate(&self) -> Result<(), ConstraintError> {
2855 Ok(())
2856 }
2857}
2858
2859impl<'a> LexiconSchema for ModEventUnmuteReporter<'a> {
2860 fn nsid() -> &'static str {
2861 "tools.ozone.moderation.defs"
2862 }
2863 fn def_name() -> &'static str {
2864 "modEventUnmuteReporter"
2865 }
2866 fn lexicon_doc() -> LexiconDoc<'static> {
2867 lexicon_doc_tools_ozone_moderation_defs()
2868 }
2869 fn validate(&self) -> Result<(), ConstraintError> {
2870 Ok(())
2871 }
2872}
2873
2874impl<'a> LexiconSchema for ModEventView<'a> {
2875 fn nsid() -> &'static str {
2876 "tools.ozone.moderation.defs"
2877 }
2878 fn def_name() -> &'static str {
2879 "modEventView"
2880 }
2881 fn lexicon_doc() -> LexiconDoc<'static> {
2882 lexicon_doc_tools_ozone_moderation_defs()
2883 }
2884 fn validate(&self) -> Result<(), ConstraintError> {
2885 Ok(())
2886 }
2887}
2888
2889impl<'a> LexiconSchema for ModEventViewDetail<'a> {
2890 fn nsid() -> &'static str {
2891 "tools.ozone.moderation.defs"
2892 }
2893 fn def_name() -> &'static str {
2894 "modEventViewDetail"
2895 }
2896 fn lexicon_doc() -> LexiconDoc<'static> {
2897 lexicon_doc_tools_ozone_moderation_defs()
2898 }
2899 fn validate(&self) -> Result<(), ConstraintError> {
2900 Ok(())
2901 }
2902}
2903
2904impl<'a> LexiconSchema for ModTool<'a> {
2905 fn nsid() -> &'static str {
2906 "tools.ozone.moderation.defs"
2907 }
2908 fn def_name() -> &'static str {
2909 "modTool"
2910 }
2911 fn lexicon_doc() -> LexiconDoc<'static> {
2912 lexicon_doc_tools_ozone_moderation_defs()
2913 }
2914 fn validate(&self) -> Result<(), ConstraintError> {
2915 Ok(())
2916 }
2917}
2918
2919impl<'a> LexiconSchema for Moderation<'a> {
2920 fn nsid() -> &'static str {
2921 "tools.ozone.moderation.defs"
2922 }
2923 fn def_name() -> &'static str {
2924 "moderation"
2925 }
2926 fn lexicon_doc() -> LexiconDoc<'static> {
2927 lexicon_doc_tools_ozone_moderation_defs()
2928 }
2929 fn validate(&self) -> Result<(), ConstraintError> {
2930 Ok(())
2931 }
2932}
2933
2934impl<'a> LexiconSchema for ModerationDetail<'a> {
2935 fn nsid() -> &'static str {
2936 "tools.ozone.moderation.defs"
2937 }
2938 fn def_name() -> &'static str {
2939 "moderationDetail"
2940 }
2941 fn lexicon_doc() -> LexiconDoc<'static> {
2942 lexicon_doc_tools_ozone_moderation_defs()
2943 }
2944 fn validate(&self) -> Result<(), ConstraintError> {
2945 Ok(())
2946 }
2947}
2948
2949impl<'a> LexiconSchema for RecordEvent<'a> {
2950 fn nsid() -> &'static str {
2951 "tools.ozone.moderation.defs"
2952 }
2953 fn def_name() -> &'static str {
2954 "recordEvent"
2955 }
2956 fn lexicon_doc() -> LexiconDoc<'static> {
2957 lexicon_doc_tools_ozone_moderation_defs()
2958 }
2959 fn validate(&self) -> Result<(), ConstraintError> {
2960 Ok(())
2961 }
2962}
2963
2964impl<'a> LexiconSchema for RecordHosting<'a> {
2965 fn nsid() -> &'static str {
2966 "tools.ozone.moderation.defs"
2967 }
2968 fn def_name() -> &'static str {
2969 "recordHosting"
2970 }
2971 fn lexicon_doc() -> LexiconDoc<'static> {
2972 lexicon_doc_tools_ozone_moderation_defs()
2973 }
2974 fn validate(&self) -> Result<(), ConstraintError> {
2975 Ok(())
2976 }
2977}
2978
2979impl<'a> LexiconSchema for RecordView<'a> {
2980 fn nsid() -> &'static str {
2981 "tools.ozone.moderation.defs"
2982 }
2983 fn def_name() -> &'static str {
2984 "recordView"
2985 }
2986 fn lexicon_doc() -> LexiconDoc<'static> {
2987 lexicon_doc_tools_ozone_moderation_defs()
2988 }
2989 fn validate(&self) -> Result<(), ConstraintError> {
2990 Ok(())
2991 }
2992}
2993
2994impl<'a> LexiconSchema for RecordViewDetail<'a> {
2995 fn nsid() -> &'static str {
2996 "tools.ozone.moderation.defs"
2997 }
2998 fn def_name() -> &'static str {
2999 "recordViewDetail"
3000 }
3001 fn lexicon_doc() -> LexiconDoc<'static> {
3002 lexicon_doc_tools_ozone_moderation_defs()
3003 }
3004 fn validate(&self) -> Result<(), ConstraintError> {
3005 Ok(())
3006 }
3007}
3008
3009impl<'a> LexiconSchema for RecordViewNotFound<'a> {
3010 fn nsid() -> &'static str {
3011 "tools.ozone.moderation.defs"
3012 }
3013 fn def_name() -> &'static str {
3014 "recordViewNotFound"
3015 }
3016 fn lexicon_doc() -> LexiconDoc<'static> {
3017 lexicon_doc_tools_ozone_moderation_defs()
3018 }
3019 fn validate(&self) -> Result<(), ConstraintError> {
3020 Ok(())
3021 }
3022}
3023
3024impl<'a> LexiconSchema for RecordsStats<'a> {
3025 fn nsid() -> &'static str {
3026 "tools.ozone.moderation.defs"
3027 }
3028 fn def_name() -> &'static str {
3029 "recordsStats"
3030 }
3031 fn lexicon_doc() -> LexiconDoc<'static> {
3032 lexicon_doc_tools_ozone_moderation_defs()
3033 }
3034 fn validate(&self) -> Result<(), ConstraintError> {
3035 Ok(())
3036 }
3037}
3038
3039impl<'a> LexiconSchema for RepoView<'a> {
3040 fn nsid() -> &'static str {
3041 "tools.ozone.moderation.defs"
3042 }
3043 fn def_name() -> &'static str {
3044 "repoView"
3045 }
3046 fn lexicon_doc() -> LexiconDoc<'static> {
3047 lexicon_doc_tools_ozone_moderation_defs()
3048 }
3049 fn validate(&self) -> Result<(), ConstraintError> {
3050 Ok(())
3051 }
3052}
3053
3054impl<'a> LexiconSchema for RepoViewDetail<'a> {
3055 fn nsid() -> &'static str {
3056 "tools.ozone.moderation.defs"
3057 }
3058 fn def_name() -> &'static str {
3059 "repoViewDetail"
3060 }
3061 fn lexicon_doc() -> LexiconDoc<'static> {
3062 lexicon_doc_tools_ozone_moderation_defs()
3063 }
3064 fn validate(&self) -> Result<(), ConstraintError> {
3065 Ok(())
3066 }
3067}
3068
3069impl<'a> LexiconSchema for RepoViewNotFound<'a> {
3070 fn nsid() -> &'static str {
3071 "tools.ozone.moderation.defs"
3072 }
3073 fn def_name() -> &'static str {
3074 "repoViewNotFound"
3075 }
3076 fn lexicon_doc() -> LexiconDoc<'static> {
3077 lexicon_doc_tools_ozone_moderation_defs()
3078 }
3079 fn validate(&self) -> Result<(), ConstraintError> {
3080 Ok(())
3081 }
3082}
3083
3084impl<'a> LexiconSchema for ReporterStats<'a> {
3085 fn nsid() -> &'static str {
3086 "tools.ozone.moderation.defs"
3087 }
3088 fn def_name() -> &'static str {
3089 "reporterStats"
3090 }
3091 fn lexicon_doc() -> LexiconDoc<'static> {
3092 lexicon_doc_tools_ozone_moderation_defs()
3093 }
3094 fn validate(&self) -> Result<(), ConstraintError> {
3095 Ok(())
3096 }
3097}
3098
3099impl<'a> LexiconSchema for RevokeAccountCredentialsEvent<'a> {
3100 fn nsid() -> &'static str {
3101 "tools.ozone.moderation.defs"
3102 }
3103 fn def_name() -> &'static str {
3104 "revokeAccountCredentialsEvent"
3105 }
3106 fn lexicon_doc() -> LexiconDoc<'static> {
3107 lexicon_doc_tools_ozone_moderation_defs()
3108 }
3109 fn validate(&self) -> Result<(), ConstraintError> {
3110 {
3111 let value = &self.comment;
3112 #[allow(unused_comparisons)]
3113 if <str>::len(value.as_ref()) < 1usize {
3114 return Err(ConstraintError::MinLength {
3115 path: ValidationPath::from_field("comment"),
3116 min: 1usize,
3117 actual: <str>::len(value.as_ref()),
3118 });
3119 }
3120 }
3121 Ok(())
3122 }
3123}
3124
3125impl<'a> LexiconSchema for ScheduleTakedownEvent<'a> {
3126 fn nsid() -> &'static str {
3127 "tools.ozone.moderation.defs"
3128 }
3129 fn def_name() -> &'static str {
3130 "scheduleTakedownEvent"
3131 }
3132 fn lexicon_doc() -> LexiconDoc<'static> {
3133 lexicon_doc_tools_ozone_moderation_defs()
3134 }
3135 fn validate(&self) -> Result<(), ConstraintError> {
3136 Ok(())
3137 }
3138}
3139
3140impl<'a> LexiconSchema for ScheduledActionView<'a> {
3141 fn nsid() -> &'static str {
3142 "tools.ozone.moderation.defs"
3143 }
3144 fn def_name() -> &'static str {
3145 "scheduledActionView"
3146 }
3147 fn lexicon_doc() -> LexiconDoc<'static> {
3148 lexicon_doc_tools_ozone_moderation_defs()
3149 }
3150 fn validate(&self) -> Result<(), ConstraintError> {
3151 Ok(())
3152 }
3153}
3154
3155impl<'a> LexiconSchema for SubjectStatusView<'a> {
3156 fn nsid() -> &'static str {
3157 "tools.ozone.moderation.defs"
3158 }
3159 fn def_name() -> &'static str {
3160 "subjectStatusView"
3161 }
3162 fn lexicon_doc() -> LexiconDoc<'static> {
3163 lexicon_doc_tools_ozone_moderation_defs()
3164 }
3165 fn validate(&self) -> Result<(), ConstraintError> {
3166 if let Some(ref value) = self.priority_score {
3167 if *value > 100i64 {
3168 return Err(ConstraintError::Maximum {
3169 path: ValidationPath::from_field("priority_score"),
3170 max: 100i64,
3171 actual: *value,
3172 });
3173 }
3174 }
3175 if let Some(ref value) = self.priority_score {
3176 if *value < 0i64 {
3177 return Err(ConstraintError::Minimum {
3178 path: ValidationPath::from_field("priority_score"),
3179 min: 0i64,
3180 actual: *value,
3181 });
3182 }
3183 }
3184 Ok(())
3185 }
3186}
3187
3188impl<'a> LexiconSchema for SubjectView<'a> {
3189 fn nsid() -> &'static str {
3190 "tools.ozone.moderation.defs"
3191 }
3192 fn def_name() -> &'static str {
3193 "subjectView"
3194 }
3195 fn lexicon_doc() -> LexiconDoc<'static> {
3196 lexicon_doc_tools_ozone_moderation_defs()
3197 }
3198 fn validate(&self) -> Result<(), ConstraintError> {
3199 Ok(())
3200 }
3201}
3202
3203impl<'a> LexiconSchema for VideoDetails<'a> {
3204 fn nsid() -> &'static str {
3205 "tools.ozone.moderation.defs"
3206 }
3207 fn def_name() -> &'static str {
3208 "videoDetails"
3209 }
3210 fn lexicon_doc() -> LexiconDoc<'static> {
3211 lexicon_doc_tools_ozone_moderation_defs()
3212 }
3213 fn validate(&self) -> Result<(), ConstraintError> {
3214 Ok(())
3215 }
3216}
3217
3218pub mod account_event_state {
3219
3220 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
3221 #[allow(unused)]
3222 use ::core::marker::PhantomData;
3223 mod sealed {
3224 pub trait Sealed {}
3225 }
3226 pub trait State: sealed::Sealed {
3228 type Timestamp;
3229 type Active;
3230 }
3231 pub struct Empty(());
3233 impl sealed::Sealed for Empty {}
3234 impl State for Empty {
3235 type Timestamp = Unset;
3236 type Active = Unset;
3237 }
3238 pub struct SetTimestamp<S: State = Empty>(PhantomData<fn() -> S>);
3240 impl<S: State> sealed::Sealed for SetTimestamp<S> {}
3241 impl<S: State> State for SetTimestamp<S> {
3242 type Timestamp = Set<members::timestamp>;
3243 type Active = S::Active;
3244 }
3245 pub struct SetActive<S: State = Empty>(PhantomData<fn() -> S>);
3247 impl<S: State> sealed::Sealed for SetActive<S> {}
3248 impl<S: State> State for SetActive<S> {
3249 type Timestamp = S::Timestamp;
3250 type Active = Set<members::active>;
3251 }
3252 #[allow(non_camel_case_types)]
3254 pub mod members {
3255 pub struct timestamp(());
3257 pub struct active(());
3259 }
3260}
3261
3262pub struct AccountEventBuilder<'a, S: account_event_state::State> {
3264 _state: PhantomData<fn() -> S>,
3265 _fields: (
3266 Option<bool>,
3267 Option<CowStr<'a>>,
3268 Option<AccountEventStatus<'a>>,
3269 Option<Datetime>,
3270 ),
3271 _lifetime: PhantomData<&'a ()>,
3272}
3273
3274impl<'a> AccountEvent<'a> {
3275 pub fn new() -> AccountEventBuilder<'a, account_event_state::Empty> {
3277 AccountEventBuilder::new()
3278 }
3279}
3280
3281impl<'a> AccountEventBuilder<'a, account_event_state::Empty> {
3282 pub fn new() -> Self {
3284 AccountEventBuilder {
3285 _state: PhantomData,
3286 _fields: (None, None, None, None),
3287 _lifetime: PhantomData,
3288 }
3289 }
3290}
3291
3292impl<'a, S> AccountEventBuilder<'a, S>
3293where
3294 S: account_event_state::State,
3295 S::Active: account_event_state::IsUnset,
3296{
3297 pub fn active(
3299 mut self,
3300 value: impl Into<bool>,
3301 ) -> AccountEventBuilder<'a, account_event_state::SetActive<S>> {
3302 self._fields.0 = Option::Some(value.into());
3303 AccountEventBuilder {
3304 _state: PhantomData,
3305 _fields: self._fields,
3306 _lifetime: PhantomData,
3307 }
3308 }
3309}
3310
3311impl<'a, S: account_event_state::State> AccountEventBuilder<'a, S> {
3312 pub fn comment(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
3314 self._fields.1 = value.into();
3315 self
3316 }
3317 pub fn maybe_comment(mut self, value: Option<CowStr<'a>>) -> Self {
3319 self._fields.1 = value;
3320 self
3321 }
3322}
3323
3324impl<'a, S: account_event_state::State> AccountEventBuilder<'a, S> {
3325 pub fn status(mut self, value: impl Into<Option<AccountEventStatus<'a>>>) -> Self {
3327 self._fields.2 = value.into();
3328 self
3329 }
3330 pub fn maybe_status(mut self, value: Option<AccountEventStatus<'a>>) -> Self {
3332 self._fields.2 = value;
3333 self
3334 }
3335}
3336
3337impl<'a, S> AccountEventBuilder<'a, S>
3338where
3339 S: account_event_state::State,
3340 S::Timestamp: account_event_state::IsUnset,
3341{
3342 pub fn timestamp(
3344 mut self,
3345 value: impl Into<Datetime>,
3346 ) -> AccountEventBuilder<'a, account_event_state::SetTimestamp<S>> {
3347 self._fields.3 = Option::Some(value.into());
3348 AccountEventBuilder {
3349 _state: PhantomData,
3350 _fields: self._fields,
3351 _lifetime: PhantomData,
3352 }
3353 }
3354}
3355
3356impl<'a, S> AccountEventBuilder<'a, S>
3357where
3358 S: account_event_state::State,
3359 S::Timestamp: account_event_state::IsSet,
3360 S::Active: account_event_state::IsSet,
3361{
3362 pub fn build(self) -> AccountEvent<'a> {
3364 AccountEvent {
3365 active: self._fields.0.unwrap(),
3366 comment: self._fields.1,
3367 status: self._fields.2,
3368 timestamp: self._fields.3.unwrap(),
3369 extra_data: Default::default(),
3370 }
3371 }
3372 pub fn build_with_data(
3374 self,
3375 extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
3376 ) -> AccountEvent<'a> {
3377 AccountEvent {
3378 active: self._fields.0.unwrap(),
3379 comment: self._fields.1,
3380 status: self._fields.2,
3381 timestamp: self._fields.3.unwrap(),
3382 extra_data: Some(extra_data),
3383 }
3384 }
3385}
3386
3387fn lexicon_doc_tools_ozone_moderation_defs() -> LexiconDoc<'static> {
3388 #[allow(unused_imports)]
3389 use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType};
3390 use jacquard_lexicon::lexicon::*;
3391 use alloc::collections::BTreeMap;
3392 LexiconDoc {
3393 lexicon: Lexicon::Lexicon1,
3394 id: CowStr::new_static("tools.ozone.moderation.defs"),
3395 defs: {
3396 let mut map = BTreeMap::new();
3397 map.insert(
3398 SmolStr::new_static("accountEvent"),
3399 LexUserType::Object(LexObject {
3400 description: Some(
3401 CowStr::new_static(
3402 "Logs account status related events on a repo subject. Normally captured by automod from the firehose and emitted to ozone for historical tracking.",
3403 ),
3404 ),
3405 required: Some(
3406 vec![
3407 SmolStr::new_static("timestamp"),
3408 SmolStr::new_static("active")
3409 ],
3410 ),
3411 properties: {
3412 #[allow(unused_mut)]
3413 let mut map = BTreeMap::new();
3414 map.insert(
3415 SmolStr::new_static("active"),
3416 LexObjectProperty::Boolean(LexBoolean {
3417 ..Default::default()
3418 }),
3419 );
3420 map.insert(
3421 SmolStr::new_static("comment"),
3422 LexObjectProperty::String(LexString { ..Default::default() }),
3423 );
3424 map.insert(
3425 SmolStr::new_static("status"),
3426 LexObjectProperty::String(LexString { ..Default::default() }),
3427 );
3428 map.insert(
3429 SmolStr::new_static("timestamp"),
3430 LexObjectProperty::String(LexString {
3431 format: Some(LexStringFormat::Datetime),
3432 ..Default::default()
3433 }),
3434 );
3435 map
3436 },
3437 ..Default::default()
3438 }),
3439 );
3440 map.insert(
3441 SmolStr::new_static("accountHosting"),
3442 LexUserType::Object(LexObject {
3443 required: Some(vec![SmolStr::new_static("status")]),
3444 properties: {
3445 #[allow(unused_mut)]
3446 let mut map = BTreeMap::new();
3447 map.insert(
3448 SmolStr::new_static("createdAt"),
3449 LexObjectProperty::String(LexString {
3450 format: Some(LexStringFormat::Datetime),
3451 ..Default::default()
3452 }),
3453 );
3454 map.insert(
3455 SmolStr::new_static("deactivatedAt"),
3456 LexObjectProperty::String(LexString {
3457 format: Some(LexStringFormat::Datetime),
3458 ..Default::default()
3459 }),
3460 );
3461 map.insert(
3462 SmolStr::new_static("deletedAt"),
3463 LexObjectProperty::String(LexString {
3464 format: Some(LexStringFormat::Datetime),
3465 ..Default::default()
3466 }),
3467 );
3468 map.insert(
3469 SmolStr::new_static("reactivatedAt"),
3470 LexObjectProperty::String(LexString {
3471 format: Some(LexStringFormat::Datetime),
3472 ..Default::default()
3473 }),
3474 );
3475 map.insert(
3476 SmolStr::new_static("status"),
3477 LexObjectProperty::String(LexString { ..Default::default() }),
3478 );
3479 map.insert(
3480 SmolStr::new_static("updatedAt"),
3481 LexObjectProperty::String(LexString {
3482 format: Some(LexStringFormat::Datetime),
3483 ..Default::default()
3484 }),
3485 );
3486 map
3487 },
3488 ..Default::default()
3489 }),
3490 );
3491 map.insert(
3492 SmolStr::new_static("accountStats"),
3493 LexUserType::Object(LexObject {
3494 description: Some(
3495 CowStr::new_static(
3496 "Statistics about a particular account subject",
3497 ),
3498 ),
3499 properties: {
3500 #[allow(unused_mut)]
3501 let mut map = BTreeMap::new();
3502 map.insert(
3503 SmolStr::new_static("appealCount"),
3504 LexObjectProperty::Integer(LexInteger {
3505 ..Default::default()
3506 }),
3507 );
3508 map.insert(
3509 SmolStr::new_static("escalateCount"),
3510 LexObjectProperty::Integer(LexInteger {
3511 ..Default::default()
3512 }),
3513 );
3514 map.insert(
3515 SmolStr::new_static("reportCount"),
3516 LexObjectProperty::Integer(LexInteger {
3517 ..Default::default()
3518 }),
3519 );
3520 map.insert(
3521 SmolStr::new_static("suspendCount"),
3522 LexObjectProperty::Integer(LexInteger {
3523 ..Default::default()
3524 }),
3525 );
3526 map.insert(
3527 SmolStr::new_static("takedownCount"),
3528 LexObjectProperty::Integer(LexInteger {
3529 ..Default::default()
3530 }),
3531 );
3532 map
3533 },
3534 ..Default::default()
3535 }),
3536 );
3537 map.insert(
3538 SmolStr::new_static("accountStrike"),
3539 LexUserType::Object(LexObject {
3540 description: Some(
3541 CowStr::new_static("Strike information for an account"),
3542 ),
3543 properties: {
3544 #[allow(unused_mut)]
3545 let mut map = BTreeMap::new();
3546 map.insert(
3547 SmolStr::new_static("activeStrikeCount"),
3548 LexObjectProperty::Integer(LexInteger {
3549 ..Default::default()
3550 }),
3551 );
3552 map.insert(
3553 SmolStr::new_static("firstStrikeAt"),
3554 LexObjectProperty::String(LexString {
3555 description: Some(
3556 CowStr::new_static("Timestamp of the first strike received"),
3557 ),
3558 format: Some(LexStringFormat::Datetime),
3559 ..Default::default()
3560 }),
3561 );
3562 map.insert(
3563 SmolStr::new_static("lastStrikeAt"),
3564 LexObjectProperty::String(LexString {
3565 description: Some(
3566 CowStr::new_static(
3567 "Timestamp of the most recent strike received",
3568 ),
3569 ),
3570 format: Some(LexStringFormat::Datetime),
3571 ..Default::default()
3572 }),
3573 );
3574 map.insert(
3575 SmolStr::new_static("totalStrikeCount"),
3576 LexObjectProperty::Integer(LexInteger {
3577 ..Default::default()
3578 }),
3579 );
3580 map
3581 },
3582 ..Default::default()
3583 }),
3584 );
3585 map.insert(
3586 SmolStr::new_static("ageAssuranceEvent"),
3587 LexUserType::Object(LexObject {
3588 description: Some(
3589 CowStr::new_static(
3590 "Age assurance info coming directly from users. Only works on DID subjects.",
3591 ),
3592 ),
3593 required: Some(
3594 vec![
3595 SmolStr::new_static("createdAt"),
3596 SmolStr::new_static("status"),
3597 SmolStr::new_static("attemptId")
3598 ],
3599 ),
3600 properties: {
3601 #[allow(unused_mut)]
3602 let mut map = BTreeMap::new();
3603 map.insert(
3604 SmolStr::new_static("access"),
3605 LexObjectProperty::Ref(LexRef {
3606 r#ref: CowStr::new_static(
3607 "app.bsky.ageassurance.defs#access",
3608 ),
3609 ..Default::default()
3610 }),
3611 );
3612 map.insert(
3613 SmolStr::new_static("attemptId"),
3614 LexObjectProperty::String(LexString {
3615 description: Some(
3616 CowStr::new_static(
3617 "The unique identifier for this instance of the age assurance flow, in UUID format.",
3618 ),
3619 ),
3620 ..Default::default()
3621 }),
3622 );
3623 map.insert(
3624 SmolStr::new_static("completeIp"),
3625 LexObjectProperty::String(LexString {
3626 description: Some(
3627 CowStr::new_static(
3628 "The IP address used when completing the AA flow.",
3629 ),
3630 ),
3631 ..Default::default()
3632 }),
3633 );
3634 map.insert(
3635 SmolStr::new_static("completeUa"),
3636 LexObjectProperty::String(LexString {
3637 description: Some(
3638 CowStr::new_static(
3639 "The user agent used when completing the AA flow.",
3640 ),
3641 ),
3642 ..Default::default()
3643 }),
3644 );
3645 map.insert(
3646 SmolStr::new_static("countryCode"),
3647 LexObjectProperty::String(LexString {
3648 description: Some(
3649 CowStr::new_static(
3650 "The ISO 3166-1 alpha-2 country code provided when beginning the Age Assurance flow.",
3651 ),
3652 ),
3653 ..Default::default()
3654 }),
3655 );
3656 map.insert(
3657 SmolStr::new_static("createdAt"),
3658 LexObjectProperty::String(LexString {
3659 description: Some(
3660 CowStr::new_static(
3661 "The date and time of this write operation.",
3662 ),
3663 ),
3664 format: Some(LexStringFormat::Datetime),
3665 ..Default::default()
3666 }),
3667 );
3668 map.insert(
3669 SmolStr::new_static("initIp"),
3670 LexObjectProperty::String(LexString {
3671 description: Some(
3672 CowStr::new_static(
3673 "The IP address used when initiating the AA flow.",
3674 ),
3675 ),
3676 ..Default::default()
3677 }),
3678 );
3679 map.insert(
3680 SmolStr::new_static("initUa"),
3681 LexObjectProperty::String(LexString {
3682 description: Some(
3683 CowStr::new_static(
3684 "The user agent used when initiating the AA flow.",
3685 ),
3686 ),
3687 ..Default::default()
3688 }),
3689 );
3690 map.insert(
3691 SmolStr::new_static("regionCode"),
3692 LexObjectProperty::String(LexString {
3693 description: Some(
3694 CowStr::new_static(
3695 "The ISO 3166-2 region code provided when beginning the Age Assurance flow.",
3696 ),
3697 ),
3698 ..Default::default()
3699 }),
3700 );
3701 map.insert(
3702 SmolStr::new_static("status"),
3703 LexObjectProperty::String(LexString {
3704 description: Some(
3705 CowStr::new_static(
3706 "The status of the Age Assurance process.",
3707 ),
3708 ),
3709 ..Default::default()
3710 }),
3711 );
3712 map
3713 },
3714 ..Default::default()
3715 }),
3716 );
3717 map.insert(
3718 SmolStr::new_static("ageAssuranceOverrideEvent"),
3719 LexUserType::Object(LexObject {
3720 description: Some(
3721 CowStr::new_static(
3722 "Age assurance status override by moderators. Only works on DID subjects.",
3723 ),
3724 ),
3725 required: Some(
3726 vec![
3727 SmolStr::new_static("comment"), SmolStr::new_static("status")
3728 ],
3729 ),
3730 properties: {
3731 #[allow(unused_mut)]
3732 let mut map = BTreeMap::new();
3733 map.insert(
3734 SmolStr::new_static("access"),
3735 LexObjectProperty::Ref(LexRef {
3736 r#ref: CowStr::new_static(
3737 "app.bsky.ageassurance.defs#access",
3738 ),
3739 ..Default::default()
3740 }),
3741 );
3742 map.insert(
3743 SmolStr::new_static("comment"),
3744 LexObjectProperty::String(LexString {
3745 description: Some(
3746 CowStr::new_static(
3747 "Comment describing the reason for the override.",
3748 ),
3749 ),
3750 min_length: Some(1usize),
3751 ..Default::default()
3752 }),
3753 );
3754 map.insert(
3755 SmolStr::new_static("status"),
3756 LexObjectProperty::String(LexString {
3757 description: Some(
3758 CowStr::new_static(
3759 "The status to be set for the user decided by a moderator, overriding whatever value the user had previously. Use reset to default to original state.",
3760 ),
3761 ),
3762 ..Default::default()
3763 }),
3764 );
3765 map
3766 },
3767 ..Default::default()
3768 }),
3769 );
3770 map.insert(
3771 SmolStr::new_static("ageAssurancePurgeEvent"),
3772 LexUserType::Object(LexObject {
3773 description: Some(
3774 CowStr::new_static(
3775 "Purges all age assurance events for the subject. Only works on DID subjects. Moderator-only.",
3776 ),
3777 ),
3778 required: Some(vec![SmolStr::new_static("comment")]),
3779 properties: {
3780 #[allow(unused_mut)]
3781 let mut map = BTreeMap::new();
3782 map.insert(
3783 SmolStr::new_static("comment"),
3784 LexObjectProperty::String(LexString {
3785 description: Some(
3786 CowStr::new_static(
3787 "Comment describing the reason for the purge.",
3788 ),
3789 ),
3790 min_length: Some(1usize),
3791 ..Default::default()
3792 }),
3793 );
3794 map
3795 },
3796 ..Default::default()
3797 }),
3798 );
3799 map.insert(
3800 SmolStr::new_static("blobView"),
3801 LexUserType::Object(LexObject {
3802 required: Some(
3803 vec![
3804 SmolStr::new_static("cid"), SmolStr::new_static("mimeType"),
3805 SmolStr::new_static("size"), SmolStr::new_static("createdAt")
3806 ],
3807 ),
3808 properties: {
3809 #[allow(unused_mut)]
3810 let mut map = BTreeMap::new();
3811 map.insert(
3812 SmolStr::new_static("cid"),
3813 LexObjectProperty::String(LexString {
3814 format: Some(LexStringFormat::Cid),
3815 ..Default::default()
3816 }),
3817 );
3818 map.insert(
3819 SmolStr::new_static("createdAt"),
3820 LexObjectProperty::String(LexString {
3821 format: Some(LexStringFormat::Datetime),
3822 ..Default::default()
3823 }),
3824 );
3825 map.insert(
3826 SmolStr::new_static("details"),
3827 LexObjectProperty::Union(LexRefUnion {
3828 refs: vec![
3829 CowStr::new_static("#imageDetails"),
3830 CowStr::new_static("#videoDetails")
3831 ],
3832 ..Default::default()
3833 }),
3834 );
3835 map.insert(
3836 SmolStr::new_static("mimeType"),
3837 LexObjectProperty::String(LexString { ..Default::default() }),
3838 );
3839 map.insert(
3840 SmolStr::new_static("moderation"),
3841 LexObjectProperty::Ref(LexRef {
3842 r#ref: CowStr::new_static("#moderation"),
3843 ..Default::default()
3844 }),
3845 );
3846 map.insert(
3847 SmolStr::new_static("size"),
3848 LexObjectProperty::Integer(LexInteger {
3849 ..Default::default()
3850 }),
3851 );
3852 map
3853 },
3854 ..Default::default()
3855 }),
3856 );
3857 map.insert(
3858 SmolStr::new_static("cancelScheduledTakedownEvent"),
3859 LexUserType::Object(LexObject {
3860 description: Some(
3861 CowStr::new_static(
3862 "Logs cancellation of a scheduled takedown action for an account.",
3863 ),
3864 ),
3865 properties: {
3866 #[allow(unused_mut)]
3867 let mut map = BTreeMap::new();
3868 map.insert(
3869 SmolStr::new_static("comment"),
3870 LexObjectProperty::String(LexString { ..Default::default() }),
3871 );
3872 map
3873 },
3874 ..Default::default()
3875 }),
3876 );
3877 map.insert(
3878 SmolStr::new_static("identityEvent"),
3879 LexUserType::Object(LexObject {
3880 description: Some(
3881 CowStr::new_static(
3882 "Logs identity related events on a repo subject. Normally captured by automod from the firehose and emitted to ozone for historical tracking.",
3883 ),
3884 ),
3885 required: Some(vec![SmolStr::new_static("timestamp")]),
3886 properties: {
3887 #[allow(unused_mut)]
3888 let mut map = BTreeMap::new();
3889 map.insert(
3890 SmolStr::new_static("comment"),
3891 LexObjectProperty::String(LexString { ..Default::default() }),
3892 );
3893 map.insert(
3894 SmolStr::new_static("handle"),
3895 LexObjectProperty::String(LexString {
3896 format: Some(LexStringFormat::Handle),
3897 ..Default::default()
3898 }),
3899 );
3900 map.insert(
3901 SmolStr::new_static("pdsHost"),
3902 LexObjectProperty::String(LexString {
3903 format: Some(LexStringFormat::Uri),
3904 ..Default::default()
3905 }),
3906 );
3907 map.insert(
3908 SmolStr::new_static("timestamp"),
3909 LexObjectProperty::String(LexString {
3910 format: Some(LexStringFormat::Datetime),
3911 ..Default::default()
3912 }),
3913 );
3914 map.insert(
3915 SmolStr::new_static("tombstone"),
3916 LexObjectProperty::Boolean(LexBoolean {
3917 ..Default::default()
3918 }),
3919 );
3920 map
3921 },
3922 ..Default::default()
3923 }),
3924 );
3925 map.insert(
3926 SmolStr::new_static("imageDetails"),
3927 LexUserType::Object(LexObject {
3928 required: Some(
3929 vec![SmolStr::new_static("width"), SmolStr::new_static("height")],
3930 ),
3931 properties: {
3932 #[allow(unused_mut)]
3933 let mut map = BTreeMap::new();
3934 map.insert(
3935 SmolStr::new_static("height"),
3936 LexObjectProperty::Integer(LexInteger {
3937 ..Default::default()
3938 }),
3939 );
3940 map.insert(
3941 SmolStr::new_static("width"),
3942 LexObjectProperty::Integer(LexInteger {
3943 ..Default::default()
3944 }),
3945 );
3946 map
3947 },
3948 ..Default::default()
3949 }),
3950 );
3951 map.insert(
3952 SmolStr::new_static("modEventAcknowledge"),
3953 LexUserType::Object(LexObject {
3954 properties: {
3955 #[allow(unused_mut)]
3956 let mut map = BTreeMap::new();
3957 map.insert(
3958 SmolStr::new_static("acknowledgeAccountSubjects"),
3959 LexObjectProperty::Boolean(LexBoolean {
3960 ..Default::default()
3961 }),
3962 );
3963 map.insert(
3964 SmolStr::new_static("comment"),
3965 LexObjectProperty::String(LexString { ..Default::default() }),
3966 );
3967 map
3968 },
3969 ..Default::default()
3970 }),
3971 );
3972 map.insert(
3973 SmolStr::new_static("modEventComment"),
3974 LexUserType::Object(LexObject {
3975 description: Some(
3976 CowStr::new_static(
3977 "Add a comment to a subject. An empty comment will clear any previously set sticky comment.",
3978 ),
3979 ),
3980 properties: {
3981 #[allow(unused_mut)]
3982 let mut map = BTreeMap::new();
3983 map.insert(
3984 SmolStr::new_static("comment"),
3985 LexObjectProperty::String(LexString { ..Default::default() }),
3986 );
3987 map.insert(
3988 SmolStr::new_static("sticky"),
3989 LexObjectProperty::Boolean(LexBoolean {
3990 ..Default::default()
3991 }),
3992 );
3993 map
3994 },
3995 ..Default::default()
3996 }),
3997 );
3998 map.insert(
3999 SmolStr::new_static("modEventDivert"),
4000 LexUserType::Object(LexObject {
4001 description: Some(
4002 CowStr::new_static(
4003 "Divert a record's blobs to a 3rd party service for further scanning/tagging",
4004 ),
4005 ),
4006 properties: {
4007 #[allow(unused_mut)]
4008 let mut map = BTreeMap::new();
4009 map.insert(
4010 SmolStr::new_static("comment"),
4011 LexObjectProperty::String(LexString { ..Default::default() }),
4012 );
4013 map
4014 },
4015 ..Default::default()
4016 }),
4017 );
4018 map.insert(
4019 SmolStr::new_static("modEventEmail"),
4020 LexUserType::Object(LexObject {
4021 description: Some(
4022 CowStr::new_static("Keep a log of outgoing email to a user"),
4023 ),
4024 required: Some(vec![SmolStr::new_static("subjectLine")]),
4025 properties: {
4026 #[allow(unused_mut)]
4027 let mut map = BTreeMap::new();
4028 map.insert(
4029 SmolStr::new_static("comment"),
4030 LexObjectProperty::String(LexString {
4031 description: Some(
4032 CowStr::new_static(
4033 "Additional comment about the outgoing comm.",
4034 ),
4035 ),
4036 ..Default::default()
4037 }),
4038 );
4039 map.insert(
4040 SmolStr::new_static("content"),
4041 LexObjectProperty::String(LexString {
4042 description: Some(
4043 CowStr::new_static(
4044 "The content of the email sent to the user.",
4045 ),
4046 ),
4047 ..Default::default()
4048 }),
4049 );
4050 map.insert(
4051 SmolStr::new_static("isDelivered"),
4052 LexObjectProperty::Boolean(LexBoolean {
4053 ..Default::default()
4054 }),
4055 );
4056 map.insert(
4057 SmolStr::new_static("policies"),
4058 LexObjectProperty::Array(LexArray {
4059 description: Some(
4060 CowStr::new_static(
4061 "Names/Keywords of the policies that necessitated the email.",
4062 ),
4063 ),
4064 items: LexArrayItem::String(LexString {
4065 ..Default::default()
4066 }),
4067 max_length: Some(5usize),
4068 ..Default::default()
4069 }),
4070 );
4071 map.insert(
4072 SmolStr::new_static("severityLevel"),
4073 LexObjectProperty::String(LexString {
4074 description: Some(
4075 CowStr::new_static(
4076 "Severity level of the violation. Normally 'sev-1' that adds strike on repeat offense",
4077 ),
4078 ),
4079 ..Default::default()
4080 }),
4081 );
4082 map.insert(
4083 SmolStr::new_static("strikeCount"),
4084 LexObjectProperty::Integer(LexInteger {
4085 ..Default::default()
4086 }),
4087 );
4088 map.insert(
4089 SmolStr::new_static("strikeExpiresAt"),
4090 LexObjectProperty::String(LexString {
4091 description: Some(
4092 CowStr::new_static(
4093 "When the strike should expire. If not provided, the strike never expires.",
4094 ),
4095 ),
4096 format: Some(LexStringFormat::Datetime),
4097 ..Default::default()
4098 }),
4099 );
4100 map.insert(
4101 SmolStr::new_static("subjectLine"),
4102 LexObjectProperty::String(LexString {
4103 description: Some(
4104 CowStr::new_static(
4105 "The subject line of the email sent to the user.",
4106 ),
4107 ),
4108 ..Default::default()
4109 }),
4110 );
4111 map
4112 },
4113 ..Default::default()
4114 }),
4115 );
4116 map.insert(
4117 SmolStr::new_static("modEventEscalate"),
4118 LexUserType::Object(LexObject {
4119 properties: {
4120 #[allow(unused_mut)]
4121 let mut map = BTreeMap::new();
4122 map.insert(
4123 SmolStr::new_static("comment"),
4124 LexObjectProperty::String(LexString { ..Default::default() }),
4125 );
4126 map
4127 },
4128 ..Default::default()
4129 }),
4130 );
4131 map.insert(
4132 SmolStr::new_static("modEventLabel"),
4133 LexUserType::Object(LexObject {
4134 description: Some(
4135 CowStr::new_static("Apply/Negate labels on a subject"),
4136 ),
4137 required: Some(
4138 vec![
4139 SmolStr::new_static("createLabelVals"),
4140 SmolStr::new_static("negateLabelVals")
4141 ],
4142 ),
4143 properties: {
4144 #[allow(unused_mut)]
4145 let mut map = BTreeMap::new();
4146 map.insert(
4147 SmolStr::new_static("comment"),
4148 LexObjectProperty::String(LexString { ..Default::default() }),
4149 );
4150 map.insert(
4151 SmolStr::new_static("createLabelVals"),
4152 LexObjectProperty::Array(LexArray {
4153 items: LexArrayItem::String(LexString {
4154 ..Default::default()
4155 }),
4156 ..Default::default()
4157 }),
4158 );
4159 map.insert(
4160 SmolStr::new_static("durationInHours"),
4161 LexObjectProperty::Integer(LexInteger {
4162 ..Default::default()
4163 }),
4164 );
4165 map.insert(
4166 SmolStr::new_static("negateLabelVals"),
4167 LexObjectProperty::Array(LexArray {
4168 items: LexArrayItem::String(LexString {
4169 ..Default::default()
4170 }),
4171 ..Default::default()
4172 }),
4173 );
4174 map
4175 },
4176 ..Default::default()
4177 }),
4178 );
4179 map.insert(
4180 SmolStr::new_static("modEventMute"),
4181 LexUserType::Object(LexObject {
4182 description: Some(
4183 CowStr::new_static("Mute incoming reports on a subject"),
4184 ),
4185 required: Some(vec![SmolStr::new_static("durationInHours")]),
4186 properties: {
4187 #[allow(unused_mut)]
4188 let mut map = BTreeMap::new();
4189 map.insert(
4190 SmolStr::new_static("comment"),
4191 LexObjectProperty::String(LexString { ..Default::default() }),
4192 );
4193 map.insert(
4194 SmolStr::new_static("durationInHours"),
4195 LexObjectProperty::Integer(LexInteger {
4196 ..Default::default()
4197 }),
4198 );
4199 map
4200 },
4201 ..Default::default()
4202 }),
4203 );
4204 map.insert(
4205 SmolStr::new_static("modEventMuteReporter"),
4206 LexUserType::Object(LexObject {
4207 description: Some(
4208 CowStr::new_static("Mute incoming reports from an account"),
4209 ),
4210 properties: {
4211 #[allow(unused_mut)]
4212 let mut map = BTreeMap::new();
4213 map.insert(
4214 SmolStr::new_static("comment"),
4215 LexObjectProperty::String(LexString { ..Default::default() }),
4216 );
4217 map.insert(
4218 SmolStr::new_static("durationInHours"),
4219 LexObjectProperty::Integer(LexInteger {
4220 ..Default::default()
4221 }),
4222 );
4223 map
4224 },
4225 ..Default::default()
4226 }),
4227 );
4228 map.insert(
4229 SmolStr::new_static("modEventPriorityScore"),
4230 LexUserType::Object(LexObject {
4231 description: Some(
4232 CowStr::new_static(
4233 "Set priority score of the subject. Higher score means higher priority.",
4234 ),
4235 ),
4236 required: Some(vec![SmolStr::new_static("score")]),
4237 properties: {
4238 #[allow(unused_mut)]
4239 let mut map = BTreeMap::new();
4240 map.insert(
4241 SmolStr::new_static("comment"),
4242 LexObjectProperty::String(LexString { ..Default::default() }),
4243 );
4244 map.insert(
4245 SmolStr::new_static("score"),
4246 LexObjectProperty::Integer(LexInteger {
4247 minimum: Some(0i64),
4248 maximum: Some(100i64),
4249 ..Default::default()
4250 }),
4251 );
4252 map
4253 },
4254 ..Default::default()
4255 }),
4256 );
4257 map.insert(
4258 SmolStr::new_static("modEventReport"),
4259 LexUserType::Object(LexObject {
4260 description: Some(CowStr::new_static("Report a subject")),
4261 required: Some(vec![SmolStr::new_static("reportType")]),
4262 properties: {
4263 #[allow(unused_mut)]
4264 let mut map = BTreeMap::new();
4265 map.insert(
4266 SmolStr::new_static("comment"),
4267 LexObjectProperty::String(LexString { ..Default::default() }),
4268 );
4269 map.insert(
4270 SmolStr::new_static("isReporterMuted"),
4271 LexObjectProperty::Boolean(LexBoolean {
4272 ..Default::default()
4273 }),
4274 );
4275 map.insert(
4276 SmolStr::new_static("reportType"),
4277 LexObjectProperty::Ref(LexRef {
4278 r#ref: CowStr::new_static(
4279 "com.atproto.moderation.defs#reasonType",
4280 ),
4281 ..Default::default()
4282 }),
4283 );
4284 map
4285 },
4286 ..Default::default()
4287 }),
4288 );
4289 map.insert(
4290 SmolStr::new_static("modEventResolveAppeal"),
4291 LexUserType::Object(LexObject {
4292 description: Some(CowStr::new_static("Resolve appeal on a subject")),
4293 properties: {
4294 #[allow(unused_mut)]
4295 let mut map = BTreeMap::new();
4296 map.insert(
4297 SmolStr::new_static("comment"),
4298 LexObjectProperty::String(LexString {
4299 description: Some(
4300 CowStr::new_static("Describe resolution."),
4301 ),
4302 ..Default::default()
4303 }),
4304 );
4305 map
4306 },
4307 ..Default::default()
4308 }),
4309 );
4310 map.insert(
4311 SmolStr::new_static("modEventReverseTakedown"),
4312 LexUserType::Object(LexObject {
4313 description: Some(
4314 CowStr::new_static("Revert take down action on a subject"),
4315 ),
4316 properties: {
4317 #[allow(unused_mut)]
4318 let mut map = BTreeMap::new();
4319 map.insert(
4320 SmolStr::new_static("comment"),
4321 LexObjectProperty::String(LexString {
4322 description: Some(
4323 CowStr::new_static(
4324 "Describe reasoning behind the reversal.",
4325 ),
4326 ),
4327 ..Default::default()
4328 }),
4329 );
4330 map.insert(
4331 SmolStr::new_static("policies"),
4332 LexObjectProperty::Array(LexArray {
4333 description: Some(
4334 CowStr::new_static(
4335 "Names/Keywords of the policy infraction for which takedown is being reversed.",
4336 ),
4337 ),
4338 items: LexArrayItem::String(LexString {
4339 ..Default::default()
4340 }),
4341 max_length: Some(5usize),
4342 ..Default::default()
4343 }),
4344 );
4345 map.insert(
4346 SmolStr::new_static("severityLevel"),
4347 LexObjectProperty::String(LexString {
4348 description: Some(
4349 CowStr::new_static(
4350 "Severity level of the violation. Usually set from the last policy infraction's severity.",
4351 ),
4352 ),
4353 ..Default::default()
4354 }),
4355 );
4356 map.insert(
4357 SmolStr::new_static("strikeCount"),
4358 LexObjectProperty::Integer(LexInteger {
4359 ..Default::default()
4360 }),
4361 );
4362 map
4363 },
4364 ..Default::default()
4365 }),
4366 );
4367 map.insert(
4368 SmolStr::new_static("modEventTag"),
4369 LexUserType::Object(LexObject {
4370 description: Some(
4371 CowStr::new_static("Add/Remove a tag on a subject"),
4372 ),
4373 required: Some(
4374 vec![SmolStr::new_static("add"), SmolStr::new_static("remove")],
4375 ),
4376 properties: {
4377 #[allow(unused_mut)]
4378 let mut map = BTreeMap::new();
4379 map.insert(
4380 SmolStr::new_static("add"),
4381 LexObjectProperty::Array(LexArray {
4382 description: Some(
4383 CowStr::new_static(
4384 "Tags to be added to the subject. If already exists, won't be duplicated.",
4385 ),
4386 ),
4387 items: LexArrayItem::String(LexString {
4388 ..Default::default()
4389 }),
4390 ..Default::default()
4391 }),
4392 );
4393 map.insert(
4394 SmolStr::new_static("comment"),
4395 LexObjectProperty::String(LexString {
4396 description: Some(
4397 CowStr::new_static(
4398 "Additional comment about added/removed tags.",
4399 ),
4400 ),
4401 ..Default::default()
4402 }),
4403 );
4404 map.insert(
4405 SmolStr::new_static("remove"),
4406 LexObjectProperty::Array(LexArray {
4407 description: Some(
4408 CowStr::new_static(
4409 "Tags to be removed to the subject. Ignores a tag If it doesn't exist, won't be duplicated.",
4410 ),
4411 ),
4412 items: LexArrayItem::String(LexString {
4413 ..Default::default()
4414 }),
4415 ..Default::default()
4416 }),
4417 );
4418 map
4419 },
4420 ..Default::default()
4421 }),
4422 );
4423 map.insert(
4424 SmolStr::new_static("modEventTakedown"),
4425 LexUserType::Object(LexObject {
4426 description: Some(
4427 CowStr::new_static(
4428 "Take down a subject permanently or temporarily",
4429 ),
4430 ),
4431 properties: {
4432 #[allow(unused_mut)]
4433 let mut map = BTreeMap::new();
4434 map.insert(
4435 SmolStr::new_static("acknowledgeAccountSubjects"),
4436 LexObjectProperty::Boolean(LexBoolean {
4437 ..Default::default()
4438 }),
4439 );
4440 map.insert(
4441 SmolStr::new_static("comment"),
4442 LexObjectProperty::String(LexString { ..Default::default() }),
4443 );
4444 map.insert(
4445 SmolStr::new_static("durationInHours"),
4446 LexObjectProperty::Integer(LexInteger {
4447 ..Default::default()
4448 }),
4449 );
4450 map.insert(
4451 SmolStr::new_static("policies"),
4452 LexObjectProperty::Array(LexArray {
4453 description: Some(
4454 CowStr::new_static(
4455 "Names/Keywords of the policies that drove the decision.",
4456 ),
4457 ),
4458 items: LexArrayItem::String(LexString {
4459 ..Default::default()
4460 }),
4461 max_length: Some(5usize),
4462 ..Default::default()
4463 }),
4464 );
4465 map.insert(
4466 SmolStr::new_static("severityLevel"),
4467 LexObjectProperty::String(LexString {
4468 description: Some(
4469 CowStr::new_static(
4470 "Severity level of the violation (e.g., 'sev-0', 'sev-1', 'sev-2', etc.).",
4471 ),
4472 ),
4473 ..Default::default()
4474 }),
4475 );
4476 map.insert(
4477 SmolStr::new_static("strikeCount"),
4478 LexObjectProperty::Integer(LexInteger {
4479 ..Default::default()
4480 }),
4481 );
4482 map.insert(
4483 SmolStr::new_static("strikeExpiresAt"),
4484 LexObjectProperty::String(LexString {
4485 description: Some(
4486 CowStr::new_static(
4487 "When the strike should expire. If not provided, the strike never expires.",
4488 ),
4489 ),
4490 format: Some(LexStringFormat::Datetime),
4491 ..Default::default()
4492 }),
4493 );
4494 map.insert(
4495 SmolStr::new_static("targetServices"),
4496 LexObjectProperty::Array(LexArray {
4497 description: Some(
4498 CowStr::new_static(
4499 "List of services where the takedown should be applied. If empty or not provided, takedown is applied on all configured services.",
4500 ),
4501 ),
4502 items: LexArrayItem::String(LexString {
4503 ..Default::default()
4504 }),
4505 ..Default::default()
4506 }),
4507 );
4508 map
4509 },
4510 ..Default::default()
4511 }),
4512 );
4513 map.insert(
4514 SmolStr::new_static("modEventUnmute"),
4515 LexUserType::Object(LexObject {
4516 description: Some(CowStr::new_static("Unmute action on a subject")),
4517 properties: {
4518 #[allow(unused_mut)]
4519 let mut map = BTreeMap::new();
4520 map.insert(
4521 SmolStr::new_static("comment"),
4522 LexObjectProperty::String(LexString {
4523 description: Some(
4524 CowStr::new_static(
4525 "Describe reasoning behind the reversal.",
4526 ),
4527 ),
4528 ..Default::default()
4529 }),
4530 );
4531 map
4532 },
4533 ..Default::default()
4534 }),
4535 );
4536 map.insert(
4537 SmolStr::new_static("modEventUnmuteReporter"),
4538 LexUserType::Object(LexObject {
4539 description: Some(
4540 CowStr::new_static("Unmute incoming reports from an account"),
4541 ),
4542 properties: {
4543 #[allow(unused_mut)]
4544 let mut map = BTreeMap::new();
4545 map.insert(
4546 SmolStr::new_static("comment"),
4547 LexObjectProperty::String(LexString {
4548 description: Some(
4549 CowStr::new_static(
4550 "Describe reasoning behind the reversal.",
4551 ),
4552 ),
4553 ..Default::default()
4554 }),
4555 );
4556 map
4557 },
4558 ..Default::default()
4559 }),
4560 );
4561 map.insert(
4562 SmolStr::new_static("modEventView"),
4563 LexUserType::Object(LexObject {
4564 required: Some(
4565 vec![
4566 SmolStr::new_static("id"), SmolStr::new_static("event"),
4567 SmolStr::new_static("subject"),
4568 SmolStr::new_static("subjectBlobCids"),
4569 SmolStr::new_static("createdBy"),
4570 SmolStr::new_static("createdAt")
4571 ],
4572 ),
4573 properties: {
4574 #[allow(unused_mut)]
4575 let mut map = BTreeMap::new();
4576 map.insert(
4577 SmolStr::new_static("createdAt"),
4578 LexObjectProperty::String(LexString {
4579 format: Some(LexStringFormat::Datetime),
4580 ..Default::default()
4581 }),
4582 );
4583 map.insert(
4584 SmolStr::new_static("createdBy"),
4585 LexObjectProperty::String(LexString {
4586 format: Some(LexStringFormat::Did),
4587 ..Default::default()
4588 }),
4589 );
4590 map.insert(
4591 SmolStr::new_static("creatorHandle"),
4592 LexObjectProperty::String(LexString { ..Default::default() }),
4593 );
4594 map.insert(
4595 SmolStr::new_static("event"),
4596 LexObjectProperty::Union(LexRefUnion {
4597 refs: vec![
4598 CowStr::new_static("#modEventTakedown"),
4599 CowStr::new_static("#modEventReverseTakedown"),
4600 CowStr::new_static("#modEventComment"),
4601 CowStr::new_static("#modEventReport"),
4602 CowStr::new_static("#modEventLabel"),
4603 CowStr::new_static("#modEventAcknowledge"),
4604 CowStr::new_static("#modEventEscalate"),
4605 CowStr::new_static("#modEventMute"),
4606 CowStr::new_static("#modEventUnmute"),
4607 CowStr::new_static("#modEventMuteReporter"),
4608 CowStr::new_static("#modEventUnmuteReporter"),
4609 CowStr::new_static("#modEventEmail"),
4610 CowStr::new_static("#modEventResolveAppeal"),
4611 CowStr::new_static("#modEventDivert"),
4612 CowStr::new_static("#modEventTag"),
4613 CowStr::new_static("#accountEvent"),
4614 CowStr::new_static("#identityEvent"),
4615 CowStr::new_static("#recordEvent"),
4616 CowStr::new_static("#modEventPriorityScore"),
4617 CowStr::new_static("#ageAssuranceEvent"),
4618 CowStr::new_static("#ageAssuranceOverrideEvent"),
4619 CowStr::new_static("#ageAssurancePurgeEvent"),
4620 CowStr::new_static("#revokeAccountCredentialsEvent"),
4621 CowStr::new_static("#scheduleTakedownEvent"),
4622 CowStr::new_static("#cancelScheduledTakedownEvent")
4623 ],
4624 ..Default::default()
4625 }),
4626 );
4627 map.insert(
4628 SmolStr::new_static("id"),
4629 LexObjectProperty::Integer(LexInteger {
4630 ..Default::default()
4631 }),
4632 );
4633 map.insert(
4634 SmolStr::new_static("modTool"),
4635 LexObjectProperty::Ref(LexRef {
4636 r#ref: CowStr::new_static("#modTool"),
4637 ..Default::default()
4638 }),
4639 );
4640 map.insert(
4641 SmolStr::new_static("subject"),
4642 LexObjectProperty::Union(LexRefUnion {
4643 refs: vec![
4644 CowStr::new_static("com.atproto.admin.defs#repoRef"),
4645 CowStr::new_static("com.atproto.repo.strongRef"),
4646 CowStr::new_static("chat.bsky.convo.defs#messageRef")
4647 ],
4648 ..Default::default()
4649 }),
4650 );
4651 map.insert(
4652 SmolStr::new_static("subjectBlobCids"),
4653 LexObjectProperty::Array(LexArray {
4654 items: LexArrayItem::String(LexString {
4655 ..Default::default()
4656 }),
4657 ..Default::default()
4658 }),
4659 );
4660 map.insert(
4661 SmolStr::new_static("subjectHandle"),
4662 LexObjectProperty::String(LexString { ..Default::default() }),
4663 );
4664 map
4665 },
4666 ..Default::default()
4667 }),
4668 );
4669 map.insert(
4670 SmolStr::new_static("modEventViewDetail"),
4671 LexUserType::Object(LexObject {
4672 required: Some(
4673 vec![
4674 SmolStr::new_static("id"), SmolStr::new_static("event"),
4675 SmolStr::new_static("subject"),
4676 SmolStr::new_static("subjectBlobs"),
4677 SmolStr::new_static("createdBy"),
4678 SmolStr::new_static("createdAt")
4679 ],
4680 ),
4681 properties: {
4682 #[allow(unused_mut)]
4683 let mut map = BTreeMap::new();
4684 map.insert(
4685 SmolStr::new_static("createdAt"),
4686 LexObjectProperty::String(LexString {
4687 format: Some(LexStringFormat::Datetime),
4688 ..Default::default()
4689 }),
4690 );
4691 map.insert(
4692 SmolStr::new_static("createdBy"),
4693 LexObjectProperty::String(LexString {
4694 format: Some(LexStringFormat::Did),
4695 ..Default::default()
4696 }),
4697 );
4698 map.insert(
4699 SmolStr::new_static("event"),
4700 LexObjectProperty::Union(LexRefUnion {
4701 refs: vec![
4702 CowStr::new_static("#modEventTakedown"),
4703 CowStr::new_static("#modEventReverseTakedown"),
4704 CowStr::new_static("#modEventComment"),
4705 CowStr::new_static("#modEventReport"),
4706 CowStr::new_static("#modEventLabel"),
4707 CowStr::new_static("#modEventAcknowledge"),
4708 CowStr::new_static("#modEventEscalate"),
4709 CowStr::new_static("#modEventMute"),
4710 CowStr::new_static("#modEventUnmute"),
4711 CowStr::new_static("#modEventMuteReporter"),
4712 CowStr::new_static("#modEventUnmuteReporter"),
4713 CowStr::new_static("#modEventEmail"),
4714 CowStr::new_static("#modEventResolveAppeal"),
4715 CowStr::new_static("#modEventDivert"),
4716 CowStr::new_static("#modEventTag"),
4717 CowStr::new_static("#accountEvent"),
4718 CowStr::new_static("#identityEvent"),
4719 CowStr::new_static("#recordEvent"),
4720 CowStr::new_static("#modEventPriorityScore"),
4721 CowStr::new_static("#ageAssuranceEvent"),
4722 CowStr::new_static("#ageAssuranceOverrideEvent"),
4723 CowStr::new_static("#ageAssurancePurgeEvent"),
4724 CowStr::new_static("#revokeAccountCredentialsEvent"),
4725 CowStr::new_static("#scheduleTakedownEvent"),
4726 CowStr::new_static("#cancelScheduledTakedownEvent")
4727 ],
4728 ..Default::default()
4729 }),
4730 );
4731 map.insert(
4732 SmolStr::new_static("id"),
4733 LexObjectProperty::Integer(LexInteger {
4734 ..Default::default()
4735 }),
4736 );
4737 map.insert(
4738 SmolStr::new_static("modTool"),
4739 LexObjectProperty::Ref(LexRef {
4740 r#ref: CowStr::new_static("#modTool"),
4741 ..Default::default()
4742 }),
4743 );
4744 map.insert(
4745 SmolStr::new_static("subject"),
4746 LexObjectProperty::Union(LexRefUnion {
4747 refs: vec![
4748 CowStr::new_static("#repoView"),
4749 CowStr::new_static("#repoViewNotFound"),
4750 CowStr::new_static("#recordView"),
4751 CowStr::new_static("#recordViewNotFound")
4752 ],
4753 ..Default::default()
4754 }),
4755 );
4756 map.insert(
4757 SmolStr::new_static("subjectBlobs"),
4758 LexObjectProperty::Array(LexArray {
4759 items: LexArrayItem::Ref(LexRef {
4760 r#ref: CowStr::new_static("#blobView"),
4761 ..Default::default()
4762 }),
4763 ..Default::default()
4764 }),
4765 );
4766 map
4767 },
4768 ..Default::default()
4769 }),
4770 );
4771 map.insert(
4772 SmolStr::new_static("modTool"),
4773 LexUserType::Object(LexObject {
4774 description: Some(
4775 CowStr::new_static(
4776 "Moderation tool information for tracing the source of the action",
4777 ),
4778 ),
4779 required: Some(vec![SmolStr::new_static("name")]),
4780 properties: {
4781 #[allow(unused_mut)]
4782 let mut map = BTreeMap::new();
4783 map.insert(
4784 SmolStr::new_static("meta"),
4785 LexObjectProperty::Unknown(LexUnknown {
4786 ..Default::default()
4787 }),
4788 );
4789 map.insert(
4790 SmolStr::new_static("name"),
4791 LexObjectProperty::String(LexString {
4792 description: Some(
4793 CowStr::new_static(
4794 "Name/identifier of the source (e.g., 'automod', 'ozone/workspace')",
4795 ),
4796 ),
4797 ..Default::default()
4798 }),
4799 );
4800 map
4801 },
4802 ..Default::default()
4803 }),
4804 );
4805 map.insert(
4806 SmolStr::new_static("moderation"),
4807 LexUserType::Object(LexObject {
4808 properties: {
4809 #[allow(unused_mut)]
4810 let mut map = BTreeMap::new();
4811 map.insert(
4812 SmolStr::new_static("subjectStatus"),
4813 LexObjectProperty::Ref(LexRef {
4814 r#ref: CowStr::new_static("#subjectStatusView"),
4815 ..Default::default()
4816 }),
4817 );
4818 map
4819 },
4820 ..Default::default()
4821 }),
4822 );
4823 map.insert(
4824 SmolStr::new_static("moderationDetail"),
4825 LexUserType::Object(LexObject {
4826 properties: {
4827 #[allow(unused_mut)]
4828 let mut map = BTreeMap::new();
4829 map.insert(
4830 SmolStr::new_static("subjectStatus"),
4831 LexObjectProperty::Ref(LexRef {
4832 r#ref: CowStr::new_static("#subjectStatusView"),
4833 ..Default::default()
4834 }),
4835 );
4836 map
4837 },
4838 ..Default::default()
4839 }),
4840 );
4841 map.insert(
4842 SmolStr::new_static("recordEvent"),
4843 LexUserType::Object(LexObject {
4844 description: Some(
4845 CowStr::new_static(
4846 "Logs lifecycle event on a record subject. Normally captured by automod from the firehose and emitted to ozone for historical tracking.",
4847 ),
4848 ),
4849 required: Some(
4850 vec![SmolStr::new_static("timestamp"), SmolStr::new_static("op")],
4851 ),
4852 properties: {
4853 #[allow(unused_mut)]
4854 let mut map = BTreeMap::new();
4855 map.insert(
4856 SmolStr::new_static("cid"),
4857 LexObjectProperty::String(LexString {
4858 format: Some(LexStringFormat::Cid),
4859 ..Default::default()
4860 }),
4861 );
4862 map.insert(
4863 SmolStr::new_static("comment"),
4864 LexObjectProperty::String(LexString { ..Default::default() }),
4865 );
4866 map.insert(
4867 SmolStr::new_static("op"),
4868 LexObjectProperty::String(LexString { ..Default::default() }),
4869 );
4870 map.insert(
4871 SmolStr::new_static("timestamp"),
4872 LexObjectProperty::String(LexString {
4873 format: Some(LexStringFormat::Datetime),
4874 ..Default::default()
4875 }),
4876 );
4877 map
4878 },
4879 ..Default::default()
4880 }),
4881 );
4882 map.insert(
4883 SmolStr::new_static("recordHosting"),
4884 LexUserType::Object(LexObject {
4885 required: Some(vec![SmolStr::new_static("status")]),
4886 properties: {
4887 #[allow(unused_mut)]
4888 let mut map = BTreeMap::new();
4889 map.insert(
4890 SmolStr::new_static("createdAt"),
4891 LexObjectProperty::String(LexString {
4892 format: Some(LexStringFormat::Datetime),
4893 ..Default::default()
4894 }),
4895 );
4896 map.insert(
4897 SmolStr::new_static("deletedAt"),
4898 LexObjectProperty::String(LexString {
4899 format: Some(LexStringFormat::Datetime),
4900 ..Default::default()
4901 }),
4902 );
4903 map.insert(
4904 SmolStr::new_static("status"),
4905 LexObjectProperty::String(LexString { ..Default::default() }),
4906 );
4907 map.insert(
4908 SmolStr::new_static("updatedAt"),
4909 LexObjectProperty::String(LexString {
4910 format: Some(LexStringFormat::Datetime),
4911 ..Default::default()
4912 }),
4913 );
4914 map
4915 },
4916 ..Default::default()
4917 }),
4918 );
4919 map.insert(
4920 SmolStr::new_static("recordView"),
4921 LexUserType::Object(LexObject {
4922 required: Some(
4923 vec![
4924 SmolStr::new_static("uri"), SmolStr::new_static("cid"),
4925 SmolStr::new_static("value"),
4926 SmolStr::new_static("blobCids"),
4927 SmolStr::new_static("indexedAt"),
4928 SmolStr::new_static("moderation"),
4929 SmolStr::new_static("repo")
4930 ],
4931 ),
4932 properties: {
4933 #[allow(unused_mut)]
4934 let mut map = BTreeMap::new();
4935 map.insert(
4936 SmolStr::new_static("blobCids"),
4937 LexObjectProperty::Array(LexArray {
4938 items: LexArrayItem::String(LexString {
4939 format: Some(LexStringFormat::Cid),
4940 ..Default::default()
4941 }),
4942 ..Default::default()
4943 }),
4944 );
4945 map.insert(
4946 SmolStr::new_static("cid"),
4947 LexObjectProperty::String(LexString {
4948 format: Some(LexStringFormat::Cid),
4949 ..Default::default()
4950 }),
4951 );
4952 map.insert(
4953 SmolStr::new_static("indexedAt"),
4954 LexObjectProperty::String(LexString {
4955 format: Some(LexStringFormat::Datetime),
4956 ..Default::default()
4957 }),
4958 );
4959 map.insert(
4960 SmolStr::new_static("moderation"),
4961 LexObjectProperty::Ref(LexRef {
4962 r#ref: CowStr::new_static("#moderation"),
4963 ..Default::default()
4964 }),
4965 );
4966 map.insert(
4967 SmolStr::new_static("repo"),
4968 LexObjectProperty::Ref(LexRef {
4969 r#ref: CowStr::new_static("#repoView"),
4970 ..Default::default()
4971 }),
4972 );
4973 map.insert(
4974 SmolStr::new_static("uri"),
4975 LexObjectProperty::String(LexString {
4976 format: Some(LexStringFormat::AtUri),
4977 ..Default::default()
4978 }),
4979 );
4980 map.insert(
4981 SmolStr::new_static("value"),
4982 LexObjectProperty::Unknown(LexUnknown {
4983 ..Default::default()
4984 }),
4985 );
4986 map
4987 },
4988 ..Default::default()
4989 }),
4990 );
4991 map.insert(
4992 SmolStr::new_static("recordViewDetail"),
4993 LexUserType::Object(LexObject {
4994 required: Some(
4995 vec![
4996 SmolStr::new_static("uri"), SmolStr::new_static("cid"),
4997 SmolStr::new_static("value"), SmolStr::new_static("blobs"),
4998 SmolStr::new_static("indexedAt"),
4999 SmolStr::new_static("moderation"),
5000 SmolStr::new_static("repo")
5001 ],
5002 ),
5003 properties: {
5004 #[allow(unused_mut)]
5005 let mut map = BTreeMap::new();
5006 map.insert(
5007 SmolStr::new_static("blobs"),
5008 LexObjectProperty::Array(LexArray {
5009 items: LexArrayItem::Ref(LexRef {
5010 r#ref: CowStr::new_static("#blobView"),
5011 ..Default::default()
5012 }),
5013 ..Default::default()
5014 }),
5015 );
5016 map.insert(
5017 SmolStr::new_static("cid"),
5018 LexObjectProperty::String(LexString {
5019 format: Some(LexStringFormat::Cid),
5020 ..Default::default()
5021 }),
5022 );
5023 map.insert(
5024 SmolStr::new_static("indexedAt"),
5025 LexObjectProperty::String(LexString {
5026 format: Some(LexStringFormat::Datetime),
5027 ..Default::default()
5028 }),
5029 );
5030 map.insert(
5031 SmolStr::new_static("labels"),
5032 LexObjectProperty::Array(LexArray {
5033 items: LexArrayItem::Ref(LexRef {
5034 r#ref: CowStr::new_static("com.atproto.label.defs#label"),
5035 ..Default::default()
5036 }),
5037 ..Default::default()
5038 }),
5039 );
5040 map.insert(
5041 SmolStr::new_static("moderation"),
5042 LexObjectProperty::Ref(LexRef {
5043 r#ref: CowStr::new_static("#moderationDetail"),
5044 ..Default::default()
5045 }),
5046 );
5047 map.insert(
5048 SmolStr::new_static("repo"),
5049 LexObjectProperty::Ref(LexRef {
5050 r#ref: CowStr::new_static("#repoView"),
5051 ..Default::default()
5052 }),
5053 );
5054 map.insert(
5055 SmolStr::new_static("uri"),
5056 LexObjectProperty::String(LexString {
5057 format: Some(LexStringFormat::AtUri),
5058 ..Default::default()
5059 }),
5060 );
5061 map.insert(
5062 SmolStr::new_static("value"),
5063 LexObjectProperty::Unknown(LexUnknown {
5064 ..Default::default()
5065 }),
5066 );
5067 map
5068 },
5069 ..Default::default()
5070 }),
5071 );
5072 map.insert(
5073 SmolStr::new_static("recordViewNotFound"),
5074 LexUserType::Object(LexObject {
5075 required: Some(vec![SmolStr::new_static("uri")]),
5076 properties: {
5077 #[allow(unused_mut)]
5078 let mut map = BTreeMap::new();
5079 map.insert(
5080 SmolStr::new_static("uri"),
5081 LexObjectProperty::String(LexString {
5082 format: Some(LexStringFormat::AtUri),
5083 ..Default::default()
5084 }),
5085 );
5086 map
5087 },
5088 ..Default::default()
5089 }),
5090 );
5091 map.insert(
5092 SmolStr::new_static("recordsStats"),
5093 LexUserType::Object(LexObject {
5094 description: Some(
5095 CowStr::new_static(
5096 "Statistics about a set of record subject items",
5097 ),
5098 ),
5099 properties: {
5100 #[allow(unused_mut)]
5101 let mut map = BTreeMap::new();
5102 map.insert(
5103 SmolStr::new_static("appealedCount"),
5104 LexObjectProperty::Integer(LexInteger {
5105 ..Default::default()
5106 }),
5107 );
5108 map.insert(
5109 SmolStr::new_static("escalatedCount"),
5110 LexObjectProperty::Integer(LexInteger {
5111 ..Default::default()
5112 }),
5113 );
5114 map.insert(
5115 SmolStr::new_static("pendingCount"),
5116 LexObjectProperty::Integer(LexInteger {
5117 ..Default::default()
5118 }),
5119 );
5120 map.insert(
5121 SmolStr::new_static("processedCount"),
5122 LexObjectProperty::Integer(LexInteger {
5123 ..Default::default()
5124 }),
5125 );
5126 map.insert(
5127 SmolStr::new_static("reportedCount"),
5128 LexObjectProperty::Integer(LexInteger {
5129 ..Default::default()
5130 }),
5131 );
5132 map.insert(
5133 SmolStr::new_static("subjectCount"),
5134 LexObjectProperty::Integer(LexInteger {
5135 ..Default::default()
5136 }),
5137 );
5138 map.insert(
5139 SmolStr::new_static("takendownCount"),
5140 LexObjectProperty::Integer(LexInteger {
5141 ..Default::default()
5142 }),
5143 );
5144 map.insert(
5145 SmolStr::new_static("totalReports"),
5146 LexObjectProperty::Integer(LexInteger {
5147 ..Default::default()
5148 }),
5149 );
5150 map
5151 },
5152 ..Default::default()
5153 }),
5154 );
5155 map.insert(
5156 SmolStr::new_static("repoView"),
5157 LexUserType::Object(LexObject {
5158 required: Some(
5159 vec![
5160 SmolStr::new_static("did"), SmolStr::new_static("handle"),
5161 SmolStr::new_static("relatedRecords"),
5162 SmolStr::new_static("indexedAt"),
5163 SmolStr::new_static("moderation")
5164 ],
5165 ),
5166 properties: {
5167 #[allow(unused_mut)]
5168 let mut map = BTreeMap::new();
5169 map.insert(
5170 SmolStr::new_static("deactivatedAt"),
5171 LexObjectProperty::String(LexString {
5172 format: Some(LexStringFormat::Datetime),
5173 ..Default::default()
5174 }),
5175 );
5176 map.insert(
5177 SmolStr::new_static("did"),
5178 LexObjectProperty::String(LexString {
5179 format: Some(LexStringFormat::Did),
5180 ..Default::default()
5181 }),
5182 );
5183 map.insert(
5184 SmolStr::new_static("email"),
5185 LexObjectProperty::String(LexString { ..Default::default() }),
5186 );
5187 map.insert(
5188 SmolStr::new_static("handle"),
5189 LexObjectProperty::String(LexString {
5190 format: Some(LexStringFormat::Handle),
5191 ..Default::default()
5192 }),
5193 );
5194 map.insert(
5195 SmolStr::new_static("indexedAt"),
5196 LexObjectProperty::String(LexString {
5197 format: Some(LexStringFormat::Datetime),
5198 ..Default::default()
5199 }),
5200 );
5201 map.insert(
5202 SmolStr::new_static("inviteNote"),
5203 LexObjectProperty::String(LexString { ..Default::default() }),
5204 );
5205 map.insert(
5206 SmolStr::new_static("invitedBy"),
5207 LexObjectProperty::Ref(LexRef {
5208 r#ref: CowStr::new_static(
5209 "com.atproto.server.defs#inviteCode",
5210 ),
5211 ..Default::default()
5212 }),
5213 );
5214 map.insert(
5215 SmolStr::new_static("invitesDisabled"),
5216 LexObjectProperty::Boolean(LexBoolean {
5217 ..Default::default()
5218 }),
5219 );
5220 map.insert(
5221 SmolStr::new_static("moderation"),
5222 LexObjectProperty::Ref(LexRef {
5223 r#ref: CowStr::new_static("#moderation"),
5224 ..Default::default()
5225 }),
5226 );
5227 map.insert(
5228 SmolStr::new_static("relatedRecords"),
5229 LexObjectProperty::Array(LexArray {
5230 items: LexArrayItem::Unknown(LexUnknown {
5231 ..Default::default()
5232 }),
5233 ..Default::default()
5234 }),
5235 );
5236 map.insert(
5237 SmolStr::new_static("threatSignatures"),
5238 LexObjectProperty::Array(LexArray {
5239 items: LexArrayItem::Ref(LexRef {
5240 r#ref: CowStr::new_static(
5241 "com.atproto.admin.defs#threatSignature",
5242 ),
5243 ..Default::default()
5244 }),
5245 ..Default::default()
5246 }),
5247 );
5248 map
5249 },
5250 ..Default::default()
5251 }),
5252 );
5253 map.insert(
5254 SmolStr::new_static("repoViewDetail"),
5255 LexUserType::Object(LexObject {
5256 required: Some(
5257 vec![
5258 SmolStr::new_static("did"), SmolStr::new_static("handle"),
5259 SmolStr::new_static("relatedRecords"),
5260 SmolStr::new_static("indexedAt"),
5261 SmolStr::new_static("moderation")
5262 ],
5263 ),
5264 properties: {
5265 #[allow(unused_mut)]
5266 let mut map = BTreeMap::new();
5267 map.insert(
5268 SmolStr::new_static("deactivatedAt"),
5269 LexObjectProperty::String(LexString {
5270 format: Some(LexStringFormat::Datetime),
5271 ..Default::default()
5272 }),
5273 );
5274 map.insert(
5275 SmolStr::new_static("did"),
5276 LexObjectProperty::String(LexString {
5277 format: Some(LexStringFormat::Did),
5278 ..Default::default()
5279 }),
5280 );
5281 map.insert(
5282 SmolStr::new_static("email"),
5283 LexObjectProperty::String(LexString { ..Default::default() }),
5284 );
5285 map.insert(
5286 SmolStr::new_static("emailConfirmedAt"),
5287 LexObjectProperty::String(LexString {
5288 format: Some(LexStringFormat::Datetime),
5289 ..Default::default()
5290 }),
5291 );
5292 map.insert(
5293 SmolStr::new_static("handle"),
5294 LexObjectProperty::String(LexString {
5295 format: Some(LexStringFormat::Handle),
5296 ..Default::default()
5297 }),
5298 );
5299 map.insert(
5300 SmolStr::new_static("indexedAt"),
5301 LexObjectProperty::String(LexString {
5302 format: Some(LexStringFormat::Datetime),
5303 ..Default::default()
5304 }),
5305 );
5306 map.insert(
5307 SmolStr::new_static("inviteNote"),
5308 LexObjectProperty::String(LexString { ..Default::default() }),
5309 );
5310 map.insert(
5311 SmolStr::new_static("invitedBy"),
5312 LexObjectProperty::Ref(LexRef {
5313 r#ref: CowStr::new_static(
5314 "com.atproto.server.defs#inviteCode",
5315 ),
5316 ..Default::default()
5317 }),
5318 );
5319 map.insert(
5320 SmolStr::new_static("invites"),
5321 LexObjectProperty::Array(LexArray {
5322 items: LexArrayItem::Ref(LexRef {
5323 r#ref: CowStr::new_static(
5324 "com.atproto.server.defs#inviteCode",
5325 ),
5326 ..Default::default()
5327 }),
5328 ..Default::default()
5329 }),
5330 );
5331 map.insert(
5332 SmolStr::new_static("invitesDisabled"),
5333 LexObjectProperty::Boolean(LexBoolean {
5334 ..Default::default()
5335 }),
5336 );
5337 map.insert(
5338 SmolStr::new_static("labels"),
5339 LexObjectProperty::Array(LexArray {
5340 items: LexArrayItem::Ref(LexRef {
5341 r#ref: CowStr::new_static("com.atproto.label.defs#label"),
5342 ..Default::default()
5343 }),
5344 ..Default::default()
5345 }),
5346 );
5347 map.insert(
5348 SmolStr::new_static("moderation"),
5349 LexObjectProperty::Ref(LexRef {
5350 r#ref: CowStr::new_static("#moderationDetail"),
5351 ..Default::default()
5352 }),
5353 );
5354 map.insert(
5355 SmolStr::new_static("relatedRecords"),
5356 LexObjectProperty::Array(LexArray {
5357 items: LexArrayItem::Unknown(LexUnknown {
5358 ..Default::default()
5359 }),
5360 ..Default::default()
5361 }),
5362 );
5363 map.insert(
5364 SmolStr::new_static("threatSignatures"),
5365 LexObjectProperty::Array(LexArray {
5366 items: LexArrayItem::Ref(LexRef {
5367 r#ref: CowStr::new_static(
5368 "com.atproto.admin.defs#threatSignature",
5369 ),
5370 ..Default::default()
5371 }),
5372 ..Default::default()
5373 }),
5374 );
5375 map
5376 },
5377 ..Default::default()
5378 }),
5379 );
5380 map.insert(
5381 SmolStr::new_static("repoViewNotFound"),
5382 LexUserType::Object(LexObject {
5383 required: Some(vec![SmolStr::new_static("did")]),
5384 properties: {
5385 #[allow(unused_mut)]
5386 let mut map = BTreeMap::new();
5387 map.insert(
5388 SmolStr::new_static("did"),
5389 LexObjectProperty::String(LexString {
5390 format: Some(LexStringFormat::Did),
5391 ..Default::default()
5392 }),
5393 );
5394 map
5395 },
5396 ..Default::default()
5397 }),
5398 );
5399 map.insert(
5400 SmolStr::new_static("reporterStats"),
5401 LexUserType::Object(LexObject {
5402 required: Some(
5403 vec![
5404 SmolStr::new_static("did"),
5405 SmolStr::new_static("accountReportCount"),
5406 SmolStr::new_static("recordReportCount"),
5407 SmolStr::new_static("reportedAccountCount"),
5408 SmolStr::new_static("reportedRecordCount"),
5409 SmolStr::new_static("takendownAccountCount"),
5410 SmolStr::new_static("takendownRecordCount"),
5411 SmolStr::new_static("labeledAccountCount"),
5412 SmolStr::new_static("labeledRecordCount")
5413 ],
5414 ),
5415 properties: {
5416 #[allow(unused_mut)]
5417 let mut map = BTreeMap::new();
5418 map.insert(
5419 SmolStr::new_static("accountReportCount"),
5420 LexObjectProperty::Integer(LexInteger {
5421 ..Default::default()
5422 }),
5423 );
5424 map.insert(
5425 SmolStr::new_static("did"),
5426 LexObjectProperty::String(LexString {
5427 format: Some(LexStringFormat::Did),
5428 ..Default::default()
5429 }),
5430 );
5431 map.insert(
5432 SmolStr::new_static("labeledAccountCount"),
5433 LexObjectProperty::Integer(LexInteger {
5434 ..Default::default()
5435 }),
5436 );
5437 map.insert(
5438 SmolStr::new_static("labeledRecordCount"),
5439 LexObjectProperty::Integer(LexInteger {
5440 ..Default::default()
5441 }),
5442 );
5443 map.insert(
5444 SmolStr::new_static("recordReportCount"),
5445 LexObjectProperty::Integer(LexInteger {
5446 ..Default::default()
5447 }),
5448 );
5449 map.insert(
5450 SmolStr::new_static("reportedAccountCount"),
5451 LexObjectProperty::Integer(LexInteger {
5452 ..Default::default()
5453 }),
5454 );
5455 map.insert(
5456 SmolStr::new_static("reportedRecordCount"),
5457 LexObjectProperty::Integer(LexInteger {
5458 ..Default::default()
5459 }),
5460 );
5461 map.insert(
5462 SmolStr::new_static("takendownAccountCount"),
5463 LexObjectProperty::Integer(LexInteger {
5464 ..Default::default()
5465 }),
5466 );
5467 map.insert(
5468 SmolStr::new_static("takendownRecordCount"),
5469 LexObjectProperty::Integer(LexInteger {
5470 ..Default::default()
5471 }),
5472 );
5473 map
5474 },
5475 ..Default::default()
5476 }),
5477 );
5478 map.insert(
5479 SmolStr::new_static("reviewClosed"),
5480 LexUserType::Token(LexToken { ..Default::default() }),
5481 );
5482 map.insert(
5483 SmolStr::new_static("reviewEscalated"),
5484 LexUserType::Token(LexToken { ..Default::default() }),
5485 );
5486 map.insert(
5487 SmolStr::new_static("reviewNone"),
5488 LexUserType::Token(LexToken { ..Default::default() }),
5489 );
5490 map.insert(
5491 SmolStr::new_static("reviewOpen"),
5492 LexUserType::Token(LexToken { ..Default::default() }),
5493 );
5494 map.insert(
5495 SmolStr::new_static("revokeAccountCredentialsEvent"),
5496 LexUserType::Object(LexObject {
5497 description: Some(
5498 CowStr::new_static(
5499 "Account credentials revocation by moderators. Only works on DID subjects.",
5500 ),
5501 ),
5502 required: Some(vec![SmolStr::new_static("comment")]),
5503 properties: {
5504 #[allow(unused_mut)]
5505 let mut map = BTreeMap::new();
5506 map.insert(
5507 SmolStr::new_static("comment"),
5508 LexObjectProperty::String(LexString {
5509 description: Some(
5510 CowStr::new_static(
5511 "Comment describing the reason for the revocation.",
5512 ),
5513 ),
5514 min_length: Some(1usize),
5515 ..Default::default()
5516 }),
5517 );
5518 map
5519 },
5520 ..Default::default()
5521 }),
5522 );
5523 map.insert(
5524 SmolStr::new_static("scheduleTakedownEvent"),
5525 LexUserType::Object(LexObject {
5526 description: Some(
5527 CowStr::new_static(
5528 "Logs a scheduled takedown action for an account.",
5529 ),
5530 ),
5531 properties: {
5532 #[allow(unused_mut)]
5533 let mut map = BTreeMap::new();
5534 map.insert(
5535 SmolStr::new_static("comment"),
5536 LexObjectProperty::String(LexString { ..Default::default() }),
5537 );
5538 map.insert(
5539 SmolStr::new_static("executeAfter"),
5540 LexObjectProperty::String(LexString {
5541 format: Some(LexStringFormat::Datetime),
5542 ..Default::default()
5543 }),
5544 );
5545 map.insert(
5546 SmolStr::new_static("executeAt"),
5547 LexObjectProperty::String(LexString {
5548 format: Some(LexStringFormat::Datetime),
5549 ..Default::default()
5550 }),
5551 );
5552 map.insert(
5553 SmolStr::new_static("executeUntil"),
5554 LexObjectProperty::String(LexString {
5555 format: Some(LexStringFormat::Datetime),
5556 ..Default::default()
5557 }),
5558 );
5559 map
5560 },
5561 ..Default::default()
5562 }),
5563 );
5564 map.insert(
5565 SmolStr::new_static("scheduledActionView"),
5566 LexUserType::Object(LexObject {
5567 description: Some(
5568 CowStr::new_static("View of a scheduled moderation action"),
5569 ),
5570 required: Some(
5571 vec![
5572 SmolStr::new_static("id"), SmolStr::new_static("action"),
5573 SmolStr::new_static("did"), SmolStr::new_static("createdBy"),
5574 SmolStr::new_static("createdAt"),
5575 SmolStr::new_static("status")
5576 ],
5577 ),
5578 properties: {
5579 #[allow(unused_mut)]
5580 let mut map = BTreeMap::new();
5581 map.insert(
5582 SmolStr::new_static("action"),
5583 LexObjectProperty::String(LexString {
5584 description: Some(
5585 CowStr::new_static("Type of action to be executed"),
5586 ),
5587 ..Default::default()
5588 }),
5589 );
5590 map.insert(
5591 SmolStr::new_static("createdAt"),
5592 LexObjectProperty::String(LexString {
5593 description: Some(
5594 CowStr::new_static("When the scheduled action was created"),
5595 ),
5596 format: Some(LexStringFormat::Datetime),
5597 ..Default::default()
5598 }),
5599 );
5600 map.insert(
5601 SmolStr::new_static("createdBy"),
5602 LexObjectProperty::String(LexString {
5603 description: Some(
5604 CowStr::new_static(
5605 "DID of the user who created this scheduled action",
5606 ),
5607 ),
5608 format: Some(LexStringFormat::Did),
5609 ..Default::default()
5610 }),
5611 );
5612 map.insert(
5613 SmolStr::new_static("did"),
5614 LexObjectProperty::String(LexString {
5615 description: Some(
5616 CowStr::new_static("Subject DID for the action"),
5617 ),
5618 format: Some(LexStringFormat::Did),
5619 ..Default::default()
5620 }),
5621 );
5622 map.insert(
5623 SmolStr::new_static("eventData"),
5624 LexObjectProperty::Unknown(LexUnknown {
5625 ..Default::default()
5626 }),
5627 );
5628 map.insert(
5629 SmolStr::new_static("executeAfter"),
5630 LexObjectProperty::String(LexString {
5631 description: Some(
5632 CowStr::new_static(
5633 "Earliest time to execute the action (for randomized scheduling)",
5634 ),
5635 ),
5636 format: Some(LexStringFormat::Datetime),
5637 ..Default::default()
5638 }),
5639 );
5640 map.insert(
5641 SmolStr::new_static("executeAt"),
5642 LexObjectProperty::String(LexString {
5643 description: Some(
5644 CowStr::new_static("Exact time to execute the action"),
5645 ),
5646 format: Some(LexStringFormat::Datetime),
5647 ..Default::default()
5648 }),
5649 );
5650 map.insert(
5651 SmolStr::new_static("executeUntil"),
5652 LexObjectProperty::String(LexString {
5653 description: Some(
5654 CowStr::new_static(
5655 "Latest time to execute the action (for randomized scheduling)",
5656 ),
5657 ),
5658 format: Some(LexStringFormat::Datetime),
5659 ..Default::default()
5660 }),
5661 );
5662 map.insert(
5663 SmolStr::new_static("executionEventId"),
5664 LexObjectProperty::Integer(LexInteger {
5665 ..Default::default()
5666 }),
5667 );
5668 map.insert(
5669 SmolStr::new_static("id"),
5670 LexObjectProperty::Integer(LexInteger {
5671 ..Default::default()
5672 }),
5673 );
5674 map.insert(
5675 SmolStr::new_static("lastExecutedAt"),
5676 LexObjectProperty::String(LexString {
5677 description: Some(
5678 CowStr::new_static(
5679 "When the action was last attempted to be executed",
5680 ),
5681 ),
5682 format: Some(LexStringFormat::Datetime),
5683 ..Default::default()
5684 }),
5685 );
5686 map.insert(
5687 SmolStr::new_static("lastFailureReason"),
5688 LexObjectProperty::String(LexString {
5689 description: Some(
5690 CowStr::new_static("Reason for the last execution failure"),
5691 ),
5692 ..Default::default()
5693 }),
5694 );
5695 map.insert(
5696 SmolStr::new_static("randomizeExecution"),
5697 LexObjectProperty::Boolean(LexBoolean {
5698 ..Default::default()
5699 }),
5700 );
5701 map.insert(
5702 SmolStr::new_static("status"),
5703 LexObjectProperty::String(LexString {
5704 description: Some(
5705 CowStr::new_static("Current status of the scheduled action"),
5706 ),
5707 ..Default::default()
5708 }),
5709 );
5710 map.insert(
5711 SmolStr::new_static("updatedAt"),
5712 LexObjectProperty::String(LexString {
5713 description: Some(
5714 CowStr::new_static(
5715 "When the scheduled action was last updated",
5716 ),
5717 ),
5718 format: Some(LexStringFormat::Datetime),
5719 ..Default::default()
5720 }),
5721 );
5722 map
5723 },
5724 ..Default::default()
5725 }),
5726 );
5727 map.insert(
5728 SmolStr::new_static("subjectReviewState"),
5729 LexUserType::String(LexString { ..Default::default() }),
5730 );
5731 map.insert(
5732 SmolStr::new_static("subjectStatusView"),
5733 LexUserType::Object(LexObject {
5734 required: Some(
5735 vec![
5736 SmolStr::new_static("id"), SmolStr::new_static("subject"),
5737 SmolStr::new_static("createdAt"),
5738 SmolStr::new_static("updatedAt"),
5739 SmolStr::new_static("reviewState")
5740 ],
5741 ),
5742 properties: {
5743 #[allow(unused_mut)]
5744 let mut map = BTreeMap::new();
5745 map.insert(
5746 SmolStr::new_static("accountStats"),
5747 LexObjectProperty::Ref(LexRef {
5748 r#ref: CowStr::new_static("#accountStats"),
5749 ..Default::default()
5750 }),
5751 );
5752 map.insert(
5753 SmolStr::new_static("accountStrike"),
5754 LexObjectProperty::Ref(LexRef {
5755 r#ref: CowStr::new_static("#accountStrike"),
5756 ..Default::default()
5757 }),
5758 );
5759 map.insert(
5760 SmolStr::new_static("ageAssuranceState"),
5761 LexObjectProperty::String(LexString {
5762 description: Some(
5763 CowStr::new_static(
5764 "Current age assurance state of the subject.",
5765 ),
5766 ),
5767 ..Default::default()
5768 }),
5769 );
5770 map.insert(
5771 SmolStr::new_static("ageAssuranceUpdatedBy"),
5772 LexObjectProperty::String(LexString {
5773 description: Some(
5774 CowStr::new_static(
5775 "Whether or not the last successful update to age assurance was made by the user or admin.",
5776 ),
5777 ),
5778 ..Default::default()
5779 }),
5780 );
5781 map.insert(
5782 SmolStr::new_static("appealed"),
5783 LexObjectProperty::Boolean(LexBoolean {
5784 ..Default::default()
5785 }),
5786 );
5787 map.insert(
5788 SmolStr::new_static("comment"),
5789 LexObjectProperty::String(LexString {
5790 description: Some(
5791 CowStr::new_static("Sticky comment on the subject."),
5792 ),
5793 ..Default::default()
5794 }),
5795 );
5796 map.insert(
5797 SmolStr::new_static("createdAt"),
5798 LexObjectProperty::String(LexString {
5799 description: Some(
5800 CowStr::new_static(
5801 "Timestamp referencing the first moderation status impacting event was emitted on the subject",
5802 ),
5803 ),
5804 format: Some(LexStringFormat::Datetime),
5805 ..Default::default()
5806 }),
5807 );
5808 map.insert(
5809 SmolStr::new_static("hosting"),
5810 LexObjectProperty::Union(LexRefUnion {
5811 refs: vec![
5812 CowStr::new_static("#accountHosting"),
5813 CowStr::new_static("#recordHosting")
5814 ],
5815 ..Default::default()
5816 }),
5817 );
5818 map.insert(
5819 SmolStr::new_static("id"),
5820 LexObjectProperty::Integer(LexInteger {
5821 ..Default::default()
5822 }),
5823 );
5824 map.insert(
5825 SmolStr::new_static("lastAppealedAt"),
5826 LexObjectProperty::String(LexString {
5827 description: Some(
5828 CowStr::new_static(
5829 "Timestamp referencing when the author of the subject appealed a moderation action",
5830 ),
5831 ),
5832 format: Some(LexStringFormat::Datetime),
5833 ..Default::default()
5834 }),
5835 );
5836 map.insert(
5837 SmolStr::new_static("lastReportedAt"),
5838 LexObjectProperty::String(LexString {
5839 format: Some(LexStringFormat::Datetime),
5840 ..Default::default()
5841 }),
5842 );
5843 map.insert(
5844 SmolStr::new_static("lastReviewedAt"),
5845 LexObjectProperty::String(LexString {
5846 format: Some(LexStringFormat::Datetime),
5847 ..Default::default()
5848 }),
5849 );
5850 map.insert(
5851 SmolStr::new_static("lastReviewedBy"),
5852 LexObjectProperty::String(LexString {
5853 format: Some(LexStringFormat::Did),
5854 ..Default::default()
5855 }),
5856 );
5857 map.insert(
5858 SmolStr::new_static("muteReportingUntil"),
5859 LexObjectProperty::String(LexString {
5860 format: Some(LexStringFormat::Datetime),
5861 ..Default::default()
5862 }),
5863 );
5864 map.insert(
5865 SmolStr::new_static("muteUntil"),
5866 LexObjectProperty::String(LexString {
5867 format: Some(LexStringFormat::Datetime),
5868 ..Default::default()
5869 }),
5870 );
5871 map.insert(
5872 SmolStr::new_static("priorityScore"),
5873 LexObjectProperty::Integer(LexInteger {
5874 minimum: Some(0i64),
5875 maximum: Some(100i64),
5876 ..Default::default()
5877 }),
5878 );
5879 map.insert(
5880 SmolStr::new_static("recordsStats"),
5881 LexObjectProperty::Ref(LexRef {
5882 r#ref: CowStr::new_static("#recordsStats"),
5883 ..Default::default()
5884 }),
5885 );
5886 map.insert(
5887 SmolStr::new_static("reviewState"),
5888 LexObjectProperty::Ref(LexRef {
5889 r#ref: CowStr::new_static("#subjectReviewState"),
5890 ..Default::default()
5891 }),
5892 );
5893 map.insert(
5894 SmolStr::new_static("subject"),
5895 LexObjectProperty::Union(LexRefUnion {
5896 refs: vec![
5897 CowStr::new_static("com.atproto.admin.defs#repoRef"),
5898 CowStr::new_static("com.atproto.repo.strongRef"),
5899 CowStr::new_static("chat.bsky.convo.defs#messageRef")
5900 ],
5901 ..Default::default()
5902 }),
5903 );
5904 map.insert(
5905 SmolStr::new_static("subjectBlobCids"),
5906 LexObjectProperty::Array(LexArray {
5907 items: LexArrayItem::String(LexString {
5908 format: Some(LexStringFormat::Cid),
5909 ..Default::default()
5910 }),
5911 ..Default::default()
5912 }),
5913 );
5914 map.insert(
5915 SmolStr::new_static("subjectRepoHandle"),
5916 LexObjectProperty::String(LexString { ..Default::default() }),
5917 );
5918 map.insert(
5919 SmolStr::new_static("suspendUntil"),
5920 LexObjectProperty::String(LexString {
5921 format: Some(LexStringFormat::Datetime),
5922 ..Default::default()
5923 }),
5924 );
5925 map.insert(
5926 SmolStr::new_static("tags"),
5927 LexObjectProperty::Array(LexArray {
5928 items: LexArrayItem::String(LexString {
5929 ..Default::default()
5930 }),
5931 ..Default::default()
5932 }),
5933 );
5934 map.insert(
5935 SmolStr::new_static("takendown"),
5936 LexObjectProperty::Boolean(LexBoolean {
5937 ..Default::default()
5938 }),
5939 );
5940 map.insert(
5941 SmolStr::new_static("updatedAt"),
5942 LexObjectProperty::String(LexString {
5943 description: Some(
5944 CowStr::new_static(
5945 "Timestamp referencing when the last update was made to the moderation status of the subject",
5946 ),
5947 ),
5948 format: Some(LexStringFormat::Datetime),
5949 ..Default::default()
5950 }),
5951 );
5952 map
5953 },
5954 ..Default::default()
5955 }),
5956 );
5957 map.insert(
5958 SmolStr::new_static("subjectView"),
5959 LexUserType::Object(LexObject {
5960 description: Some(
5961 CowStr::new_static(
5962 "Detailed view of a subject. For record subjects, the author's repo and profile will be returned.",
5963 ),
5964 ),
5965 required: Some(
5966 vec![SmolStr::new_static("type"), SmolStr::new_static("subject")],
5967 ),
5968 properties: {
5969 #[allow(unused_mut)]
5970 let mut map = BTreeMap::new();
5971 map.insert(
5972 SmolStr::new_static("profile"),
5973 LexObjectProperty::Union(LexRefUnion {
5974 refs: vec![],
5975 ..Default::default()
5976 }),
5977 );
5978 map.insert(
5979 SmolStr::new_static("record"),
5980 LexObjectProperty::Ref(LexRef {
5981 r#ref: CowStr::new_static("#recordViewDetail"),
5982 ..Default::default()
5983 }),
5984 );
5985 map.insert(
5986 SmolStr::new_static("repo"),
5987 LexObjectProperty::Ref(LexRef {
5988 r#ref: CowStr::new_static("#repoViewDetail"),
5989 ..Default::default()
5990 }),
5991 );
5992 map.insert(
5993 SmolStr::new_static("status"),
5994 LexObjectProperty::Ref(LexRef {
5995 r#ref: CowStr::new_static("#subjectStatusView"),
5996 ..Default::default()
5997 }),
5998 );
5999 map.insert(
6000 SmolStr::new_static("subject"),
6001 LexObjectProperty::String(LexString { ..Default::default() }),
6002 );
6003 map.insert(
6004 SmolStr::new_static("type"),
6005 LexObjectProperty::Ref(LexRef {
6006 r#ref: CowStr::new_static(
6007 "com.atproto.moderation.defs#subjectType",
6008 ),
6009 ..Default::default()
6010 }),
6011 );
6012 map
6013 },
6014 ..Default::default()
6015 }),
6016 );
6017 map.insert(
6018 SmolStr::new_static("timelineEventPlcCreate"),
6019 LexUserType::Token(LexToken { ..Default::default() }),
6020 );
6021 map.insert(
6022 SmolStr::new_static("timelineEventPlcOperation"),
6023 LexUserType::Token(LexToken { ..Default::default() }),
6024 );
6025 map.insert(
6026 SmolStr::new_static("timelineEventPlcTombstone"),
6027 LexUserType::Token(LexToken { ..Default::default() }),
6028 );
6029 map.insert(
6030 SmolStr::new_static("videoDetails"),
6031 LexUserType::Object(LexObject {
6032 required: Some(
6033 vec![
6034 SmolStr::new_static("width"), SmolStr::new_static("height"),
6035 SmolStr::new_static("length")
6036 ],
6037 ),
6038 properties: {
6039 #[allow(unused_mut)]
6040 let mut map = BTreeMap::new();
6041 map.insert(
6042 SmolStr::new_static("height"),
6043 LexObjectProperty::Integer(LexInteger {
6044 ..Default::default()
6045 }),
6046 );
6047 map.insert(
6048 SmolStr::new_static("length"),
6049 LexObjectProperty::Integer(LexInteger {
6050 ..Default::default()
6051 }),
6052 );
6053 map.insert(
6054 SmolStr::new_static("width"),
6055 LexObjectProperty::Integer(LexInteger {
6056 ..Default::default()
6057 }),
6058 );
6059 map
6060 },
6061 ..Default::default()
6062 }),
6063 );
6064 map
6065 },
6066 ..Default::default()
6067 }
6068}
6069
6070pub mod age_assurance_event_state {
6071
6072 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
6073 #[allow(unused)]
6074 use ::core::marker::PhantomData;
6075 mod sealed {
6076 pub trait Sealed {}
6077 }
6078 pub trait State: sealed::Sealed {
6080 type Status;
6081 type CreatedAt;
6082 type AttemptId;
6083 }
6084 pub struct Empty(());
6086 impl sealed::Sealed for Empty {}
6087 impl State for Empty {
6088 type Status = Unset;
6089 type CreatedAt = Unset;
6090 type AttemptId = Unset;
6091 }
6092 pub struct SetStatus<S: State = Empty>(PhantomData<fn() -> S>);
6094 impl<S: State> sealed::Sealed for SetStatus<S> {}
6095 impl<S: State> State for SetStatus<S> {
6096 type Status = Set<members::status>;
6097 type CreatedAt = S::CreatedAt;
6098 type AttemptId = S::AttemptId;
6099 }
6100 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>);
6102 impl<S: State> sealed::Sealed for SetCreatedAt<S> {}
6103 impl<S: State> State for SetCreatedAt<S> {
6104 type Status = S::Status;
6105 type CreatedAt = Set<members::created_at>;
6106 type AttemptId = S::AttemptId;
6107 }
6108 pub struct SetAttemptId<S: State = Empty>(PhantomData<fn() -> S>);
6110 impl<S: State> sealed::Sealed for SetAttemptId<S> {}
6111 impl<S: State> State for SetAttemptId<S> {
6112 type Status = S::Status;
6113 type CreatedAt = S::CreatedAt;
6114 type AttemptId = Set<members::attempt_id>;
6115 }
6116 #[allow(non_camel_case_types)]
6118 pub mod members {
6119 pub struct status(());
6121 pub struct created_at(());
6123 pub struct attempt_id(());
6125 }
6126}
6127
6128pub struct AgeAssuranceEventBuilder<'a, S: age_assurance_event_state::State> {
6130 _state: PhantomData<fn() -> S>,
6131 _fields: (
6132 Option<Access<'a>>,
6133 Option<CowStr<'a>>,
6134 Option<CowStr<'a>>,
6135 Option<CowStr<'a>>,
6136 Option<CowStr<'a>>,
6137 Option<Datetime>,
6138 Option<CowStr<'a>>,
6139 Option<CowStr<'a>>,
6140 Option<CowStr<'a>>,
6141 Option<AgeAssuranceEventStatus<'a>>,
6142 ),
6143 _lifetime: PhantomData<&'a ()>,
6144}
6145
6146impl<'a> AgeAssuranceEvent<'a> {
6147 pub fn new() -> AgeAssuranceEventBuilder<'a, age_assurance_event_state::Empty> {
6149 AgeAssuranceEventBuilder::new()
6150 }
6151}
6152
6153impl<'a> AgeAssuranceEventBuilder<'a, age_assurance_event_state::Empty> {
6154 pub fn new() -> Self {
6156 AgeAssuranceEventBuilder {
6157 _state: PhantomData,
6158 _fields: (None, None, None, None, None, None, None, None, None, None),
6159 _lifetime: PhantomData,
6160 }
6161 }
6162}
6163
6164impl<'a, S: age_assurance_event_state::State> AgeAssuranceEventBuilder<'a, S> {
6165 pub fn access(mut self, value: impl Into<Option<Access<'a>>>) -> Self {
6167 self._fields.0 = value.into();
6168 self
6169 }
6170 pub fn maybe_access(mut self, value: Option<Access<'a>>) -> Self {
6172 self._fields.0 = value;
6173 self
6174 }
6175}
6176
6177impl<'a, S> AgeAssuranceEventBuilder<'a, S>
6178where
6179 S: age_assurance_event_state::State,
6180 S::AttemptId: age_assurance_event_state::IsUnset,
6181{
6182 pub fn attempt_id(
6184 mut self,
6185 value: impl Into<CowStr<'a>>,
6186 ) -> AgeAssuranceEventBuilder<'a, age_assurance_event_state::SetAttemptId<S>> {
6187 self._fields.1 = Option::Some(value.into());
6188 AgeAssuranceEventBuilder {
6189 _state: PhantomData,
6190 _fields: self._fields,
6191 _lifetime: PhantomData,
6192 }
6193 }
6194}
6195
6196impl<'a, S: age_assurance_event_state::State> AgeAssuranceEventBuilder<'a, S> {
6197 pub fn complete_ip(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
6199 self._fields.2 = value.into();
6200 self
6201 }
6202 pub fn maybe_complete_ip(mut self, value: Option<CowStr<'a>>) -> Self {
6204 self._fields.2 = value;
6205 self
6206 }
6207}
6208
6209impl<'a, S: age_assurance_event_state::State> AgeAssuranceEventBuilder<'a, S> {
6210 pub fn complete_ua(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
6212 self._fields.3 = value.into();
6213 self
6214 }
6215 pub fn maybe_complete_ua(mut self, value: Option<CowStr<'a>>) -> Self {
6217 self._fields.3 = value;
6218 self
6219 }
6220}
6221
6222impl<'a, S: age_assurance_event_state::State> AgeAssuranceEventBuilder<'a, S> {
6223 pub fn country_code(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
6225 self._fields.4 = value.into();
6226 self
6227 }
6228 pub fn maybe_country_code(mut self, value: Option<CowStr<'a>>) -> Self {
6230 self._fields.4 = value;
6231 self
6232 }
6233}
6234
6235impl<'a, S> AgeAssuranceEventBuilder<'a, S>
6236where
6237 S: age_assurance_event_state::State,
6238 S::CreatedAt: age_assurance_event_state::IsUnset,
6239{
6240 pub fn created_at(
6242 mut self,
6243 value: impl Into<Datetime>,
6244 ) -> AgeAssuranceEventBuilder<'a, age_assurance_event_state::SetCreatedAt<S>> {
6245 self._fields.5 = Option::Some(value.into());
6246 AgeAssuranceEventBuilder {
6247 _state: PhantomData,
6248 _fields: self._fields,
6249 _lifetime: PhantomData,
6250 }
6251 }
6252}
6253
6254impl<'a, S: age_assurance_event_state::State> AgeAssuranceEventBuilder<'a, S> {
6255 pub fn init_ip(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
6257 self._fields.6 = value.into();
6258 self
6259 }
6260 pub fn maybe_init_ip(mut self, value: Option<CowStr<'a>>) -> Self {
6262 self._fields.6 = value;
6263 self
6264 }
6265}
6266
6267impl<'a, S: age_assurance_event_state::State> AgeAssuranceEventBuilder<'a, S> {
6268 pub fn init_ua(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
6270 self._fields.7 = value.into();
6271 self
6272 }
6273 pub fn maybe_init_ua(mut self, value: Option<CowStr<'a>>) -> Self {
6275 self._fields.7 = value;
6276 self
6277 }
6278}
6279
6280impl<'a, S: age_assurance_event_state::State> AgeAssuranceEventBuilder<'a, S> {
6281 pub fn region_code(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
6283 self._fields.8 = value.into();
6284 self
6285 }
6286 pub fn maybe_region_code(mut self, value: Option<CowStr<'a>>) -> Self {
6288 self._fields.8 = value;
6289 self
6290 }
6291}
6292
6293impl<'a, S> AgeAssuranceEventBuilder<'a, S>
6294where
6295 S: age_assurance_event_state::State,
6296 S::Status: age_assurance_event_state::IsUnset,
6297{
6298 pub fn status(
6300 mut self,
6301 value: impl Into<AgeAssuranceEventStatus<'a>>,
6302 ) -> AgeAssuranceEventBuilder<'a, age_assurance_event_state::SetStatus<S>> {
6303 self._fields.9 = Option::Some(value.into());
6304 AgeAssuranceEventBuilder {
6305 _state: PhantomData,
6306 _fields: self._fields,
6307 _lifetime: PhantomData,
6308 }
6309 }
6310}
6311
6312impl<'a, S> AgeAssuranceEventBuilder<'a, S>
6313where
6314 S: age_assurance_event_state::State,
6315 S::Status: age_assurance_event_state::IsSet,
6316 S::CreatedAt: age_assurance_event_state::IsSet,
6317 S::AttemptId: age_assurance_event_state::IsSet,
6318{
6319 pub fn build(self) -> AgeAssuranceEvent<'a> {
6321 AgeAssuranceEvent {
6322 access: self._fields.0,
6323 attempt_id: self._fields.1.unwrap(),
6324 complete_ip: self._fields.2,
6325 complete_ua: self._fields.3,
6326 country_code: self._fields.4,
6327 created_at: self._fields.5.unwrap(),
6328 init_ip: self._fields.6,
6329 init_ua: self._fields.7,
6330 region_code: self._fields.8,
6331 status: self._fields.9.unwrap(),
6332 extra_data: Default::default(),
6333 }
6334 }
6335 pub fn build_with_data(
6337 self,
6338 extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
6339 ) -> AgeAssuranceEvent<'a> {
6340 AgeAssuranceEvent {
6341 access: self._fields.0,
6342 attempt_id: self._fields.1.unwrap(),
6343 complete_ip: self._fields.2,
6344 complete_ua: self._fields.3,
6345 country_code: self._fields.4,
6346 created_at: self._fields.5.unwrap(),
6347 init_ip: self._fields.6,
6348 init_ua: self._fields.7,
6349 region_code: self._fields.8,
6350 status: self._fields.9.unwrap(),
6351 extra_data: Some(extra_data),
6352 }
6353 }
6354}
6355
6356pub mod blob_view_state {
6357
6358 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
6359 #[allow(unused)]
6360 use ::core::marker::PhantomData;
6361 mod sealed {
6362 pub trait Sealed {}
6363 }
6364 pub trait State: sealed::Sealed {
6366 type Size;
6367 type CreatedAt;
6368 type Cid;
6369 type MimeType;
6370 }
6371 pub struct Empty(());
6373 impl sealed::Sealed for Empty {}
6374 impl State for Empty {
6375 type Size = Unset;
6376 type CreatedAt = Unset;
6377 type Cid = Unset;
6378 type MimeType = Unset;
6379 }
6380 pub struct SetSize<S: State = Empty>(PhantomData<fn() -> S>);
6382 impl<S: State> sealed::Sealed for SetSize<S> {}
6383 impl<S: State> State for SetSize<S> {
6384 type Size = Set<members::size>;
6385 type CreatedAt = S::CreatedAt;
6386 type Cid = S::Cid;
6387 type MimeType = S::MimeType;
6388 }
6389 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>);
6391 impl<S: State> sealed::Sealed for SetCreatedAt<S> {}
6392 impl<S: State> State for SetCreatedAt<S> {
6393 type Size = S::Size;
6394 type CreatedAt = Set<members::created_at>;
6395 type Cid = S::Cid;
6396 type MimeType = S::MimeType;
6397 }
6398 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>);
6400 impl<S: State> sealed::Sealed for SetCid<S> {}
6401 impl<S: State> State for SetCid<S> {
6402 type Size = S::Size;
6403 type CreatedAt = S::CreatedAt;
6404 type Cid = Set<members::cid>;
6405 type MimeType = S::MimeType;
6406 }
6407 pub struct SetMimeType<S: State = Empty>(PhantomData<fn() -> S>);
6409 impl<S: State> sealed::Sealed for SetMimeType<S> {}
6410 impl<S: State> State for SetMimeType<S> {
6411 type Size = S::Size;
6412 type CreatedAt = S::CreatedAt;
6413 type Cid = S::Cid;
6414 type MimeType = Set<members::mime_type>;
6415 }
6416 #[allow(non_camel_case_types)]
6418 pub mod members {
6419 pub struct size(());
6421 pub struct created_at(());
6423 pub struct cid(());
6425 pub struct mime_type(());
6427 }
6428}
6429
6430pub struct BlobViewBuilder<'a, S: blob_view_state::State> {
6432 _state: PhantomData<fn() -> S>,
6433 _fields: (
6434 Option<Cid<'a>>,
6435 Option<Datetime>,
6436 Option<BlobViewDetails<'a>>,
6437 Option<CowStr<'a>>,
6438 Option<moderation::Moderation<'a>>,
6439 Option<i64>,
6440 ),
6441 _lifetime: PhantomData<&'a ()>,
6442}
6443
6444impl<'a> BlobView<'a> {
6445 pub fn new() -> BlobViewBuilder<'a, blob_view_state::Empty> {
6447 BlobViewBuilder::new()
6448 }
6449}
6450
6451impl<'a> BlobViewBuilder<'a, blob_view_state::Empty> {
6452 pub fn new() -> Self {
6454 BlobViewBuilder {
6455 _state: PhantomData,
6456 _fields: (None, None, None, None, None, None),
6457 _lifetime: PhantomData,
6458 }
6459 }
6460}
6461
6462impl<'a, S> BlobViewBuilder<'a, S>
6463where
6464 S: blob_view_state::State,
6465 S::Cid: blob_view_state::IsUnset,
6466{
6467 pub fn cid(
6469 mut self,
6470 value: impl Into<Cid<'a>>,
6471 ) -> BlobViewBuilder<'a, blob_view_state::SetCid<S>> {
6472 self._fields.0 = Option::Some(value.into());
6473 BlobViewBuilder {
6474 _state: PhantomData,
6475 _fields: self._fields,
6476 _lifetime: PhantomData,
6477 }
6478 }
6479}
6480
6481impl<'a, S> BlobViewBuilder<'a, S>
6482where
6483 S: blob_view_state::State,
6484 S::CreatedAt: blob_view_state::IsUnset,
6485{
6486 pub fn created_at(
6488 mut self,
6489 value: impl Into<Datetime>,
6490 ) -> BlobViewBuilder<'a, blob_view_state::SetCreatedAt<S>> {
6491 self._fields.1 = Option::Some(value.into());
6492 BlobViewBuilder {
6493 _state: PhantomData,
6494 _fields: self._fields,
6495 _lifetime: PhantomData,
6496 }
6497 }
6498}
6499
6500impl<'a, S: blob_view_state::State> BlobViewBuilder<'a, S> {
6501 pub fn details(mut self, value: impl Into<Option<BlobViewDetails<'a>>>) -> Self {
6503 self._fields.2 = value.into();
6504 self
6505 }
6506 pub fn maybe_details(mut self, value: Option<BlobViewDetails<'a>>) -> Self {
6508 self._fields.2 = value;
6509 self
6510 }
6511}
6512
6513impl<'a, S> BlobViewBuilder<'a, S>
6514where
6515 S: blob_view_state::State,
6516 S::MimeType: blob_view_state::IsUnset,
6517{
6518 pub fn mime_type(
6520 mut self,
6521 value: impl Into<CowStr<'a>>,
6522 ) -> BlobViewBuilder<'a, blob_view_state::SetMimeType<S>> {
6523 self._fields.3 = Option::Some(value.into());
6524 BlobViewBuilder {
6525 _state: PhantomData,
6526 _fields: self._fields,
6527 _lifetime: PhantomData,
6528 }
6529 }
6530}
6531
6532impl<'a, S: blob_view_state::State> BlobViewBuilder<'a, S> {
6533 pub fn moderation(
6535 mut self,
6536 value: impl Into<Option<moderation::Moderation<'a>>>,
6537 ) -> Self {
6538 self._fields.4 = value.into();
6539 self
6540 }
6541 pub fn maybe_moderation(
6543 mut self,
6544 value: Option<moderation::Moderation<'a>>,
6545 ) -> Self {
6546 self._fields.4 = value;
6547 self
6548 }
6549}
6550
6551impl<'a, S> BlobViewBuilder<'a, S>
6552where
6553 S: blob_view_state::State,
6554 S::Size: blob_view_state::IsUnset,
6555{
6556 pub fn size(
6558 mut self,
6559 value: impl Into<i64>,
6560 ) -> BlobViewBuilder<'a, blob_view_state::SetSize<S>> {
6561 self._fields.5 = Option::Some(value.into());
6562 BlobViewBuilder {
6563 _state: PhantomData,
6564 _fields: self._fields,
6565 _lifetime: PhantomData,
6566 }
6567 }
6568}
6569
6570impl<'a, S> BlobViewBuilder<'a, S>
6571where
6572 S: blob_view_state::State,
6573 S::Size: blob_view_state::IsSet,
6574 S::CreatedAt: blob_view_state::IsSet,
6575 S::Cid: blob_view_state::IsSet,
6576 S::MimeType: blob_view_state::IsSet,
6577{
6578 pub fn build(self) -> BlobView<'a> {
6580 BlobView {
6581 cid: self._fields.0.unwrap(),
6582 created_at: self._fields.1.unwrap(),
6583 details: self._fields.2,
6584 mime_type: self._fields.3.unwrap(),
6585 moderation: self._fields.4,
6586 size: self._fields.5.unwrap(),
6587 extra_data: Default::default(),
6588 }
6589 }
6590 pub fn build_with_data(
6592 self,
6593 extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
6594 ) -> BlobView<'a> {
6595 BlobView {
6596 cid: self._fields.0.unwrap(),
6597 created_at: self._fields.1.unwrap(),
6598 details: self._fields.2,
6599 mime_type: self._fields.3.unwrap(),
6600 moderation: self._fields.4,
6601 size: self._fields.5.unwrap(),
6602 extra_data: Some(extra_data),
6603 }
6604 }
6605}
6606
6607pub mod identity_event_state {
6608
6609 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
6610 #[allow(unused)]
6611 use ::core::marker::PhantomData;
6612 mod sealed {
6613 pub trait Sealed {}
6614 }
6615 pub trait State: sealed::Sealed {
6617 type Timestamp;
6618 }
6619 pub struct Empty(());
6621 impl sealed::Sealed for Empty {}
6622 impl State for Empty {
6623 type Timestamp = Unset;
6624 }
6625 pub struct SetTimestamp<S: State = Empty>(PhantomData<fn() -> S>);
6627 impl<S: State> sealed::Sealed for SetTimestamp<S> {}
6628 impl<S: State> State for SetTimestamp<S> {
6629 type Timestamp = Set<members::timestamp>;
6630 }
6631 #[allow(non_camel_case_types)]
6633 pub mod members {
6634 pub struct timestamp(());
6636 }
6637}
6638
6639pub struct IdentityEventBuilder<'a, S: identity_event_state::State> {
6641 _state: PhantomData<fn() -> S>,
6642 _fields: (
6643 Option<CowStr<'a>>,
6644 Option<Handle<'a>>,
6645 Option<UriValue<'a>>,
6646 Option<Datetime>,
6647 Option<bool>,
6648 ),
6649 _lifetime: PhantomData<&'a ()>,
6650}
6651
6652impl<'a> IdentityEvent<'a> {
6653 pub fn new() -> IdentityEventBuilder<'a, identity_event_state::Empty> {
6655 IdentityEventBuilder::new()
6656 }
6657}
6658
6659impl<'a> IdentityEventBuilder<'a, identity_event_state::Empty> {
6660 pub fn new() -> Self {
6662 IdentityEventBuilder {
6663 _state: PhantomData,
6664 _fields: (None, None, None, None, None),
6665 _lifetime: PhantomData,
6666 }
6667 }
6668}
6669
6670impl<'a, S: identity_event_state::State> IdentityEventBuilder<'a, S> {
6671 pub fn comment(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
6673 self._fields.0 = value.into();
6674 self
6675 }
6676 pub fn maybe_comment(mut self, value: Option<CowStr<'a>>) -> Self {
6678 self._fields.0 = value;
6679 self
6680 }
6681}
6682
6683impl<'a, S: identity_event_state::State> IdentityEventBuilder<'a, S> {
6684 pub fn handle(mut self, value: impl Into<Option<Handle<'a>>>) -> Self {
6686 self._fields.1 = value.into();
6687 self
6688 }
6689 pub fn maybe_handle(mut self, value: Option<Handle<'a>>) -> Self {
6691 self._fields.1 = value;
6692 self
6693 }
6694}
6695
6696impl<'a, S: identity_event_state::State> IdentityEventBuilder<'a, S> {
6697 pub fn pds_host(mut self, value: impl Into<Option<UriValue<'a>>>) -> Self {
6699 self._fields.2 = value.into();
6700 self
6701 }
6702 pub fn maybe_pds_host(mut self, value: Option<UriValue<'a>>) -> Self {
6704 self._fields.2 = value;
6705 self
6706 }
6707}
6708
6709impl<'a, S> IdentityEventBuilder<'a, S>
6710where
6711 S: identity_event_state::State,
6712 S::Timestamp: identity_event_state::IsUnset,
6713{
6714 pub fn timestamp(
6716 mut self,
6717 value: impl Into<Datetime>,
6718 ) -> IdentityEventBuilder<'a, identity_event_state::SetTimestamp<S>> {
6719 self._fields.3 = Option::Some(value.into());
6720 IdentityEventBuilder {
6721 _state: PhantomData,
6722 _fields: self._fields,
6723 _lifetime: PhantomData,
6724 }
6725 }
6726}
6727
6728impl<'a, S: identity_event_state::State> IdentityEventBuilder<'a, S> {
6729 pub fn tombstone(mut self, value: impl Into<Option<bool>>) -> Self {
6731 self._fields.4 = value.into();
6732 self
6733 }
6734 pub fn maybe_tombstone(mut self, value: Option<bool>) -> Self {
6736 self._fields.4 = value;
6737 self
6738 }
6739}
6740
6741impl<'a, S> IdentityEventBuilder<'a, S>
6742where
6743 S: identity_event_state::State,
6744 S::Timestamp: identity_event_state::IsSet,
6745{
6746 pub fn build(self) -> IdentityEvent<'a> {
6748 IdentityEvent {
6749 comment: self._fields.0,
6750 handle: self._fields.1,
6751 pds_host: self._fields.2,
6752 timestamp: self._fields.3.unwrap(),
6753 tombstone: self._fields.4,
6754 extra_data: Default::default(),
6755 }
6756 }
6757 pub fn build_with_data(
6759 self,
6760 extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
6761 ) -> IdentityEvent<'a> {
6762 IdentityEvent {
6763 comment: self._fields.0,
6764 handle: self._fields.1,
6765 pds_host: self._fields.2,
6766 timestamp: self._fields.3.unwrap(),
6767 tombstone: self._fields.4,
6768 extra_data: Some(extra_data),
6769 }
6770 }
6771}
6772
6773pub mod image_details_state {
6774
6775 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
6776 #[allow(unused)]
6777 use ::core::marker::PhantomData;
6778 mod sealed {
6779 pub trait Sealed {}
6780 }
6781 pub trait State: sealed::Sealed {
6783 type Width;
6784 type Height;
6785 }
6786 pub struct Empty(());
6788 impl sealed::Sealed for Empty {}
6789 impl State for Empty {
6790 type Width = Unset;
6791 type Height = Unset;
6792 }
6793 pub struct SetWidth<S: State = Empty>(PhantomData<fn() -> S>);
6795 impl<S: State> sealed::Sealed for SetWidth<S> {}
6796 impl<S: State> State for SetWidth<S> {
6797 type Width = Set<members::width>;
6798 type Height = S::Height;
6799 }
6800 pub struct SetHeight<S: State = Empty>(PhantomData<fn() -> S>);
6802 impl<S: State> sealed::Sealed for SetHeight<S> {}
6803 impl<S: State> State for SetHeight<S> {
6804 type Width = S::Width;
6805 type Height = Set<members::height>;
6806 }
6807 #[allow(non_camel_case_types)]
6809 pub mod members {
6810 pub struct width(());
6812 pub struct height(());
6814 }
6815}
6816
6817pub struct ImageDetailsBuilder<'a, S: image_details_state::State> {
6819 _state: PhantomData<fn() -> S>,
6820 _fields: (Option<i64>, Option<i64>),
6821 _lifetime: PhantomData<&'a ()>,
6822}
6823
6824impl<'a> ImageDetails<'a> {
6825 pub fn new() -> ImageDetailsBuilder<'a, image_details_state::Empty> {
6827 ImageDetailsBuilder::new()
6828 }
6829}
6830
6831impl<'a> ImageDetailsBuilder<'a, image_details_state::Empty> {
6832 pub fn new() -> Self {
6834 ImageDetailsBuilder {
6835 _state: PhantomData,
6836 _fields: (None, None),
6837 _lifetime: PhantomData,
6838 }
6839 }
6840}
6841
6842impl<'a, S> ImageDetailsBuilder<'a, S>
6843where
6844 S: image_details_state::State,
6845 S::Height: image_details_state::IsUnset,
6846{
6847 pub fn height(
6849 mut self,
6850 value: impl Into<i64>,
6851 ) -> ImageDetailsBuilder<'a, image_details_state::SetHeight<S>> {
6852 self._fields.0 = Option::Some(value.into());
6853 ImageDetailsBuilder {
6854 _state: PhantomData,
6855 _fields: self._fields,
6856 _lifetime: PhantomData,
6857 }
6858 }
6859}
6860
6861impl<'a, S> ImageDetailsBuilder<'a, S>
6862where
6863 S: image_details_state::State,
6864 S::Width: image_details_state::IsUnset,
6865{
6866 pub fn width(
6868 mut self,
6869 value: impl Into<i64>,
6870 ) -> ImageDetailsBuilder<'a, image_details_state::SetWidth<S>> {
6871 self._fields.1 = Option::Some(value.into());
6872 ImageDetailsBuilder {
6873 _state: PhantomData,
6874 _fields: self._fields,
6875 _lifetime: PhantomData,
6876 }
6877 }
6878}
6879
6880impl<'a, S> ImageDetailsBuilder<'a, S>
6881where
6882 S: image_details_state::State,
6883 S::Width: image_details_state::IsSet,
6884 S::Height: image_details_state::IsSet,
6885{
6886 pub fn build(self) -> ImageDetails<'a> {
6888 ImageDetails {
6889 height: self._fields.0.unwrap(),
6890 width: self._fields.1.unwrap(),
6891 extra_data: Default::default(),
6892 }
6893 }
6894 pub fn build_with_data(
6896 self,
6897 extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
6898 ) -> ImageDetails<'a> {
6899 ImageDetails {
6900 height: self._fields.0.unwrap(),
6901 width: self._fields.1.unwrap(),
6902 extra_data: Some(extra_data),
6903 }
6904 }
6905}
6906
6907pub mod mod_event_label_state {
6908
6909 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
6910 #[allow(unused)]
6911 use ::core::marker::PhantomData;
6912 mod sealed {
6913 pub trait Sealed {}
6914 }
6915 pub trait State: sealed::Sealed {
6917 type NegateLabelVals;
6918 type CreateLabelVals;
6919 }
6920 pub struct Empty(());
6922 impl sealed::Sealed for Empty {}
6923 impl State for Empty {
6924 type NegateLabelVals = Unset;
6925 type CreateLabelVals = Unset;
6926 }
6927 pub struct SetNegateLabelVals<S: State = Empty>(PhantomData<fn() -> S>);
6929 impl<S: State> sealed::Sealed for SetNegateLabelVals<S> {}
6930 impl<S: State> State for SetNegateLabelVals<S> {
6931 type NegateLabelVals = Set<members::negate_label_vals>;
6932 type CreateLabelVals = S::CreateLabelVals;
6933 }
6934 pub struct SetCreateLabelVals<S: State = Empty>(PhantomData<fn() -> S>);
6936 impl<S: State> sealed::Sealed for SetCreateLabelVals<S> {}
6937 impl<S: State> State for SetCreateLabelVals<S> {
6938 type NegateLabelVals = S::NegateLabelVals;
6939 type CreateLabelVals = Set<members::create_label_vals>;
6940 }
6941 #[allow(non_camel_case_types)]
6943 pub mod members {
6944 pub struct negate_label_vals(());
6946 pub struct create_label_vals(());
6948 }
6949}
6950
6951pub struct ModEventLabelBuilder<'a, S: mod_event_label_state::State> {
6953 _state: PhantomData<fn() -> S>,
6954 _fields: (
6955 Option<CowStr<'a>>,
6956 Option<Vec<CowStr<'a>>>,
6957 Option<i64>,
6958 Option<Vec<CowStr<'a>>>,
6959 ),
6960 _lifetime: PhantomData<&'a ()>,
6961}
6962
6963impl<'a> ModEventLabel<'a> {
6964 pub fn new() -> ModEventLabelBuilder<'a, mod_event_label_state::Empty> {
6966 ModEventLabelBuilder::new()
6967 }
6968}
6969
6970impl<'a> ModEventLabelBuilder<'a, mod_event_label_state::Empty> {
6971 pub fn new() -> Self {
6973 ModEventLabelBuilder {
6974 _state: PhantomData,
6975 _fields: (None, None, None, None),
6976 _lifetime: PhantomData,
6977 }
6978 }
6979}
6980
6981impl<'a, S: mod_event_label_state::State> ModEventLabelBuilder<'a, S> {
6982 pub fn comment(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
6984 self._fields.0 = value.into();
6985 self
6986 }
6987 pub fn maybe_comment(mut self, value: Option<CowStr<'a>>) -> Self {
6989 self._fields.0 = value;
6990 self
6991 }
6992}
6993
6994impl<'a, S> ModEventLabelBuilder<'a, S>
6995where
6996 S: mod_event_label_state::State,
6997 S::CreateLabelVals: mod_event_label_state::IsUnset,
6998{
6999 pub fn create_label_vals(
7001 mut self,
7002 value: impl Into<Vec<CowStr<'a>>>,
7003 ) -> ModEventLabelBuilder<'a, mod_event_label_state::SetCreateLabelVals<S>> {
7004 self._fields.1 = Option::Some(value.into());
7005 ModEventLabelBuilder {
7006 _state: PhantomData,
7007 _fields: self._fields,
7008 _lifetime: PhantomData,
7009 }
7010 }
7011}
7012
7013impl<'a, S: mod_event_label_state::State> ModEventLabelBuilder<'a, S> {
7014 pub fn duration_in_hours(mut self, value: impl Into<Option<i64>>) -> Self {
7016 self._fields.2 = value.into();
7017 self
7018 }
7019 pub fn maybe_duration_in_hours(mut self, value: Option<i64>) -> Self {
7021 self._fields.2 = value;
7022 self
7023 }
7024}
7025
7026impl<'a, S> ModEventLabelBuilder<'a, S>
7027where
7028 S: mod_event_label_state::State,
7029 S::NegateLabelVals: mod_event_label_state::IsUnset,
7030{
7031 pub fn negate_label_vals(
7033 mut self,
7034 value: impl Into<Vec<CowStr<'a>>>,
7035 ) -> ModEventLabelBuilder<'a, mod_event_label_state::SetNegateLabelVals<S>> {
7036 self._fields.3 = Option::Some(value.into());
7037 ModEventLabelBuilder {
7038 _state: PhantomData,
7039 _fields: self._fields,
7040 _lifetime: PhantomData,
7041 }
7042 }
7043}
7044
7045impl<'a, S> ModEventLabelBuilder<'a, S>
7046where
7047 S: mod_event_label_state::State,
7048 S::NegateLabelVals: mod_event_label_state::IsSet,
7049 S::CreateLabelVals: mod_event_label_state::IsSet,
7050{
7051 pub fn build(self) -> ModEventLabel<'a> {
7053 ModEventLabel {
7054 comment: self._fields.0,
7055 create_label_vals: self._fields.1.unwrap(),
7056 duration_in_hours: self._fields.2,
7057 negate_label_vals: self._fields.3.unwrap(),
7058 extra_data: Default::default(),
7059 }
7060 }
7061 pub fn build_with_data(
7063 self,
7064 extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
7065 ) -> ModEventLabel<'a> {
7066 ModEventLabel {
7067 comment: self._fields.0,
7068 create_label_vals: self._fields.1.unwrap(),
7069 duration_in_hours: self._fields.2,
7070 negate_label_vals: self._fields.3.unwrap(),
7071 extra_data: Some(extra_data),
7072 }
7073 }
7074}
7075
7076pub mod mod_event_mute_state {
7077
7078 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
7079 #[allow(unused)]
7080 use ::core::marker::PhantomData;
7081 mod sealed {
7082 pub trait Sealed {}
7083 }
7084 pub trait State: sealed::Sealed {
7086 type DurationInHours;
7087 }
7088 pub struct Empty(());
7090 impl sealed::Sealed for Empty {}
7091 impl State for Empty {
7092 type DurationInHours = Unset;
7093 }
7094 pub struct SetDurationInHours<S: State = Empty>(PhantomData<fn() -> S>);
7096 impl<S: State> sealed::Sealed for SetDurationInHours<S> {}
7097 impl<S: State> State for SetDurationInHours<S> {
7098 type DurationInHours = Set<members::duration_in_hours>;
7099 }
7100 #[allow(non_camel_case_types)]
7102 pub mod members {
7103 pub struct duration_in_hours(());
7105 }
7106}
7107
7108pub struct ModEventMuteBuilder<'a, S: mod_event_mute_state::State> {
7110 _state: PhantomData<fn() -> S>,
7111 _fields: (Option<CowStr<'a>>, Option<i64>),
7112 _lifetime: PhantomData<&'a ()>,
7113}
7114
7115impl<'a> ModEventMute<'a> {
7116 pub fn new() -> ModEventMuteBuilder<'a, mod_event_mute_state::Empty> {
7118 ModEventMuteBuilder::new()
7119 }
7120}
7121
7122impl<'a> ModEventMuteBuilder<'a, mod_event_mute_state::Empty> {
7123 pub fn new() -> Self {
7125 ModEventMuteBuilder {
7126 _state: PhantomData,
7127 _fields: (None, None),
7128 _lifetime: PhantomData,
7129 }
7130 }
7131}
7132
7133impl<'a, S: mod_event_mute_state::State> ModEventMuteBuilder<'a, S> {
7134 pub fn comment(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
7136 self._fields.0 = value.into();
7137 self
7138 }
7139 pub fn maybe_comment(mut self, value: Option<CowStr<'a>>) -> Self {
7141 self._fields.0 = value;
7142 self
7143 }
7144}
7145
7146impl<'a, S> ModEventMuteBuilder<'a, S>
7147where
7148 S: mod_event_mute_state::State,
7149 S::DurationInHours: mod_event_mute_state::IsUnset,
7150{
7151 pub fn duration_in_hours(
7153 mut self,
7154 value: impl Into<i64>,
7155 ) -> ModEventMuteBuilder<'a, mod_event_mute_state::SetDurationInHours<S>> {
7156 self._fields.1 = Option::Some(value.into());
7157 ModEventMuteBuilder {
7158 _state: PhantomData,
7159 _fields: self._fields,
7160 _lifetime: PhantomData,
7161 }
7162 }
7163}
7164
7165impl<'a, S> ModEventMuteBuilder<'a, S>
7166where
7167 S: mod_event_mute_state::State,
7168 S::DurationInHours: mod_event_mute_state::IsSet,
7169{
7170 pub fn build(self) -> ModEventMute<'a> {
7172 ModEventMute {
7173 comment: self._fields.0,
7174 duration_in_hours: self._fields.1.unwrap(),
7175 extra_data: Default::default(),
7176 }
7177 }
7178 pub fn build_with_data(
7180 self,
7181 extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
7182 ) -> ModEventMute<'a> {
7183 ModEventMute {
7184 comment: self._fields.0,
7185 duration_in_hours: self._fields.1.unwrap(),
7186 extra_data: Some(extra_data),
7187 }
7188 }
7189}
7190
7191pub mod mod_event_priority_score_state {
7192
7193 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
7194 #[allow(unused)]
7195 use ::core::marker::PhantomData;
7196 mod sealed {
7197 pub trait Sealed {}
7198 }
7199 pub trait State: sealed::Sealed {
7201 type Score;
7202 }
7203 pub struct Empty(());
7205 impl sealed::Sealed for Empty {}
7206 impl State for Empty {
7207 type Score = Unset;
7208 }
7209 pub struct SetScore<S: State = Empty>(PhantomData<fn() -> S>);
7211 impl<S: State> sealed::Sealed for SetScore<S> {}
7212 impl<S: State> State for SetScore<S> {
7213 type Score = Set<members::score>;
7214 }
7215 #[allow(non_camel_case_types)]
7217 pub mod members {
7218 pub struct score(());
7220 }
7221}
7222
7223pub struct ModEventPriorityScoreBuilder<'a, S: mod_event_priority_score_state::State> {
7225 _state: PhantomData<fn() -> S>,
7226 _fields: (Option<CowStr<'a>>, Option<i64>),
7227 _lifetime: PhantomData<&'a ()>,
7228}
7229
7230impl<'a> ModEventPriorityScore<'a> {
7231 pub fn new() -> ModEventPriorityScoreBuilder<
7233 'a,
7234 mod_event_priority_score_state::Empty,
7235 > {
7236 ModEventPriorityScoreBuilder::new()
7237 }
7238}
7239
7240impl<'a> ModEventPriorityScoreBuilder<'a, mod_event_priority_score_state::Empty> {
7241 pub fn new() -> Self {
7243 ModEventPriorityScoreBuilder {
7244 _state: PhantomData,
7245 _fields: (None, None),
7246 _lifetime: PhantomData,
7247 }
7248 }
7249}
7250
7251impl<'a, S: mod_event_priority_score_state::State> ModEventPriorityScoreBuilder<'a, S> {
7252 pub fn comment(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
7254 self._fields.0 = value.into();
7255 self
7256 }
7257 pub fn maybe_comment(mut self, value: Option<CowStr<'a>>) -> Self {
7259 self._fields.0 = value;
7260 self
7261 }
7262}
7263
7264impl<'a, S> ModEventPriorityScoreBuilder<'a, S>
7265where
7266 S: mod_event_priority_score_state::State,
7267 S::Score: mod_event_priority_score_state::IsUnset,
7268{
7269 pub fn score(
7271 mut self,
7272 value: impl Into<i64>,
7273 ) -> ModEventPriorityScoreBuilder<'a, mod_event_priority_score_state::SetScore<S>> {
7274 self._fields.1 = Option::Some(value.into());
7275 ModEventPriorityScoreBuilder {
7276 _state: PhantomData,
7277 _fields: self._fields,
7278 _lifetime: PhantomData,
7279 }
7280 }
7281}
7282
7283impl<'a, S> ModEventPriorityScoreBuilder<'a, S>
7284where
7285 S: mod_event_priority_score_state::State,
7286 S::Score: mod_event_priority_score_state::IsSet,
7287{
7288 pub fn build(self) -> ModEventPriorityScore<'a> {
7290 ModEventPriorityScore {
7291 comment: self._fields.0,
7292 score: self._fields.1.unwrap(),
7293 extra_data: Default::default(),
7294 }
7295 }
7296 pub fn build_with_data(
7298 self,
7299 extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
7300 ) -> ModEventPriorityScore<'a> {
7301 ModEventPriorityScore {
7302 comment: self._fields.0,
7303 score: self._fields.1.unwrap(),
7304 extra_data: Some(extra_data),
7305 }
7306 }
7307}
7308
7309pub mod mod_event_report_state {
7310
7311 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
7312 #[allow(unused)]
7313 use ::core::marker::PhantomData;
7314 mod sealed {
7315 pub trait Sealed {}
7316 }
7317 pub trait State: sealed::Sealed {
7319 type ReportType;
7320 }
7321 pub struct Empty(());
7323 impl sealed::Sealed for Empty {}
7324 impl State for Empty {
7325 type ReportType = Unset;
7326 }
7327 pub struct SetReportType<S: State = Empty>(PhantomData<fn() -> S>);
7329 impl<S: State> sealed::Sealed for SetReportType<S> {}
7330 impl<S: State> State for SetReportType<S> {
7331 type ReportType = Set<members::report_type>;
7332 }
7333 #[allow(non_camel_case_types)]
7335 pub mod members {
7336 pub struct report_type(());
7338 }
7339}
7340
7341pub struct ModEventReportBuilder<'a, S: mod_event_report_state::State> {
7343 _state: PhantomData<fn() -> S>,
7344 _fields: (Option<CowStr<'a>>, Option<bool>, Option<ReasonType<'a>>),
7345 _lifetime: PhantomData<&'a ()>,
7346}
7347
7348impl<'a> ModEventReport<'a> {
7349 pub fn new() -> ModEventReportBuilder<'a, mod_event_report_state::Empty> {
7351 ModEventReportBuilder::new()
7352 }
7353}
7354
7355impl<'a> ModEventReportBuilder<'a, mod_event_report_state::Empty> {
7356 pub fn new() -> Self {
7358 ModEventReportBuilder {
7359 _state: PhantomData,
7360 _fields: (None, None, None),
7361 _lifetime: PhantomData,
7362 }
7363 }
7364}
7365
7366impl<'a, S: mod_event_report_state::State> ModEventReportBuilder<'a, S> {
7367 pub fn comment(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
7369 self._fields.0 = value.into();
7370 self
7371 }
7372 pub fn maybe_comment(mut self, value: Option<CowStr<'a>>) -> Self {
7374 self._fields.0 = value;
7375 self
7376 }
7377}
7378
7379impl<'a, S: mod_event_report_state::State> ModEventReportBuilder<'a, S> {
7380 pub fn is_reporter_muted(mut self, value: impl Into<Option<bool>>) -> Self {
7382 self._fields.1 = value.into();
7383 self
7384 }
7385 pub fn maybe_is_reporter_muted(mut self, value: Option<bool>) -> Self {
7387 self._fields.1 = value;
7388 self
7389 }
7390}
7391
7392impl<'a, S> ModEventReportBuilder<'a, S>
7393where
7394 S: mod_event_report_state::State,
7395 S::ReportType: mod_event_report_state::IsUnset,
7396{
7397 pub fn report_type(
7399 mut self,
7400 value: impl Into<ReasonType<'a>>,
7401 ) -> ModEventReportBuilder<'a, mod_event_report_state::SetReportType<S>> {
7402 self._fields.2 = Option::Some(value.into());
7403 ModEventReportBuilder {
7404 _state: PhantomData,
7405 _fields: self._fields,
7406 _lifetime: PhantomData,
7407 }
7408 }
7409}
7410
7411impl<'a, S> ModEventReportBuilder<'a, S>
7412where
7413 S: mod_event_report_state::State,
7414 S::ReportType: mod_event_report_state::IsSet,
7415{
7416 pub fn build(self) -> ModEventReport<'a> {
7418 ModEventReport {
7419 comment: self._fields.0,
7420 is_reporter_muted: self._fields.1,
7421 report_type: self._fields.2.unwrap(),
7422 extra_data: Default::default(),
7423 }
7424 }
7425 pub fn build_with_data(
7427 self,
7428 extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
7429 ) -> ModEventReport<'a> {
7430 ModEventReport {
7431 comment: self._fields.0,
7432 is_reporter_muted: self._fields.1,
7433 report_type: self._fields.2.unwrap(),
7434 extra_data: Some(extra_data),
7435 }
7436 }
7437}
7438
7439pub mod mod_event_tag_state {
7440
7441 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
7442 #[allow(unused)]
7443 use ::core::marker::PhantomData;
7444 mod sealed {
7445 pub trait Sealed {}
7446 }
7447 pub trait State: sealed::Sealed {
7449 type Add;
7450 type Remove;
7451 }
7452 pub struct Empty(());
7454 impl sealed::Sealed for Empty {}
7455 impl State for Empty {
7456 type Add = Unset;
7457 type Remove = Unset;
7458 }
7459 pub struct SetAdd<S: State = Empty>(PhantomData<fn() -> S>);
7461 impl<S: State> sealed::Sealed for SetAdd<S> {}
7462 impl<S: State> State for SetAdd<S> {
7463 type Add = Set<members::add>;
7464 type Remove = S::Remove;
7465 }
7466 pub struct SetRemove<S: State = Empty>(PhantomData<fn() -> S>);
7468 impl<S: State> sealed::Sealed for SetRemove<S> {}
7469 impl<S: State> State for SetRemove<S> {
7470 type Add = S::Add;
7471 type Remove = Set<members::remove>;
7472 }
7473 #[allow(non_camel_case_types)]
7475 pub mod members {
7476 pub struct add(());
7478 pub struct remove(());
7480 }
7481}
7482
7483pub struct ModEventTagBuilder<'a, S: mod_event_tag_state::State> {
7485 _state: PhantomData<fn() -> S>,
7486 _fields: (Option<Vec<CowStr<'a>>>, Option<CowStr<'a>>, Option<Vec<CowStr<'a>>>),
7487 _lifetime: PhantomData<&'a ()>,
7488}
7489
7490impl<'a> ModEventTag<'a> {
7491 pub fn new() -> ModEventTagBuilder<'a, mod_event_tag_state::Empty> {
7493 ModEventTagBuilder::new()
7494 }
7495}
7496
7497impl<'a> ModEventTagBuilder<'a, mod_event_tag_state::Empty> {
7498 pub fn new() -> Self {
7500 ModEventTagBuilder {
7501 _state: PhantomData,
7502 _fields: (None, None, None),
7503 _lifetime: PhantomData,
7504 }
7505 }
7506}
7507
7508impl<'a, S> ModEventTagBuilder<'a, S>
7509where
7510 S: mod_event_tag_state::State,
7511 S::Add: mod_event_tag_state::IsUnset,
7512{
7513 pub fn add(
7515 mut self,
7516 value: impl Into<Vec<CowStr<'a>>>,
7517 ) -> ModEventTagBuilder<'a, mod_event_tag_state::SetAdd<S>> {
7518 self._fields.0 = Option::Some(value.into());
7519 ModEventTagBuilder {
7520 _state: PhantomData,
7521 _fields: self._fields,
7522 _lifetime: PhantomData,
7523 }
7524 }
7525}
7526
7527impl<'a, S: mod_event_tag_state::State> ModEventTagBuilder<'a, S> {
7528 pub fn comment(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
7530 self._fields.1 = value.into();
7531 self
7532 }
7533 pub fn maybe_comment(mut self, value: Option<CowStr<'a>>) -> Self {
7535 self._fields.1 = value;
7536 self
7537 }
7538}
7539
7540impl<'a, S> ModEventTagBuilder<'a, S>
7541where
7542 S: mod_event_tag_state::State,
7543 S::Remove: mod_event_tag_state::IsUnset,
7544{
7545 pub fn remove(
7547 mut self,
7548 value: impl Into<Vec<CowStr<'a>>>,
7549 ) -> ModEventTagBuilder<'a, mod_event_tag_state::SetRemove<S>> {
7550 self._fields.2 = Option::Some(value.into());
7551 ModEventTagBuilder {
7552 _state: PhantomData,
7553 _fields: self._fields,
7554 _lifetime: PhantomData,
7555 }
7556 }
7557}
7558
7559impl<'a, S> ModEventTagBuilder<'a, S>
7560where
7561 S: mod_event_tag_state::State,
7562 S::Add: mod_event_tag_state::IsSet,
7563 S::Remove: mod_event_tag_state::IsSet,
7564{
7565 pub fn build(self) -> ModEventTag<'a> {
7567 ModEventTag {
7568 add: self._fields.0.unwrap(),
7569 comment: self._fields.1,
7570 remove: self._fields.2.unwrap(),
7571 extra_data: Default::default(),
7572 }
7573 }
7574 pub fn build_with_data(
7576 self,
7577 extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
7578 ) -> ModEventTag<'a> {
7579 ModEventTag {
7580 add: self._fields.0.unwrap(),
7581 comment: self._fields.1,
7582 remove: self._fields.2.unwrap(),
7583 extra_data: Some(extra_data),
7584 }
7585 }
7586}
7587
7588pub mod mod_event_view_state {
7589
7590 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
7591 #[allow(unused)]
7592 use ::core::marker::PhantomData;
7593 mod sealed {
7594 pub trait Sealed {}
7595 }
7596 pub trait State: sealed::Sealed {
7598 type CreatedBy;
7599 type Event;
7600 type SubjectBlobCids;
7601 type Id;
7602 type Subject;
7603 type CreatedAt;
7604 }
7605 pub struct Empty(());
7607 impl sealed::Sealed for Empty {}
7608 impl State for Empty {
7609 type CreatedBy = Unset;
7610 type Event = Unset;
7611 type SubjectBlobCids = Unset;
7612 type Id = Unset;
7613 type Subject = Unset;
7614 type CreatedAt = Unset;
7615 }
7616 pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>);
7618 impl<S: State> sealed::Sealed for SetCreatedBy<S> {}
7619 impl<S: State> State for SetCreatedBy<S> {
7620 type CreatedBy = Set<members::created_by>;
7621 type Event = S::Event;
7622 type SubjectBlobCids = S::SubjectBlobCids;
7623 type Id = S::Id;
7624 type Subject = S::Subject;
7625 type CreatedAt = S::CreatedAt;
7626 }
7627 pub struct SetEvent<S: State = Empty>(PhantomData<fn() -> S>);
7629 impl<S: State> sealed::Sealed for SetEvent<S> {}
7630 impl<S: State> State for SetEvent<S> {
7631 type CreatedBy = S::CreatedBy;
7632 type Event = Set<members::event>;
7633 type SubjectBlobCids = S::SubjectBlobCids;
7634 type Id = S::Id;
7635 type Subject = S::Subject;
7636 type CreatedAt = S::CreatedAt;
7637 }
7638 pub struct SetSubjectBlobCids<S: State = Empty>(PhantomData<fn() -> S>);
7640 impl<S: State> sealed::Sealed for SetSubjectBlobCids<S> {}
7641 impl<S: State> State for SetSubjectBlobCids<S> {
7642 type CreatedBy = S::CreatedBy;
7643 type Event = S::Event;
7644 type SubjectBlobCids = Set<members::subject_blob_cids>;
7645 type Id = S::Id;
7646 type Subject = S::Subject;
7647 type CreatedAt = S::CreatedAt;
7648 }
7649 pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>);
7651 impl<S: State> sealed::Sealed for SetId<S> {}
7652 impl<S: State> State for SetId<S> {
7653 type CreatedBy = S::CreatedBy;
7654 type Event = S::Event;
7655 type SubjectBlobCids = S::SubjectBlobCids;
7656 type Id = Set<members::id>;
7657 type Subject = S::Subject;
7658 type CreatedAt = S::CreatedAt;
7659 }
7660 pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>);
7662 impl<S: State> sealed::Sealed for SetSubject<S> {}
7663 impl<S: State> State for SetSubject<S> {
7664 type CreatedBy = S::CreatedBy;
7665 type Event = S::Event;
7666 type SubjectBlobCids = S::SubjectBlobCids;
7667 type Id = S::Id;
7668 type Subject = Set<members::subject>;
7669 type CreatedAt = S::CreatedAt;
7670 }
7671 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>);
7673 impl<S: State> sealed::Sealed for SetCreatedAt<S> {}
7674 impl<S: State> State for SetCreatedAt<S> {
7675 type CreatedBy = S::CreatedBy;
7676 type Event = S::Event;
7677 type SubjectBlobCids = S::SubjectBlobCids;
7678 type Id = S::Id;
7679 type Subject = S::Subject;
7680 type CreatedAt = Set<members::created_at>;
7681 }
7682 #[allow(non_camel_case_types)]
7684 pub mod members {
7685 pub struct created_by(());
7687 pub struct event(());
7689 pub struct subject_blob_cids(());
7691 pub struct id(());
7693 pub struct subject(());
7695 pub struct created_at(());
7697 }
7698}
7699
7700pub struct ModEventViewBuilder<'a, S: mod_event_view_state::State> {
7702 _state: PhantomData<fn() -> S>,
7703 _fields: (
7704 Option<Datetime>,
7705 Option<Did<'a>>,
7706 Option<CowStr<'a>>,
7707 Option<ModEventViewEvent<'a>>,
7708 Option<i64>,
7709 Option<moderation::ModTool<'a>>,
7710 Option<ModEventViewSubject<'a>>,
7711 Option<Vec<CowStr<'a>>>,
7712 Option<CowStr<'a>>,
7713 ),
7714 _lifetime: PhantomData<&'a ()>,
7715}
7716
7717impl<'a> ModEventView<'a> {
7718 pub fn new() -> ModEventViewBuilder<'a, mod_event_view_state::Empty> {
7720 ModEventViewBuilder::new()
7721 }
7722}
7723
7724impl<'a> ModEventViewBuilder<'a, mod_event_view_state::Empty> {
7725 pub fn new() -> Self {
7727 ModEventViewBuilder {
7728 _state: PhantomData,
7729 _fields: (None, None, None, None, None, None, None, None, None),
7730 _lifetime: PhantomData,
7731 }
7732 }
7733}
7734
7735impl<'a, S> ModEventViewBuilder<'a, S>
7736where
7737 S: mod_event_view_state::State,
7738 S::CreatedAt: mod_event_view_state::IsUnset,
7739{
7740 pub fn created_at(
7742 mut self,
7743 value: impl Into<Datetime>,
7744 ) -> ModEventViewBuilder<'a, mod_event_view_state::SetCreatedAt<S>> {
7745 self._fields.0 = Option::Some(value.into());
7746 ModEventViewBuilder {
7747 _state: PhantomData,
7748 _fields: self._fields,
7749 _lifetime: PhantomData,
7750 }
7751 }
7752}
7753
7754impl<'a, S> ModEventViewBuilder<'a, S>
7755where
7756 S: mod_event_view_state::State,
7757 S::CreatedBy: mod_event_view_state::IsUnset,
7758{
7759 pub fn created_by(
7761 mut self,
7762 value: impl Into<Did<'a>>,
7763 ) -> ModEventViewBuilder<'a, mod_event_view_state::SetCreatedBy<S>> {
7764 self._fields.1 = Option::Some(value.into());
7765 ModEventViewBuilder {
7766 _state: PhantomData,
7767 _fields: self._fields,
7768 _lifetime: PhantomData,
7769 }
7770 }
7771}
7772
7773impl<'a, S: mod_event_view_state::State> ModEventViewBuilder<'a, S> {
7774 pub fn creator_handle(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
7776 self._fields.2 = value.into();
7777 self
7778 }
7779 pub fn maybe_creator_handle(mut self, value: Option<CowStr<'a>>) -> Self {
7781 self._fields.2 = value;
7782 self
7783 }
7784}
7785
7786impl<'a, S> ModEventViewBuilder<'a, S>
7787where
7788 S: mod_event_view_state::State,
7789 S::Event: mod_event_view_state::IsUnset,
7790{
7791 pub fn event(
7793 mut self,
7794 value: impl Into<ModEventViewEvent<'a>>,
7795 ) -> ModEventViewBuilder<'a, mod_event_view_state::SetEvent<S>> {
7796 self._fields.3 = Option::Some(value.into());
7797 ModEventViewBuilder {
7798 _state: PhantomData,
7799 _fields: self._fields,
7800 _lifetime: PhantomData,
7801 }
7802 }
7803}
7804
7805impl<'a, S> ModEventViewBuilder<'a, S>
7806where
7807 S: mod_event_view_state::State,
7808 S::Id: mod_event_view_state::IsUnset,
7809{
7810 pub fn id(
7812 mut self,
7813 value: impl Into<i64>,
7814 ) -> ModEventViewBuilder<'a, mod_event_view_state::SetId<S>> {
7815 self._fields.4 = Option::Some(value.into());
7816 ModEventViewBuilder {
7817 _state: PhantomData,
7818 _fields: self._fields,
7819 _lifetime: PhantomData,
7820 }
7821 }
7822}
7823
7824impl<'a, S: mod_event_view_state::State> ModEventViewBuilder<'a, S> {
7825 pub fn mod_tool(
7827 mut self,
7828 value: impl Into<Option<moderation::ModTool<'a>>>,
7829 ) -> Self {
7830 self._fields.5 = value.into();
7831 self
7832 }
7833 pub fn maybe_mod_tool(mut self, value: Option<moderation::ModTool<'a>>) -> Self {
7835 self._fields.5 = value;
7836 self
7837 }
7838}
7839
7840impl<'a, S> ModEventViewBuilder<'a, S>
7841where
7842 S: mod_event_view_state::State,
7843 S::Subject: mod_event_view_state::IsUnset,
7844{
7845 pub fn subject(
7847 mut self,
7848 value: impl Into<ModEventViewSubject<'a>>,
7849 ) -> ModEventViewBuilder<'a, mod_event_view_state::SetSubject<S>> {
7850 self._fields.6 = Option::Some(value.into());
7851 ModEventViewBuilder {
7852 _state: PhantomData,
7853 _fields: self._fields,
7854 _lifetime: PhantomData,
7855 }
7856 }
7857}
7858
7859impl<'a, S> ModEventViewBuilder<'a, S>
7860where
7861 S: mod_event_view_state::State,
7862 S::SubjectBlobCids: mod_event_view_state::IsUnset,
7863{
7864 pub fn subject_blob_cids(
7866 mut self,
7867 value: impl Into<Vec<CowStr<'a>>>,
7868 ) -> ModEventViewBuilder<'a, mod_event_view_state::SetSubjectBlobCids<S>> {
7869 self._fields.7 = Option::Some(value.into());
7870 ModEventViewBuilder {
7871 _state: PhantomData,
7872 _fields: self._fields,
7873 _lifetime: PhantomData,
7874 }
7875 }
7876}
7877
7878impl<'a, S: mod_event_view_state::State> ModEventViewBuilder<'a, S> {
7879 pub fn subject_handle(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
7881 self._fields.8 = value.into();
7882 self
7883 }
7884 pub fn maybe_subject_handle(mut self, value: Option<CowStr<'a>>) -> Self {
7886 self._fields.8 = value;
7887 self
7888 }
7889}
7890
7891impl<'a, S> ModEventViewBuilder<'a, S>
7892where
7893 S: mod_event_view_state::State,
7894 S::CreatedBy: mod_event_view_state::IsSet,
7895 S::Event: mod_event_view_state::IsSet,
7896 S::SubjectBlobCids: mod_event_view_state::IsSet,
7897 S::Id: mod_event_view_state::IsSet,
7898 S::Subject: mod_event_view_state::IsSet,
7899 S::CreatedAt: mod_event_view_state::IsSet,
7900{
7901 pub fn build(self) -> ModEventView<'a> {
7903 ModEventView {
7904 created_at: self._fields.0.unwrap(),
7905 created_by: self._fields.1.unwrap(),
7906 creator_handle: self._fields.2,
7907 event: self._fields.3.unwrap(),
7908 id: self._fields.4.unwrap(),
7909 mod_tool: self._fields.5,
7910 subject: self._fields.6.unwrap(),
7911 subject_blob_cids: self._fields.7.unwrap(),
7912 subject_handle: self._fields.8,
7913 extra_data: Default::default(),
7914 }
7915 }
7916 pub fn build_with_data(
7918 self,
7919 extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
7920 ) -> ModEventView<'a> {
7921 ModEventView {
7922 created_at: self._fields.0.unwrap(),
7923 created_by: self._fields.1.unwrap(),
7924 creator_handle: self._fields.2,
7925 event: self._fields.3.unwrap(),
7926 id: self._fields.4.unwrap(),
7927 mod_tool: self._fields.5,
7928 subject: self._fields.6.unwrap(),
7929 subject_blob_cids: self._fields.7.unwrap(),
7930 subject_handle: self._fields.8,
7931 extra_data: Some(extra_data),
7932 }
7933 }
7934}
7935
7936pub mod mod_event_view_detail_state {
7937
7938 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
7939 #[allow(unused)]
7940 use ::core::marker::PhantomData;
7941 mod sealed {
7942 pub trait Sealed {}
7943 }
7944 pub trait State: sealed::Sealed {
7946 type CreatedBy;
7947 type CreatedAt;
7948 type Id;
7949 type Subject;
7950 type Event;
7951 type SubjectBlobs;
7952 }
7953 pub struct Empty(());
7955 impl sealed::Sealed for Empty {}
7956 impl State for Empty {
7957 type CreatedBy = Unset;
7958 type CreatedAt = Unset;
7959 type Id = Unset;
7960 type Subject = Unset;
7961 type Event = Unset;
7962 type SubjectBlobs = Unset;
7963 }
7964 pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>);
7966 impl<S: State> sealed::Sealed for SetCreatedBy<S> {}
7967 impl<S: State> State for SetCreatedBy<S> {
7968 type CreatedBy = Set<members::created_by>;
7969 type CreatedAt = S::CreatedAt;
7970 type Id = S::Id;
7971 type Subject = S::Subject;
7972 type Event = S::Event;
7973 type SubjectBlobs = S::SubjectBlobs;
7974 }
7975 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>);
7977 impl<S: State> sealed::Sealed for SetCreatedAt<S> {}
7978 impl<S: State> State for SetCreatedAt<S> {
7979 type CreatedBy = S::CreatedBy;
7980 type CreatedAt = Set<members::created_at>;
7981 type Id = S::Id;
7982 type Subject = S::Subject;
7983 type Event = S::Event;
7984 type SubjectBlobs = S::SubjectBlobs;
7985 }
7986 pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>);
7988 impl<S: State> sealed::Sealed for SetId<S> {}
7989 impl<S: State> State for SetId<S> {
7990 type CreatedBy = S::CreatedBy;
7991 type CreatedAt = S::CreatedAt;
7992 type Id = Set<members::id>;
7993 type Subject = S::Subject;
7994 type Event = S::Event;
7995 type SubjectBlobs = S::SubjectBlobs;
7996 }
7997 pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>);
7999 impl<S: State> sealed::Sealed for SetSubject<S> {}
8000 impl<S: State> State for SetSubject<S> {
8001 type CreatedBy = S::CreatedBy;
8002 type CreatedAt = S::CreatedAt;
8003 type Id = S::Id;
8004 type Subject = Set<members::subject>;
8005 type Event = S::Event;
8006 type SubjectBlobs = S::SubjectBlobs;
8007 }
8008 pub struct SetEvent<S: State = Empty>(PhantomData<fn() -> S>);
8010 impl<S: State> sealed::Sealed for SetEvent<S> {}
8011 impl<S: State> State for SetEvent<S> {
8012 type CreatedBy = S::CreatedBy;
8013 type CreatedAt = S::CreatedAt;
8014 type Id = S::Id;
8015 type Subject = S::Subject;
8016 type Event = Set<members::event>;
8017 type SubjectBlobs = S::SubjectBlobs;
8018 }
8019 pub struct SetSubjectBlobs<S: State = Empty>(PhantomData<fn() -> S>);
8021 impl<S: State> sealed::Sealed for SetSubjectBlobs<S> {}
8022 impl<S: State> State for SetSubjectBlobs<S> {
8023 type CreatedBy = S::CreatedBy;
8024 type CreatedAt = S::CreatedAt;
8025 type Id = S::Id;
8026 type Subject = S::Subject;
8027 type Event = S::Event;
8028 type SubjectBlobs = Set<members::subject_blobs>;
8029 }
8030 #[allow(non_camel_case_types)]
8032 pub mod members {
8033 pub struct created_by(());
8035 pub struct created_at(());
8037 pub struct id(());
8039 pub struct subject(());
8041 pub struct event(());
8043 pub struct subject_blobs(());
8045 }
8046}
8047
8048pub struct ModEventViewDetailBuilder<'a, S: mod_event_view_detail_state::State> {
8050 _state: PhantomData<fn() -> S>,
8051 _fields: (
8052 Option<Datetime>,
8053 Option<Did<'a>>,
8054 Option<ModEventViewDetailEvent<'a>>,
8055 Option<i64>,
8056 Option<moderation::ModTool<'a>>,
8057 Option<ModEventViewDetailSubject<'a>>,
8058 Option<Vec<moderation::BlobView<'a>>>,
8059 ),
8060 _lifetime: PhantomData<&'a ()>,
8061}
8062
8063impl<'a> ModEventViewDetail<'a> {
8064 pub fn new() -> ModEventViewDetailBuilder<'a, mod_event_view_detail_state::Empty> {
8066 ModEventViewDetailBuilder::new()
8067 }
8068}
8069
8070impl<'a> ModEventViewDetailBuilder<'a, mod_event_view_detail_state::Empty> {
8071 pub fn new() -> Self {
8073 ModEventViewDetailBuilder {
8074 _state: PhantomData,
8075 _fields: (None, None, None, None, None, None, None),
8076 _lifetime: PhantomData,
8077 }
8078 }
8079}
8080
8081impl<'a, S> ModEventViewDetailBuilder<'a, S>
8082where
8083 S: mod_event_view_detail_state::State,
8084 S::CreatedAt: mod_event_view_detail_state::IsUnset,
8085{
8086 pub fn created_at(
8088 mut self,
8089 value: impl Into<Datetime>,
8090 ) -> ModEventViewDetailBuilder<'a, mod_event_view_detail_state::SetCreatedAt<S>> {
8091 self._fields.0 = Option::Some(value.into());
8092 ModEventViewDetailBuilder {
8093 _state: PhantomData,
8094 _fields: self._fields,
8095 _lifetime: PhantomData,
8096 }
8097 }
8098}
8099
8100impl<'a, S> ModEventViewDetailBuilder<'a, S>
8101where
8102 S: mod_event_view_detail_state::State,
8103 S::CreatedBy: mod_event_view_detail_state::IsUnset,
8104{
8105 pub fn created_by(
8107 mut self,
8108 value: impl Into<Did<'a>>,
8109 ) -> ModEventViewDetailBuilder<'a, mod_event_view_detail_state::SetCreatedBy<S>> {
8110 self._fields.1 = Option::Some(value.into());
8111 ModEventViewDetailBuilder {
8112 _state: PhantomData,
8113 _fields: self._fields,
8114 _lifetime: PhantomData,
8115 }
8116 }
8117}
8118
8119impl<'a, S> ModEventViewDetailBuilder<'a, S>
8120where
8121 S: mod_event_view_detail_state::State,
8122 S::Event: mod_event_view_detail_state::IsUnset,
8123{
8124 pub fn event(
8126 mut self,
8127 value: impl Into<ModEventViewDetailEvent<'a>>,
8128 ) -> ModEventViewDetailBuilder<'a, mod_event_view_detail_state::SetEvent<S>> {
8129 self._fields.2 = Option::Some(value.into());
8130 ModEventViewDetailBuilder {
8131 _state: PhantomData,
8132 _fields: self._fields,
8133 _lifetime: PhantomData,
8134 }
8135 }
8136}
8137
8138impl<'a, S> ModEventViewDetailBuilder<'a, S>
8139where
8140 S: mod_event_view_detail_state::State,
8141 S::Id: mod_event_view_detail_state::IsUnset,
8142{
8143 pub fn id(
8145 mut self,
8146 value: impl Into<i64>,
8147 ) -> ModEventViewDetailBuilder<'a, mod_event_view_detail_state::SetId<S>> {
8148 self._fields.3 = Option::Some(value.into());
8149 ModEventViewDetailBuilder {
8150 _state: PhantomData,
8151 _fields: self._fields,
8152 _lifetime: PhantomData,
8153 }
8154 }
8155}
8156
8157impl<'a, S: mod_event_view_detail_state::State> ModEventViewDetailBuilder<'a, S> {
8158 pub fn mod_tool(
8160 mut self,
8161 value: impl Into<Option<moderation::ModTool<'a>>>,
8162 ) -> Self {
8163 self._fields.4 = value.into();
8164 self
8165 }
8166 pub fn maybe_mod_tool(mut self, value: Option<moderation::ModTool<'a>>) -> Self {
8168 self._fields.4 = value;
8169 self
8170 }
8171}
8172
8173impl<'a, S> ModEventViewDetailBuilder<'a, S>
8174where
8175 S: mod_event_view_detail_state::State,
8176 S::Subject: mod_event_view_detail_state::IsUnset,
8177{
8178 pub fn subject(
8180 mut self,
8181 value: impl Into<ModEventViewDetailSubject<'a>>,
8182 ) -> ModEventViewDetailBuilder<'a, mod_event_view_detail_state::SetSubject<S>> {
8183 self._fields.5 = Option::Some(value.into());
8184 ModEventViewDetailBuilder {
8185 _state: PhantomData,
8186 _fields: self._fields,
8187 _lifetime: PhantomData,
8188 }
8189 }
8190}
8191
8192impl<'a, S> ModEventViewDetailBuilder<'a, S>
8193where
8194 S: mod_event_view_detail_state::State,
8195 S::SubjectBlobs: mod_event_view_detail_state::IsUnset,
8196{
8197 pub fn subject_blobs(
8199 mut self,
8200 value: impl Into<Vec<moderation::BlobView<'a>>>,
8201 ) -> ModEventViewDetailBuilder<'a, mod_event_view_detail_state::SetSubjectBlobs<S>> {
8202 self._fields.6 = Option::Some(value.into());
8203 ModEventViewDetailBuilder {
8204 _state: PhantomData,
8205 _fields: self._fields,
8206 _lifetime: PhantomData,
8207 }
8208 }
8209}
8210
8211impl<'a, S> ModEventViewDetailBuilder<'a, S>
8212where
8213 S: mod_event_view_detail_state::State,
8214 S::CreatedBy: mod_event_view_detail_state::IsSet,
8215 S::CreatedAt: mod_event_view_detail_state::IsSet,
8216 S::Id: mod_event_view_detail_state::IsSet,
8217 S::Subject: mod_event_view_detail_state::IsSet,
8218 S::Event: mod_event_view_detail_state::IsSet,
8219 S::SubjectBlobs: mod_event_view_detail_state::IsSet,
8220{
8221 pub fn build(self) -> ModEventViewDetail<'a> {
8223 ModEventViewDetail {
8224 created_at: self._fields.0.unwrap(),
8225 created_by: self._fields.1.unwrap(),
8226 event: self._fields.2.unwrap(),
8227 id: self._fields.3.unwrap(),
8228 mod_tool: self._fields.4,
8229 subject: self._fields.5.unwrap(),
8230 subject_blobs: self._fields.6.unwrap(),
8231 extra_data: Default::default(),
8232 }
8233 }
8234 pub fn build_with_data(
8236 self,
8237 extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
8238 ) -> ModEventViewDetail<'a> {
8239 ModEventViewDetail {
8240 created_at: self._fields.0.unwrap(),
8241 created_by: self._fields.1.unwrap(),
8242 event: self._fields.2.unwrap(),
8243 id: self._fields.3.unwrap(),
8244 mod_tool: self._fields.4,
8245 subject: self._fields.5.unwrap(),
8246 subject_blobs: self._fields.6.unwrap(),
8247 extra_data: Some(extra_data),
8248 }
8249 }
8250}
8251
8252pub mod record_event_state {
8253
8254 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
8255 #[allow(unused)]
8256 use ::core::marker::PhantomData;
8257 mod sealed {
8258 pub trait Sealed {}
8259 }
8260 pub trait State: sealed::Sealed {
8262 type Timestamp;
8263 type Op;
8264 }
8265 pub struct Empty(());
8267 impl sealed::Sealed for Empty {}
8268 impl State for Empty {
8269 type Timestamp = Unset;
8270 type Op = Unset;
8271 }
8272 pub struct SetTimestamp<S: State = Empty>(PhantomData<fn() -> S>);
8274 impl<S: State> sealed::Sealed for SetTimestamp<S> {}
8275 impl<S: State> State for SetTimestamp<S> {
8276 type Timestamp = Set<members::timestamp>;
8277 type Op = S::Op;
8278 }
8279 pub struct SetOp<S: State = Empty>(PhantomData<fn() -> S>);
8281 impl<S: State> sealed::Sealed for SetOp<S> {}
8282 impl<S: State> State for SetOp<S> {
8283 type Timestamp = S::Timestamp;
8284 type Op = Set<members::op>;
8285 }
8286 #[allow(non_camel_case_types)]
8288 pub mod members {
8289 pub struct timestamp(());
8291 pub struct op(());
8293 }
8294}
8295
8296pub struct RecordEventBuilder<'a, S: record_event_state::State> {
8298 _state: PhantomData<fn() -> S>,
8299 _fields: (
8300 Option<Cid<'a>>,
8301 Option<CowStr<'a>>,
8302 Option<RecordEventOp<'a>>,
8303 Option<Datetime>,
8304 ),
8305 _lifetime: PhantomData<&'a ()>,
8306}
8307
8308impl<'a> RecordEvent<'a> {
8309 pub fn new() -> RecordEventBuilder<'a, record_event_state::Empty> {
8311 RecordEventBuilder::new()
8312 }
8313}
8314
8315impl<'a> RecordEventBuilder<'a, record_event_state::Empty> {
8316 pub fn new() -> Self {
8318 RecordEventBuilder {
8319 _state: PhantomData,
8320 _fields: (None, None, None, None),
8321 _lifetime: PhantomData,
8322 }
8323 }
8324}
8325
8326impl<'a, S: record_event_state::State> RecordEventBuilder<'a, S> {
8327 pub fn cid(mut self, value: impl Into<Option<Cid<'a>>>) -> Self {
8329 self._fields.0 = value.into();
8330 self
8331 }
8332 pub fn maybe_cid(mut self, value: Option<Cid<'a>>) -> Self {
8334 self._fields.0 = value;
8335 self
8336 }
8337}
8338
8339impl<'a, S: record_event_state::State> RecordEventBuilder<'a, S> {
8340 pub fn comment(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
8342 self._fields.1 = value.into();
8343 self
8344 }
8345 pub fn maybe_comment(mut self, value: Option<CowStr<'a>>) -> Self {
8347 self._fields.1 = value;
8348 self
8349 }
8350}
8351
8352impl<'a, S> RecordEventBuilder<'a, S>
8353where
8354 S: record_event_state::State,
8355 S::Op: record_event_state::IsUnset,
8356{
8357 pub fn op(
8359 mut self,
8360 value: impl Into<RecordEventOp<'a>>,
8361 ) -> RecordEventBuilder<'a, record_event_state::SetOp<S>> {
8362 self._fields.2 = Option::Some(value.into());
8363 RecordEventBuilder {
8364 _state: PhantomData,
8365 _fields: self._fields,
8366 _lifetime: PhantomData,
8367 }
8368 }
8369}
8370
8371impl<'a, S> RecordEventBuilder<'a, S>
8372where
8373 S: record_event_state::State,
8374 S::Timestamp: record_event_state::IsUnset,
8375{
8376 pub fn timestamp(
8378 mut self,
8379 value: impl Into<Datetime>,
8380 ) -> RecordEventBuilder<'a, record_event_state::SetTimestamp<S>> {
8381 self._fields.3 = Option::Some(value.into());
8382 RecordEventBuilder {
8383 _state: PhantomData,
8384 _fields: self._fields,
8385 _lifetime: PhantomData,
8386 }
8387 }
8388}
8389
8390impl<'a, S> RecordEventBuilder<'a, S>
8391where
8392 S: record_event_state::State,
8393 S::Timestamp: record_event_state::IsSet,
8394 S::Op: record_event_state::IsSet,
8395{
8396 pub fn build(self) -> RecordEvent<'a> {
8398 RecordEvent {
8399 cid: self._fields.0,
8400 comment: self._fields.1,
8401 op: self._fields.2.unwrap(),
8402 timestamp: self._fields.3.unwrap(),
8403 extra_data: Default::default(),
8404 }
8405 }
8406 pub fn build_with_data(
8408 self,
8409 extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
8410 ) -> RecordEvent<'a> {
8411 RecordEvent {
8412 cid: self._fields.0,
8413 comment: self._fields.1,
8414 op: self._fields.2.unwrap(),
8415 timestamp: self._fields.3.unwrap(),
8416 extra_data: Some(extra_data),
8417 }
8418 }
8419}
8420
8421pub mod record_view_state {
8422
8423 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
8424 #[allow(unused)]
8425 use ::core::marker::PhantomData;
8426 mod sealed {
8427 pub trait Sealed {}
8428 }
8429 pub trait State: sealed::Sealed {
8431 type Moderation;
8432 type BlobCids;
8433 type Repo;
8434 type Cid;
8435 type Uri;
8436 type Value;
8437 type IndexedAt;
8438 }
8439 pub struct Empty(());
8441 impl sealed::Sealed for Empty {}
8442 impl State for Empty {
8443 type Moderation = Unset;
8444 type BlobCids = Unset;
8445 type Repo = Unset;
8446 type Cid = Unset;
8447 type Uri = Unset;
8448 type Value = Unset;
8449 type IndexedAt = Unset;
8450 }
8451 pub struct SetModeration<S: State = Empty>(PhantomData<fn() -> S>);
8453 impl<S: State> sealed::Sealed for SetModeration<S> {}
8454 impl<S: State> State for SetModeration<S> {
8455 type Moderation = Set<members::moderation>;
8456 type BlobCids = S::BlobCids;
8457 type Repo = S::Repo;
8458 type Cid = S::Cid;
8459 type Uri = S::Uri;
8460 type Value = S::Value;
8461 type IndexedAt = S::IndexedAt;
8462 }
8463 pub struct SetBlobCids<S: State = Empty>(PhantomData<fn() -> S>);
8465 impl<S: State> sealed::Sealed for SetBlobCids<S> {}
8466 impl<S: State> State for SetBlobCids<S> {
8467 type Moderation = S::Moderation;
8468 type BlobCids = Set<members::blob_cids>;
8469 type Repo = S::Repo;
8470 type Cid = S::Cid;
8471 type Uri = S::Uri;
8472 type Value = S::Value;
8473 type IndexedAt = S::IndexedAt;
8474 }
8475 pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>);
8477 impl<S: State> sealed::Sealed for SetRepo<S> {}
8478 impl<S: State> State for SetRepo<S> {
8479 type Moderation = S::Moderation;
8480 type BlobCids = S::BlobCids;
8481 type Repo = Set<members::repo>;
8482 type Cid = S::Cid;
8483 type Uri = S::Uri;
8484 type Value = S::Value;
8485 type IndexedAt = S::IndexedAt;
8486 }
8487 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>);
8489 impl<S: State> sealed::Sealed for SetCid<S> {}
8490 impl<S: State> State for SetCid<S> {
8491 type Moderation = S::Moderation;
8492 type BlobCids = S::BlobCids;
8493 type Repo = S::Repo;
8494 type Cid = Set<members::cid>;
8495 type Uri = S::Uri;
8496 type Value = S::Value;
8497 type IndexedAt = S::IndexedAt;
8498 }
8499 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>);
8501 impl<S: State> sealed::Sealed for SetUri<S> {}
8502 impl<S: State> State for SetUri<S> {
8503 type Moderation = S::Moderation;
8504 type BlobCids = S::BlobCids;
8505 type Repo = S::Repo;
8506 type Cid = S::Cid;
8507 type Uri = Set<members::uri>;
8508 type Value = S::Value;
8509 type IndexedAt = S::IndexedAt;
8510 }
8511 pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>);
8513 impl<S: State> sealed::Sealed for SetValue<S> {}
8514 impl<S: State> State for SetValue<S> {
8515 type Moderation = S::Moderation;
8516 type BlobCids = S::BlobCids;
8517 type Repo = S::Repo;
8518 type Cid = S::Cid;
8519 type Uri = S::Uri;
8520 type Value = Set<members::value>;
8521 type IndexedAt = S::IndexedAt;
8522 }
8523 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>);
8525 impl<S: State> sealed::Sealed for SetIndexedAt<S> {}
8526 impl<S: State> State for SetIndexedAt<S> {
8527 type Moderation = S::Moderation;
8528 type BlobCids = S::BlobCids;
8529 type Repo = S::Repo;
8530 type Cid = S::Cid;
8531 type Uri = S::Uri;
8532 type Value = S::Value;
8533 type IndexedAt = Set<members::indexed_at>;
8534 }
8535 #[allow(non_camel_case_types)]
8537 pub mod members {
8538 pub struct moderation(());
8540 pub struct blob_cids(());
8542 pub struct repo(());
8544 pub struct cid(());
8546 pub struct uri(());
8548 pub struct value(());
8550 pub struct indexed_at(());
8552 }
8553}
8554
8555pub struct RecordViewBuilder<'a, S: record_view_state::State> {
8557 _state: PhantomData<fn() -> S>,
8558 _fields: (
8559 Option<Vec<Cid<'a>>>,
8560 Option<Cid<'a>>,
8561 Option<Datetime>,
8562 Option<moderation::Moderation<'a>>,
8563 Option<moderation::RepoView<'a>>,
8564 Option<AtUri<'a>>,
8565 Option<Data<'a>>,
8566 ),
8567 _lifetime: PhantomData<&'a ()>,
8568}
8569
8570impl<'a> RecordView<'a> {
8571 pub fn new() -> RecordViewBuilder<'a, record_view_state::Empty> {
8573 RecordViewBuilder::new()
8574 }
8575}
8576
8577impl<'a> RecordViewBuilder<'a, record_view_state::Empty> {
8578 pub fn new() -> Self {
8580 RecordViewBuilder {
8581 _state: PhantomData,
8582 _fields: (None, None, None, None, None, None, None),
8583 _lifetime: PhantomData,
8584 }
8585 }
8586}
8587
8588impl<'a, S> RecordViewBuilder<'a, S>
8589where
8590 S: record_view_state::State,
8591 S::BlobCids: record_view_state::IsUnset,
8592{
8593 pub fn blob_cids(
8595 mut self,
8596 value: impl Into<Vec<Cid<'a>>>,
8597 ) -> RecordViewBuilder<'a, record_view_state::SetBlobCids<S>> {
8598 self._fields.0 = Option::Some(value.into());
8599 RecordViewBuilder {
8600 _state: PhantomData,
8601 _fields: self._fields,
8602 _lifetime: PhantomData,
8603 }
8604 }
8605}
8606
8607impl<'a, S> RecordViewBuilder<'a, S>
8608where
8609 S: record_view_state::State,
8610 S::Cid: record_view_state::IsUnset,
8611{
8612 pub fn cid(
8614 mut self,
8615 value: impl Into<Cid<'a>>,
8616 ) -> RecordViewBuilder<'a, record_view_state::SetCid<S>> {
8617 self._fields.1 = Option::Some(value.into());
8618 RecordViewBuilder {
8619 _state: PhantomData,
8620 _fields: self._fields,
8621 _lifetime: PhantomData,
8622 }
8623 }
8624}
8625
8626impl<'a, S> RecordViewBuilder<'a, S>
8627where
8628 S: record_view_state::State,
8629 S::IndexedAt: record_view_state::IsUnset,
8630{
8631 pub fn indexed_at(
8633 mut self,
8634 value: impl Into<Datetime>,
8635 ) -> RecordViewBuilder<'a, record_view_state::SetIndexedAt<S>> {
8636 self._fields.2 = Option::Some(value.into());
8637 RecordViewBuilder {
8638 _state: PhantomData,
8639 _fields: self._fields,
8640 _lifetime: PhantomData,
8641 }
8642 }
8643}
8644
8645impl<'a, S> RecordViewBuilder<'a, S>
8646where
8647 S: record_view_state::State,
8648 S::Moderation: record_view_state::IsUnset,
8649{
8650 pub fn moderation(
8652 mut self,
8653 value: impl Into<moderation::Moderation<'a>>,
8654 ) -> RecordViewBuilder<'a, record_view_state::SetModeration<S>> {
8655 self._fields.3 = Option::Some(value.into());
8656 RecordViewBuilder {
8657 _state: PhantomData,
8658 _fields: self._fields,
8659 _lifetime: PhantomData,
8660 }
8661 }
8662}
8663
8664impl<'a, S> RecordViewBuilder<'a, S>
8665where
8666 S: record_view_state::State,
8667 S::Repo: record_view_state::IsUnset,
8668{
8669 pub fn repo(
8671 mut self,
8672 value: impl Into<moderation::RepoView<'a>>,
8673 ) -> RecordViewBuilder<'a, record_view_state::SetRepo<S>> {
8674 self._fields.4 = Option::Some(value.into());
8675 RecordViewBuilder {
8676 _state: PhantomData,
8677 _fields: self._fields,
8678 _lifetime: PhantomData,
8679 }
8680 }
8681}
8682
8683impl<'a, S> RecordViewBuilder<'a, S>
8684where
8685 S: record_view_state::State,
8686 S::Uri: record_view_state::IsUnset,
8687{
8688 pub fn uri(
8690 mut self,
8691 value: impl Into<AtUri<'a>>,
8692 ) -> RecordViewBuilder<'a, record_view_state::SetUri<S>> {
8693 self._fields.5 = Option::Some(value.into());
8694 RecordViewBuilder {
8695 _state: PhantomData,
8696 _fields: self._fields,
8697 _lifetime: PhantomData,
8698 }
8699 }
8700}
8701
8702impl<'a, S> RecordViewBuilder<'a, S>
8703where
8704 S: record_view_state::State,
8705 S::Value: record_view_state::IsUnset,
8706{
8707 pub fn value(
8709 mut self,
8710 value: impl Into<Data<'a>>,
8711 ) -> RecordViewBuilder<'a, record_view_state::SetValue<S>> {
8712 self._fields.6 = Option::Some(value.into());
8713 RecordViewBuilder {
8714 _state: PhantomData,
8715 _fields: self._fields,
8716 _lifetime: PhantomData,
8717 }
8718 }
8719}
8720
8721impl<'a, S> RecordViewBuilder<'a, S>
8722where
8723 S: record_view_state::State,
8724 S::Moderation: record_view_state::IsSet,
8725 S::BlobCids: record_view_state::IsSet,
8726 S::Repo: record_view_state::IsSet,
8727 S::Cid: record_view_state::IsSet,
8728 S::Uri: record_view_state::IsSet,
8729 S::Value: record_view_state::IsSet,
8730 S::IndexedAt: record_view_state::IsSet,
8731{
8732 pub fn build(self) -> RecordView<'a> {
8734 RecordView {
8735 blob_cids: self._fields.0.unwrap(),
8736 cid: self._fields.1.unwrap(),
8737 indexed_at: self._fields.2.unwrap(),
8738 moderation: self._fields.3.unwrap(),
8739 repo: self._fields.4.unwrap(),
8740 uri: self._fields.5.unwrap(),
8741 value: self._fields.6.unwrap(),
8742 extra_data: Default::default(),
8743 }
8744 }
8745 pub fn build_with_data(
8747 self,
8748 extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
8749 ) -> RecordView<'a> {
8750 RecordView {
8751 blob_cids: self._fields.0.unwrap(),
8752 cid: self._fields.1.unwrap(),
8753 indexed_at: self._fields.2.unwrap(),
8754 moderation: self._fields.3.unwrap(),
8755 repo: self._fields.4.unwrap(),
8756 uri: self._fields.5.unwrap(),
8757 value: self._fields.6.unwrap(),
8758 extra_data: Some(extra_data),
8759 }
8760 }
8761}
8762
8763pub mod record_view_detail_state {
8764
8765 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
8766 #[allow(unused)]
8767 use ::core::marker::PhantomData;
8768 mod sealed {
8769 pub trait Sealed {}
8770 }
8771 pub trait State: sealed::Sealed {
8773 type Repo;
8774 type IndexedAt;
8775 type Moderation;
8776 type Uri;
8777 type Cid;
8778 type Value;
8779 type Blobs;
8780 }
8781 pub struct Empty(());
8783 impl sealed::Sealed for Empty {}
8784 impl State for Empty {
8785 type Repo = Unset;
8786 type IndexedAt = Unset;
8787 type Moderation = Unset;
8788 type Uri = Unset;
8789 type Cid = Unset;
8790 type Value = Unset;
8791 type Blobs = Unset;
8792 }
8793 pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>);
8795 impl<S: State> sealed::Sealed for SetRepo<S> {}
8796 impl<S: State> State for SetRepo<S> {
8797 type Repo = Set<members::repo>;
8798 type IndexedAt = S::IndexedAt;
8799 type Moderation = S::Moderation;
8800 type Uri = S::Uri;
8801 type Cid = S::Cid;
8802 type Value = S::Value;
8803 type Blobs = S::Blobs;
8804 }
8805 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>);
8807 impl<S: State> sealed::Sealed for SetIndexedAt<S> {}
8808 impl<S: State> State for SetIndexedAt<S> {
8809 type Repo = S::Repo;
8810 type IndexedAt = Set<members::indexed_at>;
8811 type Moderation = S::Moderation;
8812 type Uri = S::Uri;
8813 type Cid = S::Cid;
8814 type Value = S::Value;
8815 type Blobs = S::Blobs;
8816 }
8817 pub struct SetModeration<S: State = Empty>(PhantomData<fn() -> S>);
8819 impl<S: State> sealed::Sealed for SetModeration<S> {}
8820 impl<S: State> State for SetModeration<S> {
8821 type Repo = S::Repo;
8822 type IndexedAt = S::IndexedAt;
8823 type Moderation = Set<members::moderation>;
8824 type Uri = S::Uri;
8825 type Cid = S::Cid;
8826 type Value = S::Value;
8827 type Blobs = S::Blobs;
8828 }
8829 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>);
8831 impl<S: State> sealed::Sealed for SetUri<S> {}
8832 impl<S: State> State for SetUri<S> {
8833 type Repo = S::Repo;
8834 type IndexedAt = S::IndexedAt;
8835 type Moderation = S::Moderation;
8836 type Uri = Set<members::uri>;
8837 type Cid = S::Cid;
8838 type Value = S::Value;
8839 type Blobs = S::Blobs;
8840 }
8841 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>);
8843 impl<S: State> sealed::Sealed for SetCid<S> {}
8844 impl<S: State> State for SetCid<S> {
8845 type Repo = S::Repo;
8846 type IndexedAt = S::IndexedAt;
8847 type Moderation = S::Moderation;
8848 type Uri = S::Uri;
8849 type Cid = Set<members::cid>;
8850 type Value = S::Value;
8851 type Blobs = S::Blobs;
8852 }
8853 pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>);
8855 impl<S: State> sealed::Sealed for SetValue<S> {}
8856 impl<S: State> State for SetValue<S> {
8857 type Repo = S::Repo;
8858 type IndexedAt = S::IndexedAt;
8859 type Moderation = S::Moderation;
8860 type Uri = S::Uri;
8861 type Cid = S::Cid;
8862 type Value = Set<members::value>;
8863 type Blobs = S::Blobs;
8864 }
8865 pub struct SetBlobs<S: State = Empty>(PhantomData<fn() -> S>);
8867 impl<S: State> sealed::Sealed for SetBlobs<S> {}
8868 impl<S: State> State for SetBlobs<S> {
8869 type Repo = S::Repo;
8870 type IndexedAt = S::IndexedAt;
8871 type Moderation = S::Moderation;
8872 type Uri = S::Uri;
8873 type Cid = S::Cid;
8874 type Value = S::Value;
8875 type Blobs = Set<members::blobs>;
8876 }
8877 #[allow(non_camel_case_types)]
8879 pub mod members {
8880 pub struct repo(());
8882 pub struct indexed_at(());
8884 pub struct moderation(());
8886 pub struct uri(());
8888 pub struct cid(());
8890 pub struct value(());
8892 pub struct blobs(());
8894 }
8895}
8896
8897pub struct RecordViewDetailBuilder<'a, S: record_view_detail_state::State> {
8899 _state: PhantomData<fn() -> S>,
8900 _fields: (
8901 Option<Vec<moderation::BlobView<'a>>>,
8902 Option<Cid<'a>>,
8903 Option<Datetime>,
8904 Option<Vec<Label<'a>>>,
8905 Option<moderation::ModerationDetail<'a>>,
8906 Option<moderation::RepoView<'a>>,
8907 Option<AtUri<'a>>,
8908 Option<Data<'a>>,
8909 ),
8910 _lifetime: PhantomData<&'a ()>,
8911}
8912
8913impl<'a> RecordViewDetail<'a> {
8914 pub fn new() -> RecordViewDetailBuilder<'a, record_view_detail_state::Empty> {
8916 RecordViewDetailBuilder::new()
8917 }
8918}
8919
8920impl<'a> RecordViewDetailBuilder<'a, record_view_detail_state::Empty> {
8921 pub fn new() -> Self {
8923 RecordViewDetailBuilder {
8924 _state: PhantomData,
8925 _fields: (None, None, None, None, None, None, None, None),
8926 _lifetime: PhantomData,
8927 }
8928 }
8929}
8930
8931impl<'a, S> RecordViewDetailBuilder<'a, S>
8932where
8933 S: record_view_detail_state::State,
8934 S::Blobs: record_view_detail_state::IsUnset,
8935{
8936 pub fn blobs(
8938 mut self,
8939 value: impl Into<Vec<moderation::BlobView<'a>>>,
8940 ) -> RecordViewDetailBuilder<'a, record_view_detail_state::SetBlobs<S>> {
8941 self._fields.0 = Option::Some(value.into());
8942 RecordViewDetailBuilder {
8943 _state: PhantomData,
8944 _fields: self._fields,
8945 _lifetime: PhantomData,
8946 }
8947 }
8948}
8949
8950impl<'a, S> RecordViewDetailBuilder<'a, S>
8951where
8952 S: record_view_detail_state::State,
8953 S::Cid: record_view_detail_state::IsUnset,
8954{
8955 pub fn cid(
8957 mut self,
8958 value: impl Into<Cid<'a>>,
8959 ) -> RecordViewDetailBuilder<'a, record_view_detail_state::SetCid<S>> {
8960 self._fields.1 = Option::Some(value.into());
8961 RecordViewDetailBuilder {
8962 _state: PhantomData,
8963 _fields: self._fields,
8964 _lifetime: PhantomData,
8965 }
8966 }
8967}
8968
8969impl<'a, S> RecordViewDetailBuilder<'a, S>
8970where
8971 S: record_view_detail_state::State,
8972 S::IndexedAt: record_view_detail_state::IsUnset,
8973{
8974 pub fn indexed_at(
8976 mut self,
8977 value: impl Into<Datetime>,
8978 ) -> RecordViewDetailBuilder<'a, record_view_detail_state::SetIndexedAt<S>> {
8979 self._fields.2 = Option::Some(value.into());
8980 RecordViewDetailBuilder {
8981 _state: PhantomData,
8982 _fields: self._fields,
8983 _lifetime: PhantomData,
8984 }
8985 }
8986}
8987
8988impl<'a, S: record_view_detail_state::State> RecordViewDetailBuilder<'a, S> {
8989 pub fn labels(mut self, value: impl Into<Option<Vec<Label<'a>>>>) -> Self {
8991 self._fields.3 = value.into();
8992 self
8993 }
8994 pub fn maybe_labels(mut self, value: Option<Vec<Label<'a>>>) -> Self {
8996 self._fields.3 = value;
8997 self
8998 }
8999}
9000
9001impl<'a, S> RecordViewDetailBuilder<'a, S>
9002where
9003 S: record_view_detail_state::State,
9004 S::Moderation: record_view_detail_state::IsUnset,
9005{
9006 pub fn moderation(
9008 mut self,
9009 value: impl Into<moderation::ModerationDetail<'a>>,
9010 ) -> RecordViewDetailBuilder<'a, record_view_detail_state::SetModeration<S>> {
9011 self._fields.4 = Option::Some(value.into());
9012 RecordViewDetailBuilder {
9013 _state: PhantomData,
9014 _fields: self._fields,
9015 _lifetime: PhantomData,
9016 }
9017 }
9018}
9019
9020impl<'a, S> RecordViewDetailBuilder<'a, S>
9021where
9022 S: record_view_detail_state::State,
9023 S::Repo: record_view_detail_state::IsUnset,
9024{
9025 pub fn repo(
9027 mut self,
9028 value: impl Into<moderation::RepoView<'a>>,
9029 ) -> RecordViewDetailBuilder<'a, record_view_detail_state::SetRepo<S>> {
9030 self._fields.5 = Option::Some(value.into());
9031 RecordViewDetailBuilder {
9032 _state: PhantomData,
9033 _fields: self._fields,
9034 _lifetime: PhantomData,
9035 }
9036 }
9037}
9038
9039impl<'a, S> RecordViewDetailBuilder<'a, S>
9040where
9041 S: record_view_detail_state::State,
9042 S::Uri: record_view_detail_state::IsUnset,
9043{
9044 pub fn uri(
9046 mut self,
9047 value: impl Into<AtUri<'a>>,
9048 ) -> RecordViewDetailBuilder<'a, record_view_detail_state::SetUri<S>> {
9049 self._fields.6 = Option::Some(value.into());
9050 RecordViewDetailBuilder {
9051 _state: PhantomData,
9052 _fields: self._fields,
9053 _lifetime: PhantomData,
9054 }
9055 }
9056}
9057
9058impl<'a, S> RecordViewDetailBuilder<'a, S>
9059where
9060 S: record_view_detail_state::State,
9061 S::Value: record_view_detail_state::IsUnset,
9062{
9063 pub fn value(
9065 mut self,
9066 value: impl Into<Data<'a>>,
9067 ) -> RecordViewDetailBuilder<'a, record_view_detail_state::SetValue<S>> {
9068 self._fields.7 = Option::Some(value.into());
9069 RecordViewDetailBuilder {
9070 _state: PhantomData,
9071 _fields: self._fields,
9072 _lifetime: PhantomData,
9073 }
9074 }
9075}
9076
9077impl<'a, S> RecordViewDetailBuilder<'a, S>
9078where
9079 S: record_view_detail_state::State,
9080 S::Repo: record_view_detail_state::IsSet,
9081 S::IndexedAt: record_view_detail_state::IsSet,
9082 S::Moderation: record_view_detail_state::IsSet,
9083 S::Uri: record_view_detail_state::IsSet,
9084 S::Cid: record_view_detail_state::IsSet,
9085 S::Value: record_view_detail_state::IsSet,
9086 S::Blobs: record_view_detail_state::IsSet,
9087{
9088 pub fn build(self) -> RecordViewDetail<'a> {
9090 RecordViewDetail {
9091 blobs: self._fields.0.unwrap(),
9092 cid: self._fields.1.unwrap(),
9093 indexed_at: self._fields.2.unwrap(),
9094 labels: self._fields.3,
9095 moderation: self._fields.4.unwrap(),
9096 repo: self._fields.5.unwrap(),
9097 uri: self._fields.6.unwrap(),
9098 value: self._fields.7.unwrap(),
9099 extra_data: Default::default(),
9100 }
9101 }
9102 pub fn build_with_data(
9104 self,
9105 extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
9106 ) -> RecordViewDetail<'a> {
9107 RecordViewDetail {
9108 blobs: self._fields.0.unwrap(),
9109 cid: self._fields.1.unwrap(),
9110 indexed_at: self._fields.2.unwrap(),
9111 labels: self._fields.3,
9112 moderation: self._fields.4.unwrap(),
9113 repo: self._fields.5.unwrap(),
9114 uri: self._fields.6.unwrap(),
9115 value: self._fields.7.unwrap(),
9116 extra_data: Some(extra_data),
9117 }
9118 }
9119}
9120
9121pub mod record_view_not_found_state {
9122
9123 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
9124 #[allow(unused)]
9125 use ::core::marker::PhantomData;
9126 mod sealed {
9127 pub trait Sealed {}
9128 }
9129 pub trait State: sealed::Sealed {
9131 type Uri;
9132 }
9133 pub struct Empty(());
9135 impl sealed::Sealed for Empty {}
9136 impl State for Empty {
9137 type Uri = Unset;
9138 }
9139 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>);
9141 impl<S: State> sealed::Sealed for SetUri<S> {}
9142 impl<S: State> State for SetUri<S> {
9143 type Uri = Set<members::uri>;
9144 }
9145 #[allow(non_camel_case_types)]
9147 pub mod members {
9148 pub struct uri(());
9150 }
9151}
9152
9153pub struct RecordViewNotFoundBuilder<'a, S: record_view_not_found_state::State> {
9155 _state: PhantomData<fn() -> S>,
9156 _fields: (Option<AtUri<'a>>,),
9157 _lifetime: PhantomData<&'a ()>,
9158}
9159
9160impl<'a> RecordViewNotFound<'a> {
9161 pub fn new() -> RecordViewNotFoundBuilder<'a, record_view_not_found_state::Empty> {
9163 RecordViewNotFoundBuilder::new()
9164 }
9165}
9166
9167impl<'a> RecordViewNotFoundBuilder<'a, record_view_not_found_state::Empty> {
9168 pub fn new() -> Self {
9170 RecordViewNotFoundBuilder {
9171 _state: PhantomData,
9172 _fields: (None,),
9173 _lifetime: PhantomData,
9174 }
9175 }
9176}
9177
9178impl<'a, S> RecordViewNotFoundBuilder<'a, S>
9179where
9180 S: record_view_not_found_state::State,
9181 S::Uri: record_view_not_found_state::IsUnset,
9182{
9183 pub fn uri(
9185 mut self,
9186 value: impl Into<AtUri<'a>>,
9187 ) -> RecordViewNotFoundBuilder<'a, record_view_not_found_state::SetUri<S>> {
9188 self._fields.0 = Option::Some(value.into());
9189 RecordViewNotFoundBuilder {
9190 _state: PhantomData,
9191 _fields: self._fields,
9192 _lifetime: PhantomData,
9193 }
9194 }
9195}
9196
9197impl<'a, S> RecordViewNotFoundBuilder<'a, S>
9198where
9199 S: record_view_not_found_state::State,
9200 S::Uri: record_view_not_found_state::IsSet,
9201{
9202 pub fn build(self) -> RecordViewNotFound<'a> {
9204 RecordViewNotFound {
9205 uri: self._fields.0.unwrap(),
9206 extra_data: Default::default(),
9207 }
9208 }
9209 pub fn build_with_data(
9211 self,
9212 extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
9213 ) -> RecordViewNotFound<'a> {
9214 RecordViewNotFound {
9215 uri: self._fields.0.unwrap(),
9216 extra_data: Some(extra_data),
9217 }
9218 }
9219}
9220
9221pub mod repo_view_state {
9222
9223 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
9224 #[allow(unused)]
9225 use ::core::marker::PhantomData;
9226 mod sealed {
9227 pub trait Sealed {}
9228 }
9229 pub trait State: sealed::Sealed {
9231 type IndexedAt;
9232 type Did;
9233 type Handle;
9234 type Moderation;
9235 type RelatedRecords;
9236 }
9237 pub struct Empty(());
9239 impl sealed::Sealed for Empty {}
9240 impl State for Empty {
9241 type IndexedAt = Unset;
9242 type Did = Unset;
9243 type Handle = Unset;
9244 type Moderation = Unset;
9245 type RelatedRecords = Unset;
9246 }
9247 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>);
9249 impl<S: State> sealed::Sealed for SetIndexedAt<S> {}
9250 impl<S: State> State for SetIndexedAt<S> {
9251 type IndexedAt = Set<members::indexed_at>;
9252 type Did = S::Did;
9253 type Handle = S::Handle;
9254 type Moderation = S::Moderation;
9255 type RelatedRecords = S::RelatedRecords;
9256 }
9257 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>);
9259 impl<S: State> sealed::Sealed for SetDid<S> {}
9260 impl<S: State> State for SetDid<S> {
9261 type IndexedAt = S::IndexedAt;
9262 type Did = Set<members::did>;
9263 type Handle = S::Handle;
9264 type Moderation = S::Moderation;
9265 type RelatedRecords = S::RelatedRecords;
9266 }
9267 pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>);
9269 impl<S: State> sealed::Sealed for SetHandle<S> {}
9270 impl<S: State> State for SetHandle<S> {
9271 type IndexedAt = S::IndexedAt;
9272 type Did = S::Did;
9273 type Handle = Set<members::handle>;
9274 type Moderation = S::Moderation;
9275 type RelatedRecords = S::RelatedRecords;
9276 }
9277 pub struct SetModeration<S: State = Empty>(PhantomData<fn() -> S>);
9279 impl<S: State> sealed::Sealed for SetModeration<S> {}
9280 impl<S: State> State for SetModeration<S> {
9281 type IndexedAt = S::IndexedAt;
9282 type Did = S::Did;
9283 type Handle = S::Handle;
9284 type Moderation = Set<members::moderation>;
9285 type RelatedRecords = S::RelatedRecords;
9286 }
9287 pub struct SetRelatedRecords<S: State = Empty>(PhantomData<fn() -> S>);
9289 impl<S: State> sealed::Sealed for SetRelatedRecords<S> {}
9290 impl<S: State> State for SetRelatedRecords<S> {
9291 type IndexedAt = S::IndexedAt;
9292 type Did = S::Did;
9293 type Handle = S::Handle;
9294 type Moderation = S::Moderation;
9295 type RelatedRecords = Set<members::related_records>;
9296 }
9297 #[allow(non_camel_case_types)]
9299 pub mod members {
9300 pub struct indexed_at(());
9302 pub struct did(());
9304 pub struct handle(());
9306 pub struct moderation(());
9308 pub struct related_records(());
9310 }
9311}
9312
9313pub struct RepoViewBuilder<'a, S: repo_view_state::State> {
9315 _state: PhantomData<fn() -> S>,
9316 _fields: (
9317 Option<Datetime>,
9318 Option<Did<'a>>,
9319 Option<CowStr<'a>>,
9320 Option<Handle<'a>>,
9321 Option<Datetime>,
9322 Option<CowStr<'a>>,
9323 Option<InviteCode<'a>>,
9324 Option<bool>,
9325 Option<moderation::Moderation<'a>>,
9326 Option<Vec<Data<'a>>>,
9327 Option<Vec<ThreatSignature<'a>>>,
9328 ),
9329 _lifetime: PhantomData<&'a ()>,
9330}
9331
9332impl<'a> RepoView<'a> {
9333 pub fn new() -> RepoViewBuilder<'a, repo_view_state::Empty> {
9335 RepoViewBuilder::new()
9336 }
9337}
9338
9339impl<'a> RepoViewBuilder<'a, repo_view_state::Empty> {
9340 pub fn new() -> Self {
9342 RepoViewBuilder {
9343 _state: PhantomData,
9344 _fields: (None, None, None, None, None, None, None, None, None, None, None),
9345 _lifetime: PhantomData,
9346 }
9347 }
9348}
9349
9350impl<'a, S: repo_view_state::State> RepoViewBuilder<'a, S> {
9351 pub fn deactivated_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
9353 self._fields.0 = value.into();
9354 self
9355 }
9356 pub fn maybe_deactivated_at(mut self, value: Option<Datetime>) -> Self {
9358 self._fields.0 = value;
9359 self
9360 }
9361}
9362
9363impl<'a, S> RepoViewBuilder<'a, S>
9364where
9365 S: repo_view_state::State,
9366 S::Did: repo_view_state::IsUnset,
9367{
9368 pub fn did(
9370 mut self,
9371 value: impl Into<Did<'a>>,
9372 ) -> RepoViewBuilder<'a, repo_view_state::SetDid<S>> {
9373 self._fields.1 = Option::Some(value.into());
9374 RepoViewBuilder {
9375 _state: PhantomData,
9376 _fields: self._fields,
9377 _lifetime: PhantomData,
9378 }
9379 }
9380}
9381
9382impl<'a, S: repo_view_state::State> RepoViewBuilder<'a, S> {
9383 pub fn email(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
9385 self._fields.2 = value.into();
9386 self
9387 }
9388 pub fn maybe_email(mut self, value: Option<CowStr<'a>>) -> Self {
9390 self._fields.2 = value;
9391 self
9392 }
9393}
9394
9395impl<'a, S> RepoViewBuilder<'a, S>
9396where
9397 S: repo_view_state::State,
9398 S::Handle: repo_view_state::IsUnset,
9399{
9400 pub fn handle(
9402 mut self,
9403 value: impl Into<Handle<'a>>,
9404 ) -> RepoViewBuilder<'a, repo_view_state::SetHandle<S>> {
9405 self._fields.3 = Option::Some(value.into());
9406 RepoViewBuilder {
9407 _state: PhantomData,
9408 _fields: self._fields,
9409 _lifetime: PhantomData,
9410 }
9411 }
9412}
9413
9414impl<'a, S> RepoViewBuilder<'a, S>
9415where
9416 S: repo_view_state::State,
9417 S::IndexedAt: repo_view_state::IsUnset,
9418{
9419 pub fn indexed_at(
9421 mut self,
9422 value: impl Into<Datetime>,
9423 ) -> RepoViewBuilder<'a, repo_view_state::SetIndexedAt<S>> {
9424 self._fields.4 = Option::Some(value.into());
9425 RepoViewBuilder {
9426 _state: PhantomData,
9427 _fields: self._fields,
9428 _lifetime: PhantomData,
9429 }
9430 }
9431}
9432
9433impl<'a, S: repo_view_state::State> RepoViewBuilder<'a, S> {
9434 pub fn invite_note(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
9436 self._fields.5 = value.into();
9437 self
9438 }
9439 pub fn maybe_invite_note(mut self, value: Option<CowStr<'a>>) -> Self {
9441 self._fields.5 = value;
9442 self
9443 }
9444}
9445
9446impl<'a, S: repo_view_state::State> RepoViewBuilder<'a, S> {
9447 pub fn invited_by(mut self, value: impl Into<Option<InviteCode<'a>>>) -> Self {
9449 self._fields.6 = value.into();
9450 self
9451 }
9452 pub fn maybe_invited_by(mut self, value: Option<InviteCode<'a>>) -> Self {
9454 self._fields.6 = value;
9455 self
9456 }
9457}
9458
9459impl<'a, S: repo_view_state::State> RepoViewBuilder<'a, S> {
9460 pub fn invites_disabled(mut self, value: impl Into<Option<bool>>) -> Self {
9462 self._fields.7 = value.into();
9463 self
9464 }
9465 pub fn maybe_invites_disabled(mut self, value: Option<bool>) -> Self {
9467 self._fields.7 = value;
9468 self
9469 }
9470}
9471
9472impl<'a, S> RepoViewBuilder<'a, S>
9473where
9474 S: repo_view_state::State,
9475 S::Moderation: repo_view_state::IsUnset,
9476{
9477 pub fn moderation(
9479 mut self,
9480 value: impl Into<moderation::Moderation<'a>>,
9481 ) -> RepoViewBuilder<'a, repo_view_state::SetModeration<S>> {
9482 self._fields.8 = Option::Some(value.into());
9483 RepoViewBuilder {
9484 _state: PhantomData,
9485 _fields: self._fields,
9486 _lifetime: PhantomData,
9487 }
9488 }
9489}
9490
9491impl<'a, S> RepoViewBuilder<'a, S>
9492where
9493 S: repo_view_state::State,
9494 S::RelatedRecords: repo_view_state::IsUnset,
9495{
9496 pub fn related_records(
9498 mut self,
9499 value: impl Into<Vec<Data<'a>>>,
9500 ) -> RepoViewBuilder<'a, repo_view_state::SetRelatedRecords<S>> {
9501 self._fields.9 = Option::Some(value.into());
9502 RepoViewBuilder {
9503 _state: PhantomData,
9504 _fields: self._fields,
9505 _lifetime: PhantomData,
9506 }
9507 }
9508}
9509
9510impl<'a, S: repo_view_state::State> RepoViewBuilder<'a, S> {
9511 pub fn threat_signatures(
9513 mut self,
9514 value: impl Into<Option<Vec<ThreatSignature<'a>>>>,
9515 ) -> Self {
9516 self._fields.10 = value.into();
9517 self
9518 }
9519 pub fn maybe_threat_signatures(
9521 mut self,
9522 value: Option<Vec<ThreatSignature<'a>>>,
9523 ) -> Self {
9524 self._fields.10 = value;
9525 self
9526 }
9527}
9528
9529impl<'a, S> RepoViewBuilder<'a, S>
9530where
9531 S: repo_view_state::State,
9532 S::IndexedAt: repo_view_state::IsSet,
9533 S::Did: repo_view_state::IsSet,
9534 S::Handle: repo_view_state::IsSet,
9535 S::Moderation: repo_view_state::IsSet,
9536 S::RelatedRecords: repo_view_state::IsSet,
9537{
9538 pub fn build(self) -> RepoView<'a> {
9540 RepoView {
9541 deactivated_at: self._fields.0,
9542 did: self._fields.1.unwrap(),
9543 email: self._fields.2,
9544 handle: self._fields.3.unwrap(),
9545 indexed_at: self._fields.4.unwrap(),
9546 invite_note: self._fields.5,
9547 invited_by: self._fields.6,
9548 invites_disabled: self._fields.7,
9549 moderation: self._fields.8.unwrap(),
9550 related_records: self._fields.9.unwrap(),
9551 threat_signatures: self._fields.10,
9552 extra_data: Default::default(),
9553 }
9554 }
9555 pub fn build_with_data(
9557 self,
9558 extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
9559 ) -> RepoView<'a> {
9560 RepoView {
9561 deactivated_at: self._fields.0,
9562 did: self._fields.1.unwrap(),
9563 email: self._fields.2,
9564 handle: self._fields.3.unwrap(),
9565 indexed_at: self._fields.4.unwrap(),
9566 invite_note: self._fields.5,
9567 invited_by: self._fields.6,
9568 invites_disabled: self._fields.7,
9569 moderation: self._fields.8.unwrap(),
9570 related_records: self._fields.9.unwrap(),
9571 threat_signatures: self._fields.10,
9572 extra_data: Some(extra_data),
9573 }
9574 }
9575}
9576
9577pub mod repo_view_detail_state {
9578
9579 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
9580 #[allow(unused)]
9581 use ::core::marker::PhantomData;
9582 mod sealed {
9583 pub trait Sealed {}
9584 }
9585 pub trait State: sealed::Sealed {
9587 type Handle;
9588 type RelatedRecords;
9589 type Did;
9590 type IndexedAt;
9591 type Moderation;
9592 }
9593 pub struct Empty(());
9595 impl sealed::Sealed for Empty {}
9596 impl State for Empty {
9597 type Handle = Unset;
9598 type RelatedRecords = Unset;
9599 type Did = Unset;
9600 type IndexedAt = Unset;
9601 type Moderation = Unset;
9602 }
9603 pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>);
9605 impl<S: State> sealed::Sealed for SetHandle<S> {}
9606 impl<S: State> State for SetHandle<S> {
9607 type Handle = Set<members::handle>;
9608 type RelatedRecords = S::RelatedRecords;
9609 type Did = S::Did;
9610 type IndexedAt = S::IndexedAt;
9611 type Moderation = S::Moderation;
9612 }
9613 pub struct SetRelatedRecords<S: State = Empty>(PhantomData<fn() -> S>);
9615 impl<S: State> sealed::Sealed for SetRelatedRecords<S> {}
9616 impl<S: State> State for SetRelatedRecords<S> {
9617 type Handle = S::Handle;
9618 type RelatedRecords = Set<members::related_records>;
9619 type Did = S::Did;
9620 type IndexedAt = S::IndexedAt;
9621 type Moderation = S::Moderation;
9622 }
9623 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>);
9625 impl<S: State> sealed::Sealed for SetDid<S> {}
9626 impl<S: State> State for SetDid<S> {
9627 type Handle = S::Handle;
9628 type RelatedRecords = S::RelatedRecords;
9629 type Did = Set<members::did>;
9630 type IndexedAt = S::IndexedAt;
9631 type Moderation = S::Moderation;
9632 }
9633 pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>);
9635 impl<S: State> sealed::Sealed for SetIndexedAt<S> {}
9636 impl<S: State> State for SetIndexedAt<S> {
9637 type Handle = S::Handle;
9638 type RelatedRecords = S::RelatedRecords;
9639 type Did = S::Did;
9640 type IndexedAt = Set<members::indexed_at>;
9641 type Moderation = S::Moderation;
9642 }
9643 pub struct SetModeration<S: State = Empty>(PhantomData<fn() -> S>);
9645 impl<S: State> sealed::Sealed for SetModeration<S> {}
9646 impl<S: State> State for SetModeration<S> {
9647 type Handle = S::Handle;
9648 type RelatedRecords = S::RelatedRecords;
9649 type Did = S::Did;
9650 type IndexedAt = S::IndexedAt;
9651 type Moderation = Set<members::moderation>;
9652 }
9653 #[allow(non_camel_case_types)]
9655 pub mod members {
9656 pub struct handle(());
9658 pub struct related_records(());
9660 pub struct did(());
9662 pub struct indexed_at(());
9664 pub struct moderation(());
9666 }
9667}
9668
9669pub struct RepoViewDetailBuilder<'a, S: repo_view_detail_state::State> {
9671 _state: PhantomData<fn() -> S>,
9672 _fields: (
9673 Option<Datetime>,
9674 Option<Did<'a>>,
9675 Option<CowStr<'a>>,
9676 Option<Datetime>,
9677 Option<Handle<'a>>,
9678 Option<Datetime>,
9679 Option<CowStr<'a>>,
9680 Option<InviteCode<'a>>,
9681 Option<Vec<InviteCode<'a>>>,
9682 Option<bool>,
9683 Option<Vec<Label<'a>>>,
9684 Option<moderation::ModerationDetail<'a>>,
9685 Option<Vec<Data<'a>>>,
9686 Option<Vec<ThreatSignature<'a>>>,
9687 ),
9688 _lifetime: PhantomData<&'a ()>,
9689}
9690
9691impl<'a> RepoViewDetail<'a> {
9692 pub fn new() -> RepoViewDetailBuilder<'a, repo_view_detail_state::Empty> {
9694 RepoViewDetailBuilder::new()
9695 }
9696}
9697
9698impl<'a> RepoViewDetailBuilder<'a, repo_view_detail_state::Empty> {
9699 pub fn new() -> Self {
9701 RepoViewDetailBuilder {
9702 _state: PhantomData,
9703 _fields: (
9704 None,
9705 None,
9706 None,
9707 None,
9708 None,
9709 None,
9710 None,
9711 None,
9712 None,
9713 None,
9714 None,
9715 None,
9716 None,
9717 None,
9718 ),
9719 _lifetime: PhantomData,
9720 }
9721 }
9722}
9723
9724impl<'a, S: repo_view_detail_state::State> RepoViewDetailBuilder<'a, S> {
9725 pub fn deactivated_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
9727 self._fields.0 = value.into();
9728 self
9729 }
9730 pub fn maybe_deactivated_at(mut self, value: Option<Datetime>) -> Self {
9732 self._fields.0 = value;
9733 self
9734 }
9735}
9736
9737impl<'a, S> RepoViewDetailBuilder<'a, S>
9738where
9739 S: repo_view_detail_state::State,
9740 S::Did: repo_view_detail_state::IsUnset,
9741{
9742 pub fn did(
9744 mut self,
9745 value: impl Into<Did<'a>>,
9746 ) -> RepoViewDetailBuilder<'a, repo_view_detail_state::SetDid<S>> {
9747 self._fields.1 = Option::Some(value.into());
9748 RepoViewDetailBuilder {
9749 _state: PhantomData,
9750 _fields: self._fields,
9751 _lifetime: PhantomData,
9752 }
9753 }
9754}
9755
9756impl<'a, S: repo_view_detail_state::State> RepoViewDetailBuilder<'a, S> {
9757 pub fn email(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
9759 self._fields.2 = value.into();
9760 self
9761 }
9762 pub fn maybe_email(mut self, value: Option<CowStr<'a>>) -> Self {
9764 self._fields.2 = value;
9765 self
9766 }
9767}
9768
9769impl<'a, S: repo_view_detail_state::State> RepoViewDetailBuilder<'a, S> {
9770 pub fn email_confirmed_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
9772 self._fields.3 = value.into();
9773 self
9774 }
9775 pub fn maybe_email_confirmed_at(mut self, value: Option<Datetime>) -> Self {
9777 self._fields.3 = value;
9778 self
9779 }
9780}
9781
9782impl<'a, S> RepoViewDetailBuilder<'a, S>
9783where
9784 S: repo_view_detail_state::State,
9785 S::Handle: repo_view_detail_state::IsUnset,
9786{
9787 pub fn handle(
9789 mut self,
9790 value: impl Into<Handle<'a>>,
9791 ) -> RepoViewDetailBuilder<'a, repo_view_detail_state::SetHandle<S>> {
9792 self._fields.4 = Option::Some(value.into());
9793 RepoViewDetailBuilder {
9794 _state: PhantomData,
9795 _fields: self._fields,
9796 _lifetime: PhantomData,
9797 }
9798 }
9799}
9800
9801impl<'a, S> RepoViewDetailBuilder<'a, S>
9802where
9803 S: repo_view_detail_state::State,
9804 S::IndexedAt: repo_view_detail_state::IsUnset,
9805{
9806 pub fn indexed_at(
9808 mut self,
9809 value: impl Into<Datetime>,
9810 ) -> RepoViewDetailBuilder<'a, repo_view_detail_state::SetIndexedAt<S>> {
9811 self._fields.5 = Option::Some(value.into());
9812 RepoViewDetailBuilder {
9813 _state: PhantomData,
9814 _fields: self._fields,
9815 _lifetime: PhantomData,
9816 }
9817 }
9818}
9819
9820impl<'a, S: repo_view_detail_state::State> RepoViewDetailBuilder<'a, S> {
9821 pub fn invite_note(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
9823 self._fields.6 = value.into();
9824 self
9825 }
9826 pub fn maybe_invite_note(mut self, value: Option<CowStr<'a>>) -> Self {
9828 self._fields.6 = value;
9829 self
9830 }
9831}
9832
9833impl<'a, S: repo_view_detail_state::State> RepoViewDetailBuilder<'a, S> {
9834 pub fn invited_by(mut self, value: impl Into<Option<InviteCode<'a>>>) -> Self {
9836 self._fields.7 = value.into();
9837 self
9838 }
9839 pub fn maybe_invited_by(mut self, value: Option<InviteCode<'a>>) -> Self {
9841 self._fields.7 = value;
9842 self
9843 }
9844}
9845
9846impl<'a, S: repo_view_detail_state::State> RepoViewDetailBuilder<'a, S> {
9847 pub fn invites(mut self, value: impl Into<Option<Vec<InviteCode<'a>>>>) -> Self {
9849 self._fields.8 = value.into();
9850 self
9851 }
9852 pub fn maybe_invites(mut self, value: Option<Vec<InviteCode<'a>>>) -> Self {
9854 self._fields.8 = value;
9855 self
9856 }
9857}
9858
9859impl<'a, S: repo_view_detail_state::State> RepoViewDetailBuilder<'a, S> {
9860 pub fn invites_disabled(mut self, value: impl Into<Option<bool>>) -> Self {
9862 self._fields.9 = value.into();
9863 self
9864 }
9865 pub fn maybe_invites_disabled(mut self, value: Option<bool>) -> Self {
9867 self._fields.9 = value;
9868 self
9869 }
9870}
9871
9872impl<'a, S: repo_view_detail_state::State> RepoViewDetailBuilder<'a, S> {
9873 pub fn labels(mut self, value: impl Into<Option<Vec<Label<'a>>>>) -> Self {
9875 self._fields.10 = value.into();
9876 self
9877 }
9878 pub fn maybe_labels(mut self, value: Option<Vec<Label<'a>>>) -> Self {
9880 self._fields.10 = value;
9881 self
9882 }
9883}
9884
9885impl<'a, S> RepoViewDetailBuilder<'a, S>
9886where
9887 S: repo_view_detail_state::State,
9888 S::Moderation: repo_view_detail_state::IsUnset,
9889{
9890 pub fn moderation(
9892 mut self,
9893 value: impl Into<moderation::ModerationDetail<'a>>,
9894 ) -> RepoViewDetailBuilder<'a, repo_view_detail_state::SetModeration<S>> {
9895 self._fields.11 = Option::Some(value.into());
9896 RepoViewDetailBuilder {
9897 _state: PhantomData,
9898 _fields: self._fields,
9899 _lifetime: PhantomData,
9900 }
9901 }
9902}
9903
9904impl<'a, S> RepoViewDetailBuilder<'a, S>
9905where
9906 S: repo_view_detail_state::State,
9907 S::RelatedRecords: repo_view_detail_state::IsUnset,
9908{
9909 pub fn related_records(
9911 mut self,
9912 value: impl Into<Vec<Data<'a>>>,
9913 ) -> RepoViewDetailBuilder<'a, repo_view_detail_state::SetRelatedRecords<S>> {
9914 self._fields.12 = Option::Some(value.into());
9915 RepoViewDetailBuilder {
9916 _state: PhantomData,
9917 _fields: self._fields,
9918 _lifetime: PhantomData,
9919 }
9920 }
9921}
9922
9923impl<'a, S: repo_view_detail_state::State> RepoViewDetailBuilder<'a, S> {
9924 pub fn threat_signatures(
9926 mut self,
9927 value: impl Into<Option<Vec<ThreatSignature<'a>>>>,
9928 ) -> Self {
9929 self._fields.13 = value.into();
9930 self
9931 }
9932 pub fn maybe_threat_signatures(
9934 mut self,
9935 value: Option<Vec<ThreatSignature<'a>>>,
9936 ) -> Self {
9937 self._fields.13 = value;
9938 self
9939 }
9940}
9941
9942impl<'a, S> RepoViewDetailBuilder<'a, S>
9943where
9944 S: repo_view_detail_state::State,
9945 S::Handle: repo_view_detail_state::IsSet,
9946 S::RelatedRecords: repo_view_detail_state::IsSet,
9947 S::Did: repo_view_detail_state::IsSet,
9948 S::IndexedAt: repo_view_detail_state::IsSet,
9949 S::Moderation: repo_view_detail_state::IsSet,
9950{
9951 pub fn build(self) -> RepoViewDetail<'a> {
9953 RepoViewDetail {
9954 deactivated_at: self._fields.0,
9955 did: self._fields.1.unwrap(),
9956 email: self._fields.2,
9957 email_confirmed_at: self._fields.3,
9958 handle: self._fields.4.unwrap(),
9959 indexed_at: self._fields.5.unwrap(),
9960 invite_note: self._fields.6,
9961 invited_by: self._fields.7,
9962 invites: self._fields.8,
9963 invites_disabled: self._fields.9,
9964 labels: self._fields.10,
9965 moderation: self._fields.11.unwrap(),
9966 related_records: self._fields.12.unwrap(),
9967 threat_signatures: self._fields.13,
9968 extra_data: Default::default(),
9969 }
9970 }
9971 pub fn build_with_data(
9973 self,
9974 extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
9975 ) -> RepoViewDetail<'a> {
9976 RepoViewDetail {
9977 deactivated_at: self._fields.0,
9978 did: self._fields.1.unwrap(),
9979 email: self._fields.2,
9980 email_confirmed_at: self._fields.3,
9981 handle: self._fields.4.unwrap(),
9982 indexed_at: self._fields.5.unwrap(),
9983 invite_note: self._fields.6,
9984 invited_by: self._fields.7,
9985 invites: self._fields.8,
9986 invites_disabled: self._fields.9,
9987 labels: self._fields.10,
9988 moderation: self._fields.11.unwrap(),
9989 related_records: self._fields.12.unwrap(),
9990 threat_signatures: self._fields.13,
9991 extra_data: Some(extra_data),
9992 }
9993 }
9994}
9995
9996pub mod repo_view_not_found_state {
9997
9998 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
9999 #[allow(unused)]
10000 use ::core::marker::PhantomData;
10001 mod sealed {
10002 pub trait Sealed {}
10003 }
10004 pub trait State: sealed::Sealed {
10006 type Did;
10007 }
10008 pub struct Empty(());
10010 impl sealed::Sealed for Empty {}
10011 impl State for Empty {
10012 type Did = Unset;
10013 }
10014 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>);
10016 impl<S: State> sealed::Sealed for SetDid<S> {}
10017 impl<S: State> State for SetDid<S> {
10018 type Did = Set<members::did>;
10019 }
10020 #[allow(non_camel_case_types)]
10022 pub mod members {
10023 pub struct did(());
10025 }
10026}
10027
10028pub struct RepoViewNotFoundBuilder<'a, S: repo_view_not_found_state::State> {
10030 _state: PhantomData<fn() -> S>,
10031 _fields: (Option<Did<'a>>,),
10032 _lifetime: PhantomData<&'a ()>,
10033}
10034
10035impl<'a> RepoViewNotFound<'a> {
10036 pub fn new() -> RepoViewNotFoundBuilder<'a, repo_view_not_found_state::Empty> {
10038 RepoViewNotFoundBuilder::new()
10039 }
10040}
10041
10042impl<'a> RepoViewNotFoundBuilder<'a, repo_view_not_found_state::Empty> {
10043 pub fn new() -> Self {
10045 RepoViewNotFoundBuilder {
10046 _state: PhantomData,
10047 _fields: (None,),
10048 _lifetime: PhantomData,
10049 }
10050 }
10051}
10052
10053impl<'a, S> RepoViewNotFoundBuilder<'a, S>
10054where
10055 S: repo_view_not_found_state::State,
10056 S::Did: repo_view_not_found_state::IsUnset,
10057{
10058 pub fn did(
10060 mut self,
10061 value: impl Into<Did<'a>>,
10062 ) -> RepoViewNotFoundBuilder<'a, repo_view_not_found_state::SetDid<S>> {
10063 self._fields.0 = Option::Some(value.into());
10064 RepoViewNotFoundBuilder {
10065 _state: PhantomData,
10066 _fields: self._fields,
10067 _lifetime: PhantomData,
10068 }
10069 }
10070}
10071
10072impl<'a, S> RepoViewNotFoundBuilder<'a, S>
10073where
10074 S: repo_view_not_found_state::State,
10075 S::Did: repo_view_not_found_state::IsSet,
10076{
10077 pub fn build(self) -> RepoViewNotFound<'a> {
10079 RepoViewNotFound {
10080 did: self._fields.0.unwrap(),
10081 extra_data: Default::default(),
10082 }
10083 }
10084 pub fn build_with_data(
10086 self,
10087 extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
10088 ) -> RepoViewNotFound<'a> {
10089 RepoViewNotFound {
10090 did: self._fields.0.unwrap(),
10091 extra_data: Some(extra_data),
10092 }
10093 }
10094}
10095
10096pub mod reporter_stats_state {
10097
10098 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
10099 #[allow(unused)]
10100 use ::core::marker::PhantomData;
10101 mod sealed {
10102 pub trait Sealed {}
10103 }
10104 pub trait State: sealed::Sealed {
10106 type RecordReportCount;
10107 type LabeledRecordCount;
10108 type AccountReportCount;
10109 type LabeledAccountCount;
10110 type TakendownAccountCount;
10111 type Did;
10112 type ReportedRecordCount;
10113 type TakendownRecordCount;
10114 type ReportedAccountCount;
10115 }
10116 pub struct Empty(());
10118 impl sealed::Sealed for Empty {}
10119 impl State for Empty {
10120 type RecordReportCount = Unset;
10121 type LabeledRecordCount = Unset;
10122 type AccountReportCount = Unset;
10123 type LabeledAccountCount = Unset;
10124 type TakendownAccountCount = Unset;
10125 type Did = Unset;
10126 type ReportedRecordCount = Unset;
10127 type TakendownRecordCount = Unset;
10128 type ReportedAccountCount = Unset;
10129 }
10130 pub struct SetRecordReportCount<S: State = Empty>(PhantomData<fn() -> S>);
10132 impl<S: State> sealed::Sealed for SetRecordReportCount<S> {}
10133 impl<S: State> State for SetRecordReportCount<S> {
10134 type RecordReportCount = Set<members::record_report_count>;
10135 type LabeledRecordCount = S::LabeledRecordCount;
10136 type AccountReportCount = S::AccountReportCount;
10137 type LabeledAccountCount = S::LabeledAccountCount;
10138 type TakendownAccountCount = S::TakendownAccountCount;
10139 type Did = S::Did;
10140 type ReportedRecordCount = S::ReportedRecordCount;
10141 type TakendownRecordCount = S::TakendownRecordCount;
10142 type ReportedAccountCount = S::ReportedAccountCount;
10143 }
10144 pub struct SetLabeledRecordCount<S: State = Empty>(PhantomData<fn() -> S>);
10146 impl<S: State> sealed::Sealed for SetLabeledRecordCount<S> {}
10147 impl<S: State> State for SetLabeledRecordCount<S> {
10148 type RecordReportCount = S::RecordReportCount;
10149 type LabeledRecordCount = Set<members::labeled_record_count>;
10150 type AccountReportCount = S::AccountReportCount;
10151 type LabeledAccountCount = S::LabeledAccountCount;
10152 type TakendownAccountCount = S::TakendownAccountCount;
10153 type Did = S::Did;
10154 type ReportedRecordCount = S::ReportedRecordCount;
10155 type TakendownRecordCount = S::TakendownRecordCount;
10156 type ReportedAccountCount = S::ReportedAccountCount;
10157 }
10158 pub struct SetAccountReportCount<S: State = Empty>(PhantomData<fn() -> S>);
10160 impl<S: State> sealed::Sealed for SetAccountReportCount<S> {}
10161 impl<S: State> State for SetAccountReportCount<S> {
10162 type RecordReportCount = S::RecordReportCount;
10163 type LabeledRecordCount = S::LabeledRecordCount;
10164 type AccountReportCount = Set<members::account_report_count>;
10165 type LabeledAccountCount = S::LabeledAccountCount;
10166 type TakendownAccountCount = S::TakendownAccountCount;
10167 type Did = S::Did;
10168 type ReportedRecordCount = S::ReportedRecordCount;
10169 type TakendownRecordCount = S::TakendownRecordCount;
10170 type ReportedAccountCount = S::ReportedAccountCount;
10171 }
10172 pub struct SetLabeledAccountCount<S: State = Empty>(PhantomData<fn() -> S>);
10174 impl<S: State> sealed::Sealed for SetLabeledAccountCount<S> {}
10175 impl<S: State> State for SetLabeledAccountCount<S> {
10176 type RecordReportCount = S::RecordReportCount;
10177 type LabeledRecordCount = S::LabeledRecordCount;
10178 type AccountReportCount = S::AccountReportCount;
10179 type LabeledAccountCount = Set<members::labeled_account_count>;
10180 type TakendownAccountCount = S::TakendownAccountCount;
10181 type Did = S::Did;
10182 type ReportedRecordCount = S::ReportedRecordCount;
10183 type TakendownRecordCount = S::TakendownRecordCount;
10184 type ReportedAccountCount = S::ReportedAccountCount;
10185 }
10186 pub struct SetTakendownAccountCount<S: State = Empty>(PhantomData<fn() -> S>);
10188 impl<S: State> sealed::Sealed for SetTakendownAccountCount<S> {}
10189 impl<S: State> State for SetTakendownAccountCount<S> {
10190 type RecordReportCount = S::RecordReportCount;
10191 type LabeledRecordCount = S::LabeledRecordCount;
10192 type AccountReportCount = S::AccountReportCount;
10193 type LabeledAccountCount = S::LabeledAccountCount;
10194 type TakendownAccountCount = Set<members::takendown_account_count>;
10195 type Did = S::Did;
10196 type ReportedRecordCount = S::ReportedRecordCount;
10197 type TakendownRecordCount = S::TakendownRecordCount;
10198 type ReportedAccountCount = S::ReportedAccountCount;
10199 }
10200 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>);
10202 impl<S: State> sealed::Sealed for SetDid<S> {}
10203 impl<S: State> State for SetDid<S> {
10204 type RecordReportCount = S::RecordReportCount;
10205 type LabeledRecordCount = S::LabeledRecordCount;
10206 type AccountReportCount = S::AccountReportCount;
10207 type LabeledAccountCount = S::LabeledAccountCount;
10208 type TakendownAccountCount = S::TakendownAccountCount;
10209 type Did = Set<members::did>;
10210 type ReportedRecordCount = S::ReportedRecordCount;
10211 type TakendownRecordCount = S::TakendownRecordCount;
10212 type ReportedAccountCount = S::ReportedAccountCount;
10213 }
10214 pub struct SetReportedRecordCount<S: State = Empty>(PhantomData<fn() -> S>);
10216 impl<S: State> sealed::Sealed for SetReportedRecordCount<S> {}
10217 impl<S: State> State for SetReportedRecordCount<S> {
10218 type RecordReportCount = S::RecordReportCount;
10219 type LabeledRecordCount = S::LabeledRecordCount;
10220 type AccountReportCount = S::AccountReportCount;
10221 type LabeledAccountCount = S::LabeledAccountCount;
10222 type TakendownAccountCount = S::TakendownAccountCount;
10223 type Did = S::Did;
10224 type ReportedRecordCount = Set<members::reported_record_count>;
10225 type TakendownRecordCount = S::TakendownRecordCount;
10226 type ReportedAccountCount = S::ReportedAccountCount;
10227 }
10228 pub struct SetTakendownRecordCount<S: State = Empty>(PhantomData<fn() -> S>);
10230 impl<S: State> sealed::Sealed for SetTakendownRecordCount<S> {}
10231 impl<S: State> State for SetTakendownRecordCount<S> {
10232 type RecordReportCount = S::RecordReportCount;
10233 type LabeledRecordCount = S::LabeledRecordCount;
10234 type AccountReportCount = S::AccountReportCount;
10235 type LabeledAccountCount = S::LabeledAccountCount;
10236 type TakendownAccountCount = S::TakendownAccountCount;
10237 type Did = S::Did;
10238 type ReportedRecordCount = S::ReportedRecordCount;
10239 type TakendownRecordCount = Set<members::takendown_record_count>;
10240 type ReportedAccountCount = S::ReportedAccountCount;
10241 }
10242 pub struct SetReportedAccountCount<S: State = Empty>(PhantomData<fn() -> S>);
10244 impl<S: State> sealed::Sealed for SetReportedAccountCount<S> {}
10245 impl<S: State> State for SetReportedAccountCount<S> {
10246 type RecordReportCount = S::RecordReportCount;
10247 type LabeledRecordCount = S::LabeledRecordCount;
10248 type AccountReportCount = S::AccountReportCount;
10249 type LabeledAccountCount = S::LabeledAccountCount;
10250 type TakendownAccountCount = S::TakendownAccountCount;
10251 type Did = S::Did;
10252 type ReportedRecordCount = S::ReportedRecordCount;
10253 type TakendownRecordCount = S::TakendownRecordCount;
10254 type ReportedAccountCount = Set<members::reported_account_count>;
10255 }
10256 #[allow(non_camel_case_types)]
10258 pub mod members {
10259 pub struct record_report_count(());
10261 pub struct labeled_record_count(());
10263 pub struct account_report_count(());
10265 pub struct labeled_account_count(());
10267 pub struct takendown_account_count(());
10269 pub struct did(());
10271 pub struct reported_record_count(());
10273 pub struct takendown_record_count(());
10275 pub struct reported_account_count(());
10277 }
10278}
10279
10280pub struct ReporterStatsBuilder<'a, S: reporter_stats_state::State> {
10282 _state: PhantomData<fn() -> S>,
10283 _fields: (
10284 Option<i64>,
10285 Option<Did<'a>>,
10286 Option<i64>,
10287 Option<i64>,
10288 Option<i64>,
10289 Option<i64>,
10290 Option<i64>,
10291 Option<i64>,
10292 Option<i64>,
10293 ),
10294 _lifetime: PhantomData<&'a ()>,
10295}
10296
10297impl<'a> ReporterStats<'a> {
10298 pub fn new() -> ReporterStatsBuilder<'a, reporter_stats_state::Empty> {
10300 ReporterStatsBuilder::new()
10301 }
10302}
10303
10304impl<'a> ReporterStatsBuilder<'a, reporter_stats_state::Empty> {
10305 pub fn new() -> Self {
10307 ReporterStatsBuilder {
10308 _state: PhantomData,
10309 _fields: (None, None, None, None, None, None, None, None, None),
10310 _lifetime: PhantomData,
10311 }
10312 }
10313}
10314
10315impl<'a, S> ReporterStatsBuilder<'a, S>
10316where
10317 S: reporter_stats_state::State,
10318 S::AccountReportCount: reporter_stats_state::IsUnset,
10319{
10320 pub fn account_report_count(
10322 mut self,
10323 value: impl Into<i64>,
10324 ) -> ReporterStatsBuilder<'a, reporter_stats_state::SetAccountReportCount<S>> {
10325 self._fields.0 = Option::Some(value.into());
10326 ReporterStatsBuilder {
10327 _state: PhantomData,
10328 _fields: self._fields,
10329 _lifetime: PhantomData,
10330 }
10331 }
10332}
10333
10334impl<'a, S> ReporterStatsBuilder<'a, S>
10335where
10336 S: reporter_stats_state::State,
10337 S::Did: reporter_stats_state::IsUnset,
10338{
10339 pub fn did(
10341 mut self,
10342 value: impl Into<Did<'a>>,
10343 ) -> ReporterStatsBuilder<'a, reporter_stats_state::SetDid<S>> {
10344 self._fields.1 = Option::Some(value.into());
10345 ReporterStatsBuilder {
10346 _state: PhantomData,
10347 _fields: self._fields,
10348 _lifetime: PhantomData,
10349 }
10350 }
10351}
10352
10353impl<'a, S> ReporterStatsBuilder<'a, S>
10354where
10355 S: reporter_stats_state::State,
10356 S::LabeledAccountCount: reporter_stats_state::IsUnset,
10357{
10358 pub fn labeled_account_count(
10360 mut self,
10361 value: impl Into<i64>,
10362 ) -> ReporterStatsBuilder<'a, reporter_stats_state::SetLabeledAccountCount<S>> {
10363 self._fields.2 = Option::Some(value.into());
10364 ReporterStatsBuilder {
10365 _state: PhantomData,
10366 _fields: self._fields,
10367 _lifetime: PhantomData,
10368 }
10369 }
10370}
10371
10372impl<'a, S> ReporterStatsBuilder<'a, S>
10373where
10374 S: reporter_stats_state::State,
10375 S::LabeledRecordCount: reporter_stats_state::IsUnset,
10376{
10377 pub fn labeled_record_count(
10379 mut self,
10380 value: impl Into<i64>,
10381 ) -> ReporterStatsBuilder<'a, reporter_stats_state::SetLabeledRecordCount<S>> {
10382 self._fields.3 = Option::Some(value.into());
10383 ReporterStatsBuilder {
10384 _state: PhantomData,
10385 _fields: self._fields,
10386 _lifetime: PhantomData,
10387 }
10388 }
10389}
10390
10391impl<'a, S> ReporterStatsBuilder<'a, S>
10392where
10393 S: reporter_stats_state::State,
10394 S::RecordReportCount: reporter_stats_state::IsUnset,
10395{
10396 pub fn record_report_count(
10398 mut self,
10399 value: impl Into<i64>,
10400 ) -> ReporterStatsBuilder<'a, reporter_stats_state::SetRecordReportCount<S>> {
10401 self._fields.4 = Option::Some(value.into());
10402 ReporterStatsBuilder {
10403 _state: PhantomData,
10404 _fields: self._fields,
10405 _lifetime: PhantomData,
10406 }
10407 }
10408}
10409
10410impl<'a, S> ReporterStatsBuilder<'a, S>
10411where
10412 S: reporter_stats_state::State,
10413 S::ReportedAccountCount: reporter_stats_state::IsUnset,
10414{
10415 pub fn reported_account_count(
10417 mut self,
10418 value: impl Into<i64>,
10419 ) -> ReporterStatsBuilder<'a, reporter_stats_state::SetReportedAccountCount<S>> {
10420 self._fields.5 = Option::Some(value.into());
10421 ReporterStatsBuilder {
10422 _state: PhantomData,
10423 _fields: self._fields,
10424 _lifetime: PhantomData,
10425 }
10426 }
10427}
10428
10429impl<'a, S> ReporterStatsBuilder<'a, S>
10430where
10431 S: reporter_stats_state::State,
10432 S::ReportedRecordCount: reporter_stats_state::IsUnset,
10433{
10434 pub fn reported_record_count(
10436 mut self,
10437 value: impl Into<i64>,
10438 ) -> ReporterStatsBuilder<'a, reporter_stats_state::SetReportedRecordCount<S>> {
10439 self._fields.6 = Option::Some(value.into());
10440 ReporterStatsBuilder {
10441 _state: PhantomData,
10442 _fields: self._fields,
10443 _lifetime: PhantomData,
10444 }
10445 }
10446}
10447
10448impl<'a, S> ReporterStatsBuilder<'a, S>
10449where
10450 S: reporter_stats_state::State,
10451 S::TakendownAccountCount: reporter_stats_state::IsUnset,
10452{
10453 pub fn takendown_account_count(
10455 mut self,
10456 value: impl Into<i64>,
10457 ) -> ReporterStatsBuilder<'a, reporter_stats_state::SetTakendownAccountCount<S>> {
10458 self._fields.7 = Option::Some(value.into());
10459 ReporterStatsBuilder {
10460 _state: PhantomData,
10461 _fields: self._fields,
10462 _lifetime: PhantomData,
10463 }
10464 }
10465}
10466
10467impl<'a, S> ReporterStatsBuilder<'a, S>
10468where
10469 S: reporter_stats_state::State,
10470 S::TakendownRecordCount: reporter_stats_state::IsUnset,
10471{
10472 pub fn takendown_record_count(
10474 mut self,
10475 value: impl Into<i64>,
10476 ) -> ReporterStatsBuilder<'a, reporter_stats_state::SetTakendownRecordCount<S>> {
10477 self._fields.8 = Option::Some(value.into());
10478 ReporterStatsBuilder {
10479 _state: PhantomData,
10480 _fields: self._fields,
10481 _lifetime: PhantomData,
10482 }
10483 }
10484}
10485
10486impl<'a, S> ReporterStatsBuilder<'a, S>
10487where
10488 S: reporter_stats_state::State,
10489 S::RecordReportCount: reporter_stats_state::IsSet,
10490 S::LabeledRecordCount: reporter_stats_state::IsSet,
10491 S::AccountReportCount: reporter_stats_state::IsSet,
10492 S::LabeledAccountCount: reporter_stats_state::IsSet,
10493 S::TakendownAccountCount: reporter_stats_state::IsSet,
10494 S::Did: reporter_stats_state::IsSet,
10495 S::ReportedRecordCount: reporter_stats_state::IsSet,
10496 S::TakendownRecordCount: reporter_stats_state::IsSet,
10497 S::ReportedAccountCount: reporter_stats_state::IsSet,
10498{
10499 pub fn build(self) -> ReporterStats<'a> {
10501 ReporterStats {
10502 account_report_count: self._fields.0.unwrap(),
10503 did: self._fields.1.unwrap(),
10504 labeled_account_count: self._fields.2.unwrap(),
10505 labeled_record_count: self._fields.3.unwrap(),
10506 record_report_count: self._fields.4.unwrap(),
10507 reported_account_count: self._fields.5.unwrap(),
10508 reported_record_count: self._fields.6.unwrap(),
10509 takendown_account_count: self._fields.7.unwrap(),
10510 takendown_record_count: self._fields.8.unwrap(),
10511 extra_data: Default::default(),
10512 }
10513 }
10514 pub fn build_with_data(
10516 self,
10517 extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
10518 ) -> ReporterStats<'a> {
10519 ReporterStats {
10520 account_report_count: self._fields.0.unwrap(),
10521 did: self._fields.1.unwrap(),
10522 labeled_account_count: self._fields.2.unwrap(),
10523 labeled_record_count: self._fields.3.unwrap(),
10524 record_report_count: self._fields.4.unwrap(),
10525 reported_account_count: self._fields.5.unwrap(),
10526 reported_record_count: self._fields.6.unwrap(),
10527 takendown_account_count: self._fields.7.unwrap(),
10528 takendown_record_count: self._fields.8.unwrap(),
10529 extra_data: Some(extra_data),
10530 }
10531 }
10532}
10533
10534pub mod scheduled_action_view_state {
10535
10536 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
10537 #[allow(unused)]
10538 use ::core::marker::PhantomData;
10539 mod sealed {
10540 pub trait Sealed {}
10541 }
10542 pub trait State: sealed::Sealed {
10544 type CreatedBy;
10545 type CreatedAt;
10546 type Id;
10547 type Status;
10548 type Did;
10549 type Action;
10550 }
10551 pub struct Empty(());
10553 impl sealed::Sealed for Empty {}
10554 impl State for Empty {
10555 type CreatedBy = Unset;
10556 type CreatedAt = Unset;
10557 type Id = Unset;
10558 type Status = Unset;
10559 type Did = Unset;
10560 type Action = Unset;
10561 }
10562 pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>);
10564 impl<S: State> sealed::Sealed for SetCreatedBy<S> {}
10565 impl<S: State> State for SetCreatedBy<S> {
10566 type CreatedBy = Set<members::created_by>;
10567 type CreatedAt = S::CreatedAt;
10568 type Id = S::Id;
10569 type Status = S::Status;
10570 type Did = S::Did;
10571 type Action = S::Action;
10572 }
10573 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>);
10575 impl<S: State> sealed::Sealed for SetCreatedAt<S> {}
10576 impl<S: State> State for SetCreatedAt<S> {
10577 type CreatedBy = S::CreatedBy;
10578 type CreatedAt = Set<members::created_at>;
10579 type Id = S::Id;
10580 type Status = S::Status;
10581 type Did = S::Did;
10582 type Action = S::Action;
10583 }
10584 pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>);
10586 impl<S: State> sealed::Sealed for SetId<S> {}
10587 impl<S: State> State for SetId<S> {
10588 type CreatedBy = S::CreatedBy;
10589 type CreatedAt = S::CreatedAt;
10590 type Id = Set<members::id>;
10591 type Status = S::Status;
10592 type Did = S::Did;
10593 type Action = S::Action;
10594 }
10595 pub struct SetStatus<S: State = Empty>(PhantomData<fn() -> S>);
10597 impl<S: State> sealed::Sealed for SetStatus<S> {}
10598 impl<S: State> State for SetStatus<S> {
10599 type CreatedBy = S::CreatedBy;
10600 type CreatedAt = S::CreatedAt;
10601 type Id = S::Id;
10602 type Status = Set<members::status>;
10603 type Did = S::Did;
10604 type Action = S::Action;
10605 }
10606 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>);
10608 impl<S: State> sealed::Sealed for SetDid<S> {}
10609 impl<S: State> State for SetDid<S> {
10610 type CreatedBy = S::CreatedBy;
10611 type CreatedAt = S::CreatedAt;
10612 type Id = S::Id;
10613 type Status = S::Status;
10614 type Did = Set<members::did>;
10615 type Action = S::Action;
10616 }
10617 pub struct SetAction<S: State = Empty>(PhantomData<fn() -> S>);
10619 impl<S: State> sealed::Sealed for SetAction<S> {}
10620 impl<S: State> State for SetAction<S> {
10621 type CreatedBy = S::CreatedBy;
10622 type CreatedAt = S::CreatedAt;
10623 type Id = S::Id;
10624 type Status = S::Status;
10625 type Did = S::Did;
10626 type Action = Set<members::action>;
10627 }
10628 #[allow(non_camel_case_types)]
10630 pub mod members {
10631 pub struct created_by(());
10633 pub struct created_at(());
10635 pub struct id(());
10637 pub struct status(());
10639 pub struct did(());
10641 pub struct action(());
10643 }
10644}
10645
10646pub struct ScheduledActionViewBuilder<'a, S: scheduled_action_view_state::State> {
10648 _state: PhantomData<fn() -> S>,
10649 _fields: (
10650 Option<ScheduledActionViewAction<'a>>,
10651 Option<Datetime>,
10652 Option<Did<'a>>,
10653 Option<Did<'a>>,
10654 Option<Data<'a>>,
10655 Option<Datetime>,
10656 Option<Datetime>,
10657 Option<Datetime>,
10658 Option<i64>,
10659 Option<i64>,
10660 Option<Datetime>,
10661 Option<CowStr<'a>>,
10662 Option<bool>,
10663 Option<ScheduledActionViewStatus<'a>>,
10664 Option<Datetime>,
10665 ),
10666 _lifetime: PhantomData<&'a ()>,
10667}
10668
10669impl<'a> ScheduledActionView<'a> {
10670 pub fn new() -> ScheduledActionViewBuilder<'a, scheduled_action_view_state::Empty> {
10672 ScheduledActionViewBuilder::new()
10673 }
10674}
10675
10676impl<'a> ScheduledActionViewBuilder<'a, scheduled_action_view_state::Empty> {
10677 pub fn new() -> Self {
10679 ScheduledActionViewBuilder {
10680 _state: PhantomData,
10681 _fields: (
10682 None,
10683 None,
10684 None,
10685 None,
10686 None,
10687 None,
10688 None,
10689 None,
10690 None,
10691 None,
10692 None,
10693 None,
10694 None,
10695 None,
10696 None,
10697 ),
10698 _lifetime: PhantomData,
10699 }
10700 }
10701}
10702
10703impl<'a, S> ScheduledActionViewBuilder<'a, S>
10704where
10705 S: scheduled_action_view_state::State,
10706 S::Action: scheduled_action_view_state::IsUnset,
10707{
10708 pub fn action(
10710 mut self,
10711 value: impl Into<ScheduledActionViewAction<'a>>,
10712 ) -> ScheduledActionViewBuilder<'a, scheduled_action_view_state::SetAction<S>> {
10713 self._fields.0 = Option::Some(value.into());
10714 ScheduledActionViewBuilder {
10715 _state: PhantomData,
10716 _fields: self._fields,
10717 _lifetime: PhantomData,
10718 }
10719 }
10720}
10721
10722impl<'a, S> ScheduledActionViewBuilder<'a, S>
10723where
10724 S: scheduled_action_view_state::State,
10725 S::CreatedAt: scheduled_action_view_state::IsUnset,
10726{
10727 pub fn created_at(
10729 mut self,
10730 value: impl Into<Datetime>,
10731 ) -> ScheduledActionViewBuilder<'a, scheduled_action_view_state::SetCreatedAt<S>> {
10732 self._fields.1 = Option::Some(value.into());
10733 ScheduledActionViewBuilder {
10734 _state: PhantomData,
10735 _fields: self._fields,
10736 _lifetime: PhantomData,
10737 }
10738 }
10739}
10740
10741impl<'a, S> ScheduledActionViewBuilder<'a, S>
10742where
10743 S: scheduled_action_view_state::State,
10744 S::CreatedBy: scheduled_action_view_state::IsUnset,
10745{
10746 pub fn created_by(
10748 mut self,
10749 value: impl Into<Did<'a>>,
10750 ) -> ScheduledActionViewBuilder<'a, scheduled_action_view_state::SetCreatedBy<S>> {
10751 self._fields.2 = Option::Some(value.into());
10752 ScheduledActionViewBuilder {
10753 _state: PhantomData,
10754 _fields: self._fields,
10755 _lifetime: PhantomData,
10756 }
10757 }
10758}
10759
10760impl<'a, S> ScheduledActionViewBuilder<'a, S>
10761where
10762 S: scheduled_action_view_state::State,
10763 S::Did: scheduled_action_view_state::IsUnset,
10764{
10765 pub fn did(
10767 mut self,
10768 value: impl Into<Did<'a>>,
10769 ) -> ScheduledActionViewBuilder<'a, scheduled_action_view_state::SetDid<S>> {
10770 self._fields.3 = Option::Some(value.into());
10771 ScheduledActionViewBuilder {
10772 _state: PhantomData,
10773 _fields: self._fields,
10774 _lifetime: PhantomData,
10775 }
10776 }
10777}
10778
10779impl<'a, S: scheduled_action_view_state::State> ScheduledActionViewBuilder<'a, S> {
10780 pub fn event_data(mut self, value: impl Into<Option<Data<'a>>>) -> Self {
10782 self._fields.4 = value.into();
10783 self
10784 }
10785 pub fn maybe_event_data(mut self, value: Option<Data<'a>>) -> Self {
10787 self._fields.4 = value;
10788 self
10789 }
10790}
10791
10792impl<'a, S: scheduled_action_view_state::State> ScheduledActionViewBuilder<'a, S> {
10793 pub fn execute_after(mut self, value: impl Into<Option<Datetime>>) -> Self {
10795 self._fields.5 = value.into();
10796 self
10797 }
10798 pub fn maybe_execute_after(mut self, value: Option<Datetime>) -> Self {
10800 self._fields.5 = value;
10801 self
10802 }
10803}
10804
10805impl<'a, S: scheduled_action_view_state::State> ScheduledActionViewBuilder<'a, S> {
10806 pub fn execute_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
10808 self._fields.6 = value.into();
10809 self
10810 }
10811 pub fn maybe_execute_at(mut self, value: Option<Datetime>) -> Self {
10813 self._fields.6 = value;
10814 self
10815 }
10816}
10817
10818impl<'a, S: scheduled_action_view_state::State> ScheduledActionViewBuilder<'a, S> {
10819 pub fn execute_until(mut self, value: impl Into<Option<Datetime>>) -> Self {
10821 self._fields.7 = value.into();
10822 self
10823 }
10824 pub fn maybe_execute_until(mut self, value: Option<Datetime>) -> Self {
10826 self._fields.7 = value;
10827 self
10828 }
10829}
10830
10831impl<'a, S: scheduled_action_view_state::State> ScheduledActionViewBuilder<'a, S> {
10832 pub fn execution_event_id(mut self, value: impl Into<Option<i64>>) -> Self {
10834 self._fields.8 = value.into();
10835 self
10836 }
10837 pub fn maybe_execution_event_id(mut self, value: Option<i64>) -> Self {
10839 self._fields.8 = value;
10840 self
10841 }
10842}
10843
10844impl<'a, S> ScheduledActionViewBuilder<'a, S>
10845where
10846 S: scheduled_action_view_state::State,
10847 S::Id: scheduled_action_view_state::IsUnset,
10848{
10849 pub fn id(
10851 mut self,
10852 value: impl Into<i64>,
10853 ) -> ScheduledActionViewBuilder<'a, scheduled_action_view_state::SetId<S>> {
10854 self._fields.9 = Option::Some(value.into());
10855 ScheduledActionViewBuilder {
10856 _state: PhantomData,
10857 _fields: self._fields,
10858 _lifetime: PhantomData,
10859 }
10860 }
10861}
10862
10863impl<'a, S: scheduled_action_view_state::State> ScheduledActionViewBuilder<'a, S> {
10864 pub fn last_executed_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
10866 self._fields.10 = value.into();
10867 self
10868 }
10869 pub fn maybe_last_executed_at(mut self, value: Option<Datetime>) -> Self {
10871 self._fields.10 = value;
10872 self
10873 }
10874}
10875
10876impl<'a, S: scheduled_action_view_state::State> ScheduledActionViewBuilder<'a, S> {
10877 pub fn last_failure_reason(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
10879 self._fields.11 = value.into();
10880 self
10881 }
10882 pub fn maybe_last_failure_reason(mut self, value: Option<CowStr<'a>>) -> Self {
10884 self._fields.11 = value;
10885 self
10886 }
10887}
10888
10889impl<'a, S: scheduled_action_view_state::State> ScheduledActionViewBuilder<'a, S> {
10890 pub fn randomize_execution(mut self, value: impl Into<Option<bool>>) -> Self {
10892 self._fields.12 = value.into();
10893 self
10894 }
10895 pub fn maybe_randomize_execution(mut self, value: Option<bool>) -> Self {
10897 self._fields.12 = value;
10898 self
10899 }
10900}
10901
10902impl<'a, S> ScheduledActionViewBuilder<'a, S>
10903where
10904 S: scheduled_action_view_state::State,
10905 S::Status: scheduled_action_view_state::IsUnset,
10906{
10907 pub fn status(
10909 mut self,
10910 value: impl Into<ScheduledActionViewStatus<'a>>,
10911 ) -> ScheduledActionViewBuilder<'a, scheduled_action_view_state::SetStatus<S>> {
10912 self._fields.13 = Option::Some(value.into());
10913 ScheduledActionViewBuilder {
10914 _state: PhantomData,
10915 _fields: self._fields,
10916 _lifetime: PhantomData,
10917 }
10918 }
10919}
10920
10921impl<'a, S: scheduled_action_view_state::State> ScheduledActionViewBuilder<'a, S> {
10922 pub fn updated_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
10924 self._fields.14 = value.into();
10925 self
10926 }
10927 pub fn maybe_updated_at(mut self, value: Option<Datetime>) -> Self {
10929 self._fields.14 = value;
10930 self
10931 }
10932}
10933
10934impl<'a, S> ScheduledActionViewBuilder<'a, S>
10935where
10936 S: scheduled_action_view_state::State,
10937 S::CreatedBy: scheduled_action_view_state::IsSet,
10938 S::CreatedAt: scheduled_action_view_state::IsSet,
10939 S::Id: scheduled_action_view_state::IsSet,
10940 S::Status: scheduled_action_view_state::IsSet,
10941 S::Did: scheduled_action_view_state::IsSet,
10942 S::Action: scheduled_action_view_state::IsSet,
10943{
10944 pub fn build(self) -> ScheduledActionView<'a> {
10946 ScheduledActionView {
10947 action: self._fields.0.unwrap(),
10948 created_at: self._fields.1.unwrap(),
10949 created_by: self._fields.2.unwrap(),
10950 did: self._fields.3.unwrap(),
10951 event_data: self._fields.4,
10952 execute_after: self._fields.5,
10953 execute_at: self._fields.6,
10954 execute_until: self._fields.7,
10955 execution_event_id: self._fields.8,
10956 id: self._fields.9.unwrap(),
10957 last_executed_at: self._fields.10,
10958 last_failure_reason: self._fields.11,
10959 randomize_execution: self._fields.12,
10960 status: self._fields.13.unwrap(),
10961 updated_at: self._fields.14,
10962 extra_data: Default::default(),
10963 }
10964 }
10965 pub fn build_with_data(
10967 self,
10968 extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
10969 ) -> ScheduledActionView<'a> {
10970 ScheduledActionView {
10971 action: self._fields.0.unwrap(),
10972 created_at: self._fields.1.unwrap(),
10973 created_by: self._fields.2.unwrap(),
10974 did: self._fields.3.unwrap(),
10975 event_data: self._fields.4,
10976 execute_after: self._fields.5,
10977 execute_at: self._fields.6,
10978 execute_until: self._fields.7,
10979 execution_event_id: self._fields.8,
10980 id: self._fields.9.unwrap(),
10981 last_executed_at: self._fields.10,
10982 last_failure_reason: self._fields.11,
10983 randomize_execution: self._fields.12,
10984 status: self._fields.13.unwrap(),
10985 updated_at: self._fields.14,
10986 extra_data: Some(extra_data),
10987 }
10988 }
10989}
10990
10991pub mod subject_status_view_state {
10992
10993 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
10994 #[allow(unused)]
10995 use ::core::marker::PhantomData;
10996 mod sealed {
10997 pub trait Sealed {}
10998 }
10999 pub trait State: sealed::Sealed {
11001 type Subject;
11002 type CreatedAt;
11003 type ReviewState;
11004 type Id;
11005 type UpdatedAt;
11006 }
11007 pub struct Empty(());
11009 impl sealed::Sealed for Empty {}
11010 impl State for Empty {
11011 type Subject = Unset;
11012 type CreatedAt = Unset;
11013 type ReviewState = Unset;
11014 type Id = Unset;
11015 type UpdatedAt = Unset;
11016 }
11017 pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>);
11019 impl<S: State> sealed::Sealed for SetSubject<S> {}
11020 impl<S: State> State for SetSubject<S> {
11021 type Subject = Set<members::subject>;
11022 type CreatedAt = S::CreatedAt;
11023 type ReviewState = S::ReviewState;
11024 type Id = S::Id;
11025 type UpdatedAt = S::UpdatedAt;
11026 }
11027 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>);
11029 impl<S: State> sealed::Sealed for SetCreatedAt<S> {}
11030 impl<S: State> State for SetCreatedAt<S> {
11031 type Subject = S::Subject;
11032 type CreatedAt = Set<members::created_at>;
11033 type ReviewState = S::ReviewState;
11034 type Id = S::Id;
11035 type UpdatedAt = S::UpdatedAt;
11036 }
11037 pub struct SetReviewState<S: State = Empty>(PhantomData<fn() -> S>);
11039 impl<S: State> sealed::Sealed for SetReviewState<S> {}
11040 impl<S: State> State for SetReviewState<S> {
11041 type Subject = S::Subject;
11042 type CreatedAt = S::CreatedAt;
11043 type ReviewState = Set<members::review_state>;
11044 type Id = S::Id;
11045 type UpdatedAt = S::UpdatedAt;
11046 }
11047 pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>);
11049 impl<S: State> sealed::Sealed for SetId<S> {}
11050 impl<S: State> State for SetId<S> {
11051 type Subject = S::Subject;
11052 type CreatedAt = S::CreatedAt;
11053 type ReviewState = S::ReviewState;
11054 type Id = Set<members::id>;
11055 type UpdatedAt = S::UpdatedAt;
11056 }
11057 pub struct SetUpdatedAt<S: State = Empty>(PhantomData<fn() -> S>);
11059 impl<S: State> sealed::Sealed for SetUpdatedAt<S> {}
11060 impl<S: State> State for SetUpdatedAt<S> {
11061 type Subject = S::Subject;
11062 type CreatedAt = S::CreatedAt;
11063 type ReviewState = S::ReviewState;
11064 type Id = S::Id;
11065 type UpdatedAt = Set<members::updated_at>;
11066 }
11067 #[allow(non_camel_case_types)]
11069 pub mod members {
11070 pub struct subject(());
11072 pub struct created_at(());
11074 pub struct review_state(());
11076 pub struct id(());
11078 pub struct updated_at(());
11080 }
11081}
11082
11083pub struct SubjectStatusViewBuilder<'a, S: subject_status_view_state::State> {
11085 _state: PhantomData<fn() -> S>,
11086 _fields: (
11087 Option<moderation::AccountStats<'a>>,
11088 Option<moderation::AccountStrike<'a>>,
11089 Option<SubjectStatusViewAgeAssuranceState<'a>>,
11090 Option<SubjectStatusViewAgeAssuranceUpdatedBy<'a>>,
11091 Option<bool>,
11092 Option<CowStr<'a>>,
11093 Option<Datetime>,
11094 Option<SubjectStatusViewHosting<'a>>,
11095 Option<i64>,
11096 Option<Datetime>,
11097 Option<Datetime>,
11098 Option<Datetime>,
11099 Option<Did<'a>>,
11100 Option<Datetime>,
11101 Option<Datetime>,
11102 Option<i64>,
11103 Option<moderation::RecordsStats<'a>>,
11104 Option<moderation::SubjectReviewState<'a>>,
11105 Option<SubjectStatusViewSubject<'a>>,
11106 Option<Vec<Cid<'a>>>,
11107 Option<CowStr<'a>>,
11108 Option<Datetime>,
11109 Option<Vec<CowStr<'a>>>,
11110 Option<bool>,
11111 Option<Datetime>,
11112 ),
11113 _lifetime: PhantomData<&'a ()>,
11114}
11115
11116impl<'a> SubjectStatusView<'a> {
11117 pub fn new() -> SubjectStatusViewBuilder<'a, subject_status_view_state::Empty> {
11119 SubjectStatusViewBuilder::new()
11120 }
11121}
11122
11123impl<'a> SubjectStatusViewBuilder<'a, subject_status_view_state::Empty> {
11124 pub fn new() -> Self {
11126 SubjectStatusViewBuilder {
11127 _state: PhantomData,
11128 _fields: (
11129 None,
11130 None,
11131 None,
11132 None,
11133 None,
11134 None,
11135 None,
11136 None,
11137 None,
11138 None,
11139 None,
11140 None,
11141 None,
11142 None,
11143 None,
11144 None,
11145 None,
11146 None,
11147 None,
11148 None,
11149 None,
11150 None,
11151 None,
11152 None,
11153 None,
11154 ),
11155 _lifetime: PhantomData,
11156 }
11157 }
11158}
11159
11160impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> {
11161 pub fn account_stats(
11163 mut self,
11164 value: impl Into<Option<moderation::AccountStats<'a>>>,
11165 ) -> Self {
11166 self._fields.0 = value.into();
11167 self
11168 }
11169 pub fn maybe_account_stats(
11171 mut self,
11172 value: Option<moderation::AccountStats<'a>>,
11173 ) -> Self {
11174 self._fields.0 = value;
11175 self
11176 }
11177}
11178
11179impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> {
11180 pub fn account_strike(
11182 mut self,
11183 value: impl Into<Option<moderation::AccountStrike<'a>>>,
11184 ) -> Self {
11185 self._fields.1 = value.into();
11186 self
11187 }
11188 pub fn maybe_account_strike(
11190 mut self,
11191 value: Option<moderation::AccountStrike<'a>>,
11192 ) -> Self {
11193 self._fields.1 = value;
11194 self
11195 }
11196}
11197
11198impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> {
11199 pub fn age_assurance_state(
11201 mut self,
11202 value: impl Into<Option<SubjectStatusViewAgeAssuranceState<'a>>>,
11203 ) -> Self {
11204 self._fields.2 = value.into();
11205 self
11206 }
11207 pub fn maybe_age_assurance_state(
11209 mut self,
11210 value: Option<SubjectStatusViewAgeAssuranceState<'a>>,
11211 ) -> Self {
11212 self._fields.2 = value;
11213 self
11214 }
11215}
11216
11217impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> {
11218 pub fn age_assurance_updated_by(
11220 mut self,
11221 value: impl Into<Option<SubjectStatusViewAgeAssuranceUpdatedBy<'a>>>,
11222 ) -> Self {
11223 self._fields.3 = value.into();
11224 self
11225 }
11226 pub fn maybe_age_assurance_updated_by(
11228 mut self,
11229 value: Option<SubjectStatusViewAgeAssuranceUpdatedBy<'a>>,
11230 ) -> Self {
11231 self._fields.3 = value;
11232 self
11233 }
11234}
11235
11236impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> {
11237 pub fn appealed(mut self, value: impl Into<Option<bool>>) -> Self {
11239 self._fields.4 = value.into();
11240 self
11241 }
11242 pub fn maybe_appealed(mut self, value: Option<bool>) -> Self {
11244 self._fields.4 = value;
11245 self
11246 }
11247}
11248
11249impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> {
11250 pub fn comment(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
11252 self._fields.5 = value.into();
11253 self
11254 }
11255 pub fn maybe_comment(mut self, value: Option<CowStr<'a>>) -> Self {
11257 self._fields.5 = value;
11258 self
11259 }
11260}
11261
11262impl<'a, S> SubjectStatusViewBuilder<'a, S>
11263where
11264 S: subject_status_view_state::State,
11265 S::CreatedAt: subject_status_view_state::IsUnset,
11266{
11267 pub fn created_at(
11269 mut self,
11270 value: impl Into<Datetime>,
11271 ) -> SubjectStatusViewBuilder<'a, subject_status_view_state::SetCreatedAt<S>> {
11272 self._fields.6 = Option::Some(value.into());
11273 SubjectStatusViewBuilder {
11274 _state: PhantomData,
11275 _fields: self._fields,
11276 _lifetime: PhantomData,
11277 }
11278 }
11279}
11280
11281impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> {
11282 pub fn hosting(
11284 mut self,
11285 value: impl Into<Option<SubjectStatusViewHosting<'a>>>,
11286 ) -> Self {
11287 self._fields.7 = value.into();
11288 self
11289 }
11290 pub fn maybe_hosting(mut self, value: Option<SubjectStatusViewHosting<'a>>) -> Self {
11292 self._fields.7 = value;
11293 self
11294 }
11295}
11296
11297impl<'a, S> SubjectStatusViewBuilder<'a, S>
11298where
11299 S: subject_status_view_state::State,
11300 S::Id: subject_status_view_state::IsUnset,
11301{
11302 pub fn id(
11304 mut self,
11305 value: impl Into<i64>,
11306 ) -> SubjectStatusViewBuilder<'a, subject_status_view_state::SetId<S>> {
11307 self._fields.8 = Option::Some(value.into());
11308 SubjectStatusViewBuilder {
11309 _state: PhantomData,
11310 _fields: self._fields,
11311 _lifetime: PhantomData,
11312 }
11313 }
11314}
11315
11316impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> {
11317 pub fn last_appealed_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
11319 self._fields.9 = value.into();
11320 self
11321 }
11322 pub fn maybe_last_appealed_at(mut self, value: Option<Datetime>) -> Self {
11324 self._fields.9 = value;
11325 self
11326 }
11327}
11328
11329impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> {
11330 pub fn last_reported_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
11332 self._fields.10 = value.into();
11333 self
11334 }
11335 pub fn maybe_last_reported_at(mut self, value: Option<Datetime>) -> Self {
11337 self._fields.10 = value;
11338 self
11339 }
11340}
11341
11342impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> {
11343 pub fn last_reviewed_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
11345 self._fields.11 = value.into();
11346 self
11347 }
11348 pub fn maybe_last_reviewed_at(mut self, value: Option<Datetime>) -> Self {
11350 self._fields.11 = value;
11351 self
11352 }
11353}
11354
11355impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> {
11356 pub fn last_reviewed_by(mut self, value: impl Into<Option<Did<'a>>>) -> Self {
11358 self._fields.12 = value.into();
11359 self
11360 }
11361 pub fn maybe_last_reviewed_by(mut self, value: Option<Did<'a>>) -> Self {
11363 self._fields.12 = value;
11364 self
11365 }
11366}
11367
11368impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> {
11369 pub fn mute_reporting_until(mut self, value: impl Into<Option<Datetime>>) -> Self {
11371 self._fields.13 = value.into();
11372 self
11373 }
11374 pub fn maybe_mute_reporting_until(mut self, value: Option<Datetime>) -> Self {
11376 self._fields.13 = value;
11377 self
11378 }
11379}
11380
11381impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> {
11382 pub fn mute_until(mut self, value: impl Into<Option<Datetime>>) -> Self {
11384 self._fields.14 = value.into();
11385 self
11386 }
11387 pub fn maybe_mute_until(mut self, value: Option<Datetime>) -> Self {
11389 self._fields.14 = value;
11390 self
11391 }
11392}
11393
11394impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> {
11395 pub fn priority_score(mut self, value: impl Into<Option<i64>>) -> Self {
11397 self._fields.15 = value.into();
11398 self
11399 }
11400 pub fn maybe_priority_score(mut self, value: Option<i64>) -> Self {
11402 self._fields.15 = value;
11403 self
11404 }
11405}
11406
11407impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> {
11408 pub fn records_stats(
11410 mut self,
11411 value: impl Into<Option<moderation::RecordsStats<'a>>>,
11412 ) -> Self {
11413 self._fields.16 = value.into();
11414 self
11415 }
11416 pub fn maybe_records_stats(
11418 mut self,
11419 value: Option<moderation::RecordsStats<'a>>,
11420 ) -> Self {
11421 self._fields.16 = value;
11422 self
11423 }
11424}
11425
11426impl<'a, S> SubjectStatusViewBuilder<'a, S>
11427where
11428 S: subject_status_view_state::State,
11429 S::ReviewState: subject_status_view_state::IsUnset,
11430{
11431 pub fn review_state(
11433 mut self,
11434 value: impl Into<moderation::SubjectReviewState<'a>>,
11435 ) -> SubjectStatusViewBuilder<'a, subject_status_view_state::SetReviewState<S>> {
11436 self._fields.17 = Option::Some(value.into());
11437 SubjectStatusViewBuilder {
11438 _state: PhantomData,
11439 _fields: self._fields,
11440 _lifetime: PhantomData,
11441 }
11442 }
11443}
11444
11445impl<'a, S> SubjectStatusViewBuilder<'a, S>
11446where
11447 S: subject_status_view_state::State,
11448 S::Subject: subject_status_view_state::IsUnset,
11449{
11450 pub fn subject(
11452 mut self,
11453 value: impl Into<SubjectStatusViewSubject<'a>>,
11454 ) -> SubjectStatusViewBuilder<'a, subject_status_view_state::SetSubject<S>> {
11455 self._fields.18 = Option::Some(value.into());
11456 SubjectStatusViewBuilder {
11457 _state: PhantomData,
11458 _fields: self._fields,
11459 _lifetime: PhantomData,
11460 }
11461 }
11462}
11463
11464impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> {
11465 pub fn subject_blob_cids(mut self, value: impl Into<Option<Vec<Cid<'a>>>>) -> Self {
11467 self._fields.19 = value.into();
11468 self
11469 }
11470 pub fn maybe_subject_blob_cids(mut self, value: Option<Vec<Cid<'a>>>) -> Self {
11472 self._fields.19 = value;
11473 self
11474 }
11475}
11476
11477impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> {
11478 pub fn subject_repo_handle(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
11480 self._fields.20 = value.into();
11481 self
11482 }
11483 pub fn maybe_subject_repo_handle(mut self, value: Option<CowStr<'a>>) -> Self {
11485 self._fields.20 = value;
11486 self
11487 }
11488}
11489
11490impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> {
11491 pub fn suspend_until(mut self, value: impl Into<Option<Datetime>>) -> Self {
11493 self._fields.21 = value.into();
11494 self
11495 }
11496 pub fn maybe_suspend_until(mut self, value: Option<Datetime>) -> Self {
11498 self._fields.21 = value;
11499 self
11500 }
11501}
11502
11503impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> {
11504 pub fn tags(mut self, value: impl Into<Option<Vec<CowStr<'a>>>>) -> Self {
11506 self._fields.22 = value.into();
11507 self
11508 }
11509 pub fn maybe_tags(mut self, value: Option<Vec<CowStr<'a>>>) -> Self {
11511 self._fields.22 = value;
11512 self
11513 }
11514}
11515
11516impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> {
11517 pub fn takendown(mut self, value: impl Into<Option<bool>>) -> Self {
11519 self._fields.23 = value.into();
11520 self
11521 }
11522 pub fn maybe_takendown(mut self, value: Option<bool>) -> Self {
11524 self._fields.23 = value;
11525 self
11526 }
11527}
11528
11529impl<'a, S> SubjectStatusViewBuilder<'a, S>
11530where
11531 S: subject_status_view_state::State,
11532 S::UpdatedAt: subject_status_view_state::IsUnset,
11533{
11534 pub fn updated_at(
11536 mut self,
11537 value: impl Into<Datetime>,
11538 ) -> SubjectStatusViewBuilder<'a, subject_status_view_state::SetUpdatedAt<S>> {
11539 self._fields.24 = Option::Some(value.into());
11540 SubjectStatusViewBuilder {
11541 _state: PhantomData,
11542 _fields: self._fields,
11543 _lifetime: PhantomData,
11544 }
11545 }
11546}
11547
11548impl<'a, S> SubjectStatusViewBuilder<'a, S>
11549where
11550 S: subject_status_view_state::State,
11551 S::Subject: subject_status_view_state::IsSet,
11552 S::CreatedAt: subject_status_view_state::IsSet,
11553 S::ReviewState: subject_status_view_state::IsSet,
11554 S::Id: subject_status_view_state::IsSet,
11555 S::UpdatedAt: subject_status_view_state::IsSet,
11556{
11557 pub fn build(self) -> SubjectStatusView<'a> {
11559 SubjectStatusView {
11560 account_stats: self._fields.0,
11561 account_strike: self._fields.1,
11562 age_assurance_state: self._fields.2,
11563 age_assurance_updated_by: self._fields.3,
11564 appealed: self._fields.4,
11565 comment: self._fields.5,
11566 created_at: self._fields.6.unwrap(),
11567 hosting: self._fields.7,
11568 id: self._fields.8.unwrap(),
11569 last_appealed_at: self._fields.9,
11570 last_reported_at: self._fields.10,
11571 last_reviewed_at: self._fields.11,
11572 last_reviewed_by: self._fields.12,
11573 mute_reporting_until: self._fields.13,
11574 mute_until: self._fields.14,
11575 priority_score: self._fields.15,
11576 records_stats: self._fields.16,
11577 review_state: self._fields.17.unwrap(),
11578 subject: self._fields.18.unwrap(),
11579 subject_blob_cids: self._fields.19,
11580 subject_repo_handle: self._fields.20,
11581 suspend_until: self._fields.21,
11582 tags: self._fields.22,
11583 takendown: self._fields.23,
11584 updated_at: self._fields.24.unwrap(),
11585 extra_data: Default::default(),
11586 }
11587 }
11588 pub fn build_with_data(
11590 self,
11591 extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
11592 ) -> SubjectStatusView<'a> {
11593 SubjectStatusView {
11594 account_stats: self._fields.0,
11595 account_strike: self._fields.1,
11596 age_assurance_state: self._fields.2,
11597 age_assurance_updated_by: self._fields.3,
11598 appealed: self._fields.4,
11599 comment: self._fields.5,
11600 created_at: self._fields.6.unwrap(),
11601 hosting: self._fields.7,
11602 id: self._fields.8.unwrap(),
11603 last_appealed_at: self._fields.9,
11604 last_reported_at: self._fields.10,
11605 last_reviewed_at: self._fields.11,
11606 last_reviewed_by: self._fields.12,
11607 mute_reporting_until: self._fields.13,
11608 mute_until: self._fields.14,
11609 priority_score: self._fields.15,
11610 records_stats: self._fields.16,
11611 review_state: self._fields.17.unwrap(),
11612 subject: self._fields.18.unwrap(),
11613 subject_blob_cids: self._fields.19,
11614 subject_repo_handle: self._fields.20,
11615 suspend_until: self._fields.21,
11616 tags: self._fields.22,
11617 takendown: self._fields.23,
11618 updated_at: self._fields.24.unwrap(),
11619 extra_data: Some(extra_data),
11620 }
11621 }
11622}
11623
11624pub mod subject_view_state {
11625
11626 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
11627 #[allow(unused)]
11628 use ::core::marker::PhantomData;
11629 mod sealed {
11630 pub trait Sealed {}
11631 }
11632 pub trait State: sealed::Sealed {
11634 type Subject;
11635 type Type;
11636 }
11637 pub struct Empty(());
11639 impl sealed::Sealed for Empty {}
11640 impl State for Empty {
11641 type Subject = Unset;
11642 type Type = Unset;
11643 }
11644 pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>);
11646 impl<S: State> sealed::Sealed for SetSubject<S> {}
11647 impl<S: State> State for SetSubject<S> {
11648 type Subject = Set<members::subject>;
11649 type Type = S::Type;
11650 }
11651 pub struct SetType<S: State = Empty>(PhantomData<fn() -> S>);
11653 impl<S: State> sealed::Sealed for SetType<S> {}
11654 impl<S: State> State for SetType<S> {
11655 type Subject = S::Subject;
11656 type Type = Set<members::r#type>;
11657 }
11658 #[allow(non_camel_case_types)]
11660 pub mod members {
11661 pub struct subject(());
11663 pub struct r#type(());
11665 }
11666}
11667
11668pub struct SubjectViewBuilder<'a, S: subject_view_state::State> {
11670 _state: PhantomData<fn() -> S>,
11671 _fields: (
11672 Option<Data<'a>>,
11673 Option<moderation::RecordViewDetail<'a>>,
11674 Option<moderation::RepoViewDetail<'a>>,
11675 Option<moderation::SubjectStatusView<'a>>,
11676 Option<CowStr<'a>>,
11677 Option<SubjectType<'a>>,
11678 ),
11679 _lifetime: PhantomData<&'a ()>,
11680}
11681
11682impl<'a> SubjectView<'a> {
11683 pub fn new() -> SubjectViewBuilder<'a, subject_view_state::Empty> {
11685 SubjectViewBuilder::new()
11686 }
11687}
11688
11689impl<'a> SubjectViewBuilder<'a, subject_view_state::Empty> {
11690 pub fn new() -> Self {
11692 SubjectViewBuilder {
11693 _state: PhantomData,
11694 _fields: (None, None, None, None, None, None),
11695 _lifetime: PhantomData,
11696 }
11697 }
11698}
11699
11700impl<'a, S: subject_view_state::State> SubjectViewBuilder<'a, S> {
11701 pub fn profile(mut self, value: impl Into<Option<Data<'a>>>) -> Self {
11703 self._fields.0 = value.into();
11704 self
11705 }
11706 pub fn maybe_profile(mut self, value: Option<Data<'a>>) -> Self {
11708 self._fields.0 = value;
11709 self
11710 }
11711}
11712
11713impl<'a, S: subject_view_state::State> SubjectViewBuilder<'a, S> {
11714 pub fn record(
11716 mut self,
11717 value: impl Into<Option<moderation::RecordViewDetail<'a>>>,
11718 ) -> Self {
11719 self._fields.1 = value.into();
11720 self
11721 }
11722 pub fn maybe_record(
11724 mut self,
11725 value: Option<moderation::RecordViewDetail<'a>>,
11726 ) -> Self {
11727 self._fields.1 = value;
11728 self
11729 }
11730}
11731
11732impl<'a, S: subject_view_state::State> SubjectViewBuilder<'a, S> {
11733 pub fn repo(
11735 mut self,
11736 value: impl Into<Option<moderation::RepoViewDetail<'a>>>,
11737 ) -> Self {
11738 self._fields.2 = value.into();
11739 self
11740 }
11741 pub fn maybe_repo(mut self, value: Option<moderation::RepoViewDetail<'a>>) -> Self {
11743 self._fields.2 = value;
11744 self
11745 }
11746}
11747
11748impl<'a, S: subject_view_state::State> SubjectViewBuilder<'a, S> {
11749 pub fn status(
11751 mut self,
11752 value: impl Into<Option<moderation::SubjectStatusView<'a>>>,
11753 ) -> Self {
11754 self._fields.3 = value.into();
11755 self
11756 }
11757 pub fn maybe_status(
11759 mut self,
11760 value: Option<moderation::SubjectStatusView<'a>>,
11761 ) -> Self {
11762 self._fields.3 = value;
11763 self
11764 }
11765}
11766
11767impl<'a, S> SubjectViewBuilder<'a, S>
11768where
11769 S: subject_view_state::State,
11770 S::Subject: subject_view_state::IsUnset,
11771{
11772 pub fn subject(
11774 mut self,
11775 value: impl Into<CowStr<'a>>,
11776 ) -> SubjectViewBuilder<'a, subject_view_state::SetSubject<S>> {
11777 self._fields.4 = Option::Some(value.into());
11778 SubjectViewBuilder {
11779 _state: PhantomData,
11780 _fields: self._fields,
11781 _lifetime: PhantomData,
11782 }
11783 }
11784}
11785
11786impl<'a, S> SubjectViewBuilder<'a, S>
11787where
11788 S: subject_view_state::State,
11789 S::Type: subject_view_state::IsUnset,
11790{
11791 pub fn r#type(
11793 mut self,
11794 value: impl Into<SubjectType<'a>>,
11795 ) -> SubjectViewBuilder<'a, subject_view_state::SetType<S>> {
11796 self._fields.5 = Option::Some(value.into());
11797 SubjectViewBuilder {
11798 _state: PhantomData,
11799 _fields: self._fields,
11800 _lifetime: PhantomData,
11801 }
11802 }
11803}
11804
11805impl<'a, S> SubjectViewBuilder<'a, S>
11806where
11807 S: subject_view_state::State,
11808 S::Subject: subject_view_state::IsSet,
11809 S::Type: subject_view_state::IsSet,
11810{
11811 pub fn build(self) -> SubjectView<'a> {
11813 SubjectView {
11814 profile: self._fields.0,
11815 record: self._fields.1,
11816 repo: self._fields.2,
11817 status: self._fields.3,
11818 subject: self._fields.4.unwrap(),
11819 r#type: self._fields.5.unwrap(),
11820 extra_data: Default::default(),
11821 }
11822 }
11823 pub fn build_with_data(
11825 self,
11826 extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
11827 ) -> SubjectView<'a> {
11828 SubjectView {
11829 profile: self._fields.0,
11830 record: self._fields.1,
11831 repo: self._fields.2,
11832 status: self._fields.3,
11833 subject: self._fields.4.unwrap(),
11834 r#type: self._fields.5.unwrap(),
11835 extra_data: Some(extra_data),
11836 }
11837 }
11838}
11839
11840pub mod video_details_state {
11841
11842 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
11843 #[allow(unused)]
11844 use ::core::marker::PhantomData;
11845 mod sealed {
11846 pub trait Sealed {}
11847 }
11848 pub trait State: sealed::Sealed {
11850 type Height;
11851 type Width;
11852 type Length;
11853 }
11854 pub struct Empty(());
11856 impl sealed::Sealed for Empty {}
11857 impl State for Empty {
11858 type Height = Unset;
11859 type Width = Unset;
11860 type Length = Unset;
11861 }
11862 pub struct SetHeight<S: State = Empty>(PhantomData<fn() -> S>);
11864 impl<S: State> sealed::Sealed for SetHeight<S> {}
11865 impl<S: State> State for SetHeight<S> {
11866 type Height = Set<members::height>;
11867 type Width = S::Width;
11868 type Length = S::Length;
11869 }
11870 pub struct SetWidth<S: State = Empty>(PhantomData<fn() -> S>);
11872 impl<S: State> sealed::Sealed for SetWidth<S> {}
11873 impl<S: State> State for SetWidth<S> {
11874 type Height = S::Height;
11875 type Width = Set<members::width>;
11876 type Length = S::Length;
11877 }
11878 pub struct SetLength<S: State = Empty>(PhantomData<fn() -> S>);
11880 impl<S: State> sealed::Sealed for SetLength<S> {}
11881 impl<S: State> State for SetLength<S> {
11882 type Height = S::Height;
11883 type Width = S::Width;
11884 type Length = Set<members::length>;
11885 }
11886 #[allow(non_camel_case_types)]
11888 pub mod members {
11889 pub struct height(());
11891 pub struct width(());
11893 pub struct length(());
11895 }
11896}
11897
11898pub struct VideoDetailsBuilder<'a, S: video_details_state::State> {
11900 _state: PhantomData<fn() -> S>,
11901 _fields: (Option<i64>, Option<i64>, Option<i64>),
11902 _lifetime: PhantomData<&'a ()>,
11903}
11904
11905impl<'a> VideoDetails<'a> {
11906 pub fn new() -> VideoDetailsBuilder<'a, video_details_state::Empty> {
11908 VideoDetailsBuilder::new()
11909 }
11910}
11911
11912impl<'a> VideoDetailsBuilder<'a, video_details_state::Empty> {
11913 pub fn new() -> Self {
11915 VideoDetailsBuilder {
11916 _state: PhantomData,
11917 _fields: (None, None, None),
11918 _lifetime: PhantomData,
11919 }
11920 }
11921}
11922
11923impl<'a, S> VideoDetailsBuilder<'a, S>
11924where
11925 S: video_details_state::State,
11926 S::Height: video_details_state::IsUnset,
11927{
11928 pub fn height(
11930 mut self,
11931 value: impl Into<i64>,
11932 ) -> VideoDetailsBuilder<'a, video_details_state::SetHeight<S>> {
11933 self._fields.0 = Option::Some(value.into());
11934 VideoDetailsBuilder {
11935 _state: PhantomData,
11936 _fields: self._fields,
11937 _lifetime: PhantomData,
11938 }
11939 }
11940}
11941
11942impl<'a, S> VideoDetailsBuilder<'a, S>
11943where
11944 S: video_details_state::State,
11945 S::Length: video_details_state::IsUnset,
11946{
11947 pub fn length(
11949 mut self,
11950 value: impl Into<i64>,
11951 ) -> VideoDetailsBuilder<'a, video_details_state::SetLength<S>> {
11952 self._fields.1 = Option::Some(value.into());
11953 VideoDetailsBuilder {
11954 _state: PhantomData,
11955 _fields: self._fields,
11956 _lifetime: PhantomData,
11957 }
11958 }
11959}
11960
11961impl<'a, S> VideoDetailsBuilder<'a, S>
11962where
11963 S: video_details_state::State,
11964 S::Width: video_details_state::IsUnset,
11965{
11966 pub fn width(
11968 mut self,
11969 value: impl Into<i64>,
11970 ) -> VideoDetailsBuilder<'a, video_details_state::SetWidth<S>> {
11971 self._fields.2 = Option::Some(value.into());
11972 VideoDetailsBuilder {
11973 _state: PhantomData,
11974 _fields: self._fields,
11975 _lifetime: PhantomData,
11976 }
11977 }
11978}
11979
11980impl<'a, S> VideoDetailsBuilder<'a, S>
11981where
11982 S: video_details_state::State,
11983 S::Height: video_details_state::IsSet,
11984 S::Width: video_details_state::IsSet,
11985 S::Length: video_details_state::IsSet,
11986{
11987 pub fn build(self) -> VideoDetails<'a> {
11989 VideoDetails {
11990 height: self._fields.0.unwrap(),
11991 length: self._fields.1.unwrap(),
11992 width: self._fields.2.unwrap(),
11993 extra_data: Default::default(),
11994 }
11995 }
11996 pub fn build_with_data(
11998 self,
11999 extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
12000 ) -> VideoDetails<'a> {
12001 VideoDetails {
12002 height: self._fields.0.unwrap(),
12003 length: self._fields.1.unwrap(),
12004 width: self._fields.2.unwrap(),
12005 extra_data: Some(extra_data),
12006 }
12007 }
12008}