aws_sdk_codebuild/operation/update_webhook/_update_webhook_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct UpdateWebhookInput {
6 /// <p>The name of the CodeBuild project.</p>
7 pub project_name: ::std::option::Option<::std::string::String>,
8 /// <p>A regular expression used to determine which repository branches are built when a webhook is triggered. If the name of a branch matches the regular expression, then it is built. If <code>branchFilter</code> is empty, then all branches are built.</p><note>
9 /// <p>It is recommended that you use <code>filterGroups</code> instead of <code>branchFilter</code>.</p>
10 /// </note>
11 pub branch_filter: ::std::option::Option<::std::string::String>,
12 /// <p>A boolean value that specifies whether the associated GitHub repository's secret token should be updated. If you use Bitbucket for your repository, <code>rotateSecret</code> is ignored.</p>
13 pub rotate_secret: ::std::option::Option<bool>,
14 /// <p>An array of arrays of <code>WebhookFilter</code> objects used to determine if a webhook event can trigger a build. A filter group must contain at least one <code>EVENT</code> <code>WebhookFilter</code>.</p>
15 pub filter_groups: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<crate::types::WebhookFilter>>>,
16 /// <p>Specifies the type of build this webhook will trigger.</p><note>
17 /// <p><code>RUNNER_BUILDKITE_BUILD</code> is only available for <code>NO_SOURCE</code> source type projects configured for Buildkite runner builds. For more information about CodeBuild-hosted Buildkite runner builds, see <a href="https://docs.aws.amazon.com/codebuild/latest/userguide/sample-runner-buildkite.html">Tutorial: Configure a CodeBuild-hosted Buildkite runner</a> in the <i>CodeBuild user guide</i>.</p>
18 /// </note>
19 pub build_type: ::std::option::Option<crate::types::WebhookBuildType>,
20}
21impl UpdateWebhookInput {
22 /// <p>The name of the CodeBuild project.</p>
23 pub fn project_name(&self) -> ::std::option::Option<&str> {
24 self.project_name.as_deref()
25 }
26 /// <p>A regular expression used to determine which repository branches are built when a webhook is triggered. If the name of a branch matches the regular expression, then it is built. If <code>branchFilter</code> is empty, then all branches are built.</p><note>
27 /// <p>It is recommended that you use <code>filterGroups</code> instead of <code>branchFilter</code>.</p>
28 /// </note>
29 pub fn branch_filter(&self) -> ::std::option::Option<&str> {
30 self.branch_filter.as_deref()
31 }
32 /// <p>A boolean value that specifies whether the associated GitHub repository's secret token should be updated. If you use Bitbucket for your repository, <code>rotateSecret</code> is ignored.</p>
33 pub fn rotate_secret(&self) -> ::std::option::Option<bool> {
34 self.rotate_secret
35 }
36 /// <p>An array of arrays of <code>WebhookFilter</code> objects used to determine if a webhook event can trigger a build. A filter group must contain at least one <code>EVENT</code> <code>WebhookFilter</code>.</p>
37 ///
38 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.filter_groups.is_none()`.
39 pub fn filter_groups(&self) -> &[::std::vec::Vec<crate::types::WebhookFilter>] {
40 self.filter_groups.as_deref().unwrap_or_default()
41 }
42 /// <p>Specifies the type of build this webhook will trigger.</p><note>
43 /// <p><code>RUNNER_BUILDKITE_BUILD</code> is only available for <code>NO_SOURCE</code> source type projects configured for Buildkite runner builds. For more information about CodeBuild-hosted Buildkite runner builds, see <a href="https://docs.aws.amazon.com/codebuild/latest/userguide/sample-runner-buildkite.html">Tutorial: Configure a CodeBuild-hosted Buildkite runner</a> in the <i>CodeBuild user guide</i>.</p>
44 /// </note>
45 pub fn build_type(&self) -> ::std::option::Option<&crate::types::WebhookBuildType> {
46 self.build_type.as_ref()
47 }
48}
49impl UpdateWebhookInput {
50 /// Creates a new builder-style object to manufacture [`UpdateWebhookInput`](crate::operation::update_webhook::UpdateWebhookInput).
51 pub fn builder() -> crate::operation::update_webhook::builders::UpdateWebhookInputBuilder {
52 crate::operation::update_webhook::builders::UpdateWebhookInputBuilder::default()
53 }
54}
55
56/// A builder for [`UpdateWebhookInput`](crate::operation::update_webhook::UpdateWebhookInput).
57#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
58#[non_exhaustive]
59pub struct UpdateWebhookInputBuilder {
60 pub(crate) project_name: ::std::option::Option<::std::string::String>,
61 pub(crate) branch_filter: ::std::option::Option<::std::string::String>,
62 pub(crate) rotate_secret: ::std::option::Option<bool>,
63 pub(crate) filter_groups: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<crate::types::WebhookFilter>>>,
64 pub(crate) build_type: ::std::option::Option<crate::types::WebhookBuildType>,
65}
66impl UpdateWebhookInputBuilder {
67 /// <p>The name of the CodeBuild project.</p>
68 /// This field is required.
69 pub fn project_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
70 self.project_name = ::std::option::Option::Some(input.into());
71 self
72 }
73 /// <p>The name of the CodeBuild project.</p>
74 pub fn set_project_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
75 self.project_name = input;
76 self
77 }
78 /// <p>The name of the CodeBuild project.</p>
79 pub fn get_project_name(&self) -> &::std::option::Option<::std::string::String> {
80 &self.project_name
81 }
82 /// <p>A regular expression used to determine which repository branches are built when a webhook is triggered. If the name of a branch matches the regular expression, then it is built. If <code>branchFilter</code> is empty, then all branches are built.</p><note>
83 /// <p>It is recommended that you use <code>filterGroups</code> instead of <code>branchFilter</code>.</p>
84 /// </note>
85 pub fn branch_filter(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
86 self.branch_filter = ::std::option::Option::Some(input.into());
87 self
88 }
89 /// <p>A regular expression used to determine which repository branches are built when a webhook is triggered. If the name of a branch matches the regular expression, then it is built. If <code>branchFilter</code> is empty, then all branches are built.</p><note>
90 /// <p>It is recommended that you use <code>filterGroups</code> instead of <code>branchFilter</code>.</p>
91 /// </note>
92 pub fn set_branch_filter(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
93 self.branch_filter = input;
94 self
95 }
96 /// <p>A regular expression used to determine which repository branches are built when a webhook is triggered. If the name of a branch matches the regular expression, then it is built. If <code>branchFilter</code> is empty, then all branches are built.</p><note>
97 /// <p>It is recommended that you use <code>filterGroups</code> instead of <code>branchFilter</code>.</p>
98 /// </note>
99 pub fn get_branch_filter(&self) -> &::std::option::Option<::std::string::String> {
100 &self.branch_filter
101 }
102 /// <p>A boolean value that specifies whether the associated GitHub repository's secret token should be updated. If you use Bitbucket for your repository, <code>rotateSecret</code> is ignored.</p>
103 pub fn rotate_secret(mut self, input: bool) -> Self {
104 self.rotate_secret = ::std::option::Option::Some(input);
105 self
106 }
107 /// <p>A boolean value that specifies whether the associated GitHub repository's secret token should be updated. If you use Bitbucket for your repository, <code>rotateSecret</code> is ignored.</p>
108 pub fn set_rotate_secret(mut self, input: ::std::option::Option<bool>) -> Self {
109 self.rotate_secret = input;
110 self
111 }
112 /// <p>A boolean value that specifies whether the associated GitHub repository's secret token should be updated. If you use Bitbucket for your repository, <code>rotateSecret</code> is ignored.</p>
113 pub fn get_rotate_secret(&self) -> &::std::option::Option<bool> {
114 &self.rotate_secret
115 }
116 /// Appends an item to `filter_groups`.
117 ///
118 /// To override the contents of this collection use [`set_filter_groups`](Self::set_filter_groups).
119 ///
120 /// <p>An array of arrays of <code>WebhookFilter</code> objects used to determine if a webhook event can trigger a build. A filter group must contain at least one <code>EVENT</code> <code>WebhookFilter</code>.</p>
121 pub fn filter_groups(mut self, input: ::std::vec::Vec<crate::types::WebhookFilter>) -> Self {
122 let mut v = self.filter_groups.unwrap_or_default();
123 v.push(input);
124 self.filter_groups = ::std::option::Option::Some(v);
125 self
126 }
127 /// <p>An array of arrays of <code>WebhookFilter</code> objects used to determine if a webhook event can trigger a build. A filter group must contain at least one <code>EVENT</code> <code>WebhookFilter</code>.</p>
128 pub fn set_filter_groups(mut self, input: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<crate::types::WebhookFilter>>>) -> Self {
129 self.filter_groups = input;
130 self
131 }
132 /// <p>An array of arrays of <code>WebhookFilter</code> objects used to determine if a webhook event can trigger a build. A filter group must contain at least one <code>EVENT</code> <code>WebhookFilter</code>.</p>
133 pub fn get_filter_groups(&self) -> &::std::option::Option<::std::vec::Vec<::std::vec::Vec<crate::types::WebhookFilter>>> {
134 &self.filter_groups
135 }
136 /// <p>Specifies the type of build this webhook will trigger.</p><note>
137 /// <p><code>RUNNER_BUILDKITE_BUILD</code> is only available for <code>NO_SOURCE</code> source type projects configured for Buildkite runner builds. For more information about CodeBuild-hosted Buildkite runner builds, see <a href="https://docs.aws.amazon.com/codebuild/latest/userguide/sample-runner-buildkite.html">Tutorial: Configure a CodeBuild-hosted Buildkite runner</a> in the <i>CodeBuild user guide</i>.</p>
138 /// </note>
139 pub fn build_type(mut self, input: crate::types::WebhookBuildType) -> Self {
140 self.build_type = ::std::option::Option::Some(input);
141 self
142 }
143 /// <p>Specifies the type of build this webhook will trigger.</p><note>
144 /// <p><code>RUNNER_BUILDKITE_BUILD</code> is only available for <code>NO_SOURCE</code> source type projects configured for Buildkite runner builds. For more information about CodeBuild-hosted Buildkite runner builds, see <a href="https://docs.aws.amazon.com/codebuild/latest/userguide/sample-runner-buildkite.html">Tutorial: Configure a CodeBuild-hosted Buildkite runner</a> in the <i>CodeBuild user guide</i>.</p>
145 /// </note>
146 pub fn set_build_type(mut self, input: ::std::option::Option<crate::types::WebhookBuildType>) -> Self {
147 self.build_type = input;
148 self
149 }
150 /// <p>Specifies the type of build this webhook will trigger.</p><note>
151 /// <p><code>RUNNER_BUILDKITE_BUILD</code> is only available for <code>NO_SOURCE</code> source type projects configured for Buildkite runner builds. For more information about CodeBuild-hosted Buildkite runner builds, see <a href="https://docs.aws.amazon.com/codebuild/latest/userguide/sample-runner-buildkite.html">Tutorial: Configure a CodeBuild-hosted Buildkite runner</a> in the <i>CodeBuild user guide</i>.</p>
152 /// </note>
153 pub fn get_build_type(&self) -> &::std::option::Option<crate::types::WebhookBuildType> {
154 &self.build_type
155 }
156 /// Consumes the builder and constructs a [`UpdateWebhookInput`](crate::operation::update_webhook::UpdateWebhookInput).
157 pub fn build(
158 self,
159 ) -> ::std::result::Result<crate::operation::update_webhook::UpdateWebhookInput, ::aws_smithy_types::error::operation::BuildError> {
160 ::std::result::Result::Ok(crate::operation::update_webhook::UpdateWebhookInput {
161 project_name: self.project_name,
162 branch_filter: self.branch_filter,
163 rotate_secret: self.rotate_secret,
164 filter_groups: self.filter_groups,
165 build_type: self.build_type,
166 })
167 }
168}