atproto blogging
1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: pub.leaflet.publication
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8/// Record declaring a publication
9#[jacquard_derive::lexicon]
10#[derive(
11 serde::Serialize,
12 serde::Deserialize,
13 Debug,
14 Clone,
15 PartialEq,
16 Eq,
17 jacquard_derive::IntoStatic
18)]
19#[serde(rename_all = "camelCase")]
20pub struct Publication<'a> {
21 #[serde(skip_serializing_if = "std::option::Option::is_none")]
22 #[serde(borrow)]
23 pub base_path: std::option::Option<jacquard_common::CowStr<'a>>,
24 #[serde(skip_serializing_if = "std::option::Option::is_none")]
25 #[serde(borrow)]
26 pub description: std::option::Option<jacquard_common::CowStr<'a>>,
27 #[serde(skip_serializing_if = "std::option::Option::is_none")]
28 #[serde(borrow)]
29 pub icon: std::option::Option<jacquard_common::types::blob::BlobRef<'a>>,
30 #[serde(borrow)]
31 pub name: jacquard_common::CowStr<'a>,
32 #[serde(skip_serializing_if = "std::option::Option::is_none")]
33 #[serde(borrow)]
34 pub preferences: std::option::Option<
35 crate::pub_leaflet::publication::Preferences<'a>,
36 >,
37 #[serde(skip_serializing_if = "std::option::Option::is_none")]
38 #[serde(borrow)]
39 pub theme: std::option::Option<crate::pub_leaflet::publication::Theme<'a>>,
40}
41
42pub mod publication_state {
43
44 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
45 #[allow(unused)]
46 use ::core::marker::PhantomData;
47 mod sealed {
48 pub trait Sealed {}
49 }
50 /// State trait tracking which required fields have been set
51 pub trait State: sealed::Sealed {
52 type Name;
53 }
54 /// Empty state - all required fields are unset
55 pub struct Empty(());
56 impl sealed::Sealed for Empty {}
57 impl State for Empty {
58 type Name = Unset;
59 }
60 ///State transition - sets the `name` field to Set
61 pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>);
62 impl<S: State> sealed::Sealed for SetName<S> {}
63 impl<S: State> State for SetName<S> {
64 type Name = Set<members::name>;
65 }
66 /// Marker types for field names
67 #[allow(non_camel_case_types)]
68 pub mod members {
69 ///Marker type for the `name` field
70 pub struct name(());
71 }
72}
73
74/// Builder for constructing an instance of this type
75pub struct PublicationBuilder<'a, S: publication_state::State> {
76 _phantom_state: ::core::marker::PhantomData<fn() -> S>,
77 __unsafe_private_named: (
78 ::core::option::Option<jacquard_common::CowStr<'a>>,
79 ::core::option::Option<jacquard_common::CowStr<'a>>,
80 ::core::option::Option<jacquard_common::types::blob::BlobRef<'a>>,
81 ::core::option::Option<jacquard_common::CowStr<'a>>,
82 ::core::option::Option<crate::pub_leaflet::publication::Preferences<'a>>,
83 ::core::option::Option<crate::pub_leaflet::publication::Theme<'a>>,
84 ),
85 _phantom: ::core::marker::PhantomData<&'a ()>,
86}
87
88impl<'a> Publication<'a> {
89 /// Create a new builder for this type
90 pub fn new() -> PublicationBuilder<'a, publication_state::Empty> {
91 PublicationBuilder::new()
92 }
93}
94
95impl<'a> PublicationBuilder<'a, publication_state::Empty> {
96 /// Create a new builder with all fields unset
97 pub fn new() -> Self {
98 PublicationBuilder {
99 _phantom_state: ::core::marker::PhantomData,
100 __unsafe_private_named: (None, None, None, None, None, None),
101 _phantom: ::core::marker::PhantomData,
102 }
103 }
104}
105
106impl<'a, S: publication_state::State> PublicationBuilder<'a, S> {
107 /// Set the `base_path` field (optional)
108 pub fn base_path(
109 mut self,
110 value: impl Into<Option<jacquard_common::CowStr<'a>>>,
111 ) -> Self {
112 self.__unsafe_private_named.0 = value.into();
113 self
114 }
115 /// Set the `base_path` field to an Option value (optional)
116 pub fn maybe_base_path(
117 mut self,
118 value: Option<jacquard_common::CowStr<'a>>,
119 ) -> Self {
120 self.__unsafe_private_named.0 = value;
121 self
122 }
123}
124
125impl<'a, S: publication_state::State> PublicationBuilder<'a, S> {
126 /// Set the `description` field (optional)
127 pub fn description(
128 mut self,
129 value: impl Into<Option<jacquard_common::CowStr<'a>>>,
130 ) -> Self {
131 self.__unsafe_private_named.1 = value.into();
132 self
133 }
134 /// Set the `description` field to an Option value (optional)
135 pub fn maybe_description(
136 mut self,
137 value: Option<jacquard_common::CowStr<'a>>,
138 ) -> Self {
139 self.__unsafe_private_named.1 = value;
140 self
141 }
142}
143
144impl<'a, S: publication_state::State> PublicationBuilder<'a, S> {
145 /// Set the `icon` field (optional)
146 pub fn icon(
147 mut self,
148 value: impl Into<Option<jacquard_common::types::blob::BlobRef<'a>>>,
149 ) -> Self {
150 self.__unsafe_private_named.2 = value.into();
151 self
152 }
153 /// Set the `icon` field to an Option value (optional)
154 pub fn maybe_icon(
155 mut self,
156 value: Option<jacquard_common::types::blob::BlobRef<'a>>,
157 ) -> Self {
158 self.__unsafe_private_named.2 = value;
159 self
160 }
161}
162
163impl<'a, S> PublicationBuilder<'a, S>
164where
165 S: publication_state::State,
166 S::Name: publication_state::IsUnset,
167{
168 /// Set the `name` field (required)
169 pub fn name(
170 mut self,
171 value: impl Into<jacquard_common::CowStr<'a>>,
172 ) -> PublicationBuilder<'a, publication_state::SetName<S>> {
173 self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into());
174 PublicationBuilder {
175 _phantom_state: ::core::marker::PhantomData,
176 __unsafe_private_named: self.__unsafe_private_named,
177 _phantom: ::core::marker::PhantomData,
178 }
179 }
180}
181
182impl<'a, S: publication_state::State> PublicationBuilder<'a, S> {
183 /// Set the `preferences` field (optional)
184 pub fn preferences(
185 mut self,
186 value: impl Into<Option<crate::pub_leaflet::publication::Preferences<'a>>>,
187 ) -> Self {
188 self.__unsafe_private_named.4 = value.into();
189 self
190 }
191 /// Set the `preferences` field to an Option value (optional)
192 pub fn maybe_preferences(
193 mut self,
194 value: Option<crate::pub_leaflet::publication::Preferences<'a>>,
195 ) -> Self {
196 self.__unsafe_private_named.4 = value;
197 self
198 }
199}
200
201impl<'a, S: publication_state::State> PublicationBuilder<'a, S> {
202 /// Set the `theme` field (optional)
203 pub fn theme(
204 mut self,
205 value: impl Into<Option<crate::pub_leaflet::publication::Theme<'a>>>,
206 ) -> Self {
207 self.__unsafe_private_named.5 = value.into();
208 self
209 }
210 /// Set the `theme` field to an Option value (optional)
211 pub fn maybe_theme(
212 mut self,
213 value: Option<crate::pub_leaflet::publication::Theme<'a>>,
214 ) -> Self {
215 self.__unsafe_private_named.5 = value;
216 self
217 }
218}
219
220impl<'a, S> PublicationBuilder<'a, S>
221where
222 S: publication_state::State,
223 S::Name: publication_state::IsSet,
224{
225 /// Build the final struct
226 pub fn build(self) -> Publication<'a> {
227 Publication {
228 base_path: self.__unsafe_private_named.0,
229 description: self.__unsafe_private_named.1,
230 icon: self.__unsafe_private_named.2,
231 name: self.__unsafe_private_named.3.unwrap(),
232 preferences: self.__unsafe_private_named.4,
233 theme: self.__unsafe_private_named.5,
234 extra_data: Default::default(),
235 }
236 }
237 /// Build the final struct with custom extra_data
238 pub fn build_with_data(
239 self,
240 extra_data: std::collections::BTreeMap<
241 jacquard_common::smol_str::SmolStr,
242 jacquard_common::types::value::Data<'a>,
243 >,
244 ) -> Publication<'a> {
245 Publication {
246 base_path: self.__unsafe_private_named.0,
247 description: self.__unsafe_private_named.1,
248 icon: self.__unsafe_private_named.2,
249 name: self.__unsafe_private_named.3.unwrap(),
250 preferences: self.__unsafe_private_named.4,
251 theme: self.__unsafe_private_named.5,
252 extra_data: Some(extra_data),
253 }
254 }
255}
256
257impl<'a> Publication<'a> {
258 pub fn uri(
259 uri: impl Into<jacquard_common::CowStr<'a>>,
260 ) -> Result<
261 jacquard_common::types::uri::RecordUri<'a, PublicationRecord>,
262 jacquard_common::types::uri::UriError,
263 > {
264 jacquard_common::types::uri::RecordUri::try_from_uri(
265 jacquard_common::types::string::AtUri::new_cow(uri.into())?,
266 )
267 }
268}
269
270/// Typed wrapper for GetRecord response with this collection's record type.
271#[derive(
272 serde::Serialize,
273 serde::Deserialize,
274 Debug,
275 Clone,
276 PartialEq,
277 Eq,
278 jacquard_derive::IntoStatic
279)]
280#[serde(rename_all = "camelCase")]
281pub struct PublicationGetRecordOutput<'a> {
282 #[serde(skip_serializing_if = "std::option::Option::is_none")]
283 #[serde(borrow)]
284 pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>,
285 #[serde(borrow)]
286 pub uri: jacquard_common::types::string::AtUri<'a>,
287 #[serde(borrow)]
288 pub value: Publication<'a>,
289}
290
291impl From<PublicationGetRecordOutput<'_>> for Publication<'_> {
292 fn from(output: PublicationGetRecordOutput<'_>) -> Self {
293 use jacquard_common::IntoStatic;
294 output.value.into_static()
295 }
296}
297
298impl jacquard_common::types::collection::Collection for Publication<'_> {
299 const NSID: &'static str = "pub.leaflet.publication";
300 type Record = PublicationRecord;
301}
302
303/// Marker type for deserializing records from this collection.
304#[derive(Debug, serde::Serialize, serde::Deserialize)]
305pub struct PublicationRecord;
306impl jacquard_common::xrpc::XrpcResp for PublicationRecord {
307 const NSID: &'static str = "pub.leaflet.publication";
308 const ENCODING: &'static str = "application/json";
309 type Output<'de> = PublicationGetRecordOutput<'de>;
310 type Err<'de> = jacquard_common::types::collection::RecordError<'de>;
311}
312
313impl jacquard_common::types::collection::Collection for PublicationRecord {
314 const NSID: &'static str = "pub.leaflet.publication";
315 type Record = PublicationRecord;
316}
317
318impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Publication<'a> {
319 fn nsid() -> &'static str {
320 "pub.leaflet.publication"
321 }
322 fn def_name() -> &'static str {
323 "main"
324 }
325 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
326 lexicon_doc_pub_leaflet_publication()
327 }
328 fn validate(
329 &self,
330 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
331 if let Some(ref value) = self.description {
332 #[allow(unused_comparisons)]
333 if <str>::len(value.as_ref()) > 2000usize {
334 return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
335 path: ::jacquard_lexicon::validation::ValidationPath::from_field(
336 "description",
337 ),
338 max: 2000usize,
339 actual: <str>::len(value.as_ref()),
340 });
341 }
342 }
343 {
344 let value = &self.name;
345 #[allow(unused_comparisons)]
346 if <str>::len(value.as_ref()) > 2000usize {
347 return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
348 path: ::jacquard_lexicon::validation::ValidationPath::from_field(
349 "name",
350 ),
351 max: 2000usize,
352 actual: <str>::len(value.as_ref()),
353 });
354 }
355 }
356 Ok(())
357 }
358}
359
360fn lexicon_doc_pub_leaflet_publication() -> ::jacquard_lexicon::lexicon::LexiconDoc<
361 'static,
362> {
363 ::jacquard_lexicon::lexicon::LexiconDoc {
364 lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1,
365 id: ::jacquard_common::CowStr::new_static("pub.leaflet.publication"),
366 revision: None,
367 description: None,
368 defs: {
369 let mut map = ::alloc::collections::BTreeMap::new();
370 map.insert(
371 ::jacquard_common::smol_str::SmolStr::new_static("main"),
372 ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord {
373 description: Some(
374 ::jacquard_common::CowStr::new_static(
375 "Record declaring a publication",
376 ),
377 ),
378 key: Some(::jacquard_common::CowStr::new_static("tid")),
379 record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject {
380 description: None,
381 required: Some(
382 vec![
383 ::jacquard_common::smol_str::SmolStr::new_static("name")
384 ],
385 ),
386 nullable: None,
387 properties: {
388 #[allow(unused_mut)]
389 let mut map = ::alloc::collections::BTreeMap::new();
390 map.insert(
391 ::jacquard_common::smol_str::SmolStr::new_static(
392 "base_path",
393 ),
394 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
395 description: None,
396 format: None,
397 default: None,
398 min_length: None,
399 max_length: None,
400 min_graphemes: None,
401 max_graphemes: None,
402 r#enum: None,
403 r#const: None,
404 known_values: None,
405 }),
406 );
407 map.insert(
408 ::jacquard_common::smol_str::SmolStr::new_static(
409 "description",
410 ),
411 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
412 description: None,
413 format: None,
414 default: None,
415 min_length: None,
416 max_length: Some(2000usize),
417 min_graphemes: None,
418 max_graphemes: None,
419 r#enum: None,
420 r#const: None,
421 known_values: None,
422 }),
423 );
424 map.insert(
425 ::jacquard_common::smol_str::SmolStr::new_static("icon"),
426 ::jacquard_lexicon::lexicon::LexObjectProperty::Blob(::jacquard_lexicon::lexicon::LexBlob {
427 description: None,
428 accept: None,
429 max_size: None,
430 }),
431 );
432 map.insert(
433 ::jacquard_common::smol_str::SmolStr::new_static("name"),
434 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
435 description: None,
436 format: None,
437 default: None,
438 min_length: None,
439 max_length: Some(2000usize),
440 min_graphemes: None,
441 max_graphemes: None,
442 r#enum: None,
443 r#const: None,
444 known_values: None,
445 }),
446 );
447 map.insert(
448 ::jacquard_common::smol_str::SmolStr::new_static(
449 "preferences",
450 ),
451 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
452 description: None,
453 r#ref: ::jacquard_common::CowStr::new_static("#preferences"),
454 }),
455 );
456 map.insert(
457 ::jacquard_common::smol_str::SmolStr::new_static("theme"),
458 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
459 description: None,
460 r#ref: ::jacquard_common::CowStr::new_static("#theme"),
461 }),
462 );
463 map
464 },
465 }),
466 }),
467 );
468 map.insert(
469 ::jacquard_common::smol_str::SmolStr::new_static("preferences"),
470 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
471 description: None,
472 required: None,
473 nullable: None,
474 properties: {
475 #[allow(unused_mut)]
476 let mut map = ::alloc::collections::BTreeMap::new();
477 map.insert(
478 ::jacquard_common::smol_str::SmolStr::new_static(
479 "showComments",
480 ),
481 ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean {
482 description: None,
483 default: None,
484 r#const: None,
485 }),
486 );
487 map.insert(
488 ::jacquard_common::smol_str::SmolStr::new_static(
489 "showInDiscover",
490 ),
491 ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean {
492 description: None,
493 default: None,
494 r#const: None,
495 }),
496 );
497 map
498 },
499 }),
500 );
501 map.insert(
502 ::jacquard_common::smol_str::SmolStr::new_static("theme"),
503 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
504 description: None,
505 required: None,
506 nullable: None,
507 properties: {
508 #[allow(unused_mut)]
509 let mut map = ::alloc::collections::BTreeMap::new();
510 map.insert(
511 ::jacquard_common::smol_str::SmolStr::new_static(
512 "accentBackground",
513 ),
514 ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion {
515 description: None,
516 refs: vec![
517 ::jacquard_common::CowStr::new_static("pub.leaflet.theme.color#rgba"),
518 ::jacquard_common::CowStr::new_static("pub.leaflet.theme.color#rgb")
519 ],
520 closed: None,
521 }),
522 );
523 map.insert(
524 ::jacquard_common::smol_str::SmolStr::new_static(
525 "accentText",
526 ),
527 ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion {
528 description: None,
529 refs: vec![
530 ::jacquard_common::CowStr::new_static("pub.leaflet.theme.color#rgba"),
531 ::jacquard_common::CowStr::new_static("pub.leaflet.theme.color#rgb")
532 ],
533 closed: None,
534 }),
535 );
536 map.insert(
537 ::jacquard_common::smol_str::SmolStr::new_static(
538 "backgroundColor",
539 ),
540 ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion {
541 description: None,
542 refs: vec![
543 ::jacquard_common::CowStr::new_static("pub.leaflet.theme.color#rgba"),
544 ::jacquard_common::CowStr::new_static("pub.leaflet.theme.color#rgb")
545 ],
546 closed: None,
547 }),
548 );
549 map.insert(
550 ::jacquard_common::smol_str::SmolStr::new_static(
551 "backgroundImage",
552 ),
553 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
554 description: None,
555 r#ref: ::jacquard_common::CowStr::new_static(
556 "pub.leaflet.theme.backgroundImage",
557 ),
558 }),
559 );
560 map.insert(
561 ::jacquard_common::smol_str::SmolStr::new_static(
562 "pageBackground",
563 ),
564 ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion {
565 description: None,
566 refs: vec![
567 ::jacquard_common::CowStr::new_static("pub.leaflet.theme.color#rgba"),
568 ::jacquard_common::CowStr::new_static("pub.leaflet.theme.color#rgb")
569 ],
570 closed: None,
571 }),
572 );
573 map.insert(
574 ::jacquard_common::smol_str::SmolStr::new_static("primary"),
575 ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion {
576 description: None,
577 refs: vec![
578 ::jacquard_common::CowStr::new_static("pub.leaflet.theme.color#rgba"),
579 ::jacquard_common::CowStr::new_static("pub.leaflet.theme.color#rgb")
580 ],
581 closed: None,
582 }),
583 );
584 map.insert(
585 ::jacquard_common::smol_str::SmolStr::new_static(
586 "showPageBackground",
587 ),
588 ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean {
589 description: None,
590 default: None,
591 r#const: None,
592 }),
593 );
594 map
595 },
596 }),
597 );
598 map
599 },
600 }
601}
602
603#[jacquard_derive::lexicon]
604#[derive(
605 serde::Serialize,
606 serde::Deserialize,
607 Debug,
608 Clone,
609 PartialEq,
610 Eq,
611 jacquard_derive::IntoStatic,
612 Default
613)]
614#[serde(rename_all = "camelCase")]
615pub struct Preferences<'a> {
616 #[serde(skip_serializing_if = "std::option::Option::is_none")]
617 pub show_comments: std::option::Option<bool>,
618 #[serde(skip_serializing_if = "std::option::Option::is_none")]
619 pub show_in_discover: std::option::Option<bool>,
620}
621
622impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Preferences<'a> {
623 fn nsid() -> &'static str {
624 "pub.leaflet.publication"
625 }
626 fn def_name() -> &'static str {
627 "preferences"
628 }
629 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
630 lexicon_doc_pub_leaflet_publication()
631 }
632 fn validate(
633 &self,
634 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
635 Ok(())
636 }
637}
638
639#[jacquard_derive::lexicon]
640#[derive(
641 serde::Serialize,
642 serde::Deserialize,
643 Debug,
644 Clone,
645 PartialEq,
646 Eq,
647 jacquard_derive::IntoStatic,
648 Default
649)]
650#[serde(rename_all = "camelCase")]
651pub struct Theme<'a> {
652 #[serde(skip_serializing_if = "std::option::Option::is_none")]
653 #[serde(borrow)]
654 pub accent_background: std::option::Option<ThemeAccentBackground<'a>>,
655 #[serde(skip_serializing_if = "std::option::Option::is_none")]
656 #[serde(borrow)]
657 pub accent_text: std::option::Option<ThemeAccentText<'a>>,
658 #[serde(skip_serializing_if = "std::option::Option::is_none")]
659 #[serde(borrow)]
660 pub background_color: std::option::Option<ThemeBackgroundColor<'a>>,
661 #[serde(skip_serializing_if = "std::option::Option::is_none")]
662 #[serde(borrow)]
663 pub background_image: std::option::Option<
664 crate::pub_leaflet::theme::background_image::BackgroundImage<'a>,
665 >,
666 #[serde(skip_serializing_if = "std::option::Option::is_none")]
667 #[serde(borrow)]
668 pub page_background: std::option::Option<ThemePageBackground<'a>>,
669 #[serde(skip_serializing_if = "std::option::Option::is_none")]
670 #[serde(borrow)]
671 pub primary: std::option::Option<ThemePrimary<'a>>,
672 #[serde(skip_serializing_if = "std::option::Option::is_none")]
673 pub show_page_background: std::option::Option<bool>,
674}
675
676#[jacquard_derive::open_union]
677#[derive(
678 serde::Serialize,
679 serde::Deserialize,
680 Debug,
681 Clone,
682 PartialEq,
683 Eq,
684 jacquard_derive::IntoStatic
685)]
686#[serde(tag = "$type")]
687#[serde(bound(deserialize = "'de: 'a"))]
688pub enum ThemeAccentBackground<'a> {
689 #[serde(rename = "pub.leaflet.theme.color#rgba")]
690 ColorRgba(Box<crate::pub_leaflet::theme::color::Rgba<'a>>),
691 #[serde(rename = "pub.leaflet.theme.color#rgb")]
692 ColorRgb(Box<crate::pub_leaflet::theme::color::Rgb<'a>>),
693}
694
695#[jacquard_derive::open_union]
696#[derive(
697 serde::Serialize,
698 serde::Deserialize,
699 Debug,
700 Clone,
701 PartialEq,
702 Eq,
703 jacquard_derive::IntoStatic
704)]
705#[serde(tag = "$type")]
706#[serde(bound(deserialize = "'de: 'a"))]
707pub enum ThemeAccentText<'a> {
708 #[serde(rename = "pub.leaflet.theme.color#rgba")]
709 ColorRgba(Box<crate::pub_leaflet::theme::color::Rgba<'a>>),
710 #[serde(rename = "pub.leaflet.theme.color#rgb")]
711 ColorRgb(Box<crate::pub_leaflet::theme::color::Rgb<'a>>),
712}
713
714#[jacquard_derive::open_union]
715#[derive(
716 serde::Serialize,
717 serde::Deserialize,
718 Debug,
719 Clone,
720 PartialEq,
721 Eq,
722 jacquard_derive::IntoStatic
723)]
724#[serde(tag = "$type")]
725#[serde(bound(deserialize = "'de: 'a"))]
726pub enum ThemeBackgroundColor<'a> {
727 #[serde(rename = "pub.leaflet.theme.color#rgba")]
728 ColorRgba(Box<crate::pub_leaflet::theme::color::Rgba<'a>>),
729 #[serde(rename = "pub.leaflet.theme.color#rgb")]
730 ColorRgb(Box<crate::pub_leaflet::theme::color::Rgb<'a>>),
731}
732
733#[jacquard_derive::open_union]
734#[derive(
735 serde::Serialize,
736 serde::Deserialize,
737 Debug,
738 Clone,
739 PartialEq,
740 Eq,
741 jacquard_derive::IntoStatic
742)]
743#[serde(tag = "$type")]
744#[serde(bound(deserialize = "'de: 'a"))]
745pub enum ThemePageBackground<'a> {
746 #[serde(rename = "pub.leaflet.theme.color#rgba")]
747 ColorRgba(Box<crate::pub_leaflet::theme::color::Rgba<'a>>),
748 #[serde(rename = "pub.leaflet.theme.color#rgb")]
749 ColorRgb(Box<crate::pub_leaflet::theme::color::Rgb<'a>>),
750}
751
752#[jacquard_derive::open_union]
753#[derive(
754 serde::Serialize,
755 serde::Deserialize,
756 Debug,
757 Clone,
758 PartialEq,
759 Eq,
760 jacquard_derive::IntoStatic
761)]
762#[serde(tag = "$type")]
763#[serde(bound(deserialize = "'de: 'a"))]
764pub enum ThemePrimary<'a> {
765 #[serde(rename = "pub.leaflet.theme.color#rgba")]
766 ColorRgba(Box<crate::pub_leaflet::theme::color::Rgba<'a>>),
767 #[serde(rename = "pub.leaflet.theme.color#rgb")]
768 ColorRgb(Box<crate::pub_leaflet::theme::color::Rgb<'a>>),
769}
770
771impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Theme<'a> {
772 fn nsid() -> &'static str {
773 "pub.leaflet.publication"
774 }
775 fn def_name() -> &'static str {
776 "theme"
777 }
778 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
779 lexicon_doc_pub_leaflet_publication()
780 }
781 fn validate(
782 &self,
783 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
784 Ok(())
785 }
786}