aws_sdk_codepipeline/types/_git_branch_filter_criteria.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The Git repository branches specified as filter criteria to start the pipeline.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct GitBranchFilterCriteria {
7 /// <p>The list of patterns of Git branches that, when a commit is pushed, are to be included as criteria that starts the pipeline.</p>
8 pub includes: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
9 /// <p>The list of patterns of Git branches that, when a commit is pushed, are to be excluded from starting the pipeline.</p>
10 pub excludes: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
11}
12impl GitBranchFilterCriteria {
13 /// <p>The list of patterns of Git branches that, when a commit is pushed, are to be included as criteria that starts the pipeline.</p>
14 ///
15 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.includes.is_none()`.
16 pub fn includes(&self) -> &[::std::string::String] {
17 self.includes.as_deref().unwrap_or_default()
18 }
19 /// <p>The list of patterns of Git branches that, when a commit is pushed, are to be excluded from starting the pipeline.</p>
20 ///
21 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.excludes.is_none()`.
22 pub fn excludes(&self) -> &[::std::string::String] {
23 self.excludes.as_deref().unwrap_or_default()
24 }
25}
26impl GitBranchFilterCriteria {
27 /// Creates a new builder-style object to manufacture [`GitBranchFilterCriteria`](crate::types::GitBranchFilterCriteria).
28 pub fn builder() -> crate::types::builders::GitBranchFilterCriteriaBuilder {
29 crate::types::builders::GitBranchFilterCriteriaBuilder::default()
30 }
31}
32
33/// A builder for [`GitBranchFilterCriteria`](crate::types::GitBranchFilterCriteria).
34#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
35#[non_exhaustive]
36pub struct GitBranchFilterCriteriaBuilder {
37 pub(crate) includes: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
38 pub(crate) excludes: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
39}
40impl GitBranchFilterCriteriaBuilder {
41 /// Appends an item to `includes`.
42 ///
43 /// To override the contents of this collection use [`set_includes`](Self::set_includes).
44 ///
45 /// <p>The list of patterns of Git branches that, when a commit is pushed, are to be included as criteria that starts the pipeline.</p>
46 pub fn includes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
47 let mut v = self.includes.unwrap_or_default();
48 v.push(input.into());
49 self.includes = ::std::option::Option::Some(v);
50 self
51 }
52 /// <p>The list of patterns of Git branches that, when a commit is pushed, are to be included as criteria that starts the pipeline.</p>
53 pub fn set_includes(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
54 self.includes = input;
55 self
56 }
57 /// <p>The list of patterns of Git branches that, when a commit is pushed, are to be included as criteria that starts the pipeline.</p>
58 pub fn get_includes(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
59 &self.includes
60 }
61 /// Appends an item to `excludes`.
62 ///
63 /// To override the contents of this collection use [`set_excludes`](Self::set_excludes).
64 ///
65 /// <p>The list of patterns of Git branches that, when a commit is pushed, are to be excluded from starting the pipeline.</p>
66 pub fn excludes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67 let mut v = self.excludes.unwrap_or_default();
68 v.push(input.into());
69 self.excludes = ::std::option::Option::Some(v);
70 self
71 }
72 /// <p>The list of patterns of Git branches that, when a commit is pushed, are to be excluded from starting the pipeline.</p>
73 pub fn set_excludes(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
74 self.excludes = input;
75 self
76 }
77 /// <p>The list of patterns of Git branches that, when a commit is pushed, are to be excluded from starting the pipeline.</p>
78 pub fn get_excludes(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
79 &self.excludes
80 }
81 /// Consumes the builder and constructs a [`GitBranchFilterCriteria`](crate::types::GitBranchFilterCriteria).
82 pub fn build(self) -> crate::types::GitBranchFilterCriteria {
83 crate::types::GitBranchFilterCriteria {
84 includes: self.includes,
85 excludes: self.excludes,
86 }
87 }
88}