1#[jacquard_derive::lexicon]
9#[derive(
10 serde::Serialize,
11 serde::Deserialize,
12 Debug,
13 Clone,
14 PartialEq,
15 Eq,
16 jacquard_derive::IntoStatic,
17 Default
18)]
19#[serde(rename_all = "camelCase")]
20pub struct CommitCountBreakdown<'a> {
21 #[serde(skip_serializing_if = "std::option::Option::is_none")]
22 #[serde(borrow)]
23 pub by_email: std::option::Option<
24 Vec<crate::sh_tangled::git::ref_update::IndividualEmailCommitCount<'a>>,
25 >,
26}
27
28fn lexicon_doc_sh_tangled_git_refUpdate() -> ::jacquard_lexicon::lexicon::LexiconDoc<
29 'static,
30> {
31 ::jacquard_lexicon::lexicon::LexiconDoc {
32 lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1,
33 id: ::jacquard_common::CowStr::new_static("sh.tangled.git.refUpdate"),
34 revision: None,
35 description: None,
36 defs: {
37 let mut map = ::std::collections::BTreeMap::new();
38 map.insert(
39 ::jacquard_common::smol_str::SmolStr::new_static("commitCountBreakdown"),
40 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
41 description: None,
42 required: Some(vec![]),
43 nullable: None,
44 properties: {
45 #[allow(unused_mut)]
46 let mut map = ::std::collections::BTreeMap::new();
47 map.insert(
48 ::jacquard_common::smol_str::SmolStr::new_static("byEmail"),
49 ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
50 description: None,
51 items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef {
52 description: None,
53 r#ref: ::jacquard_common::CowStr::new_static(
54 "#individualEmailCommitCount",
55 ),
56 }),
57 min_length: None,
58 max_length: None,
59 }),
60 );
61 map
62 },
63 }),
64 );
65 map.insert(
66 ::jacquard_common::smol_str::SmolStr::new_static(
67 "individualEmailCommitCount",
68 ),
69 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
70 description: None,
71 required: Some(
72 vec![
73 ::jacquard_common::smol_str::SmolStr::new_static("email"),
74 ::jacquard_common::smol_str::SmolStr::new_static("count")
75 ],
76 ),
77 nullable: None,
78 properties: {
79 #[allow(unused_mut)]
80 let mut map = ::std::collections::BTreeMap::new();
81 map.insert(
82 ::jacquard_common::smol_str::SmolStr::new_static("count"),
83 ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
84 description: None,
85 default: None,
86 minimum: None,
87 maximum: None,
88 r#enum: None,
89 r#const: None,
90 }),
91 );
92 map.insert(
93 ::jacquard_common::smol_str::SmolStr::new_static("email"),
94 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
95 description: None,
96 format: None,
97 default: None,
98 min_length: None,
99 max_length: None,
100 min_graphemes: None,
101 max_graphemes: None,
102 r#enum: None,
103 r#const: None,
104 known_values: None,
105 }),
106 );
107 map
108 },
109 }),
110 );
111 map.insert(
112 ::jacquard_common::smol_str::SmolStr::new_static(
113 "individualLanguageSize",
114 ),
115 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
116 description: None,
117 required: Some(
118 vec![
119 ::jacquard_common::smol_str::SmolStr::new_static("lang"),
120 ::jacquard_common::smol_str::SmolStr::new_static("size")
121 ],
122 ),
123 nullable: None,
124 properties: {
125 #[allow(unused_mut)]
126 let mut map = ::std::collections::BTreeMap::new();
127 map.insert(
128 ::jacquard_common::smol_str::SmolStr::new_static("lang"),
129 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
130 description: None,
131 format: None,
132 default: None,
133 min_length: None,
134 max_length: None,
135 min_graphemes: None,
136 max_graphemes: None,
137 r#enum: None,
138 r#const: None,
139 known_values: None,
140 }),
141 );
142 map.insert(
143 ::jacquard_common::smol_str::SmolStr::new_static("size"),
144 ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
145 description: None,
146 default: None,
147 minimum: None,
148 maximum: None,
149 r#enum: None,
150 r#const: None,
151 }),
152 );
153 map
154 },
155 }),
156 );
157 map.insert(
158 ::jacquard_common::smol_str::SmolStr::new_static("langBreakdown"),
159 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
160 description: None,
161 required: None,
162 nullable: None,
163 properties: {
164 #[allow(unused_mut)]
165 let mut map = ::std::collections::BTreeMap::new();
166 map.insert(
167 ::jacquard_common::smol_str::SmolStr::new_static("inputs"),
168 ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
169 description: None,
170 items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef {
171 description: None,
172 r#ref: ::jacquard_common::CowStr::new_static(
173 "#individualLanguageSize",
174 ),
175 }),
176 min_length: None,
177 max_length: None,
178 }),
179 );
180 map
181 },
182 }),
183 );
184 map.insert(
185 ::jacquard_common::smol_str::SmolStr::new_static("main"),
186 ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord {
187 description: Some(
188 ::jacquard_common::CowStr::new_static(
189 "An update to a git repository, emitted by knots.",
190 ),
191 ),
192 key: Some(::jacquard_common::CowStr::new_static("tid")),
193 record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject {
194 description: None,
195 required: Some(
196 vec![
197 ::jacquard_common::smol_str::SmolStr::new_static("ref"),
198 ::jacquard_common::smol_str::SmolStr::new_static("committerDid"),
199 ::jacquard_common::smol_str::SmolStr::new_static("repoDid"),
200 ::jacquard_common::smol_str::SmolStr::new_static("repoName"),
201 ::jacquard_common::smol_str::SmolStr::new_static("oldSha"),
202 ::jacquard_common::smol_str::SmolStr::new_static("newSha"),
203 ::jacquard_common::smol_str::SmolStr::new_static("meta")
204 ],
205 ),
206 nullable: None,
207 properties: {
208 #[allow(unused_mut)]
209 let mut map = ::std::collections::BTreeMap::new();
210 map.insert(
211 ::jacquard_common::smol_str::SmolStr::new_static(
212 "committerDid",
213 ),
214 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
215 description: Some(
216 ::jacquard_common::CowStr::new_static(
217 "did of the user that pushed this ref",
218 ),
219 ),
220 format: Some(
221 ::jacquard_lexicon::lexicon::LexStringFormat::Did,
222 ),
223 default: None,
224 min_length: None,
225 max_length: None,
226 min_graphemes: None,
227 max_graphemes: None,
228 r#enum: None,
229 r#const: None,
230 known_values: None,
231 }),
232 );
233 map.insert(
234 ::jacquard_common::smol_str::SmolStr::new_static("meta"),
235 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
236 description: None,
237 r#ref: ::jacquard_common::CowStr::new_static("#meta"),
238 }),
239 );
240 map.insert(
241 ::jacquard_common::smol_str::SmolStr::new_static("newSha"),
242 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
243 description: Some(
244 ::jacquard_common::CowStr::new_static("new SHA of this ref"),
245 ),
246 format: None,
247 default: None,
248 min_length: Some(40usize),
249 max_length: Some(40usize),
250 min_graphemes: None,
251 max_graphemes: None,
252 r#enum: None,
253 r#const: None,
254 known_values: None,
255 }),
256 );
257 map.insert(
258 ::jacquard_common::smol_str::SmolStr::new_static("oldSha"),
259 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
260 description: Some(
261 ::jacquard_common::CowStr::new_static("old SHA of this ref"),
262 ),
263 format: None,
264 default: None,
265 min_length: Some(40usize),
266 max_length: Some(40usize),
267 min_graphemes: None,
268 max_graphemes: None,
269 r#enum: None,
270 r#const: None,
271 known_values: None,
272 }),
273 );
274 map.insert(
275 ::jacquard_common::smol_str::SmolStr::new_static("ref"),
276 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
277 description: Some(
278 ::jacquard_common::CowStr::new_static("Ref being updated"),
279 ),
280 format: None,
281 default: None,
282 min_length: None,
283 max_length: Some(2560usize),
284 min_graphemes: None,
285 max_graphemes: Some(256usize),
286 r#enum: None,
287 r#const: None,
288 known_values: None,
289 }),
290 );
291 map.insert(
292 ::jacquard_common::smol_str::SmolStr::new_static("repoDid"),
293 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
294 description: Some(
295 ::jacquard_common::CowStr::new_static(
296 "did of the owner of the repo",
297 ),
298 ),
299 format: Some(
300 ::jacquard_lexicon::lexicon::LexStringFormat::Did,
301 ),
302 default: None,
303 min_length: None,
304 max_length: None,
305 min_graphemes: None,
306 max_graphemes: None,
307 r#enum: None,
308 r#const: None,
309 known_values: None,
310 }),
311 );
312 map.insert(
313 ::jacquard_common::smol_str::SmolStr::new_static(
314 "repoName",
315 ),
316 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
317 description: Some(
318 ::jacquard_common::CowStr::new_static("name of the repo"),
319 ),
320 format: None,
321 default: None,
322 min_length: None,
323 max_length: None,
324 min_graphemes: None,
325 max_graphemes: None,
326 r#enum: None,
327 r#const: None,
328 known_values: None,
329 }),
330 );
331 map
332 },
333 }),
334 }),
335 );
336 map.insert(
337 ::jacquard_common::smol_str::SmolStr::new_static("meta"),
338 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
339 description: None,
340 required: Some(
341 vec![
342 ::jacquard_common::smol_str::SmolStr::new_static("isDefaultRef"),
343 ::jacquard_common::smol_str::SmolStr::new_static("commitCount")
344 ],
345 ),
346 nullable: None,
347 properties: {
348 #[allow(unused_mut)]
349 let mut map = ::std::collections::BTreeMap::new();
350 map.insert(
351 ::jacquard_common::smol_str::SmolStr::new_static(
352 "commitCount",
353 ),
354 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
355 description: None,
356 r#ref: ::jacquard_common::CowStr::new_static(
357 "#commitCountBreakdown",
358 ),
359 }),
360 );
361 map.insert(
362 ::jacquard_common::smol_str::SmolStr::new_static(
363 "isDefaultRef",
364 ),
365 ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean {
366 description: None,
367 default: None,
368 r#const: None,
369 }),
370 );
371 map.insert(
372 ::jacquard_common::smol_str::SmolStr::new_static(
373 "langBreakdown",
374 ),
375 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
376 description: None,
377 r#ref: ::jacquard_common::CowStr::new_static(
378 "#langBreakdown",
379 ),
380 }),
381 );
382 map
383 },
384 }),
385 );
386 map
387 },
388 }
389}
390
391impl<'a> ::jacquard_lexicon::schema::LexiconSchema for CommitCountBreakdown<'a> {
392 fn nsid() -> &'static str {
393 "sh.tangled.git.refUpdate"
394 }
395 fn def_name() -> &'static str {
396 "commitCountBreakdown"
397 }
398 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
399 lexicon_doc_sh_tangled_git_refUpdate()
400 }
401 fn validate(
402 &self,
403 ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
404 Ok(())
405 }
406}
407
408#[jacquard_derive::lexicon]
409#[derive(
410 serde::Serialize,
411 serde::Deserialize,
412 Debug,
413 Clone,
414 PartialEq,
415 Eq,
416 jacquard_derive::IntoStatic
417)]
418#[serde(rename_all = "camelCase")]
419pub struct IndividualEmailCommitCount<'a> {
420 pub count: i64,
421 #[serde(borrow)]
422 pub email: jacquard_common::CowStr<'a>,
423}
424
425pub mod individual_email_commit_count_state {
426
427 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
428 #[allow(unused)]
429 use ::core::marker::PhantomData;
430 mod sealed {
431 pub trait Sealed {}
432 }
433 pub trait State: sealed::Sealed {
435 type Email;
436 type Count;
437 }
438 pub struct Empty(());
440 impl sealed::Sealed for Empty {}
441 impl State for Empty {
442 type Email = Unset;
443 type Count = Unset;
444 }
445 pub struct SetEmail<S: State = Empty>(PhantomData<fn() -> S>);
447 impl<S: State> sealed::Sealed for SetEmail<S> {}
448 impl<S: State> State for SetEmail<S> {
449 type Email = Set<members::email>;
450 type Count = S::Count;
451 }
452 pub struct SetCount<S: State = Empty>(PhantomData<fn() -> S>);
454 impl<S: State> sealed::Sealed for SetCount<S> {}
455 impl<S: State> State for SetCount<S> {
456 type Email = S::Email;
457 type Count = Set<members::count>;
458 }
459 #[allow(non_camel_case_types)]
461 pub mod members {
462 pub struct email(());
464 pub struct count(());
466 }
467}
468
469pub struct IndividualEmailCommitCountBuilder<
471 'a,
472 S: individual_email_commit_count_state::State,
473> {
474 _phantom_state: ::core::marker::PhantomData<fn() -> S>,
475 __unsafe_private_named: (
476 ::core::option::Option<i64>,
477 ::core::option::Option<jacquard_common::CowStr<'a>>,
478 ),
479 _phantom: ::core::marker::PhantomData<&'a ()>,
480}
481
482impl<'a> IndividualEmailCommitCount<'a> {
483 pub fn new() -> IndividualEmailCommitCountBuilder<
485 'a,
486 individual_email_commit_count_state::Empty,
487 > {
488 IndividualEmailCommitCountBuilder::new()
489 }
490}
491
492impl<
493 'a,
494> IndividualEmailCommitCountBuilder<'a, individual_email_commit_count_state::Empty> {
495 pub fn new() -> Self {
497 IndividualEmailCommitCountBuilder {
498 _phantom_state: ::core::marker::PhantomData,
499 __unsafe_private_named: (None, None),
500 _phantom: ::core::marker::PhantomData,
501 }
502 }
503}
504
505impl<'a, S> IndividualEmailCommitCountBuilder<'a, S>
506where
507 S: individual_email_commit_count_state::State,
508 S::Count: individual_email_commit_count_state::IsUnset,
509{
510 pub fn count(
512 mut self,
513 value: impl Into<i64>,
514 ) -> IndividualEmailCommitCountBuilder<
515 'a,
516 individual_email_commit_count_state::SetCount<S>,
517 > {
518 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
519 IndividualEmailCommitCountBuilder {
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> IndividualEmailCommitCountBuilder<'a, S>
528where
529 S: individual_email_commit_count_state::State,
530 S::Email: individual_email_commit_count_state::IsUnset,
531{
532 pub fn email(
534 mut self,
535 value: impl Into<jacquard_common::CowStr<'a>>,
536 ) -> IndividualEmailCommitCountBuilder<
537 'a,
538 individual_email_commit_count_state::SetEmail<S>,
539 > {
540 self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
541 IndividualEmailCommitCountBuilder {
542 _phantom_state: ::core::marker::PhantomData,
543 __unsafe_private_named: self.__unsafe_private_named,
544 _phantom: ::core::marker::PhantomData,
545 }
546 }
547}
548
549impl<'a, S> IndividualEmailCommitCountBuilder<'a, S>
550where
551 S: individual_email_commit_count_state::State,
552 S::Email: individual_email_commit_count_state::IsSet,
553 S::Count: individual_email_commit_count_state::IsSet,
554{
555 pub fn build(self) -> IndividualEmailCommitCount<'a> {
557 IndividualEmailCommitCount {
558 count: self.__unsafe_private_named.0.unwrap(),
559 email: self.__unsafe_private_named.1.unwrap(),
560 extra_data: Default::default(),
561 }
562 }
563 pub fn build_with_data(
565 self,
566 extra_data: std::collections::BTreeMap<
567 jacquard_common::smol_str::SmolStr,
568 jacquard_common::types::value::Data<'a>,
569 >,
570 ) -> IndividualEmailCommitCount<'a> {
571 IndividualEmailCommitCount {
572 count: self.__unsafe_private_named.0.unwrap(),
573 email: self.__unsafe_private_named.1.unwrap(),
574 extra_data: Some(extra_data),
575 }
576 }
577}
578
579impl<'a> ::jacquard_lexicon::schema::LexiconSchema for IndividualEmailCommitCount<'a> {
580 fn nsid() -> &'static str {
581 "sh.tangled.git.refUpdate"
582 }
583 fn def_name() -> &'static str {
584 "individualEmailCommitCount"
585 }
586 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
587 lexicon_doc_sh_tangled_git_refUpdate()
588 }
589 fn validate(
590 &self,
591 ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
592 Ok(())
593 }
594}
595
596#[jacquard_derive::lexicon]
597#[derive(
598 serde::Serialize,
599 serde::Deserialize,
600 Debug,
601 Clone,
602 PartialEq,
603 Eq,
604 jacquard_derive::IntoStatic
605)]
606#[serde(rename_all = "camelCase")]
607pub struct IndividualLanguageSize<'a> {
608 #[serde(borrow)]
609 pub lang: jacquard_common::CowStr<'a>,
610 pub size: i64,
611}
612
613pub mod individual_language_size_state {
614
615 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
616 #[allow(unused)]
617 use ::core::marker::PhantomData;
618 mod sealed {
619 pub trait Sealed {}
620 }
621 pub trait State: sealed::Sealed {
623 type Lang;
624 type Size;
625 }
626 pub struct Empty(());
628 impl sealed::Sealed for Empty {}
629 impl State for Empty {
630 type Lang = Unset;
631 type Size = Unset;
632 }
633 pub struct SetLang<S: State = Empty>(PhantomData<fn() -> S>);
635 impl<S: State> sealed::Sealed for SetLang<S> {}
636 impl<S: State> State for SetLang<S> {
637 type Lang = Set<members::lang>;
638 type Size = S::Size;
639 }
640 pub struct SetSize<S: State = Empty>(PhantomData<fn() -> S>);
642 impl<S: State> sealed::Sealed for SetSize<S> {}
643 impl<S: State> State for SetSize<S> {
644 type Lang = S::Lang;
645 type Size = Set<members::size>;
646 }
647 #[allow(non_camel_case_types)]
649 pub mod members {
650 pub struct lang(());
652 pub struct size(());
654 }
655}
656
657pub struct IndividualLanguageSizeBuilder<'a, S: individual_language_size_state::State> {
659 _phantom_state: ::core::marker::PhantomData<fn() -> S>,
660 __unsafe_private_named: (
661 ::core::option::Option<jacquard_common::CowStr<'a>>,
662 ::core::option::Option<i64>,
663 ),
664 _phantom: ::core::marker::PhantomData<&'a ()>,
665}
666
667impl<'a> IndividualLanguageSize<'a> {
668 pub fn new() -> IndividualLanguageSizeBuilder<
670 'a,
671 individual_language_size_state::Empty,
672 > {
673 IndividualLanguageSizeBuilder::new()
674 }
675}
676
677impl<'a> IndividualLanguageSizeBuilder<'a, individual_language_size_state::Empty> {
678 pub fn new() -> Self {
680 IndividualLanguageSizeBuilder {
681 _phantom_state: ::core::marker::PhantomData,
682 __unsafe_private_named: (None, None),
683 _phantom: ::core::marker::PhantomData,
684 }
685 }
686}
687
688impl<'a, S> IndividualLanguageSizeBuilder<'a, S>
689where
690 S: individual_language_size_state::State,
691 S::Lang: individual_language_size_state::IsUnset,
692{
693 pub fn lang(
695 mut self,
696 value: impl Into<jacquard_common::CowStr<'a>>,
697 ) -> IndividualLanguageSizeBuilder<'a, individual_language_size_state::SetLang<S>> {
698 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
699 IndividualLanguageSizeBuilder {
700 _phantom_state: ::core::marker::PhantomData,
701 __unsafe_private_named: self.__unsafe_private_named,
702 _phantom: ::core::marker::PhantomData,
703 }
704 }
705}
706
707impl<'a, S> IndividualLanguageSizeBuilder<'a, S>
708where
709 S: individual_language_size_state::State,
710 S::Size: individual_language_size_state::IsUnset,
711{
712 pub fn size(
714 mut self,
715 value: impl Into<i64>,
716 ) -> IndividualLanguageSizeBuilder<'a, individual_language_size_state::SetSize<S>> {
717 self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
718 IndividualLanguageSizeBuilder {
719 _phantom_state: ::core::marker::PhantomData,
720 __unsafe_private_named: self.__unsafe_private_named,
721 _phantom: ::core::marker::PhantomData,
722 }
723 }
724}
725
726impl<'a, S> IndividualLanguageSizeBuilder<'a, S>
727where
728 S: individual_language_size_state::State,
729 S::Lang: individual_language_size_state::IsSet,
730 S::Size: individual_language_size_state::IsSet,
731{
732 pub fn build(self) -> IndividualLanguageSize<'a> {
734 IndividualLanguageSize {
735 lang: self.__unsafe_private_named.0.unwrap(),
736 size: self.__unsafe_private_named.1.unwrap(),
737 extra_data: Default::default(),
738 }
739 }
740 pub fn build_with_data(
742 self,
743 extra_data: std::collections::BTreeMap<
744 jacquard_common::smol_str::SmolStr,
745 jacquard_common::types::value::Data<'a>,
746 >,
747 ) -> IndividualLanguageSize<'a> {
748 IndividualLanguageSize {
749 lang: self.__unsafe_private_named.0.unwrap(),
750 size: self.__unsafe_private_named.1.unwrap(),
751 extra_data: Some(extra_data),
752 }
753 }
754}
755
756impl<'a> ::jacquard_lexicon::schema::LexiconSchema for IndividualLanguageSize<'a> {
757 fn nsid() -> &'static str {
758 "sh.tangled.git.refUpdate"
759 }
760 fn def_name() -> &'static str {
761 "individualLanguageSize"
762 }
763 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
764 lexicon_doc_sh_tangled_git_refUpdate()
765 }
766 fn validate(
767 &self,
768 ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
769 Ok(())
770 }
771}
772
773#[jacquard_derive::lexicon]
774#[derive(
775 serde::Serialize,
776 serde::Deserialize,
777 Debug,
778 Clone,
779 PartialEq,
780 Eq,
781 jacquard_derive::IntoStatic,
782 Default
783)]
784#[serde(rename_all = "camelCase")]
785pub struct LangBreakdown<'a> {
786 #[serde(skip_serializing_if = "std::option::Option::is_none")]
787 #[serde(borrow)]
788 pub inputs: std::option::Option<
789 Vec<crate::sh_tangled::git::ref_update::IndividualLanguageSize<'a>>,
790 >,
791}
792
793impl<'a> ::jacquard_lexicon::schema::LexiconSchema for LangBreakdown<'a> {
794 fn nsid() -> &'static str {
795 "sh.tangled.git.refUpdate"
796 }
797 fn def_name() -> &'static str {
798 "langBreakdown"
799 }
800 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
801 lexicon_doc_sh_tangled_git_refUpdate()
802 }
803 fn validate(
804 &self,
805 ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
806 Ok(())
807 }
808}
809
810#[jacquard_derive::lexicon]
812#[derive(
813 serde::Serialize,
814 serde::Deserialize,
815 Debug,
816 Clone,
817 PartialEq,
818 Eq,
819 jacquard_derive::IntoStatic
820)]
821#[serde(rename_all = "camelCase")]
822pub struct RefUpdate<'a> {
823 #[serde(borrow)]
825 pub committer_did: jacquard_common::types::string::Did<'a>,
826 #[serde(borrow)]
827 pub meta: crate::sh_tangled::git::ref_update::Meta<'a>,
828 #[serde(borrow)]
830 pub new_sha: jacquard_common::CowStr<'a>,
831 #[serde(borrow)]
833 pub old_sha: jacquard_common::CowStr<'a>,
834 #[serde(borrow)]
836 pub r#ref: jacquard_common::CowStr<'a>,
837 #[serde(borrow)]
839 pub repo_did: jacquard_common::types::string::Did<'a>,
840 #[serde(borrow)]
842 pub repo_name: jacquard_common::CowStr<'a>,
843}
844
845pub mod ref_update_state {
846
847 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
848 #[allow(unused)]
849 use ::core::marker::PhantomData;
850 mod sealed {
851 pub trait Sealed {}
852 }
853 pub trait State: sealed::Sealed {
855 type Ref;
856 type CommitterDid;
857 type RepoDid;
858 type RepoName;
859 type OldSha;
860 type NewSha;
861 type Meta;
862 }
863 pub struct Empty(());
865 impl sealed::Sealed for Empty {}
866 impl State for Empty {
867 type Ref = Unset;
868 type CommitterDid = Unset;
869 type RepoDid = Unset;
870 type RepoName = Unset;
871 type OldSha = Unset;
872 type NewSha = Unset;
873 type Meta = Unset;
874 }
875 pub struct SetRef<S: State = Empty>(PhantomData<fn() -> S>);
877 impl<S: State> sealed::Sealed for SetRef<S> {}
878 impl<S: State> State for SetRef<S> {
879 type Ref = Set<members::r#ref>;
880 type CommitterDid = S::CommitterDid;
881 type RepoDid = S::RepoDid;
882 type RepoName = S::RepoName;
883 type OldSha = S::OldSha;
884 type NewSha = S::NewSha;
885 type Meta = S::Meta;
886 }
887 pub struct SetCommitterDid<S: State = Empty>(PhantomData<fn() -> S>);
889 impl<S: State> sealed::Sealed for SetCommitterDid<S> {}
890 impl<S: State> State for SetCommitterDid<S> {
891 type Ref = S::Ref;
892 type CommitterDid = Set<members::committer_did>;
893 type RepoDid = S::RepoDid;
894 type RepoName = S::RepoName;
895 type OldSha = S::OldSha;
896 type NewSha = S::NewSha;
897 type Meta = S::Meta;
898 }
899 pub struct SetRepoDid<S: State = Empty>(PhantomData<fn() -> S>);
901 impl<S: State> sealed::Sealed for SetRepoDid<S> {}
902 impl<S: State> State for SetRepoDid<S> {
903 type Ref = S::Ref;
904 type CommitterDid = S::CommitterDid;
905 type RepoDid = Set<members::repo_did>;
906 type RepoName = S::RepoName;
907 type OldSha = S::OldSha;
908 type NewSha = S::NewSha;
909 type Meta = S::Meta;
910 }
911 pub struct SetRepoName<S: State = Empty>(PhantomData<fn() -> S>);
913 impl<S: State> sealed::Sealed for SetRepoName<S> {}
914 impl<S: State> State for SetRepoName<S> {
915 type Ref = S::Ref;
916 type CommitterDid = S::CommitterDid;
917 type RepoDid = S::RepoDid;
918 type RepoName = Set<members::repo_name>;
919 type OldSha = S::OldSha;
920 type NewSha = S::NewSha;
921 type Meta = S::Meta;
922 }
923 pub struct SetOldSha<S: State = Empty>(PhantomData<fn() -> S>);
925 impl<S: State> sealed::Sealed for SetOldSha<S> {}
926 impl<S: State> State for SetOldSha<S> {
927 type Ref = S::Ref;
928 type CommitterDid = S::CommitterDid;
929 type RepoDid = S::RepoDid;
930 type RepoName = S::RepoName;
931 type OldSha = Set<members::old_sha>;
932 type NewSha = S::NewSha;
933 type Meta = S::Meta;
934 }
935 pub struct SetNewSha<S: State = Empty>(PhantomData<fn() -> S>);
937 impl<S: State> sealed::Sealed for SetNewSha<S> {}
938 impl<S: State> State for SetNewSha<S> {
939 type Ref = S::Ref;
940 type CommitterDid = S::CommitterDid;
941 type RepoDid = S::RepoDid;
942 type RepoName = S::RepoName;
943 type OldSha = S::OldSha;
944 type NewSha = Set<members::new_sha>;
945 type Meta = S::Meta;
946 }
947 pub struct SetMeta<S: State = Empty>(PhantomData<fn() -> S>);
949 impl<S: State> sealed::Sealed for SetMeta<S> {}
950 impl<S: State> State for SetMeta<S> {
951 type Ref = S::Ref;
952 type CommitterDid = S::CommitterDid;
953 type RepoDid = S::RepoDid;
954 type RepoName = S::RepoName;
955 type OldSha = S::OldSha;
956 type NewSha = S::NewSha;
957 type Meta = Set<members::meta>;
958 }
959 #[allow(non_camel_case_types)]
961 pub mod members {
962 pub struct r#ref(());
964 pub struct committer_did(());
966 pub struct repo_did(());
968 pub struct repo_name(());
970 pub struct old_sha(());
972 pub struct new_sha(());
974 pub struct meta(());
976 }
977}
978
979pub struct RefUpdateBuilder<'a, S: ref_update_state::State> {
981 _phantom_state: ::core::marker::PhantomData<fn() -> S>,
982 __unsafe_private_named: (
983 ::core::option::Option<jacquard_common::types::string::Did<'a>>,
984 ::core::option::Option<crate::sh_tangled::git::ref_update::Meta<'a>>,
985 ::core::option::Option<jacquard_common::CowStr<'a>>,
986 ::core::option::Option<jacquard_common::CowStr<'a>>,
987 ::core::option::Option<jacquard_common::CowStr<'a>>,
988 ::core::option::Option<jacquard_common::types::string::Did<'a>>,
989 ::core::option::Option<jacquard_common::CowStr<'a>>,
990 ),
991 _phantom: ::core::marker::PhantomData<&'a ()>,
992}
993
994impl<'a> RefUpdate<'a> {
995 pub fn new() -> RefUpdateBuilder<'a, ref_update_state::Empty> {
997 RefUpdateBuilder::new()
998 }
999}
1000
1001impl<'a> RefUpdateBuilder<'a, ref_update_state::Empty> {
1002 pub fn new() -> Self {
1004 RefUpdateBuilder {
1005 _phantom_state: ::core::marker::PhantomData,
1006 __unsafe_private_named: (None, None, None, None, None, None, None),
1007 _phantom: ::core::marker::PhantomData,
1008 }
1009 }
1010}
1011
1012impl<'a, S> RefUpdateBuilder<'a, S>
1013where
1014 S: ref_update_state::State,
1015 S::CommitterDid: ref_update_state::IsUnset,
1016{
1017 pub fn committer_did(
1019 mut self,
1020 value: impl Into<jacquard_common::types::string::Did<'a>>,
1021 ) -> RefUpdateBuilder<'a, ref_update_state::SetCommitterDid<S>> {
1022 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
1023 RefUpdateBuilder {
1024 _phantom_state: ::core::marker::PhantomData,
1025 __unsafe_private_named: self.__unsafe_private_named,
1026 _phantom: ::core::marker::PhantomData,
1027 }
1028 }
1029}
1030
1031impl<'a, S> RefUpdateBuilder<'a, S>
1032where
1033 S: ref_update_state::State,
1034 S::Meta: ref_update_state::IsUnset,
1035{
1036 pub fn meta(
1038 mut self,
1039 value: impl Into<crate::sh_tangled::git::ref_update::Meta<'a>>,
1040 ) -> RefUpdateBuilder<'a, ref_update_state::SetMeta<S>> {
1041 self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
1042 RefUpdateBuilder {
1043 _phantom_state: ::core::marker::PhantomData,
1044 __unsafe_private_named: self.__unsafe_private_named,
1045 _phantom: ::core::marker::PhantomData,
1046 }
1047 }
1048}
1049
1050impl<'a, S> RefUpdateBuilder<'a, S>
1051where
1052 S: ref_update_state::State,
1053 S::NewSha: ref_update_state::IsUnset,
1054{
1055 pub fn new_sha(
1057 mut self,
1058 value: impl Into<jacquard_common::CowStr<'a>>,
1059 ) -> RefUpdateBuilder<'a, ref_update_state::SetNewSha<S>> {
1060 self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into());
1061 RefUpdateBuilder {
1062 _phantom_state: ::core::marker::PhantomData,
1063 __unsafe_private_named: self.__unsafe_private_named,
1064 _phantom: ::core::marker::PhantomData,
1065 }
1066 }
1067}
1068
1069impl<'a, S> RefUpdateBuilder<'a, S>
1070where
1071 S: ref_update_state::State,
1072 S::OldSha: ref_update_state::IsUnset,
1073{
1074 pub fn old_sha(
1076 mut self,
1077 value: impl Into<jacquard_common::CowStr<'a>>,
1078 ) -> RefUpdateBuilder<'a, ref_update_state::SetOldSha<S>> {
1079 self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into());
1080 RefUpdateBuilder {
1081 _phantom_state: ::core::marker::PhantomData,
1082 __unsafe_private_named: self.__unsafe_private_named,
1083 _phantom: ::core::marker::PhantomData,
1084 }
1085 }
1086}
1087
1088impl<'a, S> RefUpdateBuilder<'a, S>
1089where
1090 S: ref_update_state::State,
1091 S::Ref: ref_update_state::IsUnset,
1092{
1093 pub fn r#ref(
1095 mut self,
1096 value: impl Into<jacquard_common::CowStr<'a>>,
1097 ) -> RefUpdateBuilder<'a, ref_update_state::SetRef<S>> {
1098 self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into());
1099 RefUpdateBuilder {
1100 _phantom_state: ::core::marker::PhantomData,
1101 __unsafe_private_named: self.__unsafe_private_named,
1102 _phantom: ::core::marker::PhantomData,
1103 }
1104 }
1105}
1106
1107impl<'a, S> RefUpdateBuilder<'a, S>
1108where
1109 S: ref_update_state::State,
1110 S::RepoDid: ref_update_state::IsUnset,
1111{
1112 pub fn repo_did(
1114 mut self,
1115 value: impl Into<jacquard_common::types::string::Did<'a>>,
1116 ) -> RefUpdateBuilder<'a, ref_update_state::SetRepoDid<S>> {
1117 self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into());
1118 RefUpdateBuilder {
1119 _phantom_state: ::core::marker::PhantomData,
1120 __unsafe_private_named: self.__unsafe_private_named,
1121 _phantom: ::core::marker::PhantomData,
1122 }
1123 }
1124}
1125
1126impl<'a, S> RefUpdateBuilder<'a, S>
1127where
1128 S: ref_update_state::State,
1129 S::RepoName: ref_update_state::IsUnset,
1130{
1131 pub fn repo_name(
1133 mut self,
1134 value: impl Into<jacquard_common::CowStr<'a>>,
1135 ) -> RefUpdateBuilder<'a, ref_update_state::SetRepoName<S>> {
1136 self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into());
1137 RefUpdateBuilder {
1138 _phantom_state: ::core::marker::PhantomData,
1139 __unsafe_private_named: self.__unsafe_private_named,
1140 _phantom: ::core::marker::PhantomData,
1141 }
1142 }
1143}
1144
1145impl<'a, S> RefUpdateBuilder<'a, S>
1146where
1147 S: ref_update_state::State,
1148 S::Ref: ref_update_state::IsSet,
1149 S::CommitterDid: ref_update_state::IsSet,
1150 S::RepoDid: ref_update_state::IsSet,
1151 S::RepoName: ref_update_state::IsSet,
1152 S::OldSha: ref_update_state::IsSet,
1153 S::NewSha: ref_update_state::IsSet,
1154 S::Meta: ref_update_state::IsSet,
1155{
1156 pub fn build(self) -> RefUpdate<'a> {
1158 RefUpdate {
1159 committer_did: self.__unsafe_private_named.0.unwrap(),
1160 meta: self.__unsafe_private_named.1.unwrap(),
1161 new_sha: self.__unsafe_private_named.2.unwrap(),
1162 old_sha: self.__unsafe_private_named.3.unwrap(),
1163 r#ref: self.__unsafe_private_named.4.unwrap(),
1164 repo_did: self.__unsafe_private_named.5.unwrap(),
1165 repo_name: self.__unsafe_private_named.6.unwrap(),
1166 extra_data: Default::default(),
1167 }
1168 }
1169 pub fn build_with_data(
1171 self,
1172 extra_data: std::collections::BTreeMap<
1173 jacquard_common::smol_str::SmolStr,
1174 jacquard_common::types::value::Data<'a>,
1175 >,
1176 ) -> RefUpdate<'a> {
1177 RefUpdate {
1178 committer_did: self.__unsafe_private_named.0.unwrap(),
1179 meta: self.__unsafe_private_named.1.unwrap(),
1180 new_sha: self.__unsafe_private_named.2.unwrap(),
1181 old_sha: self.__unsafe_private_named.3.unwrap(),
1182 r#ref: self.__unsafe_private_named.4.unwrap(),
1183 repo_did: self.__unsafe_private_named.5.unwrap(),
1184 repo_name: self.__unsafe_private_named.6.unwrap(),
1185 extra_data: Some(extra_data),
1186 }
1187 }
1188}
1189
1190impl<'a> RefUpdate<'a> {
1191 pub fn uri(
1192 uri: impl Into<jacquard_common::CowStr<'a>>,
1193 ) -> Result<
1194 jacquard_common::types::uri::RecordUri<'a, RefUpdateRecord>,
1195 jacquard_common::types::uri::UriError,
1196 > {
1197 jacquard_common::types::uri::RecordUri::try_from_uri(
1198 jacquard_common::types::string::AtUri::new_cow(uri.into())?,
1199 )
1200 }
1201}
1202
1203#[derive(
1205 serde::Serialize,
1206 serde::Deserialize,
1207 Debug,
1208 Clone,
1209 PartialEq,
1210 Eq,
1211 jacquard_derive::IntoStatic
1212)]
1213#[serde(rename_all = "camelCase")]
1214pub struct RefUpdateGetRecordOutput<'a> {
1215 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1216 #[serde(borrow)]
1217 pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>,
1218 #[serde(borrow)]
1219 pub uri: jacquard_common::types::string::AtUri<'a>,
1220 #[serde(borrow)]
1221 pub value: RefUpdate<'a>,
1222}
1223
1224impl From<RefUpdateGetRecordOutput<'_>> for RefUpdate<'_> {
1225 fn from(output: RefUpdateGetRecordOutput<'_>) -> Self {
1226 use jacquard_common::IntoStatic;
1227 output.value.into_static()
1228 }
1229}
1230
1231impl jacquard_common::types::collection::Collection for RefUpdate<'_> {
1232 const NSID: &'static str = "sh.tangled.git.refUpdate";
1233 type Record = RefUpdateRecord;
1234}
1235
1236#[derive(Debug, serde::Serialize, serde::Deserialize)]
1238pub struct RefUpdateRecord;
1239impl jacquard_common::xrpc::XrpcResp for RefUpdateRecord {
1240 const NSID: &'static str = "sh.tangled.git.refUpdate";
1241 const ENCODING: &'static str = "application/json";
1242 type Output<'de> = RefUpdateGetRecordOutput<'de>;
1243 type Err<'de> = jacquard_common::types::collection::RecordError<'de>;
1244}
1245
1246impl jacquard_common::types::collection::Collection for RefUpdateRecord {
1247 const NSID: &'static str = "sh.tangled.git.refUpdate";
1248 type Record = RefUpdateRecord;
1249}
1250
1251impl<'a> ::jacquard_lexicon::schema::LexiconSchema for RefUpdate<'a> {
1252 fn nsid() -> &'static str {
1253 "sh.tangled.git.refUpdate"
1254 }
1255 fn def_name() -> &'static str {
1256 "main"
1257 }
1258 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
1259 lexicon_doc_sh_tangled_git_refUpdate()
1260 }
1261 fn validate(
1262 &self,
1263 ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
1264 {
1265 let value = &self.new_sha;
1266 #[allow(unused_comparisons)]
1267 if <str>::len(value.as_ref()) > 40usize {
1268 return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
1269 path: ::jacquard_lexicon::validation::ValidationPath::from_field(
1270 "new_sha",
1271 ),
1272 max: 40usize,
1273 actual: <str>::len(value.as_ref()),
1274 });
1275 }
1276 }
1277 {
1278 let value = &self.new_sha;
1279 #[allow(unused_comparisons)]
1280 if <str>::len(value.as_ref()) < 40usize {
1281 return Err(::jacquard_lexicon::validation::ConstraintError::MinLength {
1282 path: ::jacquard_lexicon::validation::ValidationPath::from_field(
1283 "new_sha",
1284 ),
1285 min: 40usize,
1286 actual: <str>::len(value.as_ref()),
1287 });
1288 }
1289 }
1290 {
1291 let value = &self.old_sha;
1292 #[allow(unused_comparisons)]
1293 if <str>::len(value.as_ref()) > 40usize {
1294 return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
1295 path: ::jacquard_lexicon::validation::ValidationPath::from_field(
1296 "old_sha",
1297 ),
1298 max: 40usize,
1299 actual: <str>::len(value.as_ref()),
1300 });
1301 }
1302 }
1303 {
1304 let value = &self.old_sha;
1305 #[allow(unused_comparisons)]
1306 if <str>::len(value.as_ref()) < 40usize {
1307 return Err(::jacquard_lexicon::validation::ConstraintError::MinLength {
1308 path: ::jacquard_lexicon::validation::ValidationPath::from_field(
1309 "old_sha",
1310 ),
1311 min: 40usize,
1312 actual: <str>::len(value.as_ref()),
1313 });
1314 }
1315 }
1316 {
1317 let value = &self.r#ref;
1318 #[allow(unused_comparisons)]
1319 if <str>::len(value.as_ref()) > 2560usize {
1320 return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
1321 path: ::jacquard_lexicon::validation::ValidationPath::from_field(
1322 "ref",
1323 ),
1324 max: 2560usize,
1325 actual: <str>::len(value.as_ref()),
1326 });
1327 }
1328 }
1329 {
1330 let value = &self.r#ref;
1331 {
1332 let count = ::unicode_segmentation::UnicodeSegmentation::graphemes(
1333 value.as_ref(),
1334 true,
1335 )
1336 .count();
1337 if count > 256usize {
1338 return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes {
1339 path: ::jacquard_lexicon::validation::ValidationPath::from_field(
1340 "ref",
1341 ),
1342 max: 256usize,
1343 actual: count,
1344 });
1345 }
1346 }
1347 }
1348 Ok(())
1349 }
1350}
1351
1352#[jacquard_derive::lexicon]
1353#[derive(
1354 serde::Serialize,
1355 serde::Deserialize,
1356 Debug,
1357 Clone,
1358 PartialEq,
1359 Eq,
1360 jacquard_derive::IntoStatic
1361)]
1362#[serde(rename_all = "camelCase")]
1363pub struct Meta<'a> {
1364 #[serde(borrow)]
1365 pub commit_count: crate::sh_tangled::git::ref_update::CommitCountBreakdown<'a>,
1366 pub is_default_ref: bool,
1367 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1368 #[serde(borrow)]
1369 pub lang_breakdown: Option<crate::sh_tangled::git::ref_update::LangBreakdown<'a>>,
1370}
1371
1372pub mod meta_state {
1373
1374 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
1375 #[allow(unused)]
1376 use ::core::marker::PhantomData;
1377 mod sealed {
1378 pub trait Sealed {}
1379 }
1380 pub trait State: sealed::Sealed {
1382 type IsDefaultRef;
1383 type CommitCount;
1384 }
1385 pub struct Empty(());
1387 impl sealed::Sealed for Empty {}
1388 impl State for Empty {
1389 type IsDefaultRef = Unset;
1390 type CommitCount = Unset;
1391 }
1392 pub struct SetIsDefaultRef<S: State = Empty>(PhantomData<fn() -> S>);
1394 impl<S: State> sealed::Sealed for SetIsDefaultRef<S> {}
1395 impl<S: State> State for SetIsDefaultRef<S> {
1396 type IsDefaultRef = Set<members::is_default_ref>;
1397 type CommitCount = S::CommitCount;
1398 }
1399 pub struct SetCommitCount<S: State = Empty>(PhantomData<fn() -> S>);
1401 impl<S: State> sealed::Sealed for SetCommitCount<S> {}
1402 impl<S: State> State for SetCommitCount<S> {
1403 type IsDefaultRef = S::IsDefaultRef;
1404 type CommitCount = Set<members::commit_count>;
1405 }
1406 #[allow(non_camel_case_types)]
1408 pub mod members {
1409 pub struct is_default_ref(());
1411 pub struct commit_count(());
1413 }
1414}
1415
1416pub struct MetaBuilder<'a, S: meta_state::State> {
1418 _phantom_state: ::core::marker::PhantomData<fn() -> S>,
1419 __unsafe_private_named: (
1420 ::core::option::Option<
1421 crate::sh_tangled::git::ref_update::CommitCountBreakdown<'a>,
1422 >,
1423 ::core::option::Option<bool>,
1424 ::core::option::Option<crate::sh_tangled::git::ref_update::LangBreakdown<'a>>,
1425 ),
1426 _phantom: ::core::marker::PhantomData<&'a ()>,
1427}
1428
1429impl<'a> Meta<'a> {
1430 pub fn new() -> MetaBuilder<'a, meta_state::Empty> {
1432 MetaBuilder::new()
1433 }
1434}
1435
1436impl<'a> MetaBuilder<'a, meta_state::Empty> {
1437 pub fn new() -> Self {
1439 MetaBuilder {
1440 _phantom_state: ::core::marker::PhantomData,
1441 __unsafe_private_named: (None, None, None),
1442 _phantom: ::core::marker::PhantomData,
1443 }
1444 }
1445}
1446
1447impl<'a, S> MetaBuilder<'a, S>
1448where
1449 S: meta_state::State,
1450 S::CommitCount: meta_state::IsUnset,
1451{
1452 pub fn commit_count(
1454 mut self,
1455 value: impl Into<crate::sh_tangled::git::ref_update::CommitCountBreakdown<'a>>,
1456 ) -> MetaBuilder<'a, meta_state::SetCommitCount<S>> {
1457 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
1458 MetaBuilder {
1459 _phantom_state: ::core::marker::PhantomData,
1460 __unsafe_private_named: self.__unsafe_private_named,
1461 _phantom: ::core::marker::PhantomData,
1462 }
1463 }
1464}
1465
1466impl<'a, S> MetaBuilder<'a, S>
1467where
1468 S: meta_state::State,
1469 S::IsDefaultRef: meta_state::IsUnset,
1470{
1471 pub fn is_default_ref(
1473 mut self,
1474 value: impl Into<bool>,
1475 ) -> MetaBuilder<'a, meta_state::SetIsDefaultRef<S>> {
1476 self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
1477 MetaBuilder {
1478 _phantom_state: ::core::marker::PhantomData,
1479 __unsafe_private_named: self.__unsafe_private_named,
1480 _phantom: ::core::marker::PhantomData,
1481 }
1482 }
1483}
1484
1485impl<'a, S: meta_state::State> MetaBuilder<'a, S> {
1486 pub fn lang_breakdown(
1488 mut self,
1489 value: impl Into<Option<crate::sh_tangled::git::ref_update::LangBreakdown<'a>>>,
1490 ) -> Self {
1491 self.__unsafe_private_named.2 = value.into();
1492 self
1493 }
1494 pub fn maybe_lang_breakdown(
1496 mut self,
1497 value: Option<crate::sh_tangled::git::ref_update::LangBreakdown<'a>>,
1498 ) -> Self {
1499 self.__unsafe_private_named.2 = value;
1500 self
1501 }
1502}
1503
1504impl<'a, S> MetaBuilder<'a, S>
1505where
1506 S: meta_state::State,
1507 S::IsDefaultRef: meta_state::IsSet,
1508 S::CommitCount: meta_state::IsSet,
1509{
1510 pub fn build(self) -> Meta<'a> {
1512 Meta {
1513 commit_count: self.__unsafe_private_named.0.unwrap(),
1514 is_default_ref: self.__unsafe_private_named.1.unwrap(),
1515 lang_breakdown: self.__unsafe_private_named.2,
1516 extra_data: Default::default(),
1517 }
1518 }
1519 pub fn build_with_data(
1521 self,
1522 extra_data: std::collections::BTreeMap<
1523 jacquard_common::smol_str::SmolStr,
1524 jacquard_common::types::value::Data<'a>,
1525 >,
1526 ) -> Meta<'a> {
1527 Meta {
1528 commit_count: self.__unsafe_private_named.0.unwrap(),
1529 is_default_ref: self.__unsafe_private_named.1.unwrap(),
1530 lang_breakdown: self.__unsafe_private_named.2,
1531 extra_data: Some(extra_data),
1532 }
1533 }
1534}
1535
1536impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Meta<'a> {
1537 fn nsid() -> &'static str {
1538 "sh.tangled.git.refUpdate"
1539 }
1540 fn def_name() -> &'static str {
1541 "meta"
1542 }
1543 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
1544 lexicon_doc_sh_tangled_git_refUpdate()
1545 }
1546 fn validate(
1547 &self,
1548 ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
1549 Ok(())
1550 }
1551}