jacquard_api/network_slices/
slice.rs

1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: network.slices.slice.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 clear_slice_records;
9pub mod create_o_auth_client;
10pub mod delete_o_auth_client;
11pub mod get_actors;
12pub mod get_jetstream_logs;
13pub mod get_jetstream_status;
14pub mod get_job_logs;
15pub mod get_job_status;
16pub mod get_o_auth_clients;
17pub mod get_slice_records;
18pub mod get_sparklines;
19pub mod get_sync_summary;
20pub mod start_sync;
21pub mod stats;
22pub mod sync_user_collections;
23pub mod update_o_auth_client;
24
25#[jacquard_derive::lexicon]
26#[derive(
27    serde::Serialize,
28    serde::Deserialize,
29    Debug,
30    Clone,
31    PartialEq,
32    Eq,
33    jacquard_derive::IntoStatic
34)]
35#[serde(rename_all = "camelCase")]
36pub struct Slice<'a> {
37    /// When the slice was created
38    pub created_at: jacquard_common::types::string::Datetime,
39    /// Primary domain namespace for this slice (e.g. social.grain)
40    #[serde(borrow)]
41    pub domain: jacquard_common::CowStr<'a>,
42    /// Name of the slice
43    #[serde(borrow)]
44    pub name: jacquard_common::CowStr<'a>,
45}
46
47pub mod slice_state {
48
49    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
50    #[allow(unused)]
51    use ::core::marker::PhantomData;
52    mod sealed {
53        pub trait Sealed {}
54    }
55    /// State trait tracking which required fields have been set
56    pub trait State: sealed::Sealed {
57        type Name;
58        type Domain;
59        type CreatedAt;
60    }
61    /// Empty state - all required fields are unset
62    pub struct Empty(());
63    impl sealed::Sealed for Empty {}
64    impl State for Empty {
65        type Name = Unset;
66        type Domain = Unset;
67        type CreatedAt = Unset;
68    }
69    ///State transition - sets the `name` field to Set
70    pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>);
71    impl<S: State> sealed::Sealed for SetName<S> {}
72    impl<S: State> State for SetName<S> {
73        type Name = Set<members::name>;
74        type Domain = S::Domain;
75        type CreatedAt = S::CreatedAt;
76    }
77    ///State transition - sets the `domain` field to Set
78    pub struct SetDomain<S: State = Empty>(PhantomData<fn() -> S>);
79    impl<S: State> sealed::Sealed for SetDomain<S> {}
80    impl<S: State> State for SetDomain<S> {
81        type Name = S::Name;
82        type Domain = Set<members::domain>;
83        type CreatedAt = S::CreatedAt;
84    }
85    ///State transition - sets the `created_at` field to Set
86    pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>);
87    impl<S: State> sealed::Sealed for SetCreatedAt<S> {}
88    impl<S: State> State for SetCreatedAt<S> {
89        type Name = S::Name;
90        type Domain = S::Domain;
91        type CreatedAt = Set<members::created_at>;
92    }
93    /// Marker types for field names
94    #[allow(non_camel_case_types)]
95    pub mod members {
96        ///Marker type for the `name` field
97        pub struct name(());
98        ///Marker type for the `domain` field
99        pub struct domain(());
100        ///Marker type for the `created_at` field
101        pub struct created_at(());
102    }
103}
104
105/// Builder for constructing an instance of this type
106pub struct SliceBuilder<'a, S: slice_state::State> {
107    _phantom_state: ::core::marker::PhantomData<fn() -> S>,
108    __unsafe_private_named: (
109        ::core::option::Option<jacquard_common::types::string::Datetime>,
110        ::core::option::Option<jacquard_common::CowStr<'a>>,
111        ::core::option::Option<jacquard_common::CowStr<'a>>,
112    ),
113    _phantom: ::core::marker::PhantomData<&'a ()>,
114}
115
116impl<'a> Slice<'a> {
117    /// Create a new builder for this type
118    pub fn new() -> SliceBuilder<'a, slice_state::Empty> {
119        SliceBuilder::new()
120    }
121}
122
123impl<'a> SliceBuilder<'a, slice_state::Empty> {
124    /// Create a new builder with all fields unset
125    pub fn new() -> Self {
126        SliceBuilder {
127            _phantom_state: ::core::marker::PhantomData,
128            __unsafe_private_named: (None, None, None),
129            _phantom: ::core::marker::PhantomData,
130        }
131    }
132}
133
134impl<'a, S> SliceBuilder<'a, S>
135where
136    S: slice_state::State,
137    S::CreatedAt: slice_state::IsUnset,
138{
139    /// Set the `createdAt` field (required)
140    pub fn created_at(
141        mut self,
142        value: impl Into<jacquard_common::types::string::Datetime>,
143    ) -> SliceBuilder<'a, slice_state::SetCreatedAt<S>> {
144        self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
145        SliceBuilder {
146            _phantom_state: ::core::marker::PhantomData,
147            __unsafe_private_named: self.__unsafe_private_named,
148            _phantom: ::core::marker::PhantomData,
149        }
150    }
151}
152
153impl<'a, S> SliceBuilder<'a, S>
154where
155    S: slice_state::State,
156    S::Domain: slice_state::IsUnset,
157{
158    /// Set the `domain` field (required)
159    pub fn domain(
160        mut self,
161        value: impl Into<jacquard_common::CowStr<'a>>,
162    ) -> SliceBuilder<'a, slice_state::SetDomain<S>> {
163        self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
164        SliceBuilder {
165            _phantom_state: ::core::marker::PhantomData,
166            __unsafe_private_named: self.__unsafe_private_named,
167            _phantom: ::core::marker::PhantomData,
168        }
169    }
170}
171
172impl<'a, S> SliceBuilder<'a, S>
173where
174    S: slice_state::State,
175    S::Name: slice_state::IsUnset,
176{
177    /// Set the `name` field (required)
178    pub fn name(
179        mut self,
180        value: impl Into<jacquard_common::CowStr<'a>>,
181    ) -> SliceBuilder<'a, slice_state::SetName<S>> {
182        self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into());
183        SliceBuilder {
184            _phantom_state: ::core::marker::PhantomData,
185            __unsafe_private_named: self.__unsafe_private_named,
186            _phantom: ::core::marker::PhantomData,
187        }
188    }
189}
190
191impl<'a, S> SliceBuilder<'a, S>
192where
193    S: slice_state::State,
194    S::Name: slice_state::IsSet,
195    S::Domain: slice_state::IsSet,
196    S::CreatedAt: slice_state::IsSet,
197{
198    /// Build the final struct
199    pub fn build(self) -> Slice<'a> {
200        Slice {
201            created_at: self.__unsafe_private_named.0.unwrap(),
202            domain: self.__unsafe_private_named.1.unwrap(),
203            name: self.__unsafe_private_named.2.unwrap(),
204            extra_data: Default::default(),
205        }
206    }
207    /// Build the final struct with custom extra_data
208    pub fn build_with_data(
209        self,
210        extra_data: std::collections::BTreeMap<
211            jacquard_common::smol_str::SmolStr,
212            jacquard_common::types::value::Data<'a>,
213        >,
214    ) -> Slice<'a> {
215        Slice {
216            created_at: self.__unsafe_private_named.0.unwrap(),
217            domain: self.__unsafe_private_named.1.unwrap(),
218            name: self.__unsafe_private_named.2.unwrap(),
219            extra_data: Some(extra_data),
220        }
221    }
222}
223
224impl<'a> Slice<'a> {
225    pub fn uri(
226        uri: impl Into<jacquard_common::CowStr<'a>>,
227    ) -> Result<
228        jacquard_common::types::uri::RecordUri<'a, SliceRecord>,
229        jacquard_common::types::uri::UriError,
230    > {
231        jacquard_common::types::uri::RecordUri::try_from_uri(
232            jacquard_common::types::string::AtUri::new_cow(uri.into())?,
233        )
234    }
235}
236
237/// Typed wrapper for GetRecord response with this collection's record type.
238#[derive(
239    serde::Serialize,
240    serde::Deserialize,
241    Debug,
242    Clone,
243    PartialEq,
244    Eq,
245    jacquard_derive::IntoStatic
246)]
247#[serde(rename_all = "camelCase")]
248pub struct SliceGetRecordOutput<'a> {
249    #[serde(skip_serializing_if = "std::option::Option::is_none")]
250    #[serde(borrow)]
251    pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>,
252    #[serde(borrow)]
253    pub uri: jacquard_common::types::string::AtUri<'a>,
254    #[serde(borrow)]
255    pub value: Slice<'a>,
256}
257
258impl From<SliceGetRecordOutput<'_>> for Slice<'_> {
259    fn from(output: SliceGetRecordOutput<'_>) -> Self {
260        use jacquard_common::IntoStatic;
261        output.value.into_static()
262    }
263}
264
265impl jacquard_common::types::collection::Collection for Slice<'_> {
266    const NSID: &'static str = "network.slices.slice";
267    type Record = SliceRecord;
268}
269
270/// Marker type for deserializing records from this collection.
271#[derive(Debug, serde::Serialize, serde::Deserialize)]
272pub struct SliceRecord;
273impl jacquard_common::xrpc::XrpcResp for SliceRecord {
274    const NSID: &'static str = "network.slices.slice";
275    const ENCODING: &'static str = "application/json";
276    type Output<'de> = SliceGetRecordOutput<'de>;
277    type Err<'de> = jacquard_common::types::collection::RecordError<'de>;
278}
279
280impl jacquard_common::types::collection::Collection for SliceRecord {
281    const NSID: &'static str = "network.slices.slice";
282    type Record = SliceRecord;
283}
284
285impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Slice<'a> {
286    fn nsid() -> &'static str {
287        "network.slices.slice"
288    }
289    fn def_name() -> &'static str {
290        "main"
291    }
292    fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
293        lexicon_doc_network_slices_slice()
294    }
295    fn validate(
296        &self,
297    ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
298        {
299            let value = &self.domain;
300            #[allow(unused_comparisons)]
301            if <str>::len(value.as_ref()) > 256usize {
302                return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
303                    path: ::jacquard_lexicon::validation::ValidationPath::from_field(
304                        "domain",
305                    ),
306                    max: 256usize,
307                    actual: <str>::len(value.as_ref()),
308                });
309            }
310        }
311        {
312            let value = &self.name;
313            #[allow(unused_comparisons)]
314            if <str>::len(value.as_ref()) > 256usize {
315                return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
316                    path: ::jacquard_lexicon::validation::ValidationPath::from_field(
317                        "name",
318                    ),
319                    max: 256usize,
320                    actual: <str>::len(value.as_ref()),
321                });
322            }
323        }
324        Ok(())
325    }
326}
327
328fn lexicon_doc_network_slices_slice() -> ::jacquard_lexicon::lexicon::LexiconDoc<
329    'static,
330> {
331    ::jacquard_lexicon::lexicon::LexiconDoc {
332        lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1,
333        id: ::jacquard_common::CowStr::new_static("network.slices.slice"),
334        revision: None,
335        description: None,
336        defs: {
337            let mut map = ::std::collections::BTreeMap::new();
338            map.insert(
339                ::jacquard_common::smol_str::SmolStr::new_static("main"),
340                ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord {
341                    description: None,
342                    key: Some(::jacquard_common::CowStr::new_static("tid")),
343                    record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject {
344                        description: None,
345                        required: Some(
346                            vec![
347                                ::jacquard_common::smol_str::SmolStr::new_static("name"),
348                                ::jacquard_common::smol_str::SmolStr::new_static("domain"),
349                                ::jacquard_common::smol_str::SmolStr::new_static("createdAt")
350                            ],
351                        ),
352                        nullable: None,
353                        properties: {
354                            #[allow(unused_mut)]
355                            let mut map = ::std::collections::BTreeMap::new();
356                            map.insert(
357                                ::jacquard_common::smol_str::SmolStr::new_static(
358                                    "createdAt",
359                                ),
360                                ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
361                                    description: Some(
362                                        ::jacquard_common::CowStr::new_static(
363                                            "When the slice was created",
364                                        ),
365                                    ),
366                                    format: Some(
367                                        ::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
368                                    ),
369                                    default: None,
370                                    min_length: None,
371                                    max_length: None,
372                                    min_graphemes: None,
373                                    max_graphemes: None,
374                                    r#enum: None,
375                                    r#const: None,
376                                    known_values: None,
377                                }),
378                            );
379                            map.insert(
380                                ::jacquard_common::smol_str::SmolStr::new_static("domain"),
381                                ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
382                                    description: Some(
383                                        ::jacquard_common::CowStr::new_static(
384                                            "Primary domain namespace for this slice (e.g. social.grain)",
385                                        ),
386                                    ),
387                                    format: None,
388                                    default: None,
389                                    min_length: None,
390                                    max_length: Some(256usize),
391                                    min_graphemes: None,
392                                    max_graphemes: None,
393                                    r#enum: None,
394                                    r#const: None,
395                                    known_values: None,
396                                }),
397                            );
398                            map.insert(
399                                ::jacquard_common::smol_str::SmolStr::new_static("name"),
400                                ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
401                                    description: Some(
402                                        ::jacquard_common::CowStr::new_static("Name of the slice"),
403                                    ),
404                                    format: None,
405                                    default: None,
406                                    min_length: None,
407                                    max_length: Some(256usize),
408                                    min_graphemes: None,
409                                    max_graphemes: None,
410                                    r#enum: None,
411                                    r#const: None,
412                                    known_values: None,
413                                }),
414                            );
415                            map
416                        },
417                    }),
418                }),
419            );
420            map
421        },
422    }
423}
424
425#[jacquard_derive::lexicon]
426#[derive(
427    serde::Serialize,
428    serde::Deserialize,
429    Debug,
430    Clone,
431    PartialEq,
432    Eq,
433    jacquard_derive::IntoStatic
434)]
435#[serde(rename_all = "camelCase")]
436pub struct SliceView<'a> {
437    #[serde(borrow)]
438    pub cid: jacquard_common::types::string::Cid<'a>,
439    pub created_at: jacquard_common::types::string::Datetime,
440    /// Profile of the slice creator
441    #[serde(borrow)]
442    pub creator: crate::network_slices::actor::ProfileViewBasic<'a>,
443    /// Primary domain namespace for this slice (e.g. social.grain)
444    #[serde(borrow)]
445    pub domain: jacquard_common::CowStr<'a>,
446    /// Total number of unique indexed actors in this slice
447    #[serde(skip_serializing_if = "std::option::Option::is_none")]
448    pub indexed_actor_count: Option<i64>,
449    /// Number of collections with indexed records
450    #[serde(skip_serializing_if = "std::option::Option::is_none")]
451    pub indexed_collection_count: Option<i64>,
452    /// Total number of indexed records in this slice
453    #[serde(skip_serializing_if = "std::option::Option::is_none")]
454    pub indexed_record_count: Option<i64>,
455    /// Display name of the slice
456    #[serde(borrow)]
457    pub name: jacquard_common::CowStr<'a>,
458    /// Recent activity sparkline data points for the last 24 hours
459    #[serde(skip_serializing_if = "std::option::Option::is_none")]
460    #[serde(borrow)]
461    pub sparkline: Option<Vec<crate::network_slices::slice::SparklinePoint<'a>>>,
462    #[serde(borrow)]
463    pub uri: jacquard_common::types::string::AtUri<'a>,
464    /// Total number of waitlist invites for this slice
465    #[serde(skip_serializing_if = "std::option::Option::is_none")]
466    pub waitlist_invite_count: Option<i64>,
467    /// Total number of waitlist requests for this slice
468    #[serde(skip_serializing_if = "std::option::Option::is_none")]
469    pub waitlist_request_count: Option<i64>,
470}
471
472pub mod slice_view_state {
473
474    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
475    #[allow(unused)]
476    use ::core::marker::PhantomData;
477    mod sealed {
478        pub trait Sealed {}
479    }
480    /// State trait tracking which required fields have been set
481    pub trait State: sealed::Sealed {
482        type Uri;
483        type Cid;
484        type Name;
485        type Domain;
486        type Creator;
487        type CreatedAt;
488    }
489    /// Empty state - all required fields are unset
490    pub struct Empty(());
491    impl sealed::Sealed for Empty {}
492    impl State for Empty {
493        type Uri = Unset;
494        type Cid = Unset;
495        type Name = Unset;
496        type Domain = Unset;
497        type Creator = Unset;
498        type CreatedAt = Unset;
499    }
500    ///State transition - sets the `uri` field to Set
501    pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>);
502    impl<S: State> sealed::Sealed for SetUri<S> {}
503    impl<S: State> State for SetUri<S> {
504        type Uri = Set<members::uri>;
505        type Cid = S::Cid;
506        type Name = S::Name;
507        type Domain = S::Domain;
508        type Creator = S::Creator;
509        type CreatedAt = S::CreatedAt;
510    }
511    ///State transition - sets the `cid` field to Set
512    pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>);
513    impl<S: State> sealed::Sealed for SetCid<S> {}
514    impl<S: State> State for SetCid<S> {
515        type Uri = S::Uri;
516        type Cid = Set<members::cid>;
517        type Name = S::Name;
518        type Domain = S::Domain;
519        type Creator = S::Creator;
520        type CreatedAt = S::CreatedAt;
521    }
522    ///State transition - sets the `name` field to Set
523    pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>);
524    impl<S: State> sealed::Sealed for SetName<S> {}
525    impl<S: State> State for SetName<S> {
526        type Uri = S::Uri;
527        type Cid = S::Cid;
528        type Name = Set<members::name>;
529        type Domain = S::Domain;
530        type Creator = S::Creator;
531        type CreatedAt = S::CreatedAt;
532    }
533    ///State transition - sets the `domain` field to Set
534    pub struct SetDomain<S: State = Empty>(PhantomData<fn() -> S>);
535    impl<S: State> sealed::Sealed for SetDomain<S> {}
536    impl<S: State> State for SetDomain<S> {
537        type Uri = S::Uri;
538        type Cid = S::Cid;
539        type Name = S::Name;
540        type Domain = Set<members::domain>;
541        type Creator = S::Creator;
542        type CreatedAt = S::CreatedAt;
543    }
544    ///State transition - sets the `creator` field to Set
545    pub struct SetCreator<S: State = Empty>(PhantomData<fn() -> S>);
546    impl<S: State> sealed::Sealed for SetCreator<S> {}
547    impl<S: State> State for SetCreator<S> {
548        type Uri = S::Uri;
549        type Cid = S::Cid;
550        type Name = S::Name;
551        type Domain = S::Domain;
552        type Creator = Set<members::creator>;
553        type CreatedAt = S::CreatedAt;
554    }
555    ///State transition - sets the `created_at` field to Set
556    pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>);
557    impl<S: State> sealed::Sealed for SetCreatedAt<S> {}
558    impl<S: State> State for SetCreatedAt<S> {
559        type Uri = S::Uri;
560        type Cid = S::Cid;
561        type Name = S::Name;
562        type Domain = S::Domain;
563        type Creator = S::Creator;
564        type CreatedAt = Set<members::created_at>;
565    }
566    /// Marker types for field names
567    #[allow(non_camel_case_types)]
568    pub mod members {
569        ///Marker type for the `uri` field
570        pub struct uri(());
571        ///Marker type for the `cid` field
572        pub struct cid(());
573        ///Marker type for the `name` field
574        pub struct name(());
575        ///Marker type for the `domain` field
576        pub struct domain(());
577        ///Marker type for the `creator` field
578        pub struct creator(());
579        ///Marker type for the `created_at` field
580        pub struct created_at(());
581    }
582}
583
584/// Builder for constructing an instance of this type
585pub struct SliceViewBuilder<'a, S: slice_view_state::State> {
586    _phantom_state: ::core::marker::PhantomData<fn() -> S>,
587    __unsafe_private_named: (
588        ::core::option::Option<jacquard_common::types::string::Cid<'a>>,
589        ::core::option::Option<jacquard_common::types::string::Datetime>,
590        ::core::option::Option<crate::network_slices::actor::ProfileViewBasic<'a>>,
591        ::core::option::Option<jacquard_common::CowStr<'a>>,
592        ::core::option::Option<i64>,
593        ::core::option::Option<i64>,
594        ::core::option::Option<i64>,
595        ::core::option::Option<jacquard_common::CowStr<'a>>,
596        ::core::option::Option<Vec<crate::network_slices::slice::SparklinePoint<'a>>>,
597        ::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
598        ::core::option::Option<i64>,
599        ::core::option::Option<i64>,
600    ),
601    _phantom: ::core::marker::PhantomData<&'a ()>,
602}
603
604impl<'a> SliceView<'a> {
605    /// Create a new builder for this type
606    pub fn new() -> SliceViewBuilder<'a, slice_view_state::Empty> {
607        SliceViewBuilder::new()
608    }
609}
610
611impl<'a> SliceViewBuilder<'a, slice_view_state::Empty> {
612    /// Create a new builder with all fields unset
613    pub fn new() -> Self {
614        SliceViewBuilder {
615            _phantom_state: ::core::marker::PhantomData,
616            __unsafe_private_named: (
617                None,
618                None,
619                None,
620                None,
621                None,
622                None,
623                None,
624                None,
625                None,
626                None,
627                None,
628                None,
629            ),
630            _phantom: ::core::marker::PhantomData,
631        }
632    }
633}
634
635impl<'a, S> SliceViewBuilder<'a, S>
636where
637    S: slice_view_state::State,
638    S::Cid: slice_view_state::IsUnset,
639{
640    /// Set the `cid` field (required)
641    pub fn cid(
642        mut self,
643        value: impl Into<jacquard_common::types::string::Cid<'a>>,
644    ) -> SliceViewBuilder<'a, slice_view_state::SetCid<S>> {
645        self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
646        SliceViewBuilder {
647            _phantom_state: ::core::marker::PhantomData,
648            __unsafe_private_named: self.__unsafe_private_named,
649            _phantom: ::core::marker::PhantomData,
650        }
651    }
652}
653
654impl<'a, S> SliceViewBuilder<'a, S>
655where
656    S: slice_view_state::State,
657    S::CreatedAt: slice_view_state::IsUnset,
658{
659    /// Set the `createdAt` field (required)
660    pub fn created_at(
661        mut self,
662        value: impl Into<jacquard_common::types::string::Datetime>,
663    ) -> SliceViewBuilder<'a, slice_view_state::SetCreatedAt<S>> {
664        self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
665        SliceViewBuilder {
666            _phantom_state: ::core::marker::PhantomData,
667            __unsafe_private_named: self.__unsafe_private_named,
668            _phantom: ::core::marker::PhantomData,
669        }
670    }
671}
672
673impl<'a, S> SliceViewBuilder<'a, S>
674where
675    S: slice_view_state::State,
676    S::Creator: slice_view_state::IsUnset,
677{
678    /// Set the `creator` field (required)
679    pub fn creator(
680        mut self,
681        value: impl Into<crate::network_slices::actor::ProfileViewBasic<'a>>,
682    ) -> SliceViewBuilder<'a, slice_view_state::SetCreator<S>> {
683        self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into());
684        SliceViewBuilder {
685            _phantom_state: ::core::marker::PhantomData,
686            __unsafe_private_named: self.__unsafe_private_named,
687            _phantom: ::core::marker::PhantomData,
688        }
689    }
690}
691
692impl<'a, S> SliceViewBuilder<'a, S>
693where
694    S: slice_view_state::State,
695    S::Domain: slice_view_state::IsUnset,
696{
697    /// Set the `domain` field (required)
698    pub fn domain(
699        mut self,
700        value: impl Into<jacquard_common::CowStr<'a>>,
701    ) -> SliceViewBuilder<'a, slice_view_state::SetDomain<S>> {
702        self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into());
703        SliceViewBuilder {
704            _phantom_state: ::core::marker::PhantomData,
705            __unsafe_private_named: self.__unsafe_private_named,
706            _phantom: ::core::marker::PhantomData,
707        }
708    }
709}
710
711impl<'a, S: slice_view_state::State> SliceViewBuilder<'a, S> {
712    /// Set the `indexedActorCount` field (optional)
713    pub fn indexed_actor_count(mut self, value: impl Into<Option<i64>>) -> Self {
714        self.__unsafe_private_named.4 = value.into();
715        self
716    }
717    /// Set the `indexedActorCount` field to an Option value (optional)
718    pub fn maybe_indexed_actor_count(mut self, value: Option<i64>) -> Self {
719        self.__unsafe_private_named.4 = value;
720        self
721    }
722}
723
724impl<'a, S: slice_view_state::State> SliceViewBuilder<'a, S> {
725    /// Set the `indexedCollectionCount` field (optional)
726    pub fn indexed_collection_count(mut self, value: impl Into<Option<i64>>) -> Self {
727        self.__unsafe_private_named.5 = value.into();
728        self
729    }
730    /// Set the `indexedCollectionCount` field to an Option value (optional)
731    pub fn maybe_indexed_collection_count(mut self, value: Option<i64>) -> Self {
732        self.__unsafe_private_named.5 = value;
733        self
734    }
735}
736
737impl<'a, S: slice_view_state::State> SliceViewBuilder<'a, S> {
738    /// Set the `indexedRecordCount` field (optional)
739    pub fn indexed_record_count(mut self, value: impl Into<Option<i64>>) -> Self {
740        self.__unsafe_private_named.6 = value.into();
741        self
742    }
743    /// Set the `indexedRecordCount` field to an Option value (optional)
744    pub fn maybe_indexed_record_count(mut self, value: Option<i64>) -> Self {
745        self.__unsafe_private_named.6 = value;
746        self
747    }
748}
749
750impl<'a, S> SliceViewBuilder<'a, S>
751where
752    S: slice_view_state::State,
753    S::Name: slice_view_state::IsUnset,
754{
755    /// Set the `name` field (required)
756    pub fn name(
757        mut self,
758        value: impl Into<jacquard_common::CowStr<'a>>,
759    ) -> SliceViewBuilder<'a, slice_view_state::SetName<S>> {
760        self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into());
761        SliceViewBuilder {
762            _phantom_state: ::core::marker::PhantomData,
763            __unsafe_private_named: self.__unsafe_private_named,
764            _phantom: ::core::marker::PhantomData,
765        }
766    }
767}
768
769impl<'a, S: slice_view_state::State> SliceViewBuilder<'a, S> {
770    /// Set the `sparkline` field (optional)
771    pub fn sparkline(
772        mut self,
773        value: impl Into<Option<Vec<crate::network_slices::slice::SparklinePoint<'a>>>>,
774    ) -> Self {
775        self.__unsafe_private_named.8 = value.into();
776        self
777    }
778    /// Set the `sparkline` field to an Option value (optional)
779    pub fn maybe_sparkline(
780        mut self,
781        value: Option<Vec<crate::network_slices::slice::SparklinePoint<'a>>>,
782    ) -> Self {
783        self.__unsafe_private_named.8 = value;
784        self
785    }
786}
787
788impl<'a, S> SliceViewBuilder<'a, S>
789where
790    S: slice_view_state::State,
791    S::Uri: slice_view_state::IsUnset,
792{
793    /// Set the `uri` field (required)
794    pub fn uri(
795        mut self,
796        value: impl Into<jacquard_common::types::string::AtUri<'a>>,
797    ) -> SliceViewBuilder<'a, slice_view_state::SetUri<S>> {
798        self.__unsafe_private_named.9 = ::core::option::Option::Some(value.into());
799        SliceViewBuilder {
800            _phantom_state: ::core::marker::PhantomData,
801            __unsafe_private_named: self.__unsafe_private_named,
802            _phantom: ::core::marker::PhantomData,
803        }
804    }
805}
806
807impl<'a, S: slice_view_state::State> SliceViewBuilder<'a, S> {
808    /// Set the `waitlistInviteCount` field (optional)
809    pub fn waitlist_invite_count(mut self, value: impl Into<Option<i64>>) -> Self {
810        self.__unsafe_private_named.10 = value.into();
811        self
812    }
813    /// Set the `waitlistInviteCount` field to an Option value (optional)
814    pub fn maybe_waitlist_invite_count(mut self, value: Option<i64>) -> Self {
815        self.__unsafe_private_named.10 = value;
816        self
817    }
818}
819
820impl<'a, S: slice_view_state::State> SliceViewBuilder<'a, S> {
821    /// Set the `waitlistRequestCount` field (optional)
822    pub fn waitlist_request_count(mut self, value: impl Into<Option<i64>>) -> Self {
823        self.__unsafe_private_named.11 = value.into();
824        self
825    }
826    /// Set the `waitlistRequestCount` field to an Option value (optional)
827    pub fn maybe_waitlist_request_count(mut self, value: Option<i64>) -> Self {
828        self.__unsafe_private_named.11 = value;
829        self
830    }
831}
832
833impl<'a, S> SliceViewBuilder<'a, S>
834where
835    S: slice_view_state::State,
836    S::Uri: slice_view_state::IsSet,
837    S::Cid: slice_view_state::IsSet,
838    S::Name: slice_view_state::IsSet,
839    S::Domain: slice_view_state::IsSet,
840    S::Creator: slice_view_state::IsSet,
841    S::CreatedAt: slice_view_state::IsSet,
842{
843    /// Build the final struct
844    pub fn build(self) -> SliceView<'a> {
845        SliceView {
846            cid: self.__unsafe_private_named.0.unwrap(),
847            created_at: self.__unsafe_private_named.1.unwrap(),
848            creator: self.__unsafe_private_named.2.unwrap(),
849            domain: self.__unsafe_private_named.3.unwrap(),
850            indexed_actor_count: self.__unsafe_private_named.4,
851            indexed_collection_count: self.__unsafe_private_named.5,
852            indexed_record_count: self.__unsafe_private_named.6,
853            name: self.__unsafe_private_named.7.unwrap(),
854            sparkline: self.__unsafe_private_named.8,
855            uri: self.__unsafe_private_named.9.unwrap(),
856            waitlist_invite_count: self.__unsafe_private_named.10,
857            waitlist_request_count: self.__unsafe_private_named.11,
858            extra_data: Default::default(),
859        }
860    }
861    /// Build the final struct with custom extra_data
862    pub fn build_with_data(
863        self,
864        extra_data: std::collections::BTreeMap<
865            jacquard_common::smol_str::SmolStr,
866            jacquard_common::types::value::Data<'a>,
867        >,
868    ) -> SliceView<'a> {
869        SliceView {
870            cid: self.__unsafe_private_named.0.unwrap(),
871            created_at: self.__unsafe_private_named.1.unwrap(),
872            creator: self.__unsafe_private_named.2.unwrap(),
873            domain: self.__unsafe_private_named.3.unwrap(),
874            indexed_actor_count: self.__unsafe_private_named.4,
875            indexed_collection_count: self.__unsafe_private_named.5,
876            indexed_record_count: self.__unsafe_private_named.6,
877            name: self.__unsafe_private_named.7.unwrap(),
878            sparkline: self.__unsafe_private_named.8,
879            uri: self.__unsafe_private_named.9.unwrap(),
880            waitlist_invite_count: self.__unsafe_private_named.10,
881            waitlist_request_count: self.__unsafe_private_named.11,
882            extra_data: Some(extra_data),
883        }
884    }
885}
886
887fn lexicon_doc_network_slices_slice_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc<
888    'static,
889> {
890    ::jacquard_lexicon::lexicon::LexiconDoc {
891        lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1,
892        id: ::jacquard_common::CowStr::new_static("network.slices.slice.defs"),
893        revision: None,
894        description: None,
895        defs: {
896            let mut map = ::std::collections::BTreeMap::new();
897            map.insert(
898                ::jacquard_common::smol_str::SmolStr::new_static("sliceView"),
899                ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
900                    description: None,
901                    required: Some(
902                        vec![
903                            ::jacquard_common::smol_str::SmolStr::new_static("uri"),
904                            ::jacquard_common::smol_str::SmolStr::new_static("cid"),
905                            ::jacquard_common::smol_str::SmolStr::new_static("name"),
906                            ::jacquard_common::smol_str::SmolStr::new_static("domain"),
907                            ::jacquard_common::smol_str::SmolStr::new_static("creator"),
908                            ::jacquard_common::smol_str::SmolStr::new_static("createdAt")
909                        ],
910                    ),
911                    nullable: None,
912                    properties: {
913                        #[allow(unused_mut)]
914                        let mut map = ::std::collections::BTreeMap::new();
915                        map.insert(
916                            ::jacquard_common::smol_str::SmolStr::new_static("cid"),
917                            ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
918                                description: None,
919                                format: Some(
920                                    ::jacquard_lexicon::lexicon::LexStringFormat::Cid,
921                                ),
922                                default: None,
923                                min_length: None,
924                                max_length: None,
925                                min_graphemes: None,
926                                max_graphemes: None,
927                                r#enum: None,
928                                r#const: None,
929                                known_values: None,
930                            }),
931                        );
932                        map.insert(
933                            ::jacquard_common::smol_str::SmolStr::new_static(
934                                "createdAt",
935                            ),
936                            ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
937                                description: None,
938                                format: Some(
939                                    ::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
940                                ),
941                                default: None,
942                                min_length: None,
943                                max_length: None,
944                                min_graphemes: None,
945                                max_graphemes: None,
946                                r#enum: None,
947                                r#const: None,
948                                known_values: None,
949                            }),
950                        );
951                        map.insert(
952                            ::jacquard_common::smol_str::SmolStr::new_static("creator"),
953                            ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
954                                description: None,
955                                r#ref: ::jacquard_common::CowStr::new_static(
956                                    "network.slices.actor.defs#profileViewBasic",
957                                ),
958                            }),
959                        );
960                        map.insert(
961                            ::jacquard_common::smol_str::SmolStr::new_static("domain"),
962                            ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
963                                description: Some(
964                                    ::jacquard_common::CowStr::new_static(
965                                        "Primary domain namespace for this slice (e.g. social.grain)",
966                                    ),
967                                ),
968                                format: None,
969                                default: None,
970                                min_length: None,
971                                max_length: None,
972                                min_graphemes: None,
973                                max_graphemes: None,
974                                r#enum: None,
975                                r#const: None,
976                                known_values: None,
977                            }),
978                        );
979                        map.insert(
980                            ::jacquard_common::smol_str::SmolStr::new_static(
981                                "indexedActorCount",
982                            ),
983                            ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
984                                description: None,
985                                default: None,
986                                minimum: None,
987                                maximum: None,
988                                r#enum: None,
989                                r#const: None,
990                            }),
991                        );
992                        map.insert(
993                            ::jacquard_common::smol_str::SmolStr::new_static(
994                                "indexedCollectionCount",
995                            ),
996                            ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
997                                description: None,
998                                default: None,
999                                minimum: None,
1000                                maximum: None,
1001                                r#enum: None,
1002                                r#const: None,
1003                            }),
1004                        );
1005                        map.insert(
1006                            ::jacquard_common::smol_str::SmolStr::new_static(
1007                                "indexedRecordCount",
1008                            ),
1009                            ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
1010                                description: None,
1011                                default: None,
1012                                minimum: None,
1013                                maximum: None,
1014                                r#enum: None,
1015                                r#const: None,
1016                            }),
1017                        );
1018                        map.insert(
1019                            ::jacquard_common::smol_str::SmolStr::new_static("name"),
1020                            ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
1021                                description: Some(
1022                                    ::jacquard_common::CowStr::new_static(
1023                                        "Display name of the slice",
1024                                    ),
1025                                ),
1026                                format: None,
1027                                default: None,
1028                                min_length: None,
1029                                max_length: None,
1030                                min_graphemes: None,
1031                                max_graphemes: None,
1032                                r#enum: None,
1033                                r#const: None,
1034                                known_values: None,
1035                            }),
1036                        );
1037                        map.insert(
1038                            ::jacquard_common::smol_str::SmolStr::new_static(
1039                                "sparkline",
1040                            ),
1041                            ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
1042                                description: Some(
1043                                    ::jacquard_common::CowStr::new_static(
1044                                        "Recent activity sparkline data points for the last 24 hours",
1045                                    ),
1046                                ),
1047                                items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef {
1048                                    description: None,
1049                                    r#ref: ::jacquard_common::CowStr::new_static(
1050                                        "#sparklinePoint",
1051                                    ),
1052                                }),
1053                                min_length: None,
1054                                max_length: None,
1055                            }),
1056                        );
1057                        map.insert(
1058                            ::jacquard_common::smol_str::SmolStr::new_static("uri"),
1059                            ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
1060                                description: None,
1061                                format: Some(
1062                                    ::jacquard_lexicon::lexicon::LexStringFormat::AtUri,
1063                                ),
1064                                default: None,
1065                                min_length: None,
1066                                max_length: None,
1067                                min_graphemes: None,
1068                                max_graphemes: None,
1069                                r#enum: None,
1070                                r#const: None,
1071                                known_values: None,
1072                            }),
1073                        );
1074                        map.insert(
1075                            ::jacquard_common::smol_str::SmolStr::new_static(
1076                                "waitlistInviteCount",
1077                            ),
1078                            ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
1079                                description: None,
1080                                default: None,
1081                                minimum: None,
1082                                maximum: None,
1083                                r#enum: None,
1084                                r#const: None,
1085                            }),
1086                        );
1087                        map.insert(
1088                            ::jacquard_common::smol_str::SmolStr::new_static(
1089                                "waitlistRequestCount",
1090                            ),
1091                            ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
1092                                description: None,
1093                                default: None,
1094                                minimum: None,
1095                                maximum: None,
1096                                r#enum: None,
1097                                r#const: None,
1098                            }),
1099                        );
1100                        map
1101                    },
1102                }),
1103            );
1104            map.insert(
1105                ::jacquard_common::smol_str::SmolStr::new_static("sparklinePoint"),
1106                ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
1107                    description: None,
1108                    required: Some(
1109                        vec![
1110                            ::jacquard_common::smol_str::SmolStr::new_static("timestamp"),
1111                            ::jacquard_common::smol_str::SmolStr::new_static("count")
1112                        ],
1113                    ),
1114                    nullable: None,
1115                    properties: {
1116                        #[allow(unused_mut)]
1117                        let mut map = ::std::collections::BTreeMap::new();
1118                        map.insert(
1119                            ::jacquard_common::smol_str::SmolStr::new_static("count"),
1120                            ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
1121                                description: None,
1122                                default: None,
1123                                minimum: Some(0i64),
1124                                maximum: None,
1125                                r#enum: None,
1126                                r#const: None,
1127                            }),
1128                        );
1129                        map.insert(
1130                            ::jacquard_common::smol_str::SmolStr::new_static(
1131                                "timestamp",
1132                            ),
1133                            ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
1134                                description: None,
1135                                format: Some(
1136                                    ::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
1137                                ),
1138                                default: None,
1139                                min_length: None,
1140                                max_length: None,
1141                                min_graphemes: None,
1142                                max_graphemes: None,
1143                                r#enum: None,
1144                                r#const: None,
1145                                known_values: None,
1146                            }),
1147                        );
1148                        map
1149                    },
1150                }),
1151            );
1152            map
1153        },
1154    }
1155}
1156
1157impl<'a> ::jacquard_lexicon::schema::LexiconSchema for SliceView<'a> {
1158    fn nsid() -> &'static str {
1159        "network.slices.slice.defs"
1160    }
1161    fn def_name() -> &'static str {
1162        "sliceView"
1163    }
1164    fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
1165        lexicon_doc_network_slices_slice_defs()
1166    }
1167    fn validate(
1168        &self,
1169    ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
1170        Ok(())
1171    }
1172}
1173
1174#[jacquard_derive::lexicon]
1175#[derive(
1176    serde::Serialize,
1177    serde::Deserialize,
1178    Debug,
1179    Clone,
1180    PartialEq,
1181    Eq,
1182    jacquard_derive::IntoStatic
1183)]
1184#[serde(rename_all = "camelCase")]
1185pub struct SparklinePoint<'a> {
1186    pub count: i64,
1187    pub timestamp: jacquard_common::types::string::Datetime,
1188}
1189
1190pub mod sparkline_point_state {
1191
1192    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
1193    #[allow(unused)]
1194    use ::core::marker::PhantomData;
1195    mod sealed {
1196        pub trait Sealed {}
1197    }
1198    /// State trait tracking which required fields have been set
1199    pub trait State: sealed::Sealed {
1200        type Timestamp;
1201        type Count;
1202    }
1203    /// Empty state - all required fields are unset
1204    pub struct Empty(());
1205    impl sealed::Sealed for Empty {}
1206    impl State for Empty {
1207        type Timestamp = Unset;
1208        type Count = Unset;
1209    }
1210    ///State transition - sets the `timestamp` field to Set
1211    pub struct SetTimestamp<S: State = Empty>(PhantomData<fn() -> S>);
1212    impl<S: State> sealed::Sealed for SetTimestamp<S> {}
1213    impl<S: State> State for SetTimestamp<S> {
1214        type Timestamp = Set<members::timestamp>;
1215        type Count = S::Count;
1216    }
1217    ///State transition - sets the `count` field to Set
1218    pub struct SetCount<S: State = Empty>(PhantomData<fn() -> S>);
1219    impl<S: State> sealed::Sealed for SetCount<S> {}
1220    impl<S: State> State for SetCount<S> {
1221        type Timestamp = S::Timestamp;
1222        type Count = Set<members::count>;
1223    }
1224    /// Marker types for field names
1225    #[allow(non_camel_case_types)]
1226    pub mod members {
1227        ///Marker type for the `timestamp` field
1228        pub struct timestamp(());
1229        ///Marker type for the `count` field
1230        pub struct count(());
1231    }
1232}
1233
1234/// Builder for constructing an instance of this type
1235pub struct SparklinePointBuilder<'a, S: sparkline_point_state::State> {
1236    _phantom_state: ::core::marker::PhantomData<fn() -> S>,
1237    __unsafe_private_named: (
1238        ::core::option::Option<i64>,
1239        ::core::option::Option<jacquard_common::types::string::Datetime>,
1240    ),
1241    _phantom: ::core::marker::PhantomData<&'a ()>,
1242}
1243
1244impl<'a> SparklinePoint<'a> {
1245    /// Create a new builder for this type
1246    pub fn new() -> SparklinePointBuilder<'a, sparkline_point_state::Empty> {
1247        SparklinePointBuilder::new()
1248    }
1249}
1250
1251impl<'a> SparklinePointBuilder<'a, sparkline_point_state::Empty> {
1252    /// Create a new builder with all fields unset
1253    pub fn new() -> Self {
1254        SparklinePointBuilder {
1255            _phantom_state: ::core::marker::PhantomData,
1256            __unsafe_private_named: (None, None),
1257            _phantom: ::core::marker::PhantomData,
1258        }
1259    }
1260}
1261
1262impl<'a, S> SparklinePointBuilder<'a, S>
1263where
1264    S: sparkline_point_state::State,
1265    S::Count: sparkline_point_state::IsUnset,
1266{
1267    /// Set the `count` field (required)
1268    pub fn count(
1269        mut self,
1270        value: impl Into<i64>,
1271    ) -> SparklinePointBuilder<'a, sparkline_point_state::SetCount<S>> {
1272        self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
1273        SparklinePointBuilder {
1274            _phantom_state: ::core::marker::PhantomData,
1275            __unsafe_private_named: self.__unsafe_private_named,
1276            _phantom: ::core::marker::PhantomData,
1277        }
1278    }
1279}
1280
1281impl<'a, S> SparklinePointBuilder<'a, S>
1282where
1283    S: sparkline_point_state::State,
1284    S::Timestamp: sparkline_point_state::IsUnset,
1285{
1286    /// Set the `timestamp` field (required)
1287    pub fn timestamp(
1288        mut self,
1289        value: impl Into<jacquard_common::types::string::Datetime>,
1290    ) -> SparklinePointBuilder<'a, sparkline_point_state::SetTimestamp<S>> {
1291        self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
1292        SparklinePointBuilder {
1293            _phantom_state: ::core::marker::PhantomData,
1294            __unsafe_private_named: self.__unsafe_private_named,
1295            _phantom: ::core::marker::PhantomData,
1296        }
1297    }
1298}
1299
1300impl<'a, S> SparklinePointBuilder<'a, S>
1301where
1302    S: sparkline_point_state::State,
1303    S::Timestamp: sparkline_point_state::IsSet,
1304    S::Count: sparkline_point_state::IsSet,
1305{
1306    /// Build the final struct
1307    pub fn build(self) -> SparklinePoint<'a> {
1308        SparklinePoint {
1309            count: self.__unsafe_private_named.0.unwrap(),
1310            timestamp: self.__unsafe_private_named.1.unwrap(),
1311            extra_data: Default::default(),
1312        }
1313    }
1314    /// Build the final struct with custom extra_data
1315    pub fn build_with_data(
1316        self,
1317        extra_data: std::collections::BTreeMap<
1318            jacquard_common::smol_str::SmolStr,
1319            jacquard_common::types::value::Data<'a>,
1320        >,
1321    ) -> SparklinePoint<'a> {
1322        SparklinePoint {
1323            count: self.__unsafe_private_named.0.unwrap(),
1324            timestamp: self.__unsafe_private_named.1.unwrap(),
1325            extra_data: Some(extra_data),
1326        }
1327    }
1328}
1329
1330impl<'a> ::jacquard_lexicon::schema::LexiconSchema for SparklinePoint<'a> {
1331    fn nsid() -> &'static str {
1332        "network.slices.slice.defs"
1333    }
1334    fn def_name() -> &'static str {
1335        "sparklinePoint"
1336    }
1337    fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
1338        lexicon_doc_network_slices_slice_defs()
1339    }
1340    fn validate(
1341        &self,
1342    ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
1343        {
1344            let value = &self.count;
1345            if *value < 0i64 {
1346                return Err(::jacquard_lexicon::validation::ConstraintError::Minimum {
1347                    path: ::jacquard_lexicon::validation::ValidationPath::from_field(
1348                        "count",
1349                    ),
1350                    min: 0i64,
1351                    actual: *value,
1352                });
1353            }
1354        }
1355        Ok(())
1356    }
1357}