aws_sdk_codecommit/operation/update_pull_request_approval_rule_content/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_pull_request_approval_rule_content::_update_pull_request_approval_rule_content_output::UpdatePullRequestApprovalRuleContentOutputBuilder;
3
4pub use crate::operation::update_pull_request_approval_rule_content::_update_pull_request_approval_rule_content_input::UpdatePullRequestApprovalRuleContentInputBuilder;
5
6impl crate::operation::update_pull_request_approval_rule_content::builders::UpdatePullRequestApprovalRuleContentInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::update_pull_request_approval_rule_content::UpdatePullRequestApprovalRuleContentOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_pull_request_approval_rule_content::UpdatePullRequestApprovalRuleContentError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_pull_request_approval_rule_content();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdatePullRequestApprovalRuleContent`.
24///
25/// <p>Updates the structure of an approval rule created specifically for a pull request. For example, you can change the number of required approvers and the approval pool for approvers.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdatePullRequestApprovalRuleContentFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::update_pull_request_approval_rule_content::builders::UpdatePullRequestApprovalRuleContentInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::update_pull_request_approval_rule_content::UpdatePullRequestApprovalRuleContentOutput,
35        crate::operation::update_pull_request_approval_rule_content::UpdatePullRequestApprovalRuleContentError,
36    > for UpdatePullRequestApprovalRuleContentFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::update_pull_request_approval_rule_content::UpdatePullRequestApprovalRuleContentOutput,
44            crate::operation::update_pull_request_approval_rule_content::UpdatePullRequestApprovalRuleContentError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl UpdatePullRequestApprovalRuleContentFluentBuilder {
51    /// Creates a new `UpdatePullRequestApprovalRuleContentFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the UpdatePullRequestApprovalRuleContent as a reference.
60    pub fn as_input(
61        &self,
62    ) -> &crate::operation::update_pull_request_approval_rule_content::builders::UpdatePullRequestApprovalRuleContentInputBuilder {
63        &self.inner
64    }
65    /// Sends the request and returns the response.
66    ///
67    /// If an error occurs, an `SdkError` will be returned with additional details that
68    /// can be matched against.
69    ///
70    /// By default, any retryable failures will be retried twice. Retry behavior
71    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
72    /// set when configuring the client.
73    pub async fn send(
74        self,
75    ) -> ::std::result::Result<
76        crate::operation::update_pull_request_approval_rule_content::UpdatePullRequestApprovalRuleContentOutput,
77        ::aws_smithy_runtime_api::client::result::SdkError<
78            crate::operation::update_pull_request_approval_rule_content::UpdatePullRequestApprovalRuleContentError,
79            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
80        >,
81    > {
82        let input = self
83            .inner
84            .build()
85            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
86        let runtime_plugins =
87            crate::operation::update_pull_request_approval_rule_content::UpdatePullRequestApprovalRuleContent::operation_runtime_plugins(
88                self.handle.runtime_plugins.clone(),
89                &self.handle.conf,
90                self.config_override,
91            );
92        crate::operation::update_pull_request_approval_rule_content::UpdatePullRequestApprovalRuleContent::orchestrate(&runtime_plugins, input).await
93    }
94
95    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
96    pub fn customize(
97        self,
98    ) -> crate::client::customize::CustomizableOperation<
99        crate::operation::update_pull_request_approval_rule_content::UpdatePullRequestApprovalRuleContentOutput,
100        crate::operation::update_pull_request_approval_rule_content::UpdatePullRequestApprovalRuleContentError,
101        Self,
102    > {
103        crate::client::customize::CustomizableOperation::new(self)
104    }
105    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
106        self.set_config_override(::std::option::Option::Some(config_override.into()));
107        self
108    }
109
110    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
111        self.config_override = config_override;
112        self
113    }
114    /// <p>The system-generated ID of the pull request.</p>
115    pub fn pull_request_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116        self.inner = self.inner.pull_request_id(input.into());
117        self
118    }
119    /// <p>The system-generated ID of the pull request.</p>
120    pub fn set_pull_request_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121        self.inner = self.inner.set_pull_request_id(input);
122        self
123    }
124    /// <p>The system-generated ID of the pull request.</p>
125    pub fn get_pull_request_id(&self) -> &::std::option::Option<::std::string::String> {
126        self.inner.get_pull_request_id()
127    }
128    /// <p>The name of the approval rule you want to update.</p>
129    pub fn approval_rule_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130        self.inner = self.inner.approval_rule_name(input.into());
131        self
132    }
133    /// <p>The name of the approval rule you want to update.</p>
134    pub fn set_approval_rule_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135        self.inner = self.inner.set_approval_rule_name(input);
136        self
137    }
138    /// <p>The name of the approval rule you want to update.</p>
139    pub fn get_approval_rule_name(&self) -> &::std::option::Option<::std::string::String> {
140        self.inner.get_approval_rule_name()
141    }
142    /// <p>The SHA-256 hash signature for the content of the approval rule. You can retrieve this information by using <code>GetPullRequest</code>.</p>
143    pub fn existing_rule_content_sha256(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144        self.inner = self.inner.existing_rule_content_sha256(input.into());
145        self
146    }
147    /// <p>The SHA-256 hash signature for the content of the approval rule. You can retrieve this information by using <code>GetPullRequest</code>.</p>
148    pub fn set_existing_rule_content_sha256(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149        self.inner = self.inner.set_existing_rule_content_sha256(input);
150        self
151    }
152    /// <p>The SHA-256 hash signature for the content of the approval rule. You can retrieve this information by using <code>GetPullRequest</code>.</p>
153    pub fn get_existing_rule_content_sha256(&self) -> &::std::option::Option<::std::string::String> {
154        self.inner.get_existing_rule_content_sha256()
155    }
156    /// <p>The updated content for the approval rule.</p><note>
157    /// <p>When you update the content of the approval rule, you can specify approvers in an approval pool in one of two ways:</p>
158    /// <ul>
159    /// <li>
160    /// <p><b>CodeCommitApprovers</b>: This option only requires an Amazon Web Services account and a resource. It can be used for both IAM users and federated access users whose name matches the provided resource name. This is a very powerful option that offers a great deal of flexibility. For example, if you specify the Amazon Web Services account <i>123456789012</i> and <i>Mary_Major</i>, all of the following are counted as approvals coming from that user:</p>
161    /// <ul>
162    /// <li>
163    /// <p>An IAM user in the account (arn:aws:iam::<i>123456789012</i>:user/<i>Mary_Major</i>)</p></li>
164    /// <li>
165    /// <p>A federated user identified in IAM as Mary_Major (arn:aws:sts::<i>123456789012</i>:federated-user/<i>Mary_Major</i>)</p></li>
166    /// </ul>
167    /// <p>This option does not recognize an active session of someone assuming the role of CodeCommitReview with a role session name of <i>Mary_Major</i> (arn:aws:sts::<i>123456789012</i>:assumed-role/CodeCommitReview/<i>Mary_Major</i>) unless you include a wildcard (*Mary_Major).</p></li>
168    /// <li>
169    /// <p><b>Fully qualified ARN</b>: This option allows you to specify the fully qualified Amazon Resource Name (ARN) of the IAM user or role.</p></li>
170    /// </ul>
171    /// <p>For more information about IAM ARNs, wildcards, and formats, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html">IAM Identifiers</a> in the <i>IAM User Guide</i>.</p>
172    /// </note>
173    pub fn new_rule_content(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
174        self.inner = self.inner.new_rule_content(input.into());
175        self
176    }
177    /// <p>The updated content for the approval rule.</p><note>
178    /// <p>When you update the content of the approval rule, you can specify approvers in an approval pool in one of two ways:</p>
179    /// <ul>
180    /// <li>
181    /// <p><b>CodeCommitApprovers</b>: This option only requires an Amazon Web Services account and a resource. It can be used for both IAM users and federated access users whose name matches the provided resource name. This is a very powerful option that offers a great deal of flexibility. For example, if you specify the Amazon Web Services account <i>123456789012</i> and <i>Mary_Major</i>, all of the following are counted as approvals coming from that user:</p>
182    /// <ul>
183    /// <li>
184    /// <p>An IAM user in the account (arn:aws:iam::<i>123456789012</i>:user/<i>Mary_Major</i>)</p></li>
185    /// <li>
186    /// <p>A federated user identified in IAM as Mary_Major (arn:aws:sts::<i>123456789012</i>:federated-user/<i>Mary_Major</i>)</p></li>
187    /// </ul>
188    /// <p>This option does not recognize an active session of someone assuming the role of CodeCommitReview with a role session name of <i>Mary_Major</i> (arn:aws:sts::<i>123456789012</i>:assumed-role/CodeCommitReview/<i>Mary_Major</i>) unless you include a wildcard (*Mary_Major).</p></li>
189    /// <li>
190    /// <p><b>Fully qualified ARN</b>: This option allows you to specify the fully qualified Amazon Resource Name (ARN) of the IAM user or role.</p></li>
191    /// </ul>
192    /// <p>For more information about IAM ARNs, wildcards, and formats, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html">IAM Identifiers</a> in the <i>IAM User Guide</i>.</p>
193    /// </note>
194    pub fn set_new_rule_content(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
195        self.inner = self.inner.set_new_rule_content(input);
196        self
197    }
198    /// <p>The updated content for the approval rule.</p><note>
199    /// <p>When you update the content of the approval rule, you can specify approvers in an approval pool in one of two ways:</p>
200    /// <ul>
201    /// <li>
202    /// <p><b>CodeCommitApprovers</b>: This option only requires an Amazon Web Services account and a resource. It can be used for both IAM users and federated access users whose name matches the provided resource name. This is a very powerful option that offers a great deal of flexibility. For example, if you specify the Amazon Web Services account <i>123456789012</i> and <i>Mary_Major</i>, all of the following are counted as approvals coming from that user:</p>
203    /// <ul>
204    /// <li>
205    /// <p>An IAM user in the account (arn:aws:iam::<i>123456789012</i>:user/<i>Mary_Major</i>)</p></li>
206    /// <li>
207    /// <p>A federated user identified in IAM as Mary_Major (arn:aws:sts::<i>123456789012</i>:federated-user/<i>Mary_Major</i>)</p></li>
208    /// </ul>
209    /// <p>This option does not recognize an active session of someone assuming the role of CodeCommitReview with a role session name of <i>Mary_Major</i> (arn:aws:sts::<i>123456789012</i>:assumed-role/CodeCommitReview/<i>Mary_Major</i>) unless you include a wildcard (*Mary_Major).</p></li>
210    /// <li>
211    /// <p><b>Fully qualified ARN</b>: This option allows you to specify the fully qualified Amazon Resource Name (ARN) of the IAM user or role.</p></li>
212    /// </ul>
213    /// <p>For more information about IAM ARNs, wildcards, and formats, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html">IAM Identifiers</a> in the <i>IAM User Guide</i>.</p>
214    /// </note>
215    pub fn get_new_rule_content(&self) -> &::std::option::Option<::std::string::String> {
216        self.inner.get_new_rule_content()
217    }
218}