1#![allow(clippy::needless_update)]
2
3use std::collections::HashMap;
4
5use derive_setters::Setters;
6use merge::Merge;
7use serde::{Deserialize, Serialize};
8
9use crate::is_default;
10
11#[derive(Default, Debug, Clone, Deserialize, Serialize, Merge, Setters, PartialEq, Eq)]
14#[setters(strip_option, into)]
15pub struct Event {
16 #[serde(skip_serializing_if = "Option::is_none")]
17 pub branch_protection_rule: Option<BranchProtectionRule>,
18 #[serde(skip_serializing_if = "Option::is_none")]
19 pub check_run: Option<CheckRun>,
20 #[serde(skip_serializing_if = "Option::is_none")]
21 pub check_suite: Option<CheckSuite>,
22 #[serde(skip_serializing_if = "Option::is_none")]
23 pub create: Option<Create>,
24 #[serde(skip_serializing_if = "Option::is_none")]
25 pub delete: Option<Delete>,
26 #[serde(skip_serializing_if = "Option::is_none")]
27 pub deployment: Option<Deployment>,
28 #[serde(skip_serializing_if = "Option::is_none")]
29 pub deployment_status: Option<DeploymentStatus>,
30 #[serde(skip_serializing_if = "Option::is_none")]
31 pub discussion: Option<Discussion>,
32 #[serde(skip_serializing_if = "Option::is_none")]
33 pub discussion_comment: Option<DiscussionComment>,
34 #[serde(skip_serializing_if = "Option::is_none")]
35 pub fork: Option<bool>,
36 #[serde(skip_serializing_if = "Option::is_none")]
37 pub gollum: Option<bool>,
38 #[serde(skip_serializing_if = "Option::is_none")]
39 pub issue_comment: Option<IssueComment>,
40 #[serde(skip_serializing_if = "Option::is_none")]
41 pub issues: Option<Issues>,
42 #[serde(skip_serializing_if = "Option::is_none")]
43 pub label: Option<Label>,
44 #[serde(skip_serializing_if = "Option::is_none")]
45 pub merge_group: Option<MergeGroup>,
46 #[serde(skip_serializing_if = "Option::is_none")]
47 pub milestone: Option<Milestone>,
48 #[serde(skip_serializing_if = "Option::is_none")]
49 pub page_build: Option<bool>,
50 #[serde(skip_serializing_if = "Option::is_none")]
51 pub public: Option<bool>,
52 #[serde(skip_serializing_if = "Option::is_none")]
53 pub pull_request: Option<PullRequest>,
54 #[serde(skip_serializing_if = "Option::is_none")]
55 pub pull_request_review: Option<PullRequestReview>,
56 #[serde(skip_serializing_if = "Option::is_none")]
57 pub pull_request_review_comment: Option<PullRequestReviewComment>,
58 #[serde(skip_serializing_if = "Option::is_none")]
59 pub pull_request_target: Option<PullRequestTarget>,
60 #[serde(skip_serializing_if = "Option::is_none")]
61 pub push: Option<Push>,
62 #[serde(skip_serializing_if = "Option::is_none")]
63 pub registry_package: Option<RegistryPackage>,
64 #[serde(skip_serializing_if = "Option::is_none")]
65 pub release: Option<Release>,
66 #[serde(skip_serializing_if = "Option::is_none")]
67 pub repository_dispatch: Option<RepositoryDispatch>,
68 #[serde(skip_serializing_if = "Option::is_none")]
69 pub schedule: Option<Vec<Schedule>>,
70 #[serde(skip_serializing_if = "Option::is_none")]
71 pub status: Option<bool>,
72 #[serde(skip_serializing_if = "Option::is_none")]
73 pub watch: Option<Watch>,
74 #[serde(skip_serializing_if = "Option::is_none")]
75 pub workflow_call: Option<WorkflowCall>,
76 #[serde(skip_serializing_if = "Option::is_none")]
77 pub workflow_dispatch: Option<WorkflowDispatch>,
78 #[serde(skip_serializing_if = "Option::is_none")]
79 pub workflow_run: Option<WorkflowRun>,
80}
81
82impl Event {
83 pub fn add_schedule(mut self, schedule: impl Into<Schedule>) -> Self {
84 if let Some(list) = self.schedule.as_mut() {
85 list.push(schedule.into());
86 } else {
87 self.schedule = Some(vec![schedule.into()])
88 }
89
90 self
91 }
92
93 pub fn add_cron_schedule(self, cron: impl ToString) -> Self {
94 self.add_schedule(Schedule::new(cron))
95 }
96}
97
98#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
101#[serde(rename_all = "snake_case")]
102pub enum BranchProtectionRuleType {
103 Created,
105 Edited,
107 Deleted,
109}
110
111#[derive(Debug, Clone, Default, Deserialize, Serialize, Setters, PartialEq, Eq)]
113#[setters(strip_option, into)]
114pub struct BranchProtectionRule {
115 #[serde(default, skip_serializing_if = "Vec::is_empty")]
116 pub types: Vec<BranchProtectionRuleType>,
117}
118
119impl BranchProtectionRule {
120 pub fn add_type(mut self, type_: BranchProtectionRuleType) -> Self {
122 self.types.push(type_);
123 self
124 }
125}
126
127#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
130#[serde(rename_all = "snake_case")]
131pub enum CheckRunType {
132 Created,
134 Rerequested,
136 Completed,
138 RequestedAction,
140}
141
142#[derive(Debug, Clone, Default, Deserialize, Serialize, Setters, PartialEq, Eq)]
143#[setters(strip_option, into)]
144pub struct CheckRun {
145 #[serde(default, skip_serializing_if = "Vec::is_empty")]
146 pub types: Vec<CheckRunType>,
147}
148
149impl CheckRun {
150 pub fn add_type(mut self, type_: CheckRunType) -> Self {
152 self.types.push(type_);
153 self
154 }
155}
156
157#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
160#[serde(rename_all = "snake_case")]
161pub enum CheckSuiteType {
162 Completed,
164}
165
166#[derive(Debug, Clone, Default, Deserialize, Serialize, Setters, PartialEq, Eq)]
169#[setters(strip_option, into)]
170pub struct CheckSuite {
171 #[serde(default, skip_serializing_if = "Vec::is_empty")]
172 pub types: Vec<CheckSuiteType>,
173}
174
175impl CheckSuite {
176 pub fn add_type(mut self, type_: CheckSuiteType) -> Self {
178 self.types.push(type_);
179 self
180 }
181}
182
183#[derive(Debug, Clone, Default, Deserialize, Serialize, Setters, PartialEq, Eq)]
186#[setters(strip_option, into)]
187pub struct Create {
188 #[serde(default, skip_serializing_if = "Vec::is_empty")]
190 pub branches: Vec<String>,
191 #[serde(default, skip_serializing_if = "Vec::is_empty")]
193 pub tags: Vec<String>,
194}
195
196impl Create {
197 pub fn add_branch<S: Into<String>>(mut self, branch: S) -> Self {
199 self.branches.push(branch.into());
200 self
201 }
202
203 pub fn add_tag<S: Into<String>>(mut self, tag: S) -> Self {
205 self.tags.push(tag.into());
206 self
207 }
208}
209
210#[derive(Debug, Clone, Default, Deserialize, Serialize, Setters, PartialEq, Eq)]
213#[setters(strip_option, into)]
214pub struct Delete {
215 #[serde(default, skip_serializing_if = "Vec::is_empty")]
217 pub branches: Vec<String>,
218 #[serde(default, skip_serializing_if = "Vec::is_empty")]
220 pub tags: Vec<String>,
221}
222
223impl Delete {
224 pub fn add_branch<S: Into<String>>(mut self, branch: S) -> Self {
226 self.branches.push(branch.into());
227 self
228 }
229
230 pub fn add_tag<S: Into<String>>(mut self, tag: S) -> Self {
232 self.tags.push(tag.into());
233 self
234 }
235}
236
237#[derive(Debug, Clone, Default, Deserialize, Serialize, Setters, PartialEq, Eq)]
241#[setters(strip_option, into)]
242pub struct Deployment {
243 #[serde(default, skip_serializing_if = "Vec::is_empty")]
245 pub branches: Vec<String>,
246}
247
248impl Deployment {
249 pub fn add_branch<S: Into<String>>(mut self, branch: S) -> Self {
251 self.branches.push(branch.into());
252 self
253 }
254}
255
256#[derive(Debug, Clone, Default, Deserialize, Serialize, Setters, PartialEq, Eq)]
260#[setters(strip_option, into)]
261pub struct DeploymentStatus {
262 #[serde(default, skip_serializing_if = "Vec::is_empty")]
264 pub states: Vec<String>,
265}
266
267impl DeploymentStatus {
268 pub fn add_state<S: Into<String>>(mut self, state: S) -> Self {
270 self.states.push(state.into());
271 self
272 }
273}
274
275#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
278#[serde(rename_all = "snake_case")]
279pub enum DiscussionType {
280 Created,
282 Edited,
284 Deleted,
286 Transferred,
288 Pinned,
290 Unpinned,
292 Labeled,
294 Unlabeled,
296 Locked,
298 Unlocked,
300 CategoryChanged,
302 Answered,
304 Unanswered,
306}
307
308#[derive(Debug, Clone, Default, Deserialize, Serialize, Setters, PartialEq, Eq)]
311pub struct Discussion {
312 #[serde(default, skip_serializing_if = "Vec::is_empty")]
314 pub types: Vec<DiscussionType>,
315}
316
317impl Discussion {
318 pub fn add_type(mut self, type_: DiscussionType) -> Self {
320 self.types.push(type_);
321 self
322 }
323}
324
325#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
328#[serde(rename_all = "snake_case")]
329pub enum DiscussionCommentType {
330 Created,
332 Edited,
334 Deleted,
336}
337
338#[derive(Debug, Clone, Default, Deserialize, Serialize, Setters, PartialEq, Eq)]
341pub struct DiscussionComment {
342 #[serde(default, skip_serializing_if = "Vec::is_empty")]
344 pub types: Vec<DiscussionCommentType>,
345}
346
347impl DiscussionComment {
348 pub fn add_type(mut self, type_: DiscussionCommentType) -> Self {
350 self.types.push(type_);
351 self
352 }
353}
354
355#[derive(Debug, Clone, Default, Deserialize, Serialize, Setters, PartialEq, Eq)]
358pub struct IssueComment {
359 #[serde(default, skip_serializing_if = "Vec::is_empty")]
361 pub types: Vec<IssueCommentType>,
362}
363
364#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
366#[serde(rename_all = "snake_case")]
367pub enum IssueCommentType {
368 Created,
370 Edited,
372 Deleted,
374}
375
376impl IssueComment {
377 pub fn add_type(mut self, type_: IssueCommentType) -> Self {
379 self.types.push(type_);
380 self
381 }
382}
383
384#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
387#[serde(rename_all = "snake_case")]
388pub enum IssuesType {
389 Opened,
391 Edited,
393 Deleted,
395 Transferred,
397 Pinned,
399 Unpinned,
401 Closed,
403 Reopened,
405 Assigned,
407 Unassigned,
409 Labeled,
411 Unlabeled,
413 Locked,
415 Unlocked,
417 Milestoned,
419 Demilestoned,
421}
422
423#[derive(Debug, Clone, Default, Deserialize, Serialize, Setters, PartialEq, Eq)]
426#[setters(strip_option, into)]
427pub struct Issues {
428 #[serde(default, skip_serializing_if = "Vec::is_empty")]
430 pub types: Vec<IssuesType>,
431}
432
433impl Issues {
434 pub fn add_type(mut self, type_: IssuesType) -> Self {
436 self.types.push(type_);
437 self
438 }
439}
440
441#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
444#[serde(rename_all = "snake_case")]
445pub enum LabelType {
446 Created,
448 Edited,
450 Deleted,
452}
453
454#[derive(Debug, Clone, Default, Deserialize, Serialize, Setters, PartialEq, Eq)]
457#[setters(strip_option, into)]
458pub struct Label {
459 #[serde(default, skip_serializing_if = "Vec::is_empty")]
461 pub types: Vec<LabelType>,
462}
463
464impl Label {
465 pub fn add_type(mut self, type_: LabelType) -> Self {
467 self.types.push(type_);
468 self
469 }
470}
471
472#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
473#[serde(rename_all = "snake_case")]
474pub enum MergeGroupType {
475 ChecksRequested,
476}
477
478#[derive(Debug, Clone, Default, Deserialize, Serialize, Setters, PartialEq, Eq)]
479#[setters(strip_option, into)]
480pub struct MergeGroup {
481 #[serde(default, skip_serializing_if = "Vec::is_empty")]
482 pub types: Vec<MergeGroupType>,
483}
484
485impl MergeGroup {
486 pub fn add_type(mut self, type_: MergeGroupType) -> Self {
487 self.types.push(type_);
488 self
489 }
490}
491
492#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
493#[serde(rename_all = "snake_case")]
494pub enum MilestoneType {
495 Created,
496 Closed,
497 Opened,
498 Edited,
499 Deleted,
500}
501
502#[derive(Debug, Clone, Default, Deserialize, Serialize, Setters, PartialEq, Eq)]
503#[setters(strip_option, into)]
504pub struct Milestone {
505 #[serde(default, skip_serializing_if = "Vec::is_empty")]
506 pub types: Vec<MilestoneType>,
507}
508
509impl Milestone {
510 pub fn add_type(mut self, type_: MilestoneType) -> Self {
511 self.types.push(type_);
512 self
513 }
514}
515
516#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
517#[serde(rename_all = "snake_case")]
518pub enum PullRequestType {
519 Assigned,
520 Unassigned,
521 Labeled,
522 Unlabeled,
523 Opened,
524 Edited,
525 Closed,
526 Reopened,
527 Synchronize,
528 ReadyForReview,
529 Locked,
530 Unlocked,
531 ReviewRequested,
532 ReviewRequestRemoved,
533}
534
535#[derive(Debug, Clone, Default, Deserialize, Serialize, Setters, PartialEq, Eq)]
536#[setters(strip_option, into)]
537pub struct PullRequest {
538 #[serde(default, skip_serializing_if = "Vec::is_empty")]
539 pub types: Vec<PullRequestType>,
540 #[serde(default, skip_serializing_if = "Vec::is_empty")]
541 pub branches: Vec<String>,
542 #[serde(default, skip_serializing_if = "Vec::is_empty")]
543 pub paths: Vec<String>,
544}
545
546impl PullRequest {
547 pub fn add_type(mut self, type_: PullRequestType) -> Self {
548 self.types.push(type_);
549 self
550 }
551
552 pub fn add_branch<S: Into<String>>(mut self, branch: S) -> Self {
553 self.branches.push(branch.into());
554 self
555 }
556
557 pub fn add_path<S: Into<String>>(mut self, path: S) -> Self {
558 self.paths.push(path.into());
559 self
560 }
561}
562
563#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
566#[serde(rename_all = "snake_case")]
567pub enum PullRequestReviewType {
568 Submitted,
570 Edited,
572 Dismissed,
574}
575
576#[derive(Debug, Clone, Default, Deserialize, Serialize, Setters, PartialEq, Eq)]
579#[setters(strip_option, into)]
580pub struct PullRequestReview {
581 #[serde(default, skip_serializing_if = "Vec::is_empty")]
583 pub types: Vec<PullRequestReviewType>,
584}
585
586impl PullRequestReview {
587 pub fn add_type(mut self, type_: PullRequestReviewType) -> Self {
589 self.types.push(type_);
590 self
591 }
592}
593
594#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
597#[serde(rename_all = "snake_case")]
598pub enum PullRequestReviewCommentType {
599 Created,
601 Edited,
603 Deleted,
605}
606
607#[derive(Debug, Clone, Default, Deserialize, Serialize, Setters, PartialEq, Eq)]
609#[setters(strip_option, into)]
610pub struct PullRequestReviewComment {
611 #[serde(default, skip_serializing_if = "Vec::is_empty")]
613 pub types: Vec<PullRequestReviewCommentType>,
614}
615
616impl PullRequestReviewComment {
617 pub fn add_type(mut self, type_: PullRequestReviewCommentType) -> Self {
619 self.types.push(type_);
620 self
621 }
622}
623
624#[derive(Debug, Clone, Default, Deserialize, Serialize, Setters, PartialEq, Eq)]
627#[setters(strip_option, into)]
628pub struct PullRequestTarget {
629 #[serde(default, skip_serializing_if = "Vec::is_empty")]
631 pub types: Vec<PullRequestType>,
632 #[serde(default, skip_serializing_if = "Vec::is_empty")]
634 pub branches: Vec<String>,
635}
636
637impl PullRequestTarget {
638 pub fn add_type(mut self, type_: PullRequestType) -> Self {
640 self.types.push(type_);
641 self
642 }
643
644 pub fn add_branch<S: Into<String>>(mut self, branch: S) -> Self {
646 self.branches.push(branch.into());
647 self
648 }
649}
650
651#[derive(Debug, Clone, Default, Deserialize, Serialize, Setters, PartialEq, Eq)]
654#[setters(strip_option, into)]
655pub struct Push {
656 #[serde(default, skip_serializing_if = "Vec::is_empty")]
658 pub branches: Vec<String>,
659 #[serde(default, skip_serializing_if = "Vec::is_empty")]
661 pub paths: Vec<String>,
662 #[serde(default, skip_serializing_if = "Vec::is_empty")]
664 pub tags: Vec<String>,
665}
666
667impl Push {
668 pub fn add_branch<S: Into<String>>(mut self, branch: S) -> Self {
670 self.branches.push(branch.into());
671 self
672 }
673
674 pub fn add_path<S: Into<String>>(mut self, path: S) -> Self {
676 self.paths.push(path.into());
677 self
678 }
679
680 pub fn add_tag<S: Into<String>>(mut self, tag: S) -> Self {
682 self.tags.push(tag.into());
683 self
684 }
685}
686
687#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
690#[serde(rename_all = "snake_case")]
691pub enum RegistryPackageType {
692 Published,
694 Updated,
696}
697
698#[derive(Debug, Clone, Default, Deserialize, Serialize, Setters, PartialEq, Eq)]
701#[setters(strip_option, into)]
702pub struct RegistryPackage {
703 #[serde(default, skip_serializing_if = "Vec::is_empty")]
705 pub types: Vec<RegistryPackageType>,
706}
707
708impl RegistryPackage {
709 pub fn add_type(mut self, type_: RegistryPackageType) -> Self {
711 self.types.push(type_);
712 self
713 }
714}
715
716#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
719#[serde(rename_all = "snake_case")]
720pub enum ReleaseType {
721 Published,
723 Unpublished,
725 Created,
727 Edited,
729 Deleted,
731 Prereleased,
733 Released,
735}
736
737#[derive(Debug, Clone, Default, Deserialize, Serialize, Setters, PartialEq, Eq)]
740#[setters(strip_option, into)]
741pub struct Release {
742 #[serde(default, skip_serializing_if = "Vec::is_empty")]
744 pub types: Vec<ReleaseType>,
745}
746
747impl Release {
748 pub fn add_type(mut self, type_: ReleaseType) -> Self {
750 self.types.push(type_);
751 self
752 }
753}
754
755#[derive(Debug, Clone, Default, Deserialize, Serialize, Setters, PartialEq, Eq)]
756#[setters(strip_option, into)]
757pub struct RepositoryDispatch {
758 #[serde(default, skip_serializing_if = "Vec::is_empty")]
759 pub types: Vec<String>,
760}
761
762impl RepositoryDispatch {
763 pub fn add_type<S: Into<String>>(mut self, type_: S) -> Self {
764 self.types.push(type_.into());
765 self
766 }
767}
768
769#[derive(Debug, Clone, Default, Deserialize, Serialize, Setters, PartialEq, Eq)]
770#[setters(strip_option, into)]
771pub struct Schedule {
772 pub cron: String,
773}
774
775impl Schedule {
776 pub fn new(cron: impl ToString) -> Self {
777 Self { cron: cron.to_string() }
778 }
779}
780
781#[derive(Debug, Clone, Default, Deserialize, Serialize, Setters, PartialEq, Eq)]
782#[setters(strip_option, into)]
783pub struct Watch {
784 #[serde(default, skip_serializing_if = "Vec::is_empty")]
785 pub types: Vec<String>,
786}
787
788impl Watch {
789 pub fn add_type<S: Into<String>>(mut self, type_: S) -> Self {
790 self.types.push(type_.into());
791 self
792 }
793}
794
795#[derive(Debug, Clone, Default, Deserialize, Serialize, Setters, PartialEq, Eq)]
798#[setters(strip_option, into)]
799pub struct WorkflowCall {
800 #[serde(skip_serializing_if = "HashMap::is_empty")]
802 pub inputs: HashMap<String, WorkflowCallInput>,
803 #[serde(skip_serializing_if = "HashMap::is_empty")]
805 pub outputs: HashMap<String, WorkflowCallOutput>,
806 #[serde(skip_serializing_if = "HashMap::is_empty")]
808 pub secrets: HashMap<String, WorkflowCallSecret>,
809}
810
811#[derive(Debug, Clone, Default, Deserialize, Serialize, PartialEq, Setters, Eq)]
813#[setters(strip_option, into)]
814pub struct WorkflowCallInput {
815 #[serde(skip_serializing_if = "String::is_empty")]
817 pub description: String,
818 #[serde(skip_serializing_if = "is_default")]
820 pub required: bool,
821 #[serde(rename = "type")]
823 pub input_type: String,
824 #[serde(skip_serializing_if = "Option::is_none")]
826 pub default: Option<String>,
827}
828
829#[derive(Debug, Clone, Default, Deserialize, Serialize, PartialEq, Setters, Eq)]
831#[setters(strip_option, into)]
832pub struct WorkflowCallOutput {
833 #[serde(skip_serializing_if = "String::is_empty")]
835 pub description: String,
836 #[serde(skip_serializing_if = "String::is_empty")]
838 pub value: String,
839}
840
841#[derive(Debug, Clone, Default, Deserialize, Serialize, PartialEq, Setters, Eq)]
843#[setters(strip_option, into)]
844pub struct WorkflowCallSecret {
845 #[serde(skip_serializing_if = "String::is_empty")]
847 pub description: String,
848 #[serde(skip_serializing_if = "is_default")]
850 pub required: bool,
851}
852
853#[derive(Debug, Clone, Default, Deserialize, Serialize, Setters, PartialEq, Eq)]
857#[setters(strip_option, into)]
858pub struct WorkflowDispatch {
859 #[serde(skip_serializing_if = "HashMap::is_empty")]
861 pub inputs: HashMap<String, WorkflowDispatchInput>,
862}
863
864#[derive(Debug, Clone, Default, Deserialize, Serialize, Setters, PartialEq, Eq)]
866#[setters(strip_option, into)]
867pub struct WorkflowDispatchInput {
868 #[serde(skip_serializing_if = "String::is_empty")]
870 pub description: String,
871 #[serde(skip_serializing_if = "is_default")]
873 pub required: bool,
874 #[serde(rename = "type")]
876 pub input_type: String,
877 #[serde(skip_serializing_if = "Option::is_none")]
879 pub default: Option<String>,
880}
881
882#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
885#[serde(rename_all = "snake_case")]
886pub enum WorkflowRunType {
887 Completed,
889 Requested,
891 InProgress,
893}
894
895#[derive(Debug, Clone, Default, Deserialize, Serialize, Setters, PartialEq, Eq)]
897#[setters(strip_option, into)]
898pub struct WorkflowRun {
899 #[serde(default, skip_serializing_if = "Vec::is_empty")]
901 pub types: Vec<WorkflowRunType>,
902 #[serde(default, skip_serializing_if = "Vec::is_empty")]
904 pub workflows: Vec<String>,
905 #[serde(default, skip_serializing_if = "Vec::is_empty")]
907 pub branches: Vec<String>,
908}
909
910impl WorkflowRun {
911 pub fn add_type(mut self, type_: WorkflowRunType) -> Self {
913 self.types.push(type_);
914 self
915 }
916
917 pub fn add_workflow<S: Into<String>>(mut self, workflow: S) -> Self {
919 self.workflows.push(workflow.into());
920 self
921 }
922
923 pub fn add_branch<S: Into<String>>(mut self, branch: S) -> Self {
925 self.branches.push(branch.into());
926 self
927 }
928}