atproto blogging
1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: tools.ozone.setting.defs
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8pub mod list_options;
9pub mod remove_options;
10pub mod upsert_option;
11
12#[jacquard_derive::lexicon]
13#[derive(
14 serde::Serialize,
15 serde::Deserialize,
16 Debug,
17 Clone,
18 PartialEq,
19 Eq,
20 jacquard_derive::IntoStatic
21)]
22#[serde(rename_all = "camelCase")]
23pub struct DefsOption<'a> {
24 #[serde(skip_serializing_if = "std::option::Option::is_none")]
25 pub created_at: std::option::Option<jacquard_common::types::string::Datetime>,
26 #[serde(borrow)]
27 pub created_by: jacquard_common::types::string::Did<'a>,
28 #[serde(skip_serializing_if = "std::option::Option::is_none")]
29 #[serde(borrow)]
30 pub description: std::option::Option<jacquard_common::CowStr<'a>>,
31 #[serde(borrow)]
32 pub did: jacquard_common::types::string::Did<'a>,
33 #[serde(borrow)]
34 pub key: jacquard_common::types::string::Nsid<'a>,
35 #[serde(borrow)]
36 pub last_updated_by: jacquard_common::types::string::Did<'a>,
37 #[serde(skip_serializing_if = "std::option::Option::is_none")]
38 #[serde(borrow)]
39 pub manager_role: std::option::Option<DefsOptionManagerRole<'a>>,
40 #[serde(borrow)]
41 pub scope: DefsOptionScope<'a>,
42 #[serde(skip_serializing_if = "std::option::Option::is_none")]
43 pub updated_at: std::option::Option<jacquard_common::types::string::Datetime>,
44 #[serde(borrow)]
45 pub value: jacquard_common::types::value::Data<'a>,
46}
47
48pub mod defs_option_state {
49
50 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
51 #[allow(unused)]
52 use ::core::marker::PhantomData;
53 mod sealed {
54 pub trait Sealed {}
55 }
56 /// State trait tracking which required fields have been set
57 pub trait State: sealed::Sealed {
58 type CreatedBy;
59 type Scope;
60 type Key;
61 type Value;
62 type Did;
63 type LastUpdatedBy;
64 }
65 /// Empty state - all required fields are unset
66 pub struct Empty(());
67 impl sealed::Sealed for Empty {}
68 impl State for Empty {
69 type CreatedBy = Unset;
70 type Scope = Unset;
71 type Key = Unset;
72 type Value = Unset;
73 type Did = Unset;
74 type LastUpdatedBy = Unset;
75 }
76 ///State transition - sets the `created_by` field to Set
77 pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>);
78 impl<S: State> sealed::Sealed for SetCreatedBy<S> {}
79 impl<S: State> State for SetCreatedBy<S> {
80 type CreatedBy = Set<members::created_by>;
81 type Scope = S::Scope;
82 type Key = S::Key;
83 type Value = S::Value;
84 type Did = S::Did;
85 type LastUpdatedBy = S::LastUpdatedBy;
86 }
87 ///State transition - sets the `scope` field to Set
88 pub struct SetScope<S: State = Empty>(PhantomData<fn() -> S>);
89 impl<S: State> sealed::Sealed for SetScope<S> {}
90 impl<S: State> State for SetScope<S> {
91 type CreatedBy = S::CreatedBy;
92 type Scope = Set<members::scope>;
93 type Key = S::Key;
94 type Value = S::Value;
95 type Did = S::Did;
96 type LastUpdatedBy = S::LastUpdatedBy;
97 }
98 ///State transition - sets the `key` field to Set
99 pub struct SetKey<S: State = Empty>(PhantomData<fn() -> S>);
100 impl<S: State> sealed::Sealed for SetKey<S> {}
101 impl<S: State> State for SetKey<S> {
102 type CreatedBy = S::CreatedBy;
103 type Scope = S::Scope;
104 type Key = Set<members::key>;
105 type Value = S::Value;
106 type Did = S::Did;
107 type LastUpdatedBy = S::LastUpdatedBy;
108 }
109 ///State transition - sets the `value` field to Set
110 pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>);
111 impl<S: State> sealed::Sealed for SetValue<S> {}
112 impl<S: State> State for SetValue<S> {
113 type CreatedBy = S::CreatedBy;
114 type Scope = S::Scope;
115 type Key = S::Key;
116 type Value = Set<members::value>;
117 type Did = S::Did;
118 type LastUpdatedBy = S::LastUpdatedBy;
119 }
120 ///State transition - sets the `did` field to Set
121 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>);
122 impl<S: State> sealed::Sealed for SetDid<S> {}
123 impl<S: State> State for SetDid<S> {
124 type CreatedBy = S::CreatedBy;
125 type Scope = S::Scope;
126 type Key = S::Key;
127 type Value = S::Value;
128 type Did = Set<members::did>;
129 type LastUpdatedBy = S::LastUpdatedBy;
130 }
131 ///State transition - sets the `last_updated_by` field to Set
132 pub struct SetLastUpdatedBy<S: State = Empty>(PhantomData<fn() -> S>);
133 impl<S: State> sealed::Sealed for SetLastUpdatedBy<S> {}
134 impl<S: State> State for SetLastUpdatedBy<S> {
135 type CreatedBy = S::CreatedBy;
136 type Scope = S::Scope;
137 type Key = S::Key;
138 type Value = S::Value;
139 type Did = S::Did;
140 type LastUpdatedBy = Set<members::last_updated_by>;
141 }
142 /// Marker types for field names
143 #[allow(non_camel_case_types)]
144 pub mod members {
145 ///Marker type for the `created_by` field
146 pub struct created_by(());
147 ///Marker type for the `scope` field
148 pub struct scope(());
149 ///Marker type for the `key` field
150 pub struct key(());
151 ///Marker type for the `value` field
152 pub struct value(());
153 ///Marker type for the `did` field
154 pub struct did(());
155 ///Marker type for the `last_updated_by` field
156 pub struct last_updated_by(());
157 }
158}
159
160/// Builder for constructing an instance of this type
161pub struct DefsOptionBuilder<'a, S: defs_option_state::State> {
162 _phantom_state: ::core::marker::PhantomData<fn() -> S>,
163 __unsafe_private_named: (
164 ::core::option::Option<jacquard_common::types::string::Datetime>,
165 ::core::option::Option<jacquard_common::types::string::Did<'a>>,
166 ::core::option::Option<jacquard_common::CowStr<'a>>,
167 ::core::option::Option<jacquard_common::types::string::Did<'a>>,
168 ::core::option::Option<jacquard_common::types::string::Nsid<'a>>,
169 ::core::option::Option<jacquard_common::types::string::Did<'a>>,
170 ::core::option::Option<DefsOptionManagerRole<'a>>,
171 ::core::option::Option<DefsOptionScope<'a>>,
172 ::core::option::Option<jacquard_common::types::string::Datetime>,
173 ::core::option::Option<jacquard_common::types::value::Data<'a>>,
174 ),
175 _phantom: ::core::marker::PhantomData<&'a ()>,
176}
177
178impl<'a> DefsOption<'a> {
179 /// Create a new builder for this type
180 pub fn new() -> DefsOptionBuilder<'a, defs_option_state::Empty> {
181 DefsOptionBuilder::new()
182 }
183}
184
185impl<'a> DefsOptionBuilder<'a, defs_option_state::Empty> {
186 /// Create a new builder with all fields unset
187 pub fn new() -> Self {
188 DefsOptionBuilder {
189 _phantom_state: ::core::marker::PhantomData,
190 __unsafe_private_named: (
191 None,
192 None,
193 None,
194 None,
195 None,
196 None,
197 None,
198 None,
199 None,
200 None,
201 ),
202 _phantom: ::core::marker::PhantomData,
203 }
204 }
205}
206
207impl<'a, S: defs_option_state::State> DefsOptionBuilder<'a, S> {
208 /// Set the `createdAt` field (optional)
209 pub fn created_at(
210 mut self,
211 value: impl Into<Option<jacquard_common::types::string::Datetime>>,
212 ) -> Self {
213 self.__unsafe_private_named.0 = value.into();
214 self
215 }
216 /// Set the `createdAt` field to an Option value (optional)
217 pub fn maybe_created_at(
218 mut self,
219 value: Option<jacquard_common::types::string::Datetime>,
220 ) -> Self {
221 self.__unsafe_private_named.0 = value;
222 self
223 }
224}
225
226impl<'a, S> DefsOptionBuilder<'a, S>
227where
228 S: defs_option_state::State,
229 S::CreatedBy: defs_option_state::IsUnset,
230{
231 /// Set the `createdBy` field (required)
232 pub fn created_by(
233 mut self,
234 value: impl Into<jacquard_common::types::string::Did<'a>>,
235 ) -> DefsOptionBuilder<'a, defs_option_state::SetCreatedBy<S>> {
236 self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
237 DefsOptionBuilder {
238 _phantom_state: ::core::marker::PhantomData,
239 __unsafe_private_named: self.__unsafe_private_named,
240 _phantom: ::core::marker::PhantomData,
241 }
242 }
243}
244
245impl<'a, S: defs_option_state::State> DefsOptionBuilder<'a, S> {
246 /// Set the `description` field (optional)
247 pub fn description(
248 mut self,
249 value: impl Into<Option<jacquard_common::CowStr<'a>>>,
250 ) -> Self {
251 self.__unsafe_private_named.2 = value.into();
252 self
253 }
254 /// Set the `description` field to an Option value (optional)
255 pub fn maybe_description(
256 mut self,
257 value: Option<jacquard_common::CowStr<'a>>,
258 ) -> Self {
259 self.__unsafe_private_named.2 = value;
260 self
261 }
262}
263
264impl<'a, S> DefsOptionBuilder<'a, S>
265where
266 S: defs_option_state::State,
267 S::Did: defs_option_state::IsUnset,
268{
269 /// Set the `did` field (required)
270 pub fn did(
271 mut self,
272 value: impl Into<jacquard_common::types::string::Did<'a>>,
273 ) -> DefsOptionBuilder<'a, defs_option_state::SetDid<S>> {
274 self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into());
275 DefsOptionBuilder {
276 _phantom_state: ::core::marker::PhantomData,
277 __unsafe_private_named: self.__unsafe_private_named,
278 _phantom: ::core::marker::PhantomData,
279 }
280 }
281}
282
283impl<'a, S> DefsOptionBuilder<'a, S>
284where
285 S: defs_option_state::State,
286 S::Key: defs_option_state::IsUnset,
287{
288 /// Set the `key` field (required)
289 pub fn key(
290 mut self,
291 value: impl Into<jacquard_common::types::string::Nsid<'a>>,
292 ) -> DefsOptionBuilder<'a, defs_option_state::SetKey<S>> {
293 self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into());
294 DefsOptionBuilder {
295 _phantom_state: ::core::marker::PhantomData,
296 __unsafe_private_named: self.__unsafe_private_named,
297 _phantom: ::core::marker::PhantomData,
298 }
299 }
300}
301
302impl<'a, S> DefsOptionBuilder<'a, S>
303where
304 S: defs_option_state::State,
305 S::LastUpdatedBy: defs_option_state::IsUnset,
306{
307 /// Set the `lastUpdatedBy` field (required)
308 pub fn last_updated_by(
309 mut self,
310 value: impl Into<jacquard_common::types::string::Did<'a>>,
311 ) -> DefsOptionBuilder<'a, defs_option_state::SetLastUpdatedBy<S>> {
312 self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into());
313 DefsOptionBuilder {
314 _phantom_state: ::core::marker::PhantomData,
315 __unsafe_private_named: self.__unsafe_private_named,
316 _phantom: ::core::marker::PhantomData,
317 }
318 }
319}
320
321impl<'a, S: defs_option_state::State> DefsOptionBuilder<'a, S> {
322 /// Set the `managerRole` field (optional)
323 pub fn manager_role(
324 mut self,
325 value: impl Into<Option<DefsOptionManagerRole<'a>>>,
326 ) -> Self {
327 self.__unsafe_private_named.6 = value.into();
328 self
329 }
330 /// Set the `managerRole` field to an Option value (optional)
331 pub fn maybe_manager_role(
332 mut self,
333 value: Option<DefsOptionManagerRole<'a>>,
334 ) -> Self {
335 self.__unsafe_private_named.6 = value;
336 self
337 }
338}
339
340impl<'a, S> DefsOptionBuilder<'a, S>
341where
342 S: defs_option_state::State,
343 S::Scope: defs_option_state::IsUnset,
344{
345 /// Set the `scope` field (required)
346 pub fn scope(
347 mut self,
348 value: impl Into<DefsOptionScope<'a>>,
349 ) -> DefsOptionBuilder<'a, defs_option_state::SetScope<S>> {
350 self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into());
351 DefsOptionBuilder {
352 _phantom_state: ::core::marker::PhantomData,
353 __unsafe_private_named: self.__unsafe_private_named,
354 _phantom: ::core::marker::PhantomData,
355 }
356 }
357}
358
359impl<'a, S: defs_option_state::State> DefsOptionBuilder<'a, S> {
360 /// Set the `updatedAt` field (optional)
361 pub fn updated_at(
362 mut self,
363 value: impl Into<Option<jacquard_common::types::string::Datetime>>,
364 ) -> Self {
365 self.__unsafe_private_named.8 = value.into();
366 self
367 }
368 /// Set the `updatedAt` field to an Option value (optional)
369 pub fn maybe_updated_at(
370 mut self,
371 value: Option<jacquard_common::types::string::Datetime>,
372 ) -> Self {
373 self.__unsafe_private_named.8 = value;
374 self
375 }
376}
377
378impl<'a, S> DefsOptionBuilder<'a, S>
379where
380 S: defs_option_state::State,
381 S::Value: defs_option_state::IsUnset,
382{
383 /// Set the `value` field (required)
384 pub fn value(
385 mut self,
386 value: impl Into<jacquard_common::types::value::Data<'a>>,
387 ) -> DefsOptionBuilder<'a, defs_option_state::SetValue<S>> {
388 self.__unsafe_private_named.9 = ::core::option::Option::Some(value.into());
389 DefsOptionBuilder {
390 _phantom_state: ::core::marker::PhantomData,
391 __unsafe_private_named: self.__unsafe_private_named,
392 _phantom: ::core::marker::PhantomData,
393 }
394 }
395}
396
397impl<'a, S> DefsOptionBuilder<'a, S>
398where
399 S: defs_option_state::State,
400 S::CreatedBy: defs_option_state::IsSet,
401 S::Scope: defs_option_state::IsSet,
402 S::Key: defs_option_state::IsSet,
403 S::Value: defs_option_state::IsSet,
404 S::Did: defs_option_state::IsSet,
405 S::LastUpdatedBy: defs_option_state::IsSet,
406{
407 /// Build the final struct
408 pub fn build(self) -> DefsOption<'a> {
409 DefsOption {
410 created_at: self.__unsafe_private_named.0,
411 created_by: self.__unsafe_private_named.1.unwrap(),
412 description: self.__unsafe_private_named.2,
413 did: self.__unsafe_private_named.3.unwrap(),
414 key: self.__unsafe_private_named.4.unwrap(),
415 last_updated_by: self.__unsafe_private_named.5.unwrap(),
416 manager_role: self.__unsafe_private_named.6,
417 scope: self.__unsafe_private_named.7.unwrap(),
418 updated_at: self.__unsafe_private_named.8,
419 value: self.__unsafe_private_named.9.unwrap(),
420 extra_data: Default::default(),
421 }
422 }
423 /// Build the final struct with custom extra_data
424 pub fn build_with_data(
425 self,
426 extra_data: std::collections::BTreeMap<
427 jacquard_common::smol_str::SmolStr,
428 jacquard_common::types::value::Data<'a>,
429 >,
430 ) -> DefsOption<'a> {
431 DefsOption {
432 created_at: self.__unsafe_private_named.0,
433 created_by: self.__unsafe_private_named.1.unwrap(),
434 description: self.__unsafe_private_named.2,
435 did: self.__unsafe_private_named.3.unwrap(),
436 key: self.__unsafe_private_named.4.unwrap(),
437 last_updated_by: self.__unsafe_private_named.5.unwrap(),
438 manager_role: self.__unsafe_private_named.6,
439 scope: self.__unsafe_private_named.7.unwrap(),
440 updated_at: self.__unsafe_private_named.8,
441 value: self.__unsafe_private_named.9.unwrap(),
442 extra_data: Some(extra_data),
443 }
444 }
445}
446
447#[derive(Debug, Clone, PartialEq, Eq, Hash)]
448pub enum DefsOptionManagerRole<'a> {
449 RoleModerator,
450 RoleTriage,
451 RoleAdmin,
452 RoleVerifier,
453 Other(jacquard_common::CowStr<'a>),
454}
455
456impl<'a> DefsOptionManagerRole<'a> {
457 pub fn as_str(&self) -> &str {
458 match self {
459 Self::RoleModerator => "tools.ozone.team.defs#roleModerator",
460 Self::RoleTriage => "tools.ozone.team.defs#roleTriage",
461 Self::RoleAdmin => "tools.ozone.team.defs#roleAdmin",
462 Self::RoleVerifier => "tools.ozone.team.defs#roleVerifier",
463 Self::Other(s) => s.as_ref(),
464 }
465 }
466}
467
468impl<'a> From<&'a str> for DefsOptionManagerRole<'a> {
469 fn from(s: &'a str) -> Self {
470 match s {
471 "tools.ozone.team.defs#roleModerator" => Self::RoleModerator,
472 "tools.ozone.team.defs#roleTriage" => Self::RoleTriage,
473 "tools.ozone.team.defs#roleAdmin" => Self::RoleAdmin,
474 "tools.ozone.team.defs#roleVerifier" => Self::RoleVerifier,
475 _ => Self::Other(jacquard_common::CowStr::from(s)),
476 }
477 }
478}
479
480impl<'a> From<String> for DefsOptionManagerRole<'a> {
481 fn from(s: String) -> Self {
482 match s.as_str() {
483 "tools.ozone.team.defs#roleModerator" => Self::RoleModerator,
484 "tools.ozone.team.defs#roleTriage" => Self::RoleTriage,
485 "tools.ozone.team.defs#roleAdmin" => Self::RoleAdmin,
486 "tools.ozone.team.defs#roleVerifier" => Self::RoleVerifier,
487 _ => Self::Other(jacquard_common::CowStr::from(s)),
488 }
489 }
490}
491
492impl<'a> core::fmt::Display for DefsOptionManagerRole<'a> {
493 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
494 write!(f, "{}", self.as_str())
495 }
496}
497
498impl<'a> AsRef<str> for DefsOptionManagerRole<'a> {
499 fn as_ref(&self) -> &str {
500 self.as_str()
501 }
502}
503
504impl<'a> serde::Serialize for DefsOptionManagerRole<'a> {
505 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
506 where
507 S: serde::Serializer,
508 {
509 serializer.serialize_str(self.as_str())
510 }
511}
512
513impl<'de, 'a> serde::Deserialize<'de> for DefsOptionManagerRole<'a>
514where
515 'de: 'a,
516{
517 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
518 where
519 D: serde::Deserializer<'de>,
520 {
521 let s = <&'de str>::deserialize(deserializer)?;
522 Ok(Self::from(s))
523 }
524}
525
526impl<'a> Default for DefsOptionManagerRole<'a> {
527 fn default() -> Self {
528 Self::Other(Default::default())
529 }
530}
531
532impl jacquard_common::IntoStatic for DefsOptionManagerRole<'_> {
533 type Output = DefsOptionManagerRole<'static>;
534 fn into_static(self) -> Self::Output {
535 match self {
536 DefsOptionManagerRole::RoleModerator => DefsOptionManagerRole::RoleModerator,
537 DefsOptionManagerRole::RoleTriage => DefsOptionManagerRole::RoleTriage,
538 DefsOptionManagerRole::RoleAdmin => DefsOptionManagerRole::RoleAdmin,
539 DefsOptionManagerRole::RoleVerifier => DefsOptionManagerRole::RoleVerifier,
540 DefsOptionManagerRole::Other(v) => {
541 DefsOptionManagerRole::Other(v.into_static())
542 }
543 }
544 }
545}
546
547#[derive(Debug, Clone, PartialEq, Eq, Hash)]
548pub enum DefsOptionScope<'a> {
549 Instance,
550 Personal,
551 Other(jacquard_common::CowStr<'a>),
552}
553
554impl<'a> DefsOptionScope<'a> {
555 pub fn as_str(&self) -> &str {
556 match self {
557 Self::Instance => "instance",
558 Self::Personal => "personal",
559 Self::Other(s) => s.as_ref(),
560 }
561 }
562}
563
564impl<'a> From<&'a str> for DefsOptionScope<'a> {
565 fn from(s: &'a str) -> Self {
566 match s {
567 "instance" => Self::Instance,
568 "personal" => Self::Personal,
569 _ => Self::Other(jacquard_common::CowStr::from(s)),
570 }
571 }
572}
573
574impl<'a> From<String> for DefsOptionScope<'a> {
575 fn from(s: String) -> Self {
576 match s.as_str() {
577 "instance" => Self::Instance,
578 "personal" => Self::Personal,
579 _ => Self::Other(jacquard_common::CowStr::from(s)),
580 }
581 }
582}
583
584impl<'a> core::fmt::Display for DefsOptionScope<'a> {
585 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
586 write!(f, "{}", self.as_str())
587 }
588}
589
590impl<'a> AsRef<str> for DefsOptionScope<'a> {
591 fn as_ref(&self) -> &str {
592 self.as_str()
593 }
594}
595
596impl<'a> serde::Serialize for DefsOptionScope<'a> {
597 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
598 where
599 S: serde::Serializer,
600 {
601 serializer.serialize_str(self.as_str())
602 }
603}
604
605impl<'de, 'a> serde::Deserialize<'de> for DefsOptionScope<'a>
606where
607 'de: 'a,
608{
609 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
610 where
611 D: serde::Deserializer<'de>,
612 {
613 let s = <&'de str>::deserialize(deserializer)?;
614 Ok(Self::from(s))
615 }
616}
617
618impl<'a> Default for DefsOptionScope<'a> {
619 fn default() -> Self {
620 Self::Other(Default::default())
621 }
622}
623
624impl jacquard_common::IntoStatic for DefsOptionScope<'_> {
625 type Output = DefsOptionScope<'static>;
626 fn into_static(self) -> Self::Output {
627 match self {
628 DefsOptionScope::Instance => DefsOptionScope::Instance,
629 DefsOptionScope::Personal => DefsOptionScope::Personal,
630 DefsOptionScope::Other(v) => DefsOptionScope::Other(v.into_static()),
631 }
632 }
633}
634
635fn lexicon_doc_tools_ozone_setting_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc<
636 'static,
637> {
638 ::jacquard_lexicon::lexicon::LexiconDoc {
639 lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1,
640 id: ::jacquard_common::CowStr::new_static("tools.ozone.setting.defs"),
641 revision: None,
642 description: None,
643 defs: {
644 let mut map = ::alloc::collections::BTreeMap::new();
645 map.insert(
646 ::jacquard_common::smol_str::SmolStr::new_static("option"),
647 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
648 description: None,
649 required: Some(
650 vec![
651 ::jacquard_common::smol_str::SmolStr::new_static("key"),
652 ::jacquard_common::smol_str::SmolStr::new_static("value"),
653 ::jacquard_common::smol_str::SmolStr::new_static("did"),
654 ::jacquard_common::smol_str::SmolStr::new_static("scope"),
655 ::jacquard_common::smol_str::SmolStr::new_static("createdBy"),
656 ::jacquard_common::smol_str::SmolStr::new_static("lastUpdatedBy")
657 ],
658 ),
659 nullable: None,
660 properties: {
661 #[allow(unused_mut)]
662 let mut map = ::alloc::collections::BTreeMap::new();
663 map.insert(
664 ::jacquard_common::smol_str::SmolStr::new_static(
665 "createdAt",
666 ),
667 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
668 description: None,
669 format: Some(
670 ::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
671 ),
672 default: None,
673 min_length: None,
674 max_length: None,
675 min_graphemes: None,
676 max_graphemes: None,
677 r#enum: None,
678 r#const: None,
679 known_values: None,
680 }),
681 );
682 map.insert(
683 ::jacquard_common::smol_str::SmolStr::new_static(
684 "createdBy",
685 ),
686 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
687 description: None,
688 format: Some(
689 ::jacquard_lexicon::lexicon::LexStringFormat::Did,
690 ),
691 default: None,
692 min_length: None,
693 max_length: None,
694 min_graphemes: None,
695 max_graphemes: None,
696 r#enum: None,
697 r#const: None,
698 known_values: None,
699 }),
700 );
701 map.insert(
702 ::jacquard_common::smol_str::SmolStr::new_static(
703 "description",
704 ),
705 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
706 description: None,
707 format: None,
708 default: None,
709 min_length: None,
710 max_length: Some(10240usize),
711 min_graphemes: None,
712 max_graphemes: Some(1024usize),
713 r#enum: None,
714 r#const: None,
715 known_values: None,
716 }),
717 );
718 map.insert(
719 ::jacquard_common::smol_str::SmolStr::new_static("did"),
720 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
721 description: None,
722 format: Some(
723 ::jacquard_lexicon::lexicon::LexStringFormat::Did,
724 ),
725 default: None,
726 min_length: None,
727 max_length: None,
728 min_graphemes: None,
729 max_graphemes: None,
730 r#enum: None,
731 r#const: None,
732 known_values: None,
733 }),
734 );
735 map.insert(
736 ::jacquard_common::smol_str::SmolStr::new_static("key"),
737 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
738 description: None,
739 format: Some(
740 ::jacquard_lexicon::lexicon::LexStringFormat::Nsid,
741 ),
742 default: None,
743 min_length: None,
744 max_length: None,
745 min_graphemes: None,
746 max_graphemes: None,
747 r#enum: None,
748 r#const: None,
749 known_values: None,
750 }),
751 );
752 map.insert(
753 ::jacquard_common::smol_str::SmolStr::new_static(
754 "lastUpdatedBy",
755 ),
756 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
757 description: None,
758 format: Some(
759 ::jacquard_lexicon::lexicon::LexStringFormat::Did,
760 ),
761 default: None,
762 min_length: None,
763 max_length: None,
764 min_graphemes: None,
765 max_graphemes: None,
766 r#enum: None,
767 r#const: None,
768 known_values: None,
769 }),
770 );
771 map.insert(
772 ::jacquard_common::smol_str::SmolStr::new_static(
773 "managerRole",
774 ),
775 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
776 description: None,
777 format: None,
778 default: None,
779 min_length: None,
780 max_length: None,
781 min_graphemes: None,
782 max_graphemes: None,
783 r#enum: None,
784 r#const: None,
785 known_values: None,
786 }),
787 );
788 map.insert(
789 ::jacquard_common::smol_str::SmolStr::new_static("scope"),
790 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
791 description: None,
792 format: None,
793 default: None,
794 min_length: None,
795 max_length: None,
796 min_graphemes: None,
797 max_graphemes: None,
798 r#enum: None,
799 r#const: None,
800 known_values: None,
801 }),
802 );
803 map.insert(
804 ::jacquard_common::smol_str::SmolStr::new_static(
805 "updatedAt",
806 ),
807 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
808 description: None,
809 format: Some(
810 ::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
811 ),
812 default: None,
813 min_length: None,
814 max_length: None,
815 min_graphemes: None,
816 max_graphemes: None,
817 r#enum: None,
818 r#const: None,
819 known_values: None,
820 }),
821 );
822 map.insert(
823 ::jacquard_common::smol_str::SmolStr::new_static("value"),
824 ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown {
825 description: None,
826 }),
827 );
828 map
829 },
830 }),
831 );
832 map
833 },
834 }
835}
836
837impl<'a> ::jacquard_lexicon::schema::LexiconSchema for DefsOption<'a> {
838 fn nsid() -> &'static str {
839 "tools.ozone.setting.defs"
840 }
841 fn def_name() -> &'static str {
842 "option"
843 }
844 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
845 lexicon_doc_tools_ozone_setting_defs()
846 }
847 fn validate(
848 &self,
849 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
850 if let Some(ref value) = self.description {
851 #[allow(unused_comparisons)]
852 if <str>::len(value.as_ref()) > 10240usize {
853 return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
854 path: ::jacquard_lexicon::validation::ValidationPath::from_field(
855 "description",
856 ),
857 max: 10240usize,
858 actual: <str>::len(value.as_ref()),
859 });
860 }
861 }
862 if let Some(ref value) = self.description {
863 {
864 let count = ::unicode_segmentation::UnicodeSegmentation::graphemes(
865 value.as_ref(),
866 true,
867 )
868 .count();
869 if count > 1024usize {
870 return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes {
871 path: ::jacquard_lexicon::validation::ValidationPath::from_field(
872 "description",
873 ),
874 max: 1024usize,
875 actual: count,
876 });
877 }
878 }
879 }
880 Ok(())
881 }
882}