1pub mod cancel_pipeline;
9pub mod status;
10
11
12#[allow(unused_imports)]
13use alloc::collections::BTreeMap;
14
15#[allow(unused_imports)]
16use core::marker::PhantomData;
17use jacquard_common::CowStr;
18
19#[allow(unused_imports)]
20use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
21use jacquard_common::types::collection::{Collection, RecordError};
22use jacquard_common::types::string::{Did, AtUri, Cid};
23use jacquard_common::types::uri::{RecordUri, UriError};
24use jacquard_common::xrpc::XrpcResp;
25use jacquard_derive::{IntoStatic, lexicon};
26use jacquard_lexicon::lexicon::LexiconDoc;
27use jacquard_lexicon::schema::LexiconSchema;
28
29#[allow(unused_imports)]
30use jacquard_lexicon::validation::{ConstraintError, ValidationPath};
31use serde::{Serialize, Deserialize};
32use crate::sh_tangled::pipeline;
33
34#[lexicon]
35#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
36#[serde(rename_all = "camelCase")]
37pub struct CloneOpts<'a> {
38 pub depth: i64,
39 pub skip: bool,
40 pub submodules: bool,
41}
42
43
44#[lexicon]
45#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
46#[serde(rename_all = "camelCase", rename = "sh.tangled.pipeline", tag = "$type")]
47pub struct Pipeline<'a> {
48 #[serde(borrow)]
49 pub trigger_metadata: pipeline::TriggerMetadata<'a>,
50 #[serde(borrow)]
51 pub workflows: Vec<pipeline::Workflow<'a>>,
52}
53
54#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
57#[serde(rename_all = "camelCase")]
58pub struct PipelineGetRecordOutput<'a> {
59 #[serde(skip_serializing_if = "Option::is_none")]
60 #[serde(borrow)]
61 pub cid: Option<Cid<'a>>,
62 #[serde(borrow)]
63 pub uri: AtUri<'a>,
64 #[serde(borrow)]
65 pub value: Pipeline<'a>,
66}
67
68
69#[lexicon]
70#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
71#[serde(rename_all = "camelCase")]
72pub struct ManualTriggerData<'a> {
73 #[serde(skip_serializing_if = "Option::is_none")]
74 #[serde(borrow)]
75 pub inputs: Option<Vec<pipeline::Pair<'a>>>,
76}
77
78
79#[lexicon]
80#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
81#[serde(rename_all = "camelCase")]
82pub struct Pair<'a> {
83 #[serde(borrow)]
84 pub key: CowStr<'a>,
85 #[serde(borrow)]
86 pub value: CowStr<'a>,
87}
88
89
90#[lexicon]
91#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
92#[serde(rename_all = "camelCase")]
93pub struct PullRequestTriggerData<'a> {
94 #[serde(borrow)]
95 pub action: CowStr<'a>,
96 #[serde(borrow)]
97 pub source_branch: CowStr<'a>,
98 #[serde(borrow)]
99 pub source_sha: CowStr<'a>,
100 #[serde(borrow)]
101 pub target_branch: CowStr<'a>,
102}
103
104
105#[lexicon]
106#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
107#[serde(rename_all = "camelCase")]
108pub struct PushTriggerData<'a> {
109 #[serde(borrow)]
110 pub new_sha: CowStr<'a>,
111 #[serde(borrow)]
112 pub old_sha: CowStr<'a>,
113 #[serde(borrow)]
114 pub r#ref: CowStr<'a>,
115}
116
117
118#[lexicon]
119#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
120#[serde(rename_all = "camelCase")]
121pub struct TriggerMetadata<'a> {
122 #[serde(borrow)]
123 pub kind: CowStr<'a>,
124 #[serde(skip_serializing_if = "Option::is_none")]
125 #[serde(borrow)]
126 pub manual: Option<pipeline::ManualTriggerData<'a>>,
127 #[serde(skip_serializing_if = "Option::is_none")]
128 #[serde(borrow)]
129 pub pull_request: Option<pipeline::PullRequestTriggerData<'a>>,
130 #[serde(skip_serializing_if = "Option::is_none")]
131 #[serde(borrow)]
132 pub push: Option<pipeline::PushTriggerData<'a>>,
133 #[serde(borrow)]
134 pub repo: pipeline::TriggerRepo<'a>,
135}
136
137
138#[lexicon]
139#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
140#[serde(rename_all = "camelCase")]
141pub struct TriggerRepo<'a> {
142 #[serde(borrow)]
143 pub default_branch: CowStr<'a>,
144 #[serde(borrow)]
145 pub did: Did<'a>,
146 #[serde(borrow)]
147 pub knot: CowStr<'a>,
148 #[serde(borrow)]
149 pub repo: CowStr<'a>,
150}
151
152
153#[lexicon]
154#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
155#[serde(rename_all = "camelCase")]
156pub struct Workflow<'a> {
157 #[serde(borrow)]
158 pub clone: pipeline::CloneOpts<'a>,
159 #[serde(borrow)]
160 pub engine: CowStr<'a>,
161 #[serde(borrow)]
162 pub name: CowStr<'a>,
163 #[serde(borrow)]
164 pub raw: CowStr<'a>,
165}
166
167impl<'a> Pipeline<'a> {
168 pub fn uri(
169 uri: impl Into<CowStr<'a>>,
170 ) -> Result<RecordUri<'a, PipelineRecord>, UriError> {
171 RecordUri::try_from_uri(AtUri::new_cow(uri.into())?)
172 }
173}
174
175impl<'a> LexiconSchema for CloneOpts<'a> {
176 fn nsid() -> &'static str {
177 "sh.tangled.pipeline"
178 }
179 fn def_name() -> &'static str {
180 "cloneOpts"
181 }
182 fn lexicon_doc() -> LexiconDoc<'static> {
183 lexicon_doc_sh_tangled_pipeline()
184 }
185 fn validate(&self) -> Result<(), ConstraintError> {
186 Ok(())
187 }
188}
189
190#[derive(Debug, Serialize, Deserialize)]
193pub struct PipelineRecord;
194impl XrpcResp for PipelineRecord {
195 const NSID: &'static str = "sh.tangled.pipeline";
196 const ENCODING: &'static str = "application/json";
197 type Output<'de> = PipelineGetRecordOutput<'de>;
198 type Err<'de> = RecordError<'de>;
199}
200
201impl From<PipelineGetRecordOutput<'_>> for Pipeline<'_> {
202 fn from(output: PipelineGetRecordOutput<'_>) -> Self {
203 use jacquard_common::IntoStatic;
204 output.value.into_static()
205 }
206}
207
208impl Collection for Pipeline<'_> {
209 const NSID: &'static str = "sh.tangled.pipeline";
210 type Record = PipelineRecord;
211}
212
213impl Collection for PipelineRecord {
214 const NSID: &'static str = "sh.tangled.pipeline";
215 type Record = PipelineRecord;
216}
217
218impl<'a> LexiconSchema for Pipeline<'a> {
219 fn nsid() -> &'static str {
220 "sh.tangled.pipeline"
221 }
222 fn def_name() -> &'static str {
223 "main"
224 }
225 fn lexicon_doc() -> LexiconDoc<'static> {
226 lexicon_doc_sh_tangled_pipeline()
227 }
228 fn validate(&self) -> Result<(), ConstraintError> {
229 Ok(())
230 }
231}
232
233impl<'a> LexiconSchema for ManualTriggerData<'a> {
234 fn nsid() -> &'static str {
235 "sh.tangled.pipeline"
236 }
237 fn def_name() -> &'static str {
238 "manualTriggerData"
239 }
240 fn lexicon_doc() -> LexiconDoc<'static> {
241 lexicon_doc_sh_tangled_pipeline()
242 }
243 fn validate(&self) -> Result<(), ConstraintError> {
244 Ok(())
245 }
246}
247
248impl<'a> LexiconSchema for Pair<'a> {
249 fn nsid() -> &'static str {
250 "sh.tangled.pipeline"
251 }
252 fn def_name() -> &'static str {
253 "pair"
254 }
255 fn lexicon_doc() -> LexiconDoc<'static> {
256 lexicon_doc_sh_tangled_pipeline()
257 }
258 fn validate(&self) -> Result<(), ConstraintError> {
259 Ok(())
260 }
261}
262
263impl<'a> LexiconSchema for PullRequestTriggerData<'a> {
264 fn nsid() -> &'static str {
265 "sh.tangled.pipeline"
266 }
267 fn def_name() -> &'static str {
268 "pullRequestTriggerData"
269 }
270 fn lexicon_doc() -> LexiconDoc<'static> {
271 lexicon_doc_sh_tangled_pipeline()
272 }
273 fn validate(&self) -> Result<(), ConstraintError> {
274 {
275 let value = &self.source_sha;
276 #[allow(unused_comparisons)]
277 if <str>::len(value.as_ref()) > 40usize {
278 return Err(ConstraintError::MaxLength {
279 path: ValidationPath::from_field("source_sha"),
280 max: 40usize,
281 actual: <str>::len(value.as_ref()),
282 });
283 }
284 }
285 {
286 let value = &self.source_sha;
287 #[allow(unused_comparisons)]
288 if <str>::len(value.as_ref()) < 40usize {
289 return Err(ConstraintError::MinLength {
290 path: ValidationPath::from_field("source_sha"),
291 min: 40usize,
292 actual: <str>::len(value.as_ref()),
293 });
294 }
295 }
296 Ok(())
297 }
298}
299
300impl<'a> LexiconSchema for PushTriggerData<'a> {
301 fn nsid() -> &'static str {
302 "sh.tangled.pipeline"
303 }
304 fn def_name() -> &'static str {
305 "pushTriggerData"
306 }
307 fn lexicon_doc() -> LexiconDoc<'static> {
308 lexicon_doc_sh_tangled_pipeline()
309 }
310 fn validate(&self) -> Result<(), ConstraintError> {
311 {
312 let value = &self.new_sha;
313 #[allow(unused_comparisons)]
314 if <str>::len(value.as_ref()) > 40usize {
315 return Err(ConstraintError::MaxLength {
316 path: ValidationPath::from_field("new_sha"),
317 max: 40usize,
318 actual: <str>::len(value.as_ref()),
319 });
320 }
321 }
322 {
323 let value = &self.new_sha;
324 #[allow(unused_comparisons)]
325 if <str>::len(value.as_ref()) < 40usize {
326 return Err(ConstraintError::MinLength {
327 path: ValidationPath::from_field("new_sha"),
328 min: 40usize,
329 actual: <str>::len(value.as_ref()),
330 });
331 }
332 }
333 {
334 let value = &self.old_sha;
335 #[allow(unused_comparisons)]
336 if <str>::len(value.as_ref()) > 40usize {
337 return Err(ConstraintError::MaxLength {
338 path: ValidationPath::from_field("old_sha"),
339 max: 40usize,
340 actual: <str>::len(value.as_ref()),
341 });
342 }
343 }
344 {
345 let value = &self.old_sha;
346 #[allow(unused_comparisons)]
347 if <str>::len(value.as_ref()) < 40usize {
348 return Err(ConstraintError::MinLength {
349 path: ValidationPath::from_field("old_sha"),
350 min: 40usize,
351 actual: <str>::len(value.as_ref()),
352 });
353 }
354 }
355 Ok(())
356 }
357}
358
359impl<'a> LexiconSchema for TriggerMetadata<'a> {
360 fn nsid() -> &'static str {
361 "sh.tangled.pipeline"
362 }
363 fn def_name() -> &'static str {
364 "triggerMetadata"
365 }
366 fn lexicon_doc() -> LexiconDoc<'static> {
367 lexicon_doc_sh_tangled_pipeline()
368 }
369 fn validate(&self) -> Result<(), ConstraintError> {
370 Ok(())
371 }
372}
373
374impl<'a> LexiconSchema for TriggerRepo<'a> {
375 fn nsid() -> &'static str {
376 "sh.tangled.pipeline"
377 }
378 fn def_name() -> &'static str {
379 "triggerRepo"
380 }
381 fn lexicon_doc() -> LexiconDoc<'static> {
382 lexicon_doc_sh_tangled_pipeline()
383 }
384 fn validate(&self) -> Result<(), ConstraintError> {
385 Ok(())
386 }
387}
388
389impl<'a> LexiconSchema for Workflow<'a> {
390 fn nsid() -> &'static str {
391 "sh.tangled.pipeline"
392 }
393 fn def_name() -> &'static str {
394 "workflow"
395 }
396 fn lexicon_doc() -> LexiconDoc<'static> {
397 lexicon_doc_sh_tangled_pipeline()
398 }
399 fn validate(&self) -> Result<(), ConstraintError> {
400 Ok(())
401 }
402}
403
404pub mod clone_opts_state {
405
406 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
407 #[allow(unused)]
408 use ::core::marker::PhantomData;
409 mod sealed {
410 pub trait Sealed {}
411 }
412 pub trait State: sealed::Sealed {
414 type Skip;
415 type Depth;
416 type Submodules;
417 }
418 pub struct Empty(());
420 impl sealed::Sealed for Empty {}
421 impl State for Empty {
422 type Skip = Unset;
423 type Depth = Unset;
424 type Submodules = Unset;
425 }
426 pub struct SetSkip<S: State = Empty>(PhantomData<fn() -> S>);
428 impl<S: State> sealed::Sealed for SetSkip<S> {}
429 impl<S: State> State for SetSkip<S> {
430 type Skip = Set<members::skip>;
431 type Depth = S::Depth;
432 type Submodules = S::Submodules;
433 }
434 pub struct SetDepth<S: State = Empty>(PhantomData<fn() -> S>);
436 impl<S: State> sealed::Sealed for SetDepth<S> {}
437 impl<S: State> State for SetDepth<S> {
438 type Skip = S::Skip;
439 type Depth = Set<members::depth>;
440 type Submodules = S::Submodules;
441 }
442 pub struct SetSubmodules<S: State = Empty>(PhantomData<fn() -> S>);
444 impl<S: State> sealed::Sealed for SetSubmodules<S> {}
445 impl<S: State> State for SetSubmodules<S> {
446 type Skip = S::Skip;
447 type Depth = S::Depth;
448 type Submodules = Set<members::submodules>;
449 }
450 #[allow(non_camel_case_types)]
452 pub mod members {
453 pub struct skip(());
455 pub struct depth(());
457 pub struct submodules(());
459 }
460}
461
462pub struct CloneOptsBuilder<'a, S: clone_opts_state::State> {
464 _state: PhantomData<fn() -> S>,
465 _fields: (Option<i64>, Option<bool>, Option<bool>),
466 _lifetime: PhantomData<&'a ()>,
467}
468
469impl<'a> CloneOpts<'a> {
470 pub fn new() -> CloneOptsBuilder<'a, clone_opts_state::Empty> {
472 CloneOptsBuilder::new()
473 }
474}
475
476impl<'a> CloneOptsBuilder<'a, clone_opts_state::Empty> {
477 pub fn new() -> Self {
479 CloneOptsBuilder {
480 _state: PhantomData,
481 _fields: (None, None, None),
482 _lifetime: PhantomData,
483 }
484 }
485}
486
487impl<'a, S> CloneOptsBuilder<'a, S>
488where
489 S: clone_opts_state::State,
490 S::Depth: clone_opts_state::IsUnset,
491{
492 pub fn depth(
494 mut self,
495 value: impl Into<i64>,
496 ) -> CloneOptsBuilder<'a, clone_opts_state::SetDepth<S>> {
497 self._fields.0 = Option::Some(value.into());
498 CloneOptsBuilder {
499 _state: PhantomData,
500 _fields: self._fields,
501 _lifetime: PhantomData,
502 }
503 }
504}
505
506impl<'a, S> CloneOptsBuilder<'a, S>
507where
508 S: clone_opts_state::State,
509 S::Skip: clone_opts_state::IsUnset,
510{
511 pub fn skip(
513 mut self,
514 value: impl Into<bool>,
515 ) -> CloneOptsBuilder<'a, clone_opts_state::SetSkip<S>> {
516 self._fields.1 = Option::Some(value.into());
517 CloneOptsBuilder {
518 _state: PhantomData,
519 _fields: self._fields,
520 _lifetime: PhantomData,
521 }
522 }
523}
524
525impl<'a, S> CloneOptsBuilder<'a, S>
526where
527 S: clone_opts_state::State,
528 S::Submodules: clone_opts_state::IsUnset,
529{
530 pub fn submodules(
532 mut self,
533 value: impl Into<bool>,
534 ) -> CloneOptsBuilder<'a, clone_opts_state::SetSubmodules<S>> {
535 self._fields.2 = Option::Some(value.into());
536 CloneOptsBuilder {
537 _state: PhantomData,
538 _fields: self._fields,
539 _lifetime: PhantomData,
540 }
541 }
542}
543
544impl<'a, S> CloneOptsBuilder<'a, S>
545where
546 S: clone_opts_state::State,
547 S::Skip: clone_opts_state::IsSet,
548 S::Depth: clone_opts_state::IsSet,
549 S::Submodules: clone_opts_state::IsSet,
550{
551 pub fn build(self) -> CloneOpts<'a> {
553 CloneOpts {
554 depth: self._fields.0.unwrap(),
555 skip: self._fields.1.unwrap(),
556 submodules: self._fields.2.unwrap(),
557 extra_data: Default::default(),
558 }
559 }
560 pub fn build_with_data(
562 self,
563 extra_data: BTreeMap<
564 jacquard_common::deps::smol_str::SmolStr,
565 jacquard_common::types::value::Data<'a>,
566 >,
567 ) -> CloneOpts<'a> {
568 CloneOpts {
569 depth: self._fields.0.unwrap(),
570 skip: self._fields.1.unwrap(),
571 submodules: self._fields.2.unwrap(),
572 extra_data: Some(extra_data),
573 }
574 }
575}
576
577fn lexicon_doc_sh_tangled_pipeline() -> LexiconDoc<'static> {
578 #[allow(unused_imports)]
579 use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType};
580 use jacquard_lexicon::lexicon::*;
581 use alloc::collections::BTreeMap;
582 LexiconDoc {
583 lexicon: Lexicon::Lexicon1,
584 id: CowStr::new_static("sh.tangled.pipeline"),
585 defs: {
586 let mut map = BTreeMap::new();
587 map.insert(
588 SmolStr::new_static("cloneOpts"),
589 LexUserType::Object(LexObject {
590 required: Some(
591 vec![
592 SmolStr::new_static("skip"), SmolStr::new_static("depth"),
593 SmolStr::new_static("submodules")
594 ],
595 ),
596 properties: {
597 #[allow(unused_mut)]
598 let mut map = BTreeMap::new();
599 map.insert(
600 SmolStr::new_static("depth"),
601 LexObjectProperty::Integer(LexInteger {
602 ..Default::default()
603 }),
604 );
605 map.insert(
606 SmolStr::new_static("skip"),
607 LexObjectProperty::Boolean(LexBoolean {
608 ..Default::default()
609 }),
610 );
611 map.insert(
612 SmolStr::new_static("submodules"),
613 LexObjectProperty::Boolean(LexBoolean {
614 ..Default::default()
615 }),
616 );
617 map
618 },
619 ..Default::default()
620 }),
621 );
622 map.insert(
623 SmolStr::new_static("main"),
624 LexUserType::Record(LexRecord {
625 key: Some(CowStr::new_static("tid")),
626 record: LexRecordRecord::Object(LexObject {
627 required: Some(
628 vec![
629 SmolStr::new_static("triggerMetadata"),
630 SmolStr::new_static("workflows")
631 ],
632 ),
633 properties: {
634 #[allow(unused_mut)]
635 let mut map = BTreeMap::new();
636 map.insert(
637 SmolStr::new_static("triggerMetadata"),
638 LexObjectProperty::Ref(LexRef {
639 r#ref: CowStr::new_static("#triggerMetadata"),
640 ..Default::default()
641 }),
642 );
643 map.insert(
644 SmolStr::new_static("workflows"),
645 LexObjectProperty::Array(LexArray {
646 items: LexArrayItem::Ref(LexRef {
647 r#ref: CowStr::new_static("#workflow"),
648 ..Default::default()
649 }),
650 ..Default::default()
651 }),
652 );
653 map
654 },
655 ..Default::default()
656 }),
657 ..Default::default()
658 }),
659 );
660 map.insert(
661 SmolStr::new_static("manualTriggerData"),
662 LexUserType::Object(LexObject {
663 properties: {
664 #[allow(unused_mut)]
665 let mut map = BTreeMap::new();
666 map.insert(
667 SmolStr::new_static("inputs"),
668 LexObjectProperty::Array(LexArray {
669 items: LexArrayItem::Ref(LexRef {
670 r#ref: CowStr::new_static("#pair"),
671 ..Default::default()
672 }),
673 ..Default::default()
674 }),
675 );
676 map
677 },
678 ..Default::default()
679 }),
680 );
681 map.insert(
682 SmolStr::new_static("pair"),
683 LexUserType::Object(LexObject {
684 required: Some(
685 vec![SmolStr::new_static("key"), SmolStr::new_static("value")],
686 ),
687 properties: {
688 #[allow(unused_mut)]
689 let mut map = BTreeMap::new();
690 map.insert(
691 SmolStr::new_static("key"),
692 LexObjectProperty::String(LexString { ..Default::default() }),
693 );
694 map.insert(
695 SmolStr::new_static("value"),
696 LexObjectProperty::String(LexString { ..Default::default() }),
697 );
698 map
699 },
700 ..Default::default()
701 }),
702 );
703 map.insert(
704 SmolStr::new_static("pullRequestTriggerData"),
705 LexUserType::Object(LexObject {
706 required: Some(
707 vec![
708 SmolStr::new_static("sourceBranch"),
709 SmolStr::new_static("targetBranch"),
710 SmolStr::new_static("sourceSha"),
711 SmolStr::new_static("action")
712 ],
713 ),
714 properties: {
715 #[allow(unused_mut)]
716 let mut map = BTreeMap::new();
717 map.insert(
718 SmolStr::new_static("action"),
719 LexObjectProperty::String(LexString { ..Default::default() }),
720 );
721 map.insert(
722 SmolStr::new_static("sourceBranch"),
723 LexObjectProperty::String(LexString { ..Default::default() }),
724 );
725 map.insert(
726 SmolStr::new_static("sourceSha"),
727 LexObjectProperty::String(LexString {
728 min_length: Some(40usize),
729 max_length: Some(40usize),
730 ..Default::default()
731 }),
732 );
733 map.insert(
734 SmolStr::new_static("targetBranch"),
735 LexObjectProperty::String(LexString { ..Default::default() }),
736 );
737 map
738 },
739 ..Default::default()
740 }),
741 );
742 map.insert(
743 SmolStr::new_static("pushTriggerData"),
744 LexUserType::Object(LexObject {
745 required: Some(
746 vec![
747 SmolStr::new_static("ref"), SmolStr::new_static("newSha"),
748 SmolStr::new_static("oldSha")
749 ],
750 ),
751 properties: {
752 #[allow(unused_mut)]
753 let mut map = BTreeMap::new();
754 map.insert(
755 SmolStr::new_static("newSha"),
756 LexObjectProperty::String(LexString {
757 min_length: Some(40usize),
758 max_length: Some(40usize),
759 ..Default::default()
760 }),
761 );
762 map.insert(
763 SmolStr::new_static("oldSha"),
764 LexObjectProperty::String(LexString {
765 min_length: Some(40usize),
766 max_length: Some(40usize),
767 ..Default::default()
768 }),
769 );
770 map.insert(
771 SmolStr::new_static("ref"),
772 LexObjectProperty::String(LexString { ..Default::default() }),
773 );
774 map
775 },
776 ..Default::default()
777 }),
778 );
779 map.insert(
780 SmolStr::new_static("triggerMetadata"),
781 LexUserType::Object(LexObject {
782 required: Some(
783 vec![SmolStr::new_static("kind"), SmolStr::new_static("repo")],
784 ),
785 properties: {
786 #[allow(unused_mut)]
787 let mut map = BTreeMap::new();
788 map.insert(
789 SmolStr::new_static("kind"),
790 LexObjectProperty::String(LexString { ..Default::default() }),
791 );
792 map.insert(
793 SmolStr::new_static("manual"),
794 LexObjectProperty::Ref(LexRef {
795 r#ref: CowStr::new_static("#manualTriggerData"),
796 ..Default::default()
797 }),
798 );
799 map.insert(
800 SmolStr::new_static("pullRequest"),
801 LexObjectProperty::Ref(LexRef {
802 r#ref: CowStr::new_static("#pullRequestTriggerData"),
803 ..Default::default()
804 }),
805 );
806 map.insert(
807 SmolStr::new_static("push"),
808 LexObjectProperty::Ref(LexRef {
809 r#ref: CowStr::new_static("#pushTriggerData"),
810 ..Default::default()
811 }),
812 );
813 map.insert(
814 SmolStr::new_static("repo"),
815 LexObjectProperty::Ref(LexRef {
816 r#ref: CowStr::new_static("#triggerRepo"),
817 ..Default::default()
818 }),
819 );
820 map
821 },
822 ..Default::default()
823 }),
824 );
825 map.insert(
826 SmolStr::new_static("triggerRepo"),
827 LexUserType::Object(LexObject {
828 required: Some(
829 vec![
830 SmolStr::new_static("knot"), SmolStr::new_static("did"),
831 SmolStr::new_static("repo"),
832 SmolStr::new_static("defaultBranch")
833 ],
834 ),
835 properties: {
836 #[allow(unused_mut)]
837 let mut map = BTreeMap::new();
838 map.insert(
839 SmolStr::new_static("defaultBranch"),
840 LexObjectProperty::String(LexString { ..Default::default() }),
841 );
842 map.insert(
843 SmolStr::new_static("did"),
844 LexObjectProperty::String(LexString {
845 format: Some(LexStringFormat::Did),
846 ..Default::default()
847 }),
848 );
849 map.insert(
850 SmolStr::new_static("knot"),
851 LexObjectProperty::String(LexString { ..Default::default() }),
852 );
853 map.insert(
854 SmolStr::new_static("repo"),
855 LexObjectProperty::String(LexString { ..Default::default() }),
856 );
857 map
858 },
859 ..Default::default()
860 }),
861 );
862 map.insert(
863 SmolStr::new_static("workflow"),
864 LexUserType::Object(LexObject {
865 required: Some(
866 vec![
867 SmolStr::new_static("name"), SmolStr::new_static("engine"),
868 SmolStr::new_static("clone"), SmolStr::new_static("raw")
869 ],
870 ),
871 properties: {
872 #[allow(unused_mut)]
873 let mut map = BTreeMap::new();
874 map.insert(
875 SmolStr::new_static("clone"),
876 LexObjectProperty::Ref(LexRef {
877 r#ref: CowStr::new_static("#cloneOpts"),
878 ..Default::default()
879 }),
880 );
881 map.insert(
882 SmolStr::new_static("engine"),
883 LexObjectProperty::String(LexString { ..Default::default() }),
884 );
885 map.insert(
886 SmolStr::new_static("name"),
887 LexObjectProperty::String(LexString { ..Default::default() }),
888 );
889 map.insert(
890 SmolStr::new_static("raw"),
891 LexObjectProperty::String(LexString { ..Default::default() }),
892 );
893 map
894 },
895 ..Default::default()
896 }),
897 );
898 map
899 },
900 ..Default::default()
901 }
902}
903
904pub mod pipeline_state {
905
906 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
907 #[allow(unused)]
908 use ::core::marker::PhantomData;
909 mod sealed {
910 pub trait Sealed {}
911 }
912 pub trait State: sealed::Sealed {
914 type TriggerMetadata;
915 type Workflows;
916 }
917 pub struct Empty(());
919 impl sealed::Sealed for Empty {}
920 impl State for Empty {
921 type TriggerMetadata = Unset;
922 type Workflows = Unset;
923 }
924 pub struct SetTriggerMetadata<S: State = Empty>(PhantomData<fn() -> S>);
926 impl<S: State> sealed::Sealed for SetTriggerMetadata<S> {}
927 impl<S: State> State for SetTriggerMetadata<S> {
928 type TriggerMetadata = Set<members::trigger_metadata>;
929 type Workflows = S::Workflows;
930 }
931 pub struct SetWorkflows<S: State = Empty>(PhantomData<fn() -> S>);
933 impl<S: State> sealed::Sealed for SetWorkflows<S> {}
934 impl<S: State> State for SetWorkflows<S> {
935 type TriggerMetadata = S::TriggerMetadata;
936 type Workflows = Set<members::workflows>;
937 }
938 #[allow(non_camel_case_types)]
940 pub mod members {
941 pub struct trigger_metadata(());
943 pub struct workflows(());
945 }
946}
947
948pub struct PipelineBuilder<'a, S: pipeline_state::State> {
950 _state: PhantomData<fn() -> S>,
951 _fields: (
952 Option<pipeline::TriggerMetadata<'a>>,
953 Option<Vec<pipeline::Workflow<'a>>>,
954 ),
955 _lifetime: PhantomData<&'a ()>,
956}
957
958impl<'a> Pipeline<'a> {
959 pub fn new() -> PipelineBuilder<'a, pipeline_state::Empty> {
961 PipelineBuilder::new()
962 }
963}
964
965impl<'a> PipelineBuilder<'a, pipeline_state::Empty> {
966 pub fn new() -> Self {
968 PipelineBuilder {
969 _state: PhantomData,
970 _fields: (None, None),
971 _lifetime: PhantomData,
972 }
973 }
974}
975
976impl<'a, S> PipelineBuilder<'a, S>
977where
978 S: pipeline_state::State,
979 S::TriggerMetadata: pipeline_state::IsUnset,
980{
981 pub fn trigger_metadata(
983 mut self,
984 value: impl Into<pipeline::TriggerMetadata<'a>>,
985 ) -> PipelineBuilder<'a, pipeline_state::SetTriggerMetadata<S>> {
986 self._fields.0 = Option::Some(value.into());
987 PipelineBuilder {
988 _state: PhantomData,
989 _fields: self._fields,
990 _lifetime: PhantomData,
991 }
992 }
993}
994
995impl<'a, S> PipelineBuilder<'a, S>
996where
997 S: pipeline_state::State,
998 S::Workflows: pipeline_state::IsUnset,
999{
1000 pub fn workflows(
1002 mut self,
1003 value: impl Into<Vec<pipeline::Workflow<'a>>>,
1004 ) -> PipelineBuilder<'a, pipeline_state::SetWorkflows<S>> {
1005 self._fields.1 = Option::Some(value.into());
1006 PipelineBuilder {
1007 _state: PhantomData,
1008 _fields: self._fields,
1009 _lifetime: PhantomData,
1010 }
1011 }
1012}
1013
1014impl<'a, S> PipelineBuilder<'a, S>
1015where
1016 S: pipeline_state::State,
1017 S::TriggerMetadata: pipeline_state::IsSet,
1018 S::Workflows: pipeline_state::IsSet,
1019{
1020 pub fn build(self) -> Pipeline<'a> {
1022 Pipeline {
1023 trigger_metadata: self._fields.0.unwrap(),
1024 workflows: self._fields.1.unwrap(),
1025 extra_data: Default::default(),
1026 }
1027 }
1028 pub fn build_with_data(
1030 self,
1031 extra_data: BTreeMap<
1032 jacquard_common::deps::smol_str::SmolStr,
1033 jacquard_common::types::value::Data<'a>,
1034 >,
1035 ) -> Pipeline<'a> {
1036 Pipeline {
1037 trigger_metadata: self._fields.0.unwrap(),
1038 workflows: self._fields.1.unwrap(),
1039 extra_data: Some(extra_data),
1040 }
1041 }
1042}
1043
1044pub mod trigger_metadata_state {
1045
1046 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
1047 #[allow(unused)]
1048 use ::core::marker::PhantomData;
1049 mod sealed {
1050 pub trait Sealed {}
1051 }
1052 pub trait State: sealed::Sealed {
1054 type Kind;
1055 type Repo;
1056 }
1057 pub struct Empty(());
1059 impl sealed::Sealed for Empty {}
1060 impl State for Empty {
1061 type Kind = Unset;
1062 type Repo = Unset;
1063 }
1064 pub struct SetKind<S: State = Empty>(PhantomData<fn() -> S>);
1066 impl<S: State> sealed::Sealed for SetKind<S> {}
1067 impl<S: State> State for SetKind<S> {
1068 type Kind = Set<members::kind>;
1069 type Repo = S::Repo;
1070 }
1071 pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>);
1073 impl<S: State> sealed::Sealed for SetRepo<S> {}
1074 impl<S: State> State for SetRepo<S> {
1075 type Kind = S::Kind;
1076 type Repo = Set<members::repo>;
1077 }
1078 #[allow(non_camel_case_types)]
1080 pub mod members {
1081 pub struct kind(());
1083 pub struct repo(());
1085 }
1086}
1087
1088pub struct TriggerMetadataBuilder<'a, S: trigger_metadata_state::State> {
1090 _state: PhantomData<fn() -> S>,
1091 _fields: (
1092 Option<CowStr<'a>>,
1093 Option<pipeline::ManualTriggerData<'a>>,
1094 Option<pipeline::PullRequestTriggerData<'a>>,
1095 Option<pipeline::PushTriggerData<'a>>,
1096 Option<pipeline::TriggerRepo<'a>>,
1097 ),
1098 _lifetime: PhantomData<&'a ()>,
1099}
1100
1101impl<'a> TriggerMetadata<'a> {
1102 pub fn new() -> TriggerMetadataBuilder<'a, trigger_metadata_state::Empty> {
1104 TriggerMetadataBuilder::new()
1105 }
1106}
1107
1108impl<'a> TriggerMetadataBuilder<'a, trigger_metadata_state::Empty> {
1109 pub fn new() -> Self {
1111 TriggerMetadataBuilder {
1112 _state: PhantomData,
1113 _fields: (None, None, None, None, None),
1114 _lifetime: PhantomData,
1115 }
1116 }
1117}
1118
1119impl<'a, S> TriggerMetadataBuilder<'a, S>
1120where
1121 S: trigger_metadata_state::State,
1122 S::Kind: trigger_metadata_state::IsUnset,
1123{
1124 pub fn kind(
1126 mut self,
1127 value: impl Into<CowStr<'a>>,
1128 ) -> TriggerMetadataBuilder<'a, trigger_metadata_state::SetKind<S>> {
1129 self._fields.0 = Option::Some(value.into());
1130 TriggerMetadataBuilder {
1131 _state: PhantomData,
1132 _fields: self._fields,
1133 _lifetime: PhantomData,
1134 }
1135 }
1136}
1137
1138impl<'a, S: trigger_metadata_state::State> TriggerMetadataBuilder<'a, S> {
1139 pub fn manual(
1141 mut self,
1142 value: impl Into<Option<pipeline::ManualTriggerData<'a>>>,
1143 ) -> Self {
1144 self._fields.1 = value.into();
1145 self
1146 }
1147 pub fn maybe_manual(
1149 mut self,
1150 value: Option<pipeline::ManualTriggerData<'a>>,
1151 ) -> Self {
1152 self._fields.1 = value;
1153 self
1154 }
1155}
1156
1157impl<'a, S: trigger_metadata_state::State> TriggerMetadataBuilder<'a, S> {
1158 pub fn pull_request(
1160 mut self,
1161 value: impl Into<Option<pipeline::PullRequestTriggerData<'a>>>,
1162 ) -> Self {
1163 self._fields.2 = value.into();
1164 self
1165 }
1166 pub fn maybe_pull_request(
1168 mut self,
1169 value: Option<pipeline::PullRequestTriggerData<'a>>,
1170 ) -> Self {
1171 self._fields.2 = value;
1172 self
1173 }
1174}
1175
1176impl<'a, S: trigger_metadata_state::State> TriggerMetadataBuilder<'a, S> {
1177 pub fn push(
1179 mut self,
1180 value: impl Into<Option<pipeline::PushTriggerData<'a>>>,
1181 ) -> Self {
1182 self._fields.3 = value.into();
1183 self
1184 }
1185 pub fn maybe_push(mut self, value: Option<pipeline::PushTriggerData<'a>>) -> Self {
1187 self._fields.3 = value;
1188 self
1189 }
1190}
1191
1192impl<'a, S> TriggerMetadataBuilder<'a, S>
1193where
1194 S: trigger_metadata_state::State,
1195 S::Repo: trigger_metadata_state::IsUnset,
1196{
1197 pub fn repo(
1199 mut self,
1200 value: impl Into<pipeline::TriggerRepo<'a>>,
1201 ) -> TriggerMetadataBuilder<'a, trigger_metadata_state::SetRepo<S>> {
1202 self._fields.4 = Option::Some(value.into());
1203 TriggerMetadataBuilder {
1204 _state: PhantomData,
1205 _fields: self._fields,
1206 _lifetime: PhantomData,
1207 }
1208 }
1209}
1210
1211impl<'a, S> TriggerMetadataBuilder<'a, S>
1212where
1213 S: trigger_metadata_state::State,
1214 S::Kind: trigger_metadata_state::IsSet,
1215 S::Repo: trigger_metadata_state::IsSet,
1216{
1217 pub fn build(self) -> TriggerMetadata<'a> {
1219 TriggerMetadata {
1220 kind: self._fields.0.unwrap(),
1221 manual: self._fields.1,
1222 pull_request: self._fields.2,
1223 push: self._fields.3,
1224 repo: self._fields.4.unwrap(),
1225 extra_data: Default::default(),
1226 }
1227 }
1228 pub fn build_with_data(
1230 self,
1231 extra_data: BTreeMap<
1232 jacquard_common::deps::smol_str::SmolStr,
1233 jacquard_common::types::value::Data<'a>,
1234 >,
1235 ) -> TriggerMetadata<'a> {
1236 TriggerMetadata {
1237 kind: self._fields.0.unwrap(),
1238 manual: self._fields.1,
1239 pull_request: self._fields.2,
1240 push: self._fields.3,
1241 repo: self._fields.4.unwrap(),
1242 extra_data: Some(extra_data),
1243 }
1244 }
1245}
1246
1247pub mod trigger_repo_state {
1248
1249 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
1250 #[allow(unused)]
1251 use ::core::marker::PhantomData;
1252 mod sealed {
1253 pub trait Sealed {}
1254 }
1255 pub trait State: sealed::Sealed {
1257 type Repo;
1258 type Did;
1259 type Knot;
1260 type DefaultBranch;
1261 }
1262 pub struct Empty(());
1264 impl sealed::Sealed for Empty {}
1265 impl State for Empty {
1266 type Repo = Unset;
1267 type Did = Unset;
1268 type Knot = Unset;
1269 type DefaultBranch = Unset;
1270 }
1271 pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>);
1273 impl<S: State> sealed::Sealed for SetRepo<S> {}
1274 impl<S: State> State for SetRepo<S> {
1275 type Repo = Set<members::repo>;
1276 type Did = S::Did;
1277 type Knot = S::Knot;
1278 type DefaultBranch = S::DefaultBranch;
1279 }
1280 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>);
1282 impl<S: State> sealed::Sealed for SetDid<S> {}
1283 impl<S: State> State for SetDid<S> {
1284 type Repo = S::Repo;
1285 type Did = Set<members::did>;
1286 type Knot = S::Knot;
1287 type DefaultBranch = S::DefaultBranch;
1288 }
1289 pub struct SetKnot<S: State = Empty>(PhantomData<fn() -> S>);
1291 impl<S: State> sealed::Sealed for SetKnot<S> {}
1292 impl<S: State> State for SetKnot<S> {
1293 type Repo = S::Repo;
1294 type Did = S::Did;
1295 type Knot = Set<members::knot>;
1296 type DefaultBranch = S::DefaultBranch;
1297 }
1298 pub struct SetDefaultBranch<S: State = Empty>(PhantomData<fn() -> S>);
1300 impl<S: State> sealed::Sealed for SetDefaultBranch<S> {}
1301 impl<S: State> State for SetDefaultBranch<S> {
1302 type Repo = S::Repo;
1303 type Did = S::Did;
1304 type Knot = S::Knot;
1305 type DefaultBranch = Set<members::default_branch>;
1306 }
1307 #[allow(non_camel_case_types)]
1309 pub mod members {
1310 pub struct repo(());
1312 pub struct did(());
1314 pub struct knot(());
1316 pub struct default_branch(());
1318 }
1319}
1320
1321pub struct TriggerRepoBuilder<'a, S: trigger_repo_state::State> {
1323 _state: PhantomData<fn() -> S>,
1324 _fields: (
1325 Option<CowStr<'a>>,
1326 Option<Did<'a>>,
1327 Option<CowStr<'a>>,
1328 Option<CowStr<'a>>,
1329 ),
1330 _lifetime: PhantomData<&'a ()>,
1331}
1332
1333impl<'a> TriggerRepo<'a> {
1334 pub fn new() -> TriggerRepoBuilder<'a, trigger_repo_state::Empty> {
1336 TriggerRepoBuilder::new()
1337 }
1338}
1339
1340impl<'a> TriggerRepoBuilder<'a, trigger_repo_state::Empty> {
1341 pub fn new() -> Self {
1343 TriggerRepoBuilder {
1344 _state: PhantomData,
1345 _fields: (None, None, None, None),
1346 _lifetime: PhantomData,
1347 }
1348 }
1349}
1350
1351impl<'a, S> TriggerRepoBuilder<'a, S>
1352where
1353 S: trigger_repo_state::State,
1354 S::DefaultBranch: trigger_repo_state::IsUnset,
1355{
1356 pub fn default_branch(
1358 mut self,
1359 value: impl Into<CowStr<'a>>,
1360 ) -> TriggerRepoBuilder<'a, trigger_repo_state::SetDefaultBranch<S>> {
1361 self._fields.0 = Option::Some(value.into());
1362 TriggerRepoBuilder {
1363 _state: PhantomData,
1364 _fields: self._fields,
1365 _lifetime: PhantomData,
1366 }
1367 }
1368}
1369
1370impl<'a, S> TriggerRepoBuilder<'a, S>
1371where
1372 S: trigger_repo_state::State,
1373 S::Did: trigger_repo_state::IsUnset,
1374{
1375 pub fn did(
1377 mut self,
1378 value: impl Into<Did<'a>>,
1379 ) -> TriggerRepoBuilder<'a, trigger_repo_state::SetDid<S>> {
1380 self._fields.1 = Option::Some(value.into());
1381 TriggerRepoBuilder {
1382 _state: PhantomData,
1383 _fields: self._fields,
1384 _lifetime: PhantomData,
1385 }
1386 }
1387}
1388
1389impl<'a, S> TriggerRepoBuilder<'a, S>
1390where
1391 S: trigger_repo_state::State,
1392 S::Knot: trigger_repo_state::IsUnset,
1393{
1394 pub fn knot(
1396 mut self,
1397 value: impl Into<CowStr<'a>>,
1398 ) -> TriggerRepoBuilder<'a, trigger_repo_state::SetKnot<S>> {
1399 self._fields.2 = Option::Some(value.into());
1400 TriggerRepoBuilder {
1401 _state: PhantomData,
1402 _fields: self._fields,
1403 _lifetime: PhantomData,
1404 }
1405 }
1406}
1407
1408impl<'a, S> TriggerRepoBuilder<'a, S>
1409where
1410 S: trigger_repo_state::State,
1411 S::Repo: trigger_repo_state::IsUnset,
1412{
1413 pub fn repo(
1415 mut self,
1416 value: impl Into<CowStr<'a>>,
1417 ) -> TriggerRepoBuilder<'a, trigger_repo_state::SetRepo<S>> {
1418 self._fields.3 = Option::Some(value.into());
1419 TriggerRepoBuilder {
1420 _state: PhantomData,
1421 _fields: self._fields,
1422 _lifetime: PhantomData,
1423 }
1424 }
1425}
1426
1427impl<'a, S> TriggerRepoBuilder<'a, S>
1428where
1429 S: trigger_repo_state::State,
1430 S::Repo: trigger_repo_state::IsSet,
1431 S::Did: trigger_repo_state::IsSet,
1432 S::Knot: trigger_repo_state::IsSet,
1433 S::DefaultBranch: trigger_repo_state::IsSet,
1434{
1435 pub fn build(self) -> TriggerRepo<'a> {
1437 TriggerRepo {
1438 default_branch: self._fields.0.unwrap(),
1439 did: self._fields.1.unwrap(),
1440 knot: self._fields.2.unwrap(),
1441 repo: self._fields.3.unwrap(),
1442 extra_data: Default::default(),
1443 }
1444 }
1445 pub fn build_with_data(
1447 self,
1448 extra_data: BTreeMap<
1449 jacquard_common::deps::smol_str::SmolStr,
1450 jacquard_common::types::value::Data<'a>,
1451 >,
1452 ) -> TriggerRepo<'a> {
1453 TriggerRepo {
1454 default_branch: self._fields.0.unwrap(),
1455 did: self._fields.1.unwrap(),
1456 knot: self._fields.2.unwrap(),
1457 repo: self._fields.3.unwrap(),
1458 extra_data: Some(extra_data),
1459 }
1460 }
1461}
1462
1463pub mod workflow_state {
1464
1465 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
1466 #[allow(unused)]
1467 use ::core::marker::PhantomData;
1468 mod sealed {
1469 pub trait Sealed {}
1470 }
1471 pub trait State: sealed::Sealed {
1473 type Clone;
1474 type Name;
1475 type Raw;
1476 type Engine;
1477 }
1478 pub struct Empty(());
1480 impl sealed::Sealed for Empty {}
1481 impl State for Empty {
1482 type Clone = Unset;
1483 type Name = Unset;
1484 type Raw = Unset;
1485 type Engine = Unset;
1486 }
1487 pub struct SetClone<S: State = Empty>(PhantomData<fn() -> S>);
1489 impl<S: State> sealed::Sealed for SetClone<S> {}
1490 impl<S: State> State for SetClone<S> {
1491 type Clone = Set<members::clone>;
1492 type Name = S::Name;
1493 type Raw = S::Raw;
1494 type Engine = S::Engine;
1495 }
1496 pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>);
1498 impl<S: State> sealed::Sealed for SetName<S> {}
1499 impl<S: State> State for SetName<S> {
1500 type Clone = S::Clone;
1501 type Name = Set<members::name>;
1502 type Raw = S::Raw;
1503 type Engine = S::Engine;
1504 }
1505 pub struct SetRaw<S: State = Empty>(PhantomData<fn() -> S>);
1507 impl<S: State> sealed::Sealed for SetRaw<S> {}
1508 impl<S: State> State for SetRaw<S> {
1509 type Clone = S::Clone;
1510 type Name = S::Name;
1511 type Raw = Set<members::raw>;
1512 type Engine = S::Engine;
1513 }
1514 pub struct SetEngine<S: State = Empty>(PhantomData<fn() -> S>);
1516 impl<S: State> sealed::Sealed for SetEngine<S> {}
1517 impl<S: State> State for SetEngine<S> {
1518 type Clone = S::Clone;
1519 type Name = S::Name;
1520 type Raw = S::Raw;
1521 type Engine = Set<members::engine>;
1522 }
1523 #[allow(non_camel_case_types)]
1525 pub mod members {
1526 pub struct clone(());
1528 pub struct name(());
1530 pub struct raw(());
1532 pub struct engine(());
1534 }
1535}
1536
1537pub struct WorkflowBuilder<'a, S: workflow_state::State> {
1539 _state: PhantomData<fn() -> S>,
1540 _fields: (
1541 Option<pipeline::CloneOpts<'a>>,
1542 Option<CowStr<'a>>,
1543 Option<CowStr<'a>>,
1544 Option<CowStr<'a>>,
1545 ),
1546 _lifetime: PhantomData<&'a ()>,
1547}
1548
1549impl<'a> Workflow<'a> {
1550 pub fn new() -> WorkflowBuilder<'a, workflow_state::Empty> {
1552 WorkflowBuilder::new()
1553 }
1554}
1555
1556impl<'a> WorkflowBuilder<'a, workflow_state::Empty> {
1557 pub fn new() -> Self {
1559 WorkflowBuilder {
1560 _state: PhantomData,
1561 _fields: (None, None, None, None),
1562 _lifetime: PhantomData,
1563 }
1564 }
1565}
1566
1567impl<'a, S> WorkflowBuilder<'a, S>
1568where
1569 S: workflow_state::State,
1570 S::Clone: workflow_state::IsUnset,
1571{
1572 pub fn clone(
1574 mut self,
1575 value: impl Into<pipeline::CloneOpts<'a>>,
1576 ) -> WorkflowBuilder<'a, workflow_state::SetClone<S>> {
1577 self._fields.0 = Option::Some(value.into());
1578 WorkflowBuilder {
1579 _state: PhantomData,
1580 _fields: self._fields,
1581 _lifetime: PhantomData,
1582 }
1583 }
1584}
1585
1586impl<'a, S> WorkflowBuilder<'a, S>
1587where
1588 S: workflow_state::State,
1589 S::Engine: workflow_state::IsUnset,
1590{
1591 pub fn engine(
1593 mut self,
1594 value: impl Into<CowStr<'a>>,
1595 ) -> WorkflowBuilder<'a, workflow_state::SetEngine<S>> {
1596 self._fields.1 = Option::Some(value.into());
1597 WorkflowBuilder {
1598 _state: PhantomData,
1599 _fields: self._fields,
1600 _lifetime: PhantomData,
1601 }
1602 }
1603}
1604
1605impl<'a, S> WorkflowBuilder<'a, S>
1606where
1607 S: workflow_state::State,
1608 S::Name: workflow_state::IsUnset,
1609{
1610 pub fn name(
1612 mut self,
1613 value: impl Into<CowStr<'a>>,
1614 ) -> WorkflowBuilder<'a, workflow_state::SetName<S>> {
1615 self._fields.2 = Option::Some(value.into());
1616 WorkflowBuilder {
1617 _state: PhantomData,
1618 _fields: self._fields,
1619 _lifetime: PhantomData,
1620 }
1621 }
1622}
1623
1624impl<'a, S> WorkflowBuilder<'a, S>
1625where
1626 S: workflow_state::State,
1627 S::Raw: workflow_state::IsUnset,
1628{
1629 pub fn raw(
1631 mut self,
1632 value: impl Into<CowStr<'a>>,
1633 ) -> WorkflowBuilder<'a, workflow_state::SetRaw<S>> {
1634 self._fields.3 = Option::Some(value.into());
1635 WorkflowBuilder {
1636 _state: PhantomData,
1637 _fields: self._fields,
1638 _lifetime: PhantomData,
1639 }
1640 }
1641}
1642
1643impl<'a, S> WorkflowBuilder<'a, S>
1644where
1645 S: workflow_state::State,
1646 S::Clone: workflow_state::IsSet,
1647 S::Name: workflow_state::IsSet,
1648 S::Raw: workflow_state::IsSet,
1649 S::Engine: workflow_state::IsSet,
1650{
1651 pub fn build(self) -> Workflow<'a> {
1653 Workflow {
1654 clone: self._fields.0.unwrap(),
1655 engine: self._fields.1.unwrap(),
1656 name: self._fields.2.unwrap(),
1657 raw: self._fields.3.unwrap(),
1658 extra_data: Default::default(),
1659 }
1660 }
1661 pub fn build_with_data(
1663 self,
1664 extra_data: BTreeMap<
1665 jacquard_common::deps::smol_str::SmolStr,
1666 jacquard_common::types::value::Data<'a>,
1667 >,
1668 ) -> Workflow<'a> {
1669 Workflow {
1670 clone: self._fields.0.unwrap(),
1671 engine: self._fields.1.unwrap(),
1672 name: self._fields.2.unwrap(),
1673 raw: self._fields.3.unwrap(),
1674 extra_data: Some(extra_data),
1675 }
1676 }
1677}