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 /// <p>A PullRequestBuildPolicy object that defines comment-based approval requirements for triggering builds on pull requests. This policy helps control when automated builds are executed based on contributor permissions and approval workflows.</p>
21 pub pull_request_build_policy: ::std::option::Option<crate::types::PullRequestBuildPolicy>,
22}
23impl UpdateWebhookInput {
24 /// <p>The name of the CodeBuild project.</p>
25 pub fn project_name(&self) -> ::std::option::Option<&str> {
26 self.project_name.as_deref()
27 }
28 /// <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>
29 /// <p>It is recommended that you use <code>filterGroups</code> instead of <code>branchFilter</code>.</p>
30 /// </note>
31 pub fn branch_filter(&self) -> ::std::option::Option<&str> {
32 self.branch_filter.as_deref()
33 }
34 /// <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>
35 pub fn rotate_secret(&self) -> ::std::option::Option<bool> {
36 self.rotate_secret
37 }
38 /// <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>
39 ///
40 /// 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()`.
41 pub fn filter_groups(&self) -> &[::std::vec::Vec<crate::types::WebhookFilter>] {
42 self.filter_groups.as_deref().unwrap_or_default()
43 }
44 /// <p>Specifies the type of build this webhook will trigger.</p><note>
45 /// <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>
46 /// </note>
47 pub fn build_type(&self) -> ::std::option::Option<&crate::types::WebhookBuildType> {
48 self.build_type.as_ref()
49 }
50 /// <p>A PullRequestBuildPolicy object that defines comment-based approval requirements for triggering builds on pull requests. This policy helps control when automated builds are executed based on contributor permissions and approval workflows.</p>
51 pub fn pull_request_build_policy(&self) -> ::std::option::Option<&crate::types::PullRequestBuildPolicy> {
52 self.pull_request_build_policy.as_ref()
53 }
54}
55impl UpdateWebhookInput {
56 /// Creates a new builder-style object to manufacture [`UpdateWebhookInput`](crate::operation::update_webhook::UpdateWebhookInput).
57 pub fn builder() -> crate::operation::update_webhook::builders::UpdateWebhookInputBuilder {
58 crate::operation::update_webhook::builders::UpdateWebhookInputBuilder::default()
59 }
60}
61
62/// A builder for [`UpdateWebhookInput`](crate::operation::update_webhook::UpdateWebhookInput).
63#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
64#[non_exhaustive]
65pub struct UpdateWebhookInputBuilder {
66 pub(crate) project_name: ::std::option::Option<::std::string::String>,
67 pub(crate) branch_filter: ::std::option::Option<::std::string::String>,
68 pub(crate) rotate_secret: ::std::option::Option<bool>,
69 pub(crate) filter_groups: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<crate::types::WebhookFilter>>>,
70 pub(crate) build_type: ::std::option::Option<crate::types::WebhookBuildType>,
71 pub(crate) pull_request_build_policy: ::std::option::Option<crate::types::PullRequestBuildPolicy>,
72}
73impl UpdateWebhookInputBuilder {
74 /// <p>The name of the CodeBuild project.</p>
75 /// This field is required.
76 pub fn project_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
77 self.project_name = ::std::option::Option::Some(input.into());
78 self
79 }
80 /// <p>The name of the CodeBuild project.</p>
81 pub fn set_project_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
82 self.project_name = input;
83 self
84 }
85 /// <p>The name of the CodeBuild project.</p>
86 pub fn get_project_name(&self) -> &::std::option::Option<::std::string::String> {
87 &self.project_name
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 branch_filter(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
93 self.branch_filter = ::std::option::Option::Some(input.into());
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 set_branch_filter(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
100 self.branch_filter = input;
101 self
102 }
103 /// <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>
104 /// <p>It is recommended that you use <code>filterGroups</code> instead of <code>branchFilter</code>.</p>
105 /// </note>
106 pub fn get_branch_filter(&self) -> &::std::option::Option<::std::string::String> {
107 &self.branch_filter
108 }
109 /// <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>
110 pub fn rotate_secret(mut self, input: bool) -> Self {
111 self.rotate_secret = ::std::option::Option::Some(input);
112 self
113 }
114 /// <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>
115 pub fn set_rotate_secret(mut self, input: ::std::option::Option<bool>) -> Self {
116 self.rotate_secret = input;
117 self
118 }
119 /// <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>
120 pub fn get_rotate_secret(&self) -> &::std::option::Option<bool> {
121 &self.rotate_secret
122 }
123 /// Appends an item to `filter_groups`.
124 ///
125 /// To override the contents of this collection use [`set_filter_groups`](Self::set_filter_groups).
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 filter_groups(mut self, input: ::std::vec::Vec<crate::types::WebhookFilter>) -> Self {
129 let mut v = self.filter_groups.unwrap_or_default();
130 v.push(input);
131 self.filter_groups = ::std::option::Option::Some(v);
132 self
133 }
134 /// <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>
135 pub fn set_filter_groups(mut self, input: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<crate::types::WebhookFilter>>>) -> Self {
136 self.filter_groups = input;
137 self
138 }
139 /// <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>
140 pub fn get_filter_groups(&self) -> &::std::option::Option<::std::vec::Vec<::std::vec::Vec<crate::types::WebhookFilter>>> {
141 &self.filter_groups
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 build_type(mut self, input: crate::types::WebhookBuildType) -> Self {
147 self.build_type = ::std::option::Option::Some(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 set_build_type(mut self, input: ::std::option::Option<crate::types::WebhookBuildType>) -> Self {
154 self.build_type = input;
155 self
156 }
157 /// <p>Specifies the type of build this webhook will trigger.</p><note>
158 /// <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>
159 /// </note>
160 pub fn get_build_type(&self) -> &::std::option::Option<crate::types::WebhookBuildType> {
161 &self.build_type
162 }
163 /// <p>A PullRequestBuildPolicy object that defines comment-based approval requirements for triggering builds on pull requests. This policy helps control when automated builds are executed based on contributor permissions and approval workflows.</p>
164 pub fn pull_request_build_policy(mut self, input: crate::types::PullRequestBuildPolicy) -> Self {
165 self.pull_request_build_policy = ::std::option::Option::Some(input);
166 self
167 }
168 /// <p>A PullRequestBuildPolicy object that defines comment-based approval requirements for triggering builds on pull requests. This policy helps control when automated builds are executed based on contributor permissions and approval workflows.</p>
169 pub fn set_pull_request_build_policy(mut self, input: ::std::option::Option<crate::types::PullRequestBuildPolicy>) -> Self {
170 self.pull_request_build_policy = input;
171 self
172 }
173 /// <p>A PullRequestBuildPolicy object that defines comment-based approval requirements for triggering builds on pull requests. This policy helps control when automated builds are executed based on contributor permissions and approval workflows.</p>
174 pub fn get_pull_request_build_policy(&self) -> &::std::option::Option<crate::types::PullRequestBuildPolicy> {
175 &self.pull_request_build_policy
176 }
177 /// Consumes the builder and constructs a [`UpdateWebhookInput`](crate::operation::update_webhook::UpdateWebhookInput).
178 pub fn build(
179 self,
180 ) -> ::std::result::Result<crate::operation::update_webhook::UpdateWebhookInput, ::aws_smithy_types::error::operation::BuildError> {
181 ::std::result::Result::Ok(crate::operation::update_webhook::UpdateWebhookInput {
182 project_name: self.project_name,
183 branch_filter: self.branch_filter,
184 rotate_secret: self.rotate_secret,
185 filter_groups: self.filter_groups,
186 build_type: self.build_type,
187 pull_request_build_policy: self.pull_request_build_policy,
188 })
189 }
190}