jacquard_api/com_whtwnd/
blog.rs

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