jacquard_api/pub_leaflet/pages/
linear_document.rs

1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: pub.leaflet.pages.linearDocument
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 Block<'a> {
20    #[serde(skip_serializing_if = "std::option::Option::is_none")]
21    #[serde(borrow)]
22    pub alignment: Option<jacquard_common::CowStr<'a>>,
23    #[serde(borrow)]
24    pub block: BlockBlock<'a>,
25}
26
27pub mod block_state {
28
29    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
30    #[allow(unused)]
31    use ::core::marker::PhantomData;
32    mod sealed {
33        pub trait Sealed {}
34    }
35    /// State trait tracking which required fields have been set
36    pub trait State: sealed::Sealed {
37        type Block;
38    }
39    /// Empty state - all required fields are unset
40    pub struct Empty(());
41    impl sealed::Sealed for Empty {}
42    impl State for Empty {
43        type Block = Unset;
44    }
45    ///State transition - sets the `block` field to Set
46    pub struct SetBlock<S: State = Empty>(PhantomData<fn() -> S>);
47    impl<S: State> sealed::Sealed for SetBlock<S> {}
48    impl<S: State> State for SetBlock<S> {
49        type Block = Set<members::block>;
50    }
51    /// Marker types for field names
52    #[allow(non_camel_case_types)]
53    pub mod members {
54        ///Marker type for the `block` field
55        pub struct block(());
56    }
57}
58
59/// Builder for constructing an instance of this type
60pub struct BlockBuilder<'a, S: block_state::State> {
61    _phantom_state: ::core::marker::PhantomData<fn() -> S>,
62    __unsafe_private_named: (
63        ::core::option::Option<jacquard_common::CowStr<'a>>,
64        ::core::option::Option<BlockBlock<'a>>,
65    ),
66    _phantom: ::core::marker::PhantomData<&'a ()>,
67}
68
69impl<'a> Block<'a> {
70    /// Create a new builder for this type
71    pub fn new() -> BlockBuilder<'a, block_state::Empty> {
72        BlockBuilder::new()
73    }
74}
75
76impl<'a> BlockBuilder<'a, block_state::Empty> {
77    /// Create a new builder with all fields unset
78    pub fn new() -> Self {
79        BlockBuilder {
80            _phantom_state: ::core::marker::PhantomData,
81            __unsafe_private_named: (None, None),
82            _phantom: ::core::marker::PhantomData,
83        }
84    }
85}
86
87impl<'a, S: block_state::State> BlockBuilder<'a, S> {
88    /// Set the `alignment` field (optional)
89    pub fn alignment(
90        mut self,
91        value: impl Into<Option<jacquard_common::CowStr<'a>>>,
92    ) -> Self {
93        self.__unsafe_private_named.0 = value.into();
94        self
95    }
96    /// Set the `alignment` field to an Option value (optional)
97    pub fn maybe_alignment(
98        mut self,
99        value: Option<jacquard_common::CowStr<'a>>,
100    ) -> Self {
101        self.__unsafe_private_named.0 = value;
102        self
103    }
104}
105
106impl<'a, S> BlockBuilder<'a, S>
107where
108    S: block_state::State,
109    S::Block: block_state::IsUnset,
110{
111    /// Set the `block` field (required)
112    pub fn block(
113        mut self,
114        value: impl Into<BlockBlock<'a>>,
115    ) -> BlockBuilder<'a, block_state::SetBlock<S>> {
116        self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
117        BlockBuilder {
118            _phantom_state: ::core::marker::PhantomData,
119            __unsafe_private_named: self.__unsafe_private_named,
120            _phantom: ::core::marker::PhantomData,
121        }
122    }
123}
124
125impl<'a, S> BlockBuilder<'a, S>
126where
127    S: block_state::State,
128    S::Block: block_state::IsSet,
129{
130    /// Build the final struct
131    pub fn build(self) -> Block<'a> {
132        Block {
133            alignment: self.__unsafe_private_named.0,
134            block: self.__unsafe_private_named.1.unwrap(),
135            extra_data: Default::default(),
136        }
137    }
138    /// Build the final struct with custom extra_data
139    pub fn build_with_data(
140        self,
141        extra_data: std::collections::BTreeMap<
142            jacquard_common::smol_str::SmolStr,
143            jacquard_common::types::value::Data<'a>,
144        >,
145    ) -> Block<'a> {
146        Block {
147            alignment: self.__unsafe_private_named.0,
148            block: self.__unsafe_private_named.1.unwrap(),
149            extra_data: Some(extra_data),
150        }
151    }
152}
153
154#[jacquard_derive::open_union]
155#[derive(
156    serde::Serialize,
157    serde::Deserialize,
158    Debug,
159    Clone,
160    PartialEq,
161    Eq,
162    jacquard_derive::IntoStatic
163)]
164#[serde(tag = "$type")]
165#[serde(bound(deserialize = "'de: 'a"))]
166pub enum BlockBlock<'a> {
167    #[serde(rename = "pub.leaflet.blocks.iframe")]
168    Iframe(Box<crate::pub_leaflet::blocks::iframe::Iframe<'a>>),
169    #[serde(rename = "pub.leaflet.blocks.text")]
170    Text(Box<crate::pub_leaflet::blocks::text::Text<'a>>),
171    #[serde(rename = "pub.leaflet.blocks.blockquote")]
172    Blockquote(Box<crate::pub_leaflet::blocks::blockquote::Blockquote<'a>>),
173    #[serde(rename = "pub.leaflet.blocks.header")]
174    Header(Box<crate::pub_leaflet::blocks::header::Header<'a>>),
175    #[serde(rename = "pub.leaflet.blocks.image")]
176    Image(Box<crate::pub_leaflet::blocks::image::Image<'a>>),
177    #[serde(rename = "pub.leaflet.blocks.unorderedList")]
178    UnorderedList(Box<crate::pub_leaflet::blocks::unordered_list::UnorderedList<'a>>),
179    #[serde(rename = "pub.leaflet.blocks.website")]
180    Website(Box<crate::pub_leaflet::blocks::website::Website<'a>>),
181    #[serde(rename = "pub.leaflet.blocks.math")]
182    Math(Box<crate::pub_leaflet::blocks::math::Math<'a>>),
183    #[serde(rename = "pub.leaflet.blocks.code")]
184    Code(Box<crate::pub_leaflet::blocks::code::Code<'a>>),
185    #[serde(rename = "pub.leaflet.blocks.horizontalRule")]
186    HorizontalRule(Box<crate::pub_leaflet::blocks::horizontal_rule::HorizontalRule<'a>>),
187    #[serde(rename = "pub.leaflet.blocks.bskyPost")]
188    BskyPost(Box<crate::pub_leaflet::blocks::bsky_post::BskyPost<'a>>),
189    #[serde(rename = "pub.leaflet.blocks.page")]
190    Page(Box<crate::pub_leaflet::blocks::page::Page<'a>>),
191    #[serde(rename = "pub.leaflet.blocks.poll")]
192    Poll(Box<crate::pub_leaflet::blocks::poll::Poll<'a>>),
193    #[serde(rename = "pub.leaflet.blocks.button")]
194    Button(Box<crate::pub_leaflet::blocks::button::Button<'a>>),
195}
196
197fn lexicon_doc_pub_leaflet_pages_linearDocument() -> ::jacquard_lexicon::lexicon::LexiconDoc<
198    'static,
199> {
200    ::jacquard_lexicon::lexicon::LexiconDoc {
201        lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1,
202        id: ::jacquard_common::CowStr::new_static("pub.leaflet.pages.linearDocument"),
203        revision: None,
204        description: None,
205        defs: {
206            let mut map = ::std::collections::BTreeMap::new();
207            map.insert(
208                ::jacquard_common::smol_str::SmolStr::new_static("block"),
209                ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
210                    description: None,
211                    required: Some(
212                        vec![::jacquard_common::smol_str::SmolStr::new_static("block")],
213                    ),
214                    nullable: None,
215                    properties: {
216                        #[allow(unused_mut)]
217                        let mut map = ::std::collections::BTreeMap::new();
218                        map.insert(
219                            ::jacquard_common::smol_str::SmolStr::new_static(
220                                "alignment",
221                            ),
222                            ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
223                                description: None,
224                                format: None,
225                                default: None,
226                                min_length: None,
227                                max_length: None,
228                                min_graphemes: None,
229                                max_graphemes: None,
230                                r#enum: None,
231                                r#const: None,
232                                known_values: None,
233                            }),
234                        );
235                        map.insert(
236                            ::jacquard_common::smol_str::SmolStr::new_static("block"),
237                            ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion {
238                                description: None,
239                                refs: vec![
240                                    ::jacquard_common::CowStr::new_static("pub.leaflet.blocks.iframe"),
241                                    ::jacquard_common::CowStr::new_static("pub.leaflet.blocks.text"),
242                                    ::jacquard_common::CowStr::new_static("pub.leaflet.blocks.blockquote"),
243                                    ::jacquard_common::CowStr::new_static("pub.leaflet.blocks.header"),
244                                    ::jacquard_common::CowStr::new_static("pub.leaflet.blocks.image"),
245                                    ::jacquard_common::CowStr::new_static("pub.leaflet.blocks.unorderedList"),
246                                    ::jacquard_common::CowStr::new_static("pub.leaflet.blocks.website"),
247                                    ::jacquard_common::CowStr::new_static("pub.leaflet.blocks.math"),
248                                    ::jacquard_common::CowStr::new_static("pub.leaflet.blocks.code"),
249                                    ::jacquard_common::CowStr::new_static("pub.leaflet.blocks.horizontalRule"),
250                                    ::jacquard_common::CowStr::new_static("pub.leaflet.blocks.bskyPost"),
251                                    ::jacquard_common::CowStr::new_static("pub.leaflet.blocks.page"),
252                                    ::jacquard_common::CowStr::new_static("pub.leaflet.blocks.poll"),
253                                    ::jacquard_common::CowStr::new_static("pub.leaflet.blocks.button")
254                                ],
255                                closed: None,
256                            }),
257                        );
258                        map
259                    },
260                }),
261            );
262            map.insert(
263                ::jacquard_common::smol_str::SmolStr::new_static("main"),
264                ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
265                    description: None,
266                    required: Some(
267                        vec![::jacquard_common::smol_str::SmolStr::new_static("blocks")],
268                    ),
269                    nullable: None,
270                    properties: {
271                        #[allow(unused_mut)]
272                        let mut map = ::std::collections::BTreeMap::new();
273                        map.insert(
274                            ::jacquard_common::smol_str::SmolStr::new_static("blocks"),
275                            ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
276                                description: None,
277                                items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef {
278                                    description: None,
279                                    r#ref: ::jacquard_common::CowStr::new_static("#block"),
280                                }),
281                                min_length: None,
282                                max_length: None,
283                            }),
284                        );
285                        map.insert(
286                            ::jacquard_common::smol_str::SmolStr::new_static("id"),
287                            ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
288                                description: None,
289                                format: None,
290                                default: None,
291                                min_length: None,
292                                max_length: None,
293                                min_graphemes: None,
294                                max_graphemes: None,
295                                r#enum: None,
296                                r#const: None,
297                                known_values: None,
298                            }),
299                        );
300                        map
301                    },
302                }),
303            );
304            map.insert(
305                ::jacquard_common::smol_str::SmolStr::new_static("position"),
306                ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
307                    description: None,
308                    required: Some(
309                        vec![
310                            ::jacquard_common::smol_str::SmolStr::new_static("block"),
311                            ::jacquard_common::smol_str::SmolStr::new_static("offset")
312                        ],
313                    ),
314                    nullable: None,
315                    properties: {
316                        #[allow(unused_mut)]
317                        let mut map = ::std::collections::BTreeMap::new();
318                        map.insert(
319                            ::jacquard_common::smol_str::SmolStr::new_static("block"),
320                            ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
321                                description: None,
322                                items: ::jacquard_lexicon::lexicon::LexArrayItem::Integer(::jacquard_lexicon::lexicon::LexInteger {
323                                    description: None,
324                                    default: None,
325                                    minimum: None,
326                                    maximum: None,
327                                    r#enum: None,
328                                    r#const: None,
329                                }),
330                                min_length: None,
331                                max_length: None,
332                            }),
333                        );
334                        map.insert(
335                            ::jacquard_common::smol_str::SmolStr::new_static("offset"),
336                            ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
337                                description: None,
338                                default: None,
339                                minimum: None,
340                                maximum: None,
341                                r#enum: None,
342                                r#const: None,
343                            }),
344                        );
345                        map
346                    },
347                }),
348            );
349            map.insert(
350                ::jacquard_common::smol_str::SmolStr::new_static("quote"),
351                ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
352                    description: None,
353                    required: Some(
354                        vec![
355                            ::jacquard_common::smol_str::SmolStr::new_static("start"),
356                            ::jacquard_common::smol_str::SmolStr::new_static("end")
357                        ],
358                    ),
359                    nullable: None,
360                    properties: {
361                        #[allow(unused_mut)]
362                        let mut map = ::std::collections::BTreeMap::new();
363                        map.insert(
364                            ::jacquard_common::smol_str::SmolStr::new_static("end"),
365                            ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
366                                description: None,
367                                r#ref: ::jacquard_common::CowStr::new_static("#position"),
368                            }),
369                        );
370                        map.insert(
371                            ::jacquard_common::smol_str::SmolStr::new_static("start"),
372                            ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
373                                description: None,
374                                r#ref: ::jacquard_common::CowStr::new_static("#position"),
375                            }),
376                        );
377                        map
378                    },
379                }),
380            );
381            map.insert(
382                ::jacquard_common::smol_str::SmolStr::new_static("textAlignCenter"),
383                ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken {
384                    description: None,
385                }),
386            );
387            map.insert(
388                ::jacquard_common::smol_str::SmolStr::new_static("textAlignJustify"),
389                ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken {
390                    description: None,
391                }),
392            );
393            map.insert(
394                ::jacquard_common::smol_str::SmolStr::new_static("textAlignLeft"),
395                ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken {
396                    description: None,
397                }),
398            );
399            map.insert(
400                ::jacquard_common::smol_str::SmolStr::new_static("textAlignRight"),
401                ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken {
402                    description: None,
403                }),
404            );
405            map
406        },
407    }
408}
409
410impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Block<'a> {
411    fn nsid() -> &'static str {
412        "pub.leaflet.pages.linearDocument"
413    }
414    fn def_name() -> &'static str {
415        "block"
416    }
417    fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
418        lexicon_doc_pub_leaflet_pages_linearDocument()
419    }
420    fn validate(
421        &self,
422    ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
423        Ok(())
424    }
425}
426
427#[jacquard_derive::lexicon]
428#[derive(
429    serde::Serialize,
430    serde::Deserialize,
431    Debug,
432    Clone,
433    PartialEq,
434    Eq,
435    jacquard_derive::IntoStatic
436)]
437#[serde(rename_all = "camelCase")]
438pub struct LinearDocument<'a> {
439    #[serde(borrow)]
440    pub blocks: Vec<crate::pub_leaflet::pages::linear_document::Block<'a>>,
441    #[serde(skip_serializing_if = "std::option::Option::is_none")]
442    #[serde(borrow)]
443    pub id: Option<jacquard_common::CowStr<'a>>,
444}
445
446pub mod linear_document_state {
447
448    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
449    #[allow(unused)]
450    use ::core::marker::PhantomData;
451    mod sealed {
452        pub trait Sealed {}
453    }
454    /// State trait tracking which required fields have been set
455    pub trait State: sealed::Sealed {
456        type Blocks;
457    }
458    /// Empty state - all required fields are unset
459    pub struct Empty(());
460    impl sealed::Sealed for Empty {}
461    impl State for Empty {
462        type Blocks = Unset;
463    }
464    ///State transition - sets the `blocks` field to Set
465    pub struct SetBlocks<S: State = Empty>(PhantomData<fn() -> S>);
466    impl<S: State> sealed::Sealed for SetBlocks<S> {}
467    impl<S: State> State for SetBlocks<S> {
468        type Blocks = Set<members::blocks>;
469    }
470    /// Marker types for field names
471    #[allow(non_camel_case_types)]
472    pub mod members {
473        ///Marker type for the `blocks` field
474        pub struct blocks(());
475    }
476}
477
478/// Builder for constructing an instance of this type
479pub struct LinearDocumentBuilder<'a, S: linear_document_state::State> {
480    _phantom_state: ::core::marker::PhantomData<fn() -> S>,
481    __unsafe_private_named: (
482        ::core::option::Option<
483            Vec<crate::pub_leaflet::pages::linear_document::Block<'a>>,
484        >,
485        ::core::option::Option<jacquard_common::CowStr<'a>>,
486    ),
487    _phantom: ::core::marker::PhantomData<&'a ()>,
488}
489
490impl<'a> LinearDocument<'a> {
491    /// Create a new builder for this type
492    pub fn new() -> LinearDocumentBuilder<'a, linear_document_state::Empty> {
493        LinearDocumentBuilder::new()
494    }
495}
496
497impl<'a> LinearDocumentBuilder<'a, linear_document_state::Empty> {
498    /// Create a new builder with all fields unset
499    pub fn new() -> Self {
500        LinearDocumentBuilder {
501            _phantom_state: ::core::marker::PhantomData,
502            __unsafe_private_named: (None, None),
503            _phantom: ::core::marker::PhantomData,
504        }
505    }
506}
507
508impl<'a, S> LinearDocumentBuilder<'a, S>
509where
510    S: linear_document_state::State,
511    S::Blocks: linear_document_state::IsUnset,
512{
513    /// Set the `blocks` field (required)
514    pub fn blocks(
515        mut self,
516        value: impl Into<Vec<crate::pub_leaflet::pages::linear_document::Block<'a>>>,
517    ) -> LinearDocumentBuilder<'a, linear_document_state::SetBlocks<S>> {
518        self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
519        LinearDocumentBuilder {
520            _phantom_state: ::core::marker::PhantomData,
521            __unsafe_private_named: self.__unsafe_private_named,
522            _phantom: ::core::marker::PhantomData,
523        }
524    }
525}
526
527impl<'a, S: linear_document_state::State> LinearDocumentBuilder<'a, S> {
528    /// Set the `id` field (optional)
529    pub fn id(mut self, value: impl Into<Option<jacquard_common::CowStr<'a>>>) -> Self {
530        self.__unsafe_private_named.1 = value.into();
531        self
532    }
533    /// Set the `id` field to an Option value (optional)
534    pub fn maybe_id(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self {
535        self.__unsafe_private_named.1 = value;
536        self
537    }
538}
539
540impl<'a, S> LinearDocumentBuilder<'a, S>
541where
542    S: linear_document_state::State,
543    S::Blocks: linear_document_state::IsSet,
544{
545    /// Build the final struct
546    pub fn build(self) -> LinearDocument<'a> {
547        LinearDocument {
548            blocks: self.__unsafe_private_named.0.unwrap(),
549            id: self.__unsafe_private_named.1,
550            extra_data: Default::default(),
551        }
552    }
553    /// Build the final struct with custom extra_data
554    pub fn build_with_data(
555        self,
556        extra_data: std::collections::BTreeMap<
557            jacquard_common::smol_str::SmolStr,
558            jacquard_common::types::value::Data<'a>,
559        >,
560    ) -> LinearDocument<'a> {
561        LinearDocument {
562            blocks: self.__unsafe_private_named.0.unwrap(),
563            id: self.__unsafe_private_named.1,
564            extra_data: Some(extra_data),
565        }
566    }
567}
568
569impl<'a> ::jacquard_lexicon::schema::LexiconSchema for LinearDocument<'a> {
570    fn nsid() -> &'static str {
571        "pub.leaflet.pages.linearDocument"
572    }
573    fn def_name() -> &'static str {
574        "main"
575    }
576    fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
577        lexicon_doc_pub_leaflet_pages_linearDocument()
578    }
579    fn validate(
580        &self,
581    ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
582        Ok(())
583    }
584}
585
586#[jacquard_derive::lexicon]
587#[derive(
588    serde::Serialize,
589    serde::Deserialize,
590    Debug,
591    Clone,
592    PartialEq,
593    Eq,
594    jacquard_derive::IntoStatic
595)]
596#[serde(rename_all = "camelCase")]
597pub struct Position<'a> {
598    pub block: Vec<i64>,
599    pub offset: i64,
600}
601
602pub mod position_state {
603
604    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
605    #[allow(unused)]
606    use ::core::marker::PhantomData;
607    mod sealed {
608        pub trait Sealed {}
609    }
610    /// State trait tracking which required fields have been set
611    pub trait State: sealed::Sealed {
612        type Block;
613        type Offset;
614    }
615    /// Empty state - all required fields are unset
616    pub struct Empty(());
617    impl sealed::Sealed for Empty {}
618    impl State for Empty {
619        type Block = Unset;
620        type Offset = Unset;
621    }
622    ///State transition - sets the `block` field to Set
623    pub struct SetBlock<S: State = Empty>(PhantomData<fn() -> S>);
624    impl<S: State> sealed::Sealed for SetBlock<S> {}
625    impl<S: State> State for SetBlock<S> {
626        type Block = Set<members::block>;
627        type Offset = S::Offset;
628    }
629    ///State transition - sets the `offset` field to Set
630    pub struct SetOffset<S: State = Empty>(PhantomData<fn() -> S>);
631    impl<S: State> sealed::Sealed for SetOffset<S> {}
632    impl<S: State> State for SetOffset<S> {
633        type Block = S::Block;
634        type Offset = Set<members::offset>;
635    }
636    /// Marker types for field names
637    #[allow(non_camel_case_types)]
638    pub mod members {
639        ///Marker type for the `block` field
640        pub struct block(());
641        ///Marker type for the `offset` field
642        pub struct offset(());
643    }
644}
645
646/// Builder for constructing an instance of this type
647pub struct PositionBuilder<'a, S: position_state::State> {
648    _phantom_state: ::core::marker::PhantomData<fn() -> S>,
649    __unsafe_private_named: (
650        ::core::option::Option<Vec<i64>>,
651        ::core::option::Option<i64>,
652    ),
653    _phantom: ::core::marker::PhantomData<&'a ()>,
654}
655
656impl<'a> Position<'a> {
657    /// Create a new builder for this type
658    pub fn new() -> PositionBuilder<'a, position_state::Empty> {
659        PositionBuilder::new()
660    }
661}
662
663impl<'a> PositionBuilder<'a, position_state::Empty> {
664    /// Create a new builder with all fields unset
665    pub fn new() -> Self {
666        PositionBuilder {
667            _phantom_state: ::core::marker::PhantomData,
668            __unsafe_private_named: (None, None),
669            _phantom: ::core::marker::PhantomData,
670        }
671    }
672}
673
674impl<'a, S> PositionBuilder<'a, S>
675where
676    S: position_state::State,
677    S::Block: position_state::IsUnset,
678{
679    /// Set the `block` field (required)
680    pub fn block(
681        mut self,
682        value: impl Into<Vec<i64>>,
683    ) -> PositionBuilder<'a, position_state::SetBlock<S>> {
684        self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
685        PositionBuilder {
686            _phantom_state: ::core::marker::PhantomData,
687            __unsafe_private_named: self.__unsafe_private_named,
688            _phantom: ::core::marker::PhantomData,
689        }
690    }
691}
692
693impl<'a, S> PositionBuilder<'a, S>
694where
695    S: position_state::State,
696    S::Offset: position_state::IsUnset,
697{
698    /// Set the `offset` field (required)
699    pub fn offset(
700        mut self,
701        value: impl Into<i64>,
702    ) -> PositionBuilder<'a, position_state::SetOffset<S>> {
703        self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
704        PositionBuilder {
705            _phantom_state: ::core::marker::PhantomData,
706            __unsafe_private_named: self.__unsafe_private_named,
707            _phantom: ::core::marker::PhantomData,
708        }
709    }
710}
711
712impl<'a, S> PositionBuilder<'a, S>
713where
714    S: position_state::State,
715    S::Block: position_state::IsSet,
716    S::Offset: position_state::IsSet,
717{
718    /// Build the final struct
719    pub fn build(self) -> Position<'a> {
720        Position {
721            block: self.__unsafe_private_named.0.unwrap(),
722            offset: self.__unsafe_private_named.1.unwrap(),
723            extra_data: Default::default(),
724        }
725    }
726    /// Build the final struct with custom extra_data
727    pub fn build_with_data(
728        self,
729        extra_data: std::collections::BTreeMap<
730            jacquard_common::smol_str::SmolStr,
731            jacquard_common::types::value::Data<'a>,
732        >,
733    ) -> Position<'a> {
734        Position {
735            block: self.__unsafe_private_named.0.unwrap(),
736            offset: self.__unsafe_private_named.1.unwrap(),
737            extra_data: Some(extra_data),
738        }
739    }
740}
741
742impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Position<'a> {
743    fn nsid() -> &'static str {
744        "pub.leaflet.pages.linearDocument"
745    }
746    fn def_name() -> &'static str {
747        "position"
748    }
749    fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
750        lexicon_doc_pub_leaflet_pages_linearDocument()
751    }
752    fn validate(
753        &self,
754    ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
755        Ok(())
756    }
757}
758
759#[jacquard_derive::lexicon]
760#[derive(
761    serde::Serialize,
762    serde::Deserialize,
763    Debug,
764    Clone,
765    PartialEq,
766    Eq,
767    jacquard_derive::IntoStatic
768)]
769#[serde(rename_all = "camelCase")]
770pub struct Quote<'a> {
771    #[serde(borrow)]
772    pub end: crate::pub_leaflet::pages::linear_document::Position<'a>,
773    #[serde(borrow)]
774    pub start: crate::pub_leaflet::pages::linear_document::Position<'a>,
775}
776
777pub mod quote_state {
778
779    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
780    #[allow(unused)]
781    use ::core::marker::PhantomData;
782    mod sealed {
783        pub trait Sealed {}
784    }
785    /// State trait tracking which required fields have been set
786    pub trait State: sealed::Sealed {
787        type Start;
788        type End;
789    }
790    /// Empty state - all required fields are unset
791    pub struct Empty(());
792    impl sealed::Sealed for Empty {}
793    impl State for Empty {
794        type Start = Unset;
795        type End = Unset;
796    }
797    ///State transition - sets the `start` field to Set
798    pub struct SetStart<S: State = Empty>(PhantomData<fn() -> S>);
799    impl<S: State> sealed::Sealed for SetStart<S> {}
800    impl<S: State> State for SetStart<S> {
801        type Start = Set<members::start>;
802        type End = S::End;
803    }
804    ///State transition - sets the `end` field to Set
805    pub struct SetEnd<S: State = Empty>(PhantomData<fn() -> S>);
806    impl<S: State> sealed::Sealed for SetEnd<S> {}
807    impl<S: State> State for SetEnd<S> {
808        type Start = S::Start;
809        type End = Set<members::end>;
810    }
811    /// Marker types for field names
812    #[allow(non_camel_case_types)]
813    pub mod members {
814        ///Marker type for the `start` field
815        pub struct start(());
816        ///Marker type for the `end` field
817        pub struct end(());
818    }
819}
820
821/// Builder for constructing an instance of this type
822pub struct QuoteBuilder<'a, S: quote_state::State> {
823    _phantom_state: ::core::marker::PhantomData<fn() -> S>,
824    __unsafe_private_named: (
825        ::core::option::Option<crate::pub_leaflet::pages::linear_document::Position<'a>>,
826        ::core::option::Option<crate::pub_leaflet::pages::linear_document::Position<'a>>,
827    ),
828    _phantom: ::core::marker::PhantomData<&'a ()>,
829}
830
831impl<'a> Quote<'a> {
832    /// Create a new builder for this type
833    pub fn new() -> QuoteBuilder<'a, quote_state::Empty> {
834        QuoteBuilder::new()
835    }
836}
837
838impl<'a> QuoteBuilder<'a, quote_state::Empty> {
839    /// Create a new builder with all fields unset
840    pub fn new() -> Self {
841        QuoteBuilder {
842            _phantom_state: ::core::marker::PhantomData,
843            __unsafe_private_named: (None, None),
844            _phantom: ::core::marker::PhantomData,
845        }
846    }
847}
848
849impl<'a, S> QuoteBuilder<'a, S>
850where
851    S: quote_state::State,
852    S::End: quote_state::IsUnset,
853{
854    /// Set the `end` field (required)
855    pub fn end(
856        mut self,
857        value: impl Into<crate::pub_leaflet::pages::linear_document::Position<'a>>,
858    ) -> QuoteBuilder<'a, quote_state::SetEnd<S>> {
859        self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
860        QuoteBuilder {
861            _phantom_state: ::core::marker::PhantomData,
862            __unsafe_private_named: self.__unsafe_private_named,
863            _phantom: ::core::marker::PhantomData,
864        }
865    }
866}
867
868impl<'a, S> QuoteBuilder<'a, S>
869where
870    S: quote_state::State,
871    S::Start: quote_state::IsUnset,
872{
873    /// Set the `start` field (required)
874    pub fn start(
875        mut self,
876        value: impl Into<crate::pub_leaflet::pages::linear_document::Position<'a>>,
877    ) -> QuoteBuilder<'a, quote_state::SetStart<S>> {
878        self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
879        QuoteBuilder {
880            _phantom_state: ::core::marker::PhantomData,
881            __unsafe_private_named: self.__unsafe_private_named,
882            _phantom: ::core::marker::PhantomData,
883        }
884    }
885}
886
887impl<'a, S> QuoteBuilder<'a, S>
888where
889    S: quote_state::State,
890    S::Start: quote_state::IsSet,
891    S::End: quote_state::IsSet,
892{
893    /// Build the final struct
894    pub fn build(self) -> Quote<'a> {
895        Quote {
896            end: self.__unsafe_private_named.0.unwrap(),
897            start: self.__unsafe_private_named.1.unwrap(),
898            extra_data: Default::default(),
899        }
900    }
901    /// Build the final struct with custom extra_data
902    pub fn build_with_data(
903        self,
904        extra_data: std::collections::BTreeMap<
905            jacquard_common::smol_str::SmolStr,
906            jacquard_common::types::value::Data<'a>,
907        >,
908    ) -> Quote<'a> {
909        Quote {
910            end: self.__unsafe_private_named.0.unwrap(),
911            start: self.__unsafe_private_named.1.unwrap(),
912            extra_data: Some(extra_data),
913        }
914    }
915}
916
917impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Quote<'a> {
918    fn nsid() -> &'static str {
919        "pub.leaflet.pages.linearDocument"
920    }
921    fn def_name() -> &'static str {
922        "quote"
923    }
924    fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
925        lexicon_doc_pub_leaflet_pages_linearDocument()
926    }
927    fn validate(
928        &self,
929    ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
930        Ok(())
931    }
932}
933
934#[derive(
935    serde::Serialize,
936    serde::Deserialize,
937    Debug,
938    Clone,
939    PartialEq,
940    Eq,
941    Hash,
942    jacquard_derive::IntoStatic
943)]
944pub struct TextAlignCenter;
945impl std::fmt::Display for TextAlignCenter {
946    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
947        write!(f, "textAlignCenter")
948    }
949}
950
951#[derive(
952    serde::Serialize,
953    serde::Deserialize,
954    Debug,
955    Clone,
956    PartialEq,
957    Eq,
958    Hash,
959    jacquard_derive::IntoStatic
960)]
961pub struct TextAlignJustify;
962impl std::fmt::Display for TextAlignJustify {
963    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
964        write!(f, "textAlignJustify")
965    }
966}
967
968#[derive(
969    serde::Serialize,
970    serde::Deserialize,
971    Debug,
972    Clone,
973    PartialEq,
974    Eq,
975    Hash,
976    jacquard_derive::IntoStatic
977)]
978pub struct TextAlignLeft;
979impl std::fmt::Display for TextAlignLeft {
980    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
981        write!(f, "textAlignLeft")
982    }
983}
984
985#[derive(
986    serde::Serialize,
987    serde::Deserialize,
988    Debug,
989    Clone,
990    PartialEq,
991    Eq,
992    Hash,
993    jacquard_derive::IntoStatic
994)]
995pub struct TextAlignRight;
996impl std::fmt::Display for TextAlignRight {
997    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
998        write!(f, "textAlignRight")
999    }
1000}