jacquard_api/pub_leaflet/
publication.rs

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