atproto blogging
1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: tools.ozone.moderation.scheduleAction
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8#[jacquard_derive::lexicon]
9#[derive(
10 serde::Serialize,
11 serde::Deserialize,
12 Debug,
13 Clone,
14 PartialEq,
15 Eq,
16 jacquard_derive::IntoStatic
17)]
18#[serde(rename_all = "camelCase")]
19pub struct FailedScheduling<'a> {
20 #[serde(borrow)]
21 pub error: jacquard_common::CowStr<'a>,
22 #[serde(skip_serializing_if = "std::option::Option::is_none")]
23 #[serde(borrow)]
24 pub error_code: std::option::Option<jacquard_common::CowStr<'a>>,
25 #[serde(borrow)]
26 pub subject: jacquard_common::types::string::Did<'a>,
27}
28
29pub mod failed_scheduling_state {
30
31 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
32 #[allow(unused)]
33 use ::core::marker::PhantomData;
34 mod sealed {
35 pub trait Sealed {}
36 }
37 /// State trait tracking which required fields have been set
38 pub trait State: sealed::Sealed {
39 type Subject;
40 type Error;
41 }
42 /// Empty state - all required fields are unset
43 pub struct Empty(());
44 impl sealed::Sealed for Empty {}
45 impl State for Empty {
46 type Subject = Unset;
47 type Error = Unset;
48 }
49 ///State transition - sets the `subject` field to Set
50 pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>);
51 impl<S: State> sealed::Sealed for SetSubject<S> {}
52 impl<S: State> State for SetSubject<S> {
53 type Subject = Set<members::subject>;
54 type Error = S::Error;
55 }
56 ///State transition - sets the `error` field to Set
57 pub struct SetError<S: State = Empty>(PhantomData<fn() -> S>);
58 impl<S: State> sealed::Sealed for SetError<S> {}
59 impl<S: State> State for SetError<S> {
60 type Subject = S::Subject;
61 type Error = Set<members::error>;
62 }
63 /// Marker types for field names
64 #[allow(non_camel_case_types)]
65 pub mod members {
66 ///Marker type for the `subject` field
67 pub struct subject(());
68 ///Marker type for the `error` field
69 pub struct error(());
70 }
71}
72
73/// Builder for constructing an instance of this type
74pub struct FailedSchedulingBuilder<'a, S: failed_scheduling_state::State> {
75 _phantom_state: ::core::marker::PhantomData<fn() -> S>,
76 __unsafe_private_named: (
77 ::core::option::Option<jacquard_common::CowStr<'a>>,
78 ::core::option::Option<jacquard_common::CowStr<'a>>,
79 ::core::option::Option<jacquard_common::types::string::Did<'a>>,
80 ),
81 _phantom: ::core::marker::PhantomData<&'a ()>,
82}
83
84impl<'a> FailedScheduling<'a> {
85 /// Create a new builder for this type
86 pub fn new() -> FailedSchedulingBuilder<'a, failed_scheduling_state::Empty> {
87 FailedSchedulingBuilder::new()
88 }
89}
90
91impl<'a> FailedSchedulingBuilder<'a, failed_scheduling_state::Empty> {
92 /// Create a new builder with all fields unset
93 pub fn new() -> Self {
94 FailedSchedulingBuilder {
95 _phantom_state: ::core::marker::PhantomData,
96 __unsafe_private_named: (None, None, None),
97 _phantom: ::core::marker::PhantomData,
98 }
99 }
100}
101
102impl<'a, S> FailedSchedulingBuilder<'a, S>
103where
104 S: failed_scheduling_state::State,
105 S::Error: failed_scheduling_state::IsUnset,
106{
107 /// Set the `error` field (required)
108 pub fn error(
109 mut self,
110 value: impl Into<jacquard_common::CowStr<'a>>,
111 ) -> FailedSchedulingBuilder<'a, failed_scheduling_state::SetError<S>> {
112 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
113 FailedSchedulingBuilder {
114 _phantom_state: ::core::marker::PhantomData,
115 __unsafe_private_named: self.__unsafe_private_named,
116 _phantom: ::core::marker::PhantomData,
117 }
118 }
119}
120
121impl<'a, S: failed_scheduling_state::State> FailedSchedulingBuilder<'a, S> {
122 /// Set the `errorCode` field (optional)
123 pub fn error_code(
124 mut self,
125 value: impl Into<Option<jacquard_common::CowStr<'a>>>,
126 ) -> Self {
127 self.__unsafe_private_named.1 = value.into();
128 self
129 }
130 /// Set the `errorCode` field to an Option value (optional)
131 pub fn maybe_error_code(
132 mut self,
133 value: Option<jacquard_common::CowStr<'a>>,
134 ) -> Self {
135 self.__unsafe_private_named.1 = value;
136 self
137 }
138}
139
140impl<'a, S> FailedSchedulingBuilder<'a, S>
141where
142 S: failed_scheduling_state::State,
143 S::Subject: failed_scheduling_state::IsUnset,
144{
145 /// Set the `subject` field (required)
146 pub fn subject(
147 mut self,
148 value: impl Into<jacquard_common::types::string::Did<'a>>,
149 ) -> FailedSchedulingBuilder<'a, failed_scheduling_state::SetSubject<S>> {
150 self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into());
151 FailedSchedulingBuilder {
152 _phantom_state: ::core::marker::PhantomData,
153 __unsafe_private_named: self.__unsafe_private_named,
154 _phantom: ::core::marker::PhantomData,
155 }
156 }
157}
158
159impl<'a, S> FailedSchedulingBuilder<'a, S>
160where
161 S: failed_scheduling_state::State,
162 S::Subject: failed_scheduling_state::IsSet,
163 S::Error: failed_scheduling_state::IsSet,
164{
165 /// Build the final struct
166 pub fn build(self) -> FailedScheduling<'a> {
167 FailedScheduling {
168 error: self.__unsafe_private_named.0.unwrap(),
169 error_code: self.__unsafe_private_named.1,
170 subject: self.__unsafe_private_named.2.unwrap(),
171 extra_data: Default::default(),
172 }
173 }
174 /// Build the final struct with custom extra_data
175 pub fn build_with_data(
176 self,
177 extra_data: std::collections::BTreeMap<
178 jacquard_common::smol_str::SmolStr,
179 jacquard_common::types::value::Data<'a>,
180 >,
181 ) -> FailedScheduling<'a> {
182 FailedScheduling {
183 error: self.__unsafe_private_named.0.unwrap(),
184 error_code: self.__unsafe_private_named.1,
185 subject: self.__unsafe_private_named.2.unwrap(),
186 extra_data: Some(extra_data),
187 }
188 }
189}
190
191fn lexicon_doc_tools_ozone_moderation_scheduleAction() -> ::jacquard_lexicon::lexicon::LexiconDoc<
192 'static,
193> {
194 ::jacquard_lexicon::lexicon::LexiconDoc {
195 lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1,
196 id: ::jacquard_common::CowStr::new_static(
197 "tools.ozone.moderation.scheduleAction",
198 ),
199 revision: None,
200 description: None,
201 defs: {
202 let mut map = ::alloc::collections::BTreeMap::new();
203 map.insert(
204 ::jacquard_common::smol_str::SmolStr::new_static("failedScheduling"),
205 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
206 description: None,
207 required: Some(
208 vec![
209 ::jacquard_common::smol_str::SmolStr::new_static("subject"),
210 ::jacquard_common::smol_str::SmolStr::new_static("error")
211 ],
212 ),
213 nullable: None,
214 properties: {
215 #[allow(unused_mut)]
216 let mut map = ::alloc::collections::BTreeMap::new();
217 map.insert(
218 ::jacquard_common::smol_str::SmolStr::new_static("error"),
219 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
220 description: None,
221 format: None,
222 default: None,
223 min_length: None,
224 max_length: None,
225 min_graphemes: None,
226 max_graphemes: None,
227 r#enum: None,
228 r#const: None,
229 known_values: None,
230 }),
231 );
232 map.insert(
233 ::jacquard_common::smol_str::SmolStr::new_static(
234 "errorCode",
235 ),
236 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
237 description: None,
238 format: None,
239 default: None,
240 min_length: None,
241 max_length: None,
242 min_graphemes: None,
243 max_graphemes: None,
244 r#enum: None,
245 r#const: None,
246 known_values: None,
247 }),
248 );
249 map.insert(
250 ::jacquard_common::smol_str::SmolStr::new_static("subject"),
251 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
252 description: None,
253 format: Some(
254 ::jacquard_lexicon::lexicon::LexStringFormat::Did,
255 ),
256 default: None,
257 min_length: None,
258 max_length: None,
259 min_graphemes: None,
260 max_graphemes: None,
261 r#enum: None,
262 r#const: None,
263 known_values: None,
264 }),
265 );
266 map
267 },
268 }),
269 );
270 map.insert(
271 ::jacquard_common::smol_str::SmolStr::new_static("main"),
272 ::jacquard_lexicon::lexicon::LexUserType::XrpcProcedure(::jacquard_lexicon::lexicon::LexXrpcProcedure {
273 description: None,
274 parameters: None,
275 input: Some(::jacquard_lexicon::lexicon::LexXrpcBody {
276 description: None,
277 encoding: ::jacquard_common::CowStr::new_static(
278 "application/json",
279 ),
280 schema: Some(
281 ::jacquard_lexicon::lexicon::LexXrpcBodySchema::Object(::jacquard_lexicon::lexicon::LexObject {
282 description: None,
283 required: Some(
284 vec![
285 ::jacquard_common::smol_str::SmolStr::new_static("action"),
286 ::jacquard_common::smol_str::SmolStr::new_static("subjects"),
287 ::jacquard_common::smol_str::SmolStr::new_static("createdBy"),
288 ::jacquard_common::smol_str::SmolStr::new_static("scheduling")
289 ],
290 ),
291 nullable: None,
292 properties: {
293 #[allow(unused_mut)]
294 let mut map = ::alloc::collections::BTreeMap::new();
295 map.insert(
296 ::jacquard_common::smol_str::SmolStr::new_static("action"),
297 ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion {
298 description: None,
299 refs: vec![
300 ::jacquard_common::CowStr::new_static("#takedown")
301 ],
302 closed: None,
303 }),
304 );
305 map.insert(
306 ::jacquard_common::smol_str::SmolStr::new_static(
307 "createdBy",
308 ),
309 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
310 description: None,
311 format: Some(
312 ::jacquard_lexicon::lexicon::LexStringFormat::Did,
313 ),
314 default: None,
315 min_length: None,
316 max_length: None,
317 min_graphemes: None,
318 max_graphemes: None,
319 r#enum: None,
320 r#const: None,
321 known_values: None,
322 }),
323 );
324 map.insert(
325 ::jacquard_common::smol_str::SmolStr::new_static("modTool"),
326 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
327 description: None,
328 r#ref: ::jacquard_common::CowStr::new_static(
329 "tools.ozone.moderation.defs#modTool",
330 ),
331 }),
332 );
333 map.insert(
334 ::jacquard_common::smol_str::SmolStr::new_static(
335 "scheduling",
336 ),
337 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
338 description: None,
339 r#ref: ::jacquard_common::CowStr::new_static(
340 "#schedulingConfig",
341 ),
342 }),
343 );
344 map.insert(
345 ::jacquard_common::smol_str::SmolStr::new_static(
346 "subjects",
347 ),
348 ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
349 description: Some(
350 ::jacquard_common::CowStr::new_static(
351 "Array of DID subjects to schedule the action for",
352 ),
353 ),
354 items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString {
355 description: None,
356 format: Some(
357 ::jacquard_lexicon::lexicon::LexStringFormat::Did,
358 ),
359 default: None,
360 min_length: None,
361 max_length: None,
362 min_graphemes: None,
363 max_graphemes: None,
364 r#enum: None,
365 r#const: None,
366 known_values: None,
367 }),
368 min_length: None,
369 max_length: Some(100usize),
370 }),
371 );
372 map
373 },
374 }),
375 ),
376 }),
377 output: None,
378 errors: None,
379 }),
380 );
381 map.insert(
382 ::jacquard_common::smol_str::SmolStr::new_static(
383 "scheduledActionResults",
384 ),
385 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
386 description: None,
387 required: Some(
388 vec![
389 ::jacquard_common::smol_str::SmolStr::new_static("succeeded"),
390 ::jacquard_common::smol_str::SmolStr::new_static("failed")
391 ],
392 ),
393 nullable: None,
394 properties: {
395 #[allow(unused_mut)]
396 let mut map = ::alloc::collections::BTreeMap::new();
397 map.insert(
398 ::jacquard_common::smol_str::SmolStr::new_static("failed"),
399 ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
400 description: None,
401 items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef {
402 description: None,
403 r#ref: ::jacquard_common::CowStr::new_static(
404 "#failedScheduling",
405 ),
406 }),
407 min_length: None,
408 max_length: None,
409 }),
410 );
411 map.insert(
412 ::jacquard_common::smol_str::SmolStr::new_static(
413 "succeeded",
414 ),
415 ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
416 description: None,
417 items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString {
418 description: None,
419 format: Some(
420 ::jacquard_lexicon::lexicon::LexStringFormat::Did,
421 ),
422 default: None,
423 min_length: None,
424 max_length: None,
425 min_graphemes: None,
426 max_graphemes: None,
427 r#enum: None,
428 r#const: None,
429 known_values: None,
430 }),
431 min_length: None,
432 max_length: None,
433 }),
434 );
435 map
436 },
437 }),
438 );
439 map.insert(
440 ::jacquard_common::smol_str::SmolStr::new_static("schedulingConfig"),
441 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
442 description: Some(
443 ::jacquard_common::CowStr::new_static(
444 "Configuration for when the action should be executed",
445 ),
446 ),
447 required: None,
448 nullable: None,
449 properties: {
450 #[allow(unused_mut)]
451 let mut map = ::alloc::collections::BTreeMap::new();
452 map.insert(
453 ::jacquard_common::smol_str::SmolStr::new_static(
454 "executeAfter",
455 ),
456 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
457 description: Some(
458 ::jacquard_common::CowStr::new_static(
459 "Earliest time to execute the action (for randomized scheduling)",
460 ),
461 ),
462 format: Some(
463 ::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
464 ),
465 default: None,
466 min_length: None,
467 max_length: None,
468 min_graphemes: None,
469 max_graphemes: None,
470 r#enum: None,
471 r#const: None,
472 known_values: None,
473 }),
474 );
475 map.insert(
476 ::jacquard_common::smol_str::SmolStr::new_static(
477 "executeAt",
478 ),
479 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
480 description: Some(
481 ::jacquard_common::CowStr::new_static(
482 "Exact time to execute the action",
483 ),
484 ),
485 format: Some(
486 ::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
487 ),
488 default: None,
489 min_length: None,
490 max_length: None,
491 min_graphemes: None,
492 max_graphemes: None,
493 r#enum: None,
494 r#const: None,
495 known_values: None,
496 }),
497 );
498 map.insert(
499 ::jacquard_common::smol_str::SmolStr::new_static(
500 "executeUntil",
501 ),
502 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
503 description: Some(
504 ::jacquard_common::CowStr::new_static(
505 "Latest time to execute the action (for randomized scheduling)",
506 ),
507 ),
508 format: Some(
509 ::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
510 ),
511 default: None,
512 min_length: None,
513 max_length: None,
514 min_graphemes: None,
515 max_graphemes: None,
516 r#enum: None,
517 r#const: None,
518 known_values: None,
519 }),
520 );
521 map
522 },
523 }),
524 );
525 map.insert(
526 ::jacquard_common::smol_str::SmolStr::new_static("takedown"),
527 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
528 description: Some(
529 ::jacquard_common::CowStr::new_static(
530 "Schedule a takedown action",
531 ),
532 ),
533 required: None,
534 nullable: None,
535 properties: {
536 #[allow(unused_mut)]
537 let mut map = ::alloc::collections::BTreeMap::new();
538 map.insert(
539 ::jacquard_common::smol_str::SmolStr::new_static(
540 "acknowledgeAccountSubjects",
541 ),
542 ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean {
543 description: None,
544 default: None,
545 r#const: None,
546 }),
547 );
548 map.insert(
549 ::jacquard_common::smol_str::SmolStr::new_static("comment"),
550 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
551 description: None,
552 format: None,
553 default: None,
554 min_length: None,
555 max_length: None,
556 min_graphemes: None,
557 max_graphemes: None,
558 r#enum: None,
559 r#const: None,
560 known_values: None,
561 }),
562 );
563 map.insert(
564 ::jacquard_common::smol_str::SmolStr::new_static(
565 "durationInHours",
566 ),
567 ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
568 description: None,
569 default: None,
570 minimum: None,
571 maximum: None,
572 r#enum: None,
573 r#const: None,
574 }),
575 );
576 map.insert(
577 ::jacquard_common::smol_str::SmolStr::new_static(
578 "emailContent",
579 ),
580 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
581 description: Some(
582 ::jacquard_common::CowStr::new_static(
583 "Email content to be sent to the user upon takedown.",
584 ),
585 ),
586 format: None,
587 default: None,
588 min_length: None,
589 max_length: None,
590 min_graphemes: None,
591 max_graphemes: None,
592 r#enum: None,
593 r#const: None,
594 known_values: None,
595 }),
596 );
597 map.insert(
598 ::jacquard_common::smol_str::SmolStr::new_static(
599 "emailSubject",
600 ),
601 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
602 description: Some(
603 ::jacquard_common::CowStr::new_static(
604 "Subject of the email to be sent to the user upon takedown.",
605 ),
606 ),
607 format: None,
608 default: None,
609 min_length: None,
610 max_length: None,
611 min_graphemes: None,
612 max_graphemes: None,
613 r#enum: None,
614 r#const: None,
615 known_values: None,
616 }),
617 );
618 map.insert(
619 ::jacquard_common::smol_str::SmolStr::new_static("policies"),
620 ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
621 description: Some(
622 ::jacquard_common::CowStr::new_static(
623 "Names/Keywords of the policies that drove the decision.",
624 ),
625 ),
626 items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString {
627 description: None,
628 format: None,
629 default: None,
630 min_length: None,
631 max_length: None,
632 min_graphemes: None,
633 max_graphemes: None,
634 r#enum: None,
635 r#const: None,
636 known_values: None,
637 }),
638 min_length: None,
639 max_length: Some(5usize),
640 }),
641 );
642 map.insert(
643 ::jacquard_common::smol_str::SmolStr::new_static(
644 "severityLevel",
645 ),
646 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
647 description: Some(
648 ::jacquard_common::CowStr::new_static(
649 "Severity level of the violation (e.g., 'sev-0', 'sev-1', 'sev-2', etc.).",
650 ),
651 ),
652 format: None,
653 default: None,
654 min_length: None,
655 max_length: None,
656 min_graphemes: None,
657 max_graphemes: None,
658 r#enum: None,
659 r#const: None,
660 known_values: None,
661 }),
662 );
663 map.insert(
664 ::jacquard_common::smol_str::SmolStr::new_static(
665 "strikeCount",
666 ),
667 ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
668 description: None,
669 default: None,
670 minimum: None,
671 maximum: None,
672 r#enum: None,
673 r#const: None,
674 }),
675 );
676 map.insert(
677 ::jacquard_common::smol_str::SmolStr::new_static(
678 "strikeExpiresAt",
679 ),
680 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
681 description: Some(
682 ::jacquard_common::CowStr::new_static(
683 "When the strike should expire. If not provided, the strike never expires.",
684 ),
685 ),
686 format: Some(
687 ::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
688 ),
689 default: None,
690 min_length: None,
691 max_length: None,
692 min_graphemes: None,
693 max_graphemes: None,
694 r#enum: None,
695 r#const: None,
696 known_values: None,
697 }),
698 );
699 map
700 },
701 }),
702 );
703 map
704 },
705 }
706}
707
708impl<'a> ::jacquard_lexicon::schema::LexiconSchema for FailedScheduling<'a> {
709 fn nsid() -> &'static str {
710 "tools.ozone.moderation.scheduleAction"
711 }
712 fn def_name() -> &'static str {
713 "failedScheduling"
714 }
715 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
716 lexicon_doc_tools_ozone_moderation_scheduleAction()
717 }
718 fn validate(
719 &self,
720 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
721 Ok(())
722 }
723}
724
725#[jacquard_derive::lexicon]
726#[derive(
727 serde::Serialize,
728 serde::Deserialize,
729 Debug,
730 Clone,
731 PartialEq,
732 Eq,
733 jacquard_derive::IntoStatic
734)]
735#[serde(rename_all = "camelCase")]
736pub struct ScheduleAction<'a> {
737 #[serde(borrow)]
738 pub action: crate::tools_ozone::moderation::schedule_action::Takedown<'a>,
739 #[serde(borrow)]
740 pub created_by: jacquard_common::types::string::Did<'a>,
741 /// This will be propagated to the moderation event when it is applied
742 #[serde(skip_serializing_if = "std::option::Option::is_none")]
743 #[serde(borrow)]
744 pub mod_tool: std::option::Option<crate::tools_ozone::moderation::ModTool<'a>>,
745 #[serde(borrow)]
746 pub scheduling: crate::tools_ozone::moderation::schedule_action::SchedulingConfig<
747 'a,
748 >,
749 /// Array of DID subjects to schedule the action for
750 #[serde(borrow)]
751 pub subjects: Vec<jacquard_common::types::string::Did<'a>>,
752}
753
754pub mod schedule_action_state {
755
756 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
757 #[allow(unused)]
758 use ::core::marker::PhantomData;
759 mod sealed {
760 pub trait Sealed {}
761 }
762 /// State trait tracking which required fields have been set
763 pub trait State: sealed::Sealed {
764 type Subjects;
765 type Action;
766 type CreatedBy;
767 type Scheduling;
768 }
769 /// Empty state - all required fields are unset
770 pub struct Empty(());
771 impl sealed::Sealed for Empty {}
772 impl State for Empty {
773 type Subjects = Unset;
774 type Action = Unset;
775 type CreatedBy = Unset;
776 type Scheduling = Unset;
777 }
778 ///State transition - sets the `subjects` field to Set
779 pub struct SetSubjects<S: State = Empty>(PhantomData<fn() -> S>);
780 impl<S: State> sealed::Sealed for SetSubjects<S> {}
781 impl<S: State> State for SetSubjects<S> {
782 type Subjects = Set<members::subjects>;
783 type Action = S::Action;
784 type CreatedBy = S::CreatedBy;
785 type Scheduling = S::Scheduling;
786 }
787 ///State transition - sets the `action` field to Set
788 pub struct SetAction<S: State = Empty>(PhantomData<fn() -> S>);
789 impl<S: State> sealed::Sealed for SetAction<S> {}
790 impl<S: State> State for SetAction<S> {
791 type Subjects = S::Subjects;
792 type Action = Set<members::action>;
793 type CreatedBy = S::CreatedBy;
794 type Scheduling = S::Scheduling;
795 }
796 ///State transition - sets the `created_by` field to Set
797 pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>);
798 impl<S: State> sealed::Sealed for SetCreatedBy<S> {}
799 impl<S: State> State for SetCreatedBy<S> {
800 type Subjects = S::Subjects;
801 type Action = S::Action;
802 type CreatedBy = Set<members::created_by>;
803 type Scheduling = S::Scheduling;
804 }
805 ///State transition - sets the `scheduling` field to Set
806 pub struct SetScheduling<S: State = Empty>(PhantomData<fn() -> S>);
807 impl<S: State> sealed::Sealed for SetScheduling<S> {}
808 impl<S: State> State for SetScheduling<S> {
809 type Subjects = S::Subjects;
810 type Action = S::Action;
811 type CreatedBy = S::CreatedBy;
812 type Scheduling = Set<members::scheduling>;
813 }
814 /// Marker types for field names
815 #[allow(non_camel_case_types)]
816 pub mod members {
817 ///Marker type for the `subjects` field
818 pub struct subjects(());
819 ///Marker type for the `action` field
820 pub struct action(());
821 ///Marker type for the `created_by` field
822 pub struct created_by(());
823 ///Marker type for the `scheduling` field
824 pub struct scheduling(());
825 }
826}
827
828/// Builder for constructing an instance of this type
829pub struct ScheduleActionBuilder<'a, S: schedule_action_state::State> {
830 _phantom_state: ::core::marker::PhantomData<fn() -> S>,
831 __unsafe_private_named: (
832 ::core::option::Option<
833 crate::tools_ozone::moderation::schedule_action::Takedown<'a>,
834 >,
835 ::core::option::Option<jacquard_common::types::string::Did<'a>>,
836 ::core::option::Option<crate::tools_ozone::moderation::ModTool<'a>>,
837 ::core::option::Option<
838 crate::tools_ozone::moderation::schedule_action::SchedulingConfig<'a>,
839 >,
840 ::core::option::Option<Vec<jacquard_common::types::string::Did<'a>>>,
841 ),
842 _phantom: ::core::marker::PhantomData<&'a ()>,
843}
844
845impl<'a> ScheduleAction<'a> {
846 /// Create a new builder for this type
847 pub fn new() -> ScheduleActionBuilder<'a, schedule_action_state::Empty> {
848 ScheduleActionBuilder::new()
849 }
850}
851
852impl<'a> ScheduleActionBuilder<'a, schedule_action_state::Empty> {
853 /// Create a new builder with all fields unset
854 pub fn new() -> Self {
855 ScheduleActionBuilder {
856 _phantom_state: ::core::marker::PhantomData,
857 __unsafe_private_named: (None, None, None, None, None),
858 _phantom: ::core::marker::PhantomData,
859 }
860 }
861}
862
863impl<'a, S> ScheduleActionBuilder<'a, S>
864where
865 S: schedule_action_state::State,
866 S::Action: schedule_action_state::IsUnset,
867{
868 /// Set the `action` field (required)
869 pub fn action(
870 mut self,
871 value: impl Into<crate::tools_ozone::moderation::schedule_action::Takedown<'a>>,
872 ) -> ScheduleActionBuilder<'a, schedule_action_state::SetAction<S>> {
873 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
874 ScheduleActionBuilder {
875 _phantom_state: ::core::marker::PhantomData,
876 __unsafe_private_named: self.__unsafe_private_named,
877 _phantom: ::core::marker::PhantomData,
878 }
879 }
880}
881
882impl<'a, S> ScheduleActionBuilder<'a, S>
883where
884 S: schedule_action_state::State,
885 S::CreatedBy: schedule_action_state::IsUnset,
886{
887 /// Set the `createdBy` field (required)
888 pub fn created_by(
889 mut self,
890 value: impl Into<jacquard_common::types::string::Did<'a>>,
891 ) -> ScheduleActionBuilder<'a, schedule_action_state::SetCreatedBy<S>> {
892 self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
893 ScheduleActionBuilder {
894 _phantom_state: ::core::marker::PhantomData,
895 __unsafe_private_named: self.__unsafe_private_named,
896 _phantom: ::core::marker::PhantomData,
897 }
898 }
899}
900
901impl<'a, S: schedule_action_state::State> ScheduleActionBuilder<'a, S> {
902 /// Set the `modTool` field (optional)
903 pub fn mod_tool(
904 mut self,
905 value: impl Into<Option<crate::tools_ozone::moderation::ModTool<'a>>>,
906 ) -> Self {
907 self.__unsafe_private_named.2 = value.into();
908 self
909 }
910 /// Set the `modTool` field to an Option value (optional)
911 pub fn maybe_mod_tool(
912 mut self,
913 value: Option<crate::tools_ozone::moderation::ModTool<'a>>,
914 ) -> Self {
915 self.__unsafe_private_named.2 = value;
916 self
917 }
918}
919
920impl<'a, S> ScheduleActionBuilder<'a, S>
921where
922 S: schedule_action_state::State,
923 S::Scheduling: schedule_action_state::IsUnset,
924{
925 /// Set the `scheduling` field (required)
926 pub fn scheduling(
927 mut self,
928 value: impl Into<
929 crate::tools_ozone::moderation::schedule_action::SchedulingConfig<'a>,
930 >,
931 ) -> ScheduleActionBuilder<'a, schedule_action_state::SetScheduling<S>> {
932 self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into());
933 ScheduleActionBuilder {
934 _phantom_state: ::core::marker::PhantomData,
935 __unsafe_private_named: self.__unsafe_private_named,
936 _phantom: ::core::marker::PhantomData,
937 }
938 }
939}
940
941impl<'a, S> ScheduleActionBuilder<'a, S>
942where
943 S: schedule_action_state::State,
944 S::Subjects: schedule_action_state::IsUnset,
945{
946 /// Set the `subjects` field (required)
947 pub fn subjects(
948 mut self,
949 value: impl Into<Vec<jacquard_common::types::string::Did<'a>>>,
950 ) -> ScheduleActionBuilder<'a, schedule_action_state::SetSubjects<S>> {
951 self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into());
952 ScheduleActionBuilder {
953 _phantom_state: ::core::marker::PhantomData,
954 __unsafe_private_named: self.__unsafe_private_named,
955 _phantom: ::core::marker::PhantomData,
956 }
957 }
958}
959
960impl<'a, S> ScheduleActionBuilder<'a, S>
961where
962 S: schedule_action_state::State,
963 S::Subjects: schedule_action_state::IsSet,
964 S::Action: schedule_action_state::IsSet,
965 S::CreatedBy: schedule_action_state::IsSet,
966 S::Scheduling: schedule_action_state::IsSet,
967{
968 /// Build the final struct
969 pub fn build(self) -> ScheduleAction<'a> {
970 ScheduleAction {
971 action: self.__unsafe_private_named.0.unwrap(),
972 created_by: self.__unsafe_private_named.1.unwrap(),
973 mod_tool: self.__unsafe_private_named.2,
974 scheduling: self.__unsafe_private_named.3.unwrap(),
975 subjects: self.__unsafe_private_named.4.unwrap(),
976 extra_data: Default::default(),
977 }
978 }
979 /// Build the final struct with custom extra_data
980 pub fn build_with_data(
981 self,
982 extra_data: std::collections::BTreeMap<
983 jacquard_common::smol_str::SmolStr,
984 jacquard_common::types::value::Data<'a>,
985 >,
986 ) -> ScheduleAction<'a> {
987 ScheduleAction {
988 action: self.__unsafe_private_named.0.unwrap(),
989 created_by: self.__unsafe_private_named.1.unwrap(),
990 mod_tool: self.__unsafe_private_named.2,
991 scheduling: self.__unsafe_private_named.3.unwrap(),
992 subjects: self.__unsafe_private_named.4.unwrap(),
993 extra_data: Some(extra_data),
994 }
995 }
996}
997
998#[jacquard_derive::lexicon]
999#[derive(
1000 serde::Serialize,
1001 serde::Deserialize,
1002 Debug,
1003 Clone,
1004 PartialEq,
1005 Eq,
1006 jacquard_derive::IntoStatic
1007)]
1008#[serde(rename_all = "camelCase")]
1009pub struct ScheduleActionOutput<'a> {
1010 #[serde(flatten)]
1011 #[serde(borrow)]
1012 pub value: jacquard_common::types::value::Data<'a>,
1013}
1014
1015/// Response type for
1016///tools.ozone.moderation.scheduleAction
1017pub struct ScheduleActionResponse;
1018impl jacquard_common::xrpc::XrpcResp for ScheduleActionResponse {
1019 const NSID: &'static str = "tools.ozone.moderation.scheduleAction";
1020 const ENCODING: &'static str = "application/json";
1021 type Output<'de> = ScheduleActionOutput<'de>;
1022 type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
1023}
1024
1025impl<'a> jacquard_common::xrpc::XrpcRequest for ScheduleAction<'a> {
1026 const NSID: &'static str = "tools.ozone.moderation.scheduleAction";
1027 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
1028 "application/json",
1029 );
1030 type Response = ScheduleActionResponse;
1031}
1032
1033/// Endpoint type for
1034///tools.ozone.moderation.scheduleAction
1035pub struct ScheduleActionRequest;
1036impl jacquard_common::xrpc::XrpcEndpoint for ScheduleActionRequest {
1037 const PATH: &'static str = "/xrpc/tools.ozone.moderation.scheduleAction";
1038 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
1039 "application/json",
1040 );
1041 type Request<'de> = ScheduleAction<'de>;
1042 type Response = ScheduleActionResponse;
1043}
1044
1045#[jacquard_derive::lexicon]
1046#[derive(
1047 serde::Serialize,
1048 serde::Deserialize,
1049 Debug,
1050 Clone,
1051 PartialEq,
1052 Eq,
1053 jacquard_derive::IntoStatic
1054)]
1055#[serde(rename_all = "camelCase")]
1056pub struct ScheduledActionResults<'a> {
1057 #[serde(borrow)]
1058 pub failed: Vec<
1059 crate::tools_ozone::moderation::schedule_action::FailedScheduling<'a>,
1060 >,
1061 #[serde(borrow)]
1062 pub succeeded: Vec<jacquard_common::types::string::Did<'a>>,
1063}
1064
1065pub mod scheduled_action_results_state {
1066
1067 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
1068 #[allow(unused)]
1069 use ::core::marker::PhantomData;
1070 mod sealed {
1071 pub trait Sealed {}
1072 }
1073 /// State trait tracking which required fields have been set
1074 pub trait State: sealed::Sealed {
1075 type Succeeded;
1076 type Failed;
1077 }
1078 /// Empty state - all required fields are unset
1079 pub struct Empty(());
1080 impl sealed::Sealed for Empty {}
1081 impl State for Empty {
1082 type Succeeded = Unset;
1083 type Failed = Unset;
1084 }
1085 ///State transition - sets the `succeeded` field to Set
1086 pub struct SetSucceeded<S: State = Empty>(PhantomData<fn() -> S>);
1087 impl<S: State> sealed::Sealed for SetSucceeded<S> {}
1088 impl<S: State> State for SetSucceeded<S> {
1089 type Succeeded = Set<members::succeeded>;
1090 type Failed = S::Failed;
1091 }
1092 ///State transition - sets the `failed` field to Set
1093 pub struct SetFailed<S: State = Empty>(PhantomData<fn() -> S>);
1094 impl<S: State> sealed::Sealed for SetFailed<S> {}
1095 impl<S: State> State for SetFailed<S> {
1096 type Succeeded = S::Succeeded;
1097 type Failed = Set<members::failed>;
1098 }
1099 /// Marker types for field names
1100 #[allow(non_camel_case_types)]
1101 pub mod members {
1102 ///Marker type for the `succeeded` field
1103 pub struct succeeded(());
1104 ///Marker type for the `failed` field
1105 pub struct failed(());
1106 }
1107}
1108
1109/// Builder for constructing an instance of this type
1110pub struct ScheduledActionResultsBuilder<'a, S: scheduled_action_results_state::State> {
1111 _phantom_state: ::core::marker::PhantomData<fn() -> S>,
1112 __unsafe_private_named: (
1113 ::core::option::Option<
1114 Vec<crate::tools_ozone::moderation::schedule_action::FailedScheduling<'a>>,
1115 >,
1116 ::core::option::Option<Vec<jacquard_common::types::string::Did<'a>>>,
1117 ),
1118 _phantom: ::core::marker::PhantomData<&'a ()>,
1119}
1120
1121impl<'a> ScheduledActionResults<'a> {
1122 /// Create a new builder for this type
1123 pub fn new() -> ScheduledActionResultsBuilder<
1124 'a,
1125 scheduled_action_results_state::Empty,
1126 > {
1127 ScheduledActionResultsBuilder::new()
1128 }
1129}
1130
1131impl<'a> ScheduledActionResultsBuilder<'a, scheduled_action_results_state::Empty> {
1132 /// Create a new builder with all fields unset
1133 pub fn new() -> Self {
1134 ScheduledActionResultsBuilder {
1135 _phantom_state: ::core::marker::PhantomData,
1136 __unsafe_private_named: (None, None),
1137 _phantom: ::core::marker::PhantomData,
1138 }
1139 }
1140}
1141
1142impl<'a, S> ScheduledActionResultsBuilder<'a, S>
1143where
1144 S: scheduled_action_results_state::State,
1145 S::Failed: scheduled_action_results_state::IsUnset,
1146{
1147 /// Set the `failed` field (required)
1148 pub fn failed(
1149 mut self,
1150 value: impl Into<
1151 Vec<crate::tools_ozone::moderation::schedule_action::FailedScheduling<'a>>,
1152 >,
1153 ) -> ScheduledActionResultsBuilder<
1154 'a,
1155 scheduled_action_results_state::SetFailed<S>,
1156 > {
1157 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
1158 ScheduledActionResultsBuilder {
1159 _phantom_state: ::core::marker::PhantomData,
1160 __unsafe_private_named: self.__unsafe_private_named,
1161 _phantom: ::core::marker::PhantomData,
1162 }
1163 }
1164}
1165
1166impl<'a, S> ScheduledActionResultsBuilder<'a, S>
1167where
1168 S: scheduled_action_results_state::State,
1169 S::Succeeded: scheduled_action_results_state::IsUnset,
1170{
1171 /// Set the `succeeded` field (required)
1172 pub fn succeeded(
1173 mut self,
1174 value: impl Into<Vec<jacquard_common::types::string::Did<'a>>>,
1175 ) -> ScheduledActionResultsBuilder<
1176 'a,
1177 scheduled_action_results_state::SetSucceeded<S>,
1178 > {
1179 self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
1180 ScheduledActionResultsBuilder {
1181 _phantom_state: ::core::marker::PhantomData,
1182 __unsafe_private_named: self.__unsafe_private_named,
1183 _phantom: ::core::marker::PhantomData,
1184 }
1185 }
1186}
1187
1188impl<'a, S> ScheduledActionResultsBuilder<'a, S>
1189where
1190 S: scheduled_action_results_state::State,
1191 S::Succeeded: scheduled_action_results_state::IsSet,
1192 S::Failed: scheduled_action_results_state::IsSet,
1193{
1194 /// Build the final struct
1195 pub fn build(self) -> ScheduledActionResults<'a> {
1196 ScheduledActionResults {
1197 failed: self.__unsafe_private_named.0.unwrap(),
1198 succeeded: self.__unsafe_private_named.1.unwrap(),
1199 extra_data: Default::default(),
1200 }
1201 }
1202 /// Build the final struct with custom extra_data
1203 pub fn build_with_data(
1204 self,
1205 extra_data: std::collections::BTreeMap<
1206 jacquard_common::smol_str::SmolStr,
1207 jacquard_common::types::value::Data<'a>,
1208 >,
1209 ) -> ScheduledActionResults<'a> {
1210 ScheduledActionResults {
1211 failed: self.__unsafe_private_named.0.unwrap(),
1212 succeeded: self.__unsafe_private_named.1.unwrap(),
1213 extra_data: Some(extra_data),
1214 }
1215 }
1216}
1217
1218impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ScheduledActionResults<'a> {
1219 fn nsid() -> &'static str {
1220 "tools.ozone.moderation.scheduleAction"
1221 }
1222 fn def_name() -> &'static str {
1223 "scheduledActionResults"
1224 }
1225 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
1226 lexicon_doc_tools_ozone_moderation_scheduleAction()
1227 }
1228 fn validate(
1229 &self,
1230 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
1231 Ok(())
1232 }
1233}
1234
1235/// Configuration for when the action should be executed
1236#[jacquard_derive::lexicon]
1237#[derive(
1238 serde::Serialize,
1239 serde::Deserialize,
1240 Debug,
1241 Clone,
1242 PartialEq,
1243 Eq,
1244 jacquard_derive::IntoStatic,
1245 Default
1246)]
1247#[serde(rename_all = "camelCase")]
1248pub struct SchedulingConfig<'a> {
1249 /// Earliest time to execute the action (for randomized scheduling)
1250 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1251 pub execute_after: std::option::Option<jacquard_common::types::string::Datetime>,
1252 /// Exact time to execute the action
1253 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1254 pub execute_at: std::option::Option<jacquard_common::types::string::Datetime>,
1255 /// Latest time to execute the action (for randomized scheduling)
1256 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1257 pub execute_until: std::option::Option<jacquard_common::types::string::Datetime>,
1258}
1259
1260impl<'a> ::jacquard_lexicon::schema::LexiconSchema for SchedulingConfig<'a> {
1261 fn nsid() -> &'static str {
1262 "tools.ozone.moderation.scheduleAction"
1263 }
1264 fn def_name() -> &'static str {
1265 "schedulingConfig"
1266 }
1267 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
1268 lexicon_doc_tools_ozone_moderation_scheduleAction()
1269 }
1270 fn validate(
1271 &self,
1272 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
1273 Ok(())
1274 }
1275}
1276
1277/// Schedule a takedown action
1278#[jacquard_derive::lexicon]
1279#[derive(
1280 serde::Serialize,
1281 serde::Deserialize,
1282 Debug,
1283 Clone,
1284 PartialEq,
1285 Eq,
1286 jacquard_derive::IntoStatic,
1287 Default
1288)]
1289#[serde(rename_all = "camelCase")]
1290pub struct Takedown<'a> {
1291 /// If true, all other reports on content authored by this account will be resolved (acknowledged).
1292 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1293 pub acknowledge_account_subjects: std::option::Option<bool>,
1294 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1295 #[serde(borrow)]
1296 pub comment: std::option::Option<jacquard_common::CowStr<'a>>,
1297 /// Indicates how long the takedown should be in effect before automatically expiring.
1298 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1299 pub duration_in_hours: std::option::Option<i64>,
1300 /// Email content to be sent to the user upon takedown.
1301 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1302 #[serde(borrow)]
1303 pub email_content: std::option::Option<jacquard_common::CowStr<'a>>,
1304 /// Subject of the email to be sent to the user upon takedown.
1305 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1306 #[serde(borrow)]
1307 pub email_subject: std::option::Option<jacquard_common::CowStr<'a>>,
1308 /// Names/Keywords of the policies that drove the decision.
1309 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1310 #[serde(borrow)]
1311 pub policies: std::option::Option<Vec<jacquard_common::CowStr<'a>>>,
1312 /// Severity level of the violation (e.g., 'sev-0', 'sev-1', 'sev-2', etc.).
1313 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1314 #[serde(borrow)]
1315 pub severity_level: std::option::Option<jacquard_common::CowStr<'a>>,
1316 /// Number of strikes to assign to the user when takedown is applied.
1317 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1318 pub strike_count: std::option::Option<i64>,
1319 /// When the strike should expire. If not provided, the strike never expires.
1320 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1321 pub strike_expires_at: std::option::Option<jacquard_common::types::string::Datetime>,
1322}
1323
1324impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Takedown<'a> {
1325 fn nsid() -> &'static str {
1326 "tools.ozone.moderation.scheduleAction"
1327 }
1328 fn def_name() -> &'static str {
1329 "takedown"
1330 }
1331 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
1332 lexicon_doc_tools_ozone_moderation_scheduleAction()
1333 }
1334 fn validate(
1335 &self,
1336 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
1337 if let Some(ref value) = self.policies {
1338 #[allow(unused_comparisons)]
1339 if value.len() > 5usize {
1340 return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
1341 path: ::jacquard_lexicon::validation::ValidationPath::from_field(
1342 "policies",
1343 ),
1344 max: 5usize,
1345 actual: value.len(),
1346 });
1347 }
1348 }
1349 Ok(())
1350 }
1351}