aws_sdk_amplify/operation/update_branch/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_branch::_update_branch_output::UpdateBranchOutputBuilder;
3
4pub use crate::operation::update_branch::_update_branch_input::UpdateBranchInputBuilder;
5
6impl crate::operation::update_branch::builders::UpdateBranchInputBuilder {
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_branch::UpdateBranchOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_branch::UpdateBranchError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_branch();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateBranch`.
24///
25/// <p>Updates a branch for an Amplify app.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdateBranchFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::update_branch::builders::UpdateBranchInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::update_branch::UpdateBranchOutput,
35        crate::operation::update_branch::UpdateBranchError,
36    > for UpdateBranchFluentBuilder
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_branch::UpdateBranchOutput,
44            crate::operation::update_branch::UpdateBranchError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl UpdateBranchFluentBuilder {
51    /// Creates a new `UpdateBranchFluentBuilder`.
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 UpdateBranch as a reference.
60    pub fn as_input(&self) -> &crate::operation::update_branch::builders::UpdateBranchInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::update_branch::UpdateBranchOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::update_branch::UpdateBranchError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::update_branch::UpdateBranch::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::update_branch::UpdateBranch::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::update_branch::UpdateBranchOutput,
97        crate::operation::update_branch::UpdateBranchError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>The unique ID for an Amplify app.</p>
112    pub fn app_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.app_id(input.into());
114        self
115    }
116    /// <p>The unique ID for an Amplify app.</p>
117    pub fn set_app_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_app_id(input);
119        self
120    }
121    /// <p>The unique ID for an Amplify app.</p>
122    pub fn get_app_id(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_app_id()
124    }
125    /// <p>The name of the branch.</p>
126    pub fn branch_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.branch_name(input.into());
128        self
129    }
130    /// <p>The name of the branch.</p>
131    pub fn set_branch_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_branch_name(input);
133        self
134    }
135    /// <p>The name of the branch.</p>
136    pub fn get_branch_name(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_branch_name()
138    }
139    /// <p>The description for the branch.</p>
140    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.description(input.into());
142        self
143    }
144    /// <p>The description for the branch.</p>
145    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_description(input);
147        self
148    }
149    /// <p>The description for the branch.</p>
150    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_description()
152    }
153    /// <p>The framework for the branch.</p>
154    pub fn framework(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155        self.inner = self.inner.framework(input.into());
156        self
157    }
158    /// <p>The framework for the branch.</p>
159    pub fn set_framework(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160        self.inner = self.inner.set_framework(input);
161        self
162    }
163    /// <p>The framework for the branch.</p>
164    pub fn get_framework(&self) -> &::std::option::Option<::std::string::String> {
165        self.inner.get_framework()
166    }
167    /// <p>Describes the current stage for the branch.</p>
168    pub fn stage(mut self, input: crate::types::Stage) -> Self {
169        self.inner = self.inner.stage(input);
170        self
171    }
172    /// <p>Describes the current stage for the branch.</p>
173    pub fn set_stage(mut self, input: ::std::option::Option<crate::types::Stage>) -> Self {
174        self.inner = self.inner.set_stage(input);
175        self
176    }
177    /// <p>Describes the current stage for the branch.</p>
178    pub fn get_stage(&self) -> &::std::option::Option<crate::types::Stage> {
179        self.inner.get_stage()
180    }
181    /// <p>Enables notifications for the branch.</p>
182    pub fn enable_notification(mut self, input: bool) -> Self {
183        self.inner = self.inner.enable_notification(input);
184        self
185    }
186    /// <p>Enables notifications for the branch.</p>
187    pub fn set_enable_notification(mut self, input: ::std::option::Option<bool>) -> Self {
188        self.inner = self.inner.set_enable_notification(input);
189        self
190    }
191    /// <p>Enables notifications for the branch.</p>
192    pub fn get_enable_notification(&self) -> &::std::option::Option<bool> {
193        self.inner.get_enable_notification()
194    }
195    /// <p>Enables auto building for the branch.</p>
196    pub fn enable_auto_build(mut self, input: bool) -> Self {
197        self.inner = self.inner.enable_auto_build(input);
198        self
199    }
200    /// <p>Enables auto building for the branch.</p>
201    pub fn set_enable_auto_build(mut self, input: ::std::option::Option<bool>) -> Self {
202        self.inner = self.inner.set_enable_auto_build(input);
203        self
204    }
205    /// <p>Enables auto building for the branch.</p>
206    pub fn get_enable_auto_build(&self) -> &::std::option::Option<bool> {
207        self.inner.get_enable_auto_build()
208    }
209    /// <p>Specifies whether the skew protection feature is enabled for the branch.</p>
210    /// <p>Deployment skew protection is available to Amplify applications to eliminate version skew issues between client and servers in web applications. When you apply skew protection to a branch, you can ensure that your clients always interact with the correct version of server-side assets, regardless of when a deployment occurs. For more information about skew protection, see <a href="https://docs.aws.amazon.com/amplify/latest/userguide/skew-protection.html">Skew protection for Amplify deployments</a> in the <i>Amplify User Guide</i>.</p>
211    pub fn enable_skew_protection(mut self, input: bool) -> Self {
212        self.inner = self.inner.enable_skew_protection(input);
213        self
214    }
215    /// <p>Specifies whether the skew protection feature is enabled for the branch.</p>
216    /// <p>Deployment skew protection is available to Amplify applications to eliminate version skew issues between client and servers in web applications. When you apply skew protection to a branch, you can ensure that your clients always interact with the correct version of server-side assets, regardless of when a deployment occurs. For more information about skew protection, see <a href="https://docs.aws.amazon.com/amplify/latest/userguide/skew-protection.html">Skew protection for Amplify deployments</a> in the <i>Amplify User Guide</i>.</p>
217    pub fn set_enable_skew_protection(mut self, input: ::std::option::Option<bool>) -> Self {
218        self.inner = self.inner.set_enable_skew_protection(input);
219        self
220    }
221    /// <p>Specifies whether the skew protection feature is enabled for the branch.</p>
222    /// <p>Deployment skew protection is available to Amplify applications to eliminate version skew issues between client and servers in web applications. When you apply skew protection to a branch, you can ensure that your clients always interact with the correct version of server-side assets, regardless of when a deployment occurs. For more information about skew protection, see <a href="https://docs.aws.amazon.com/amplify/latest/userguide/skew-protection.html">Skew protection for Amplify deployments</a> in the <i>Amplify User Guide</i>.</p>
223    pub fn get_enable_skew_protection(&self) -> &::std::option::Option<bool> {
224        self.inner.get_enable_skew_protection()
225    }
226    ///
227    /// Adds a key-value pair to `environmentVariables`.
228    ///
229    /// To override the contents of this collection use [`set_environment_variables`](Self::set_environment_variables).
230    ///
231    /// <p>The environment variables for the branch.</p>
232    pub fn environment_variables(
233        mut self,
234        k: impl ::std::convert::Into<::std::string::String>,
235        v: impl ::std::convert::Into<::std::string::String>,
236    ) -> Self {
237        self.inner = self.inner.environment_variables(k.into(), v.into());
238        self
239    }
240    /// <p>The environment variables for the branch.</p>
241    pub fn set_environment_variables(
242        mut self,
243        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
244    ) -> Self {
245        self.inner = self.inner.set_environment_variables(input);
246        self
247    }
248    /// <p>The environment variables for the branch.</p>
249    pub fn get_environment_variables(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
250        self.inner.get_environment_variables()
251    }
252    /// <p>The basic authorization credentials for the branch. You must base64-encode the authorization credentials and provide them in the format <code>user:password</code>.</p>
253    pub fn basic_auth_credentials(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
254        self.inner = self.inner.basic_auth_credentials(input.into());
255        self
256    }
257    /// <p>The basic authorization credentials for the branch. You must base64-encode the authorization credentials and provide them in the format <code>user:password</code>.</p>
258    pub fn set_basic_auth_credentials(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
259        self.inner = self.inner.set_basic_auth_credentials(input);
260        self
261    }
262    /// <p>The basic authorization credentials for the branch. You must base64-encode the authorization credentials and provide them in the format <code>user:password</code>.</p>
263    pub fn get_basic_auth_credentials(&self) -> &::std::option::Option<::std::string::String> {
264        self.inner.get_basic_auth_credentials()
265    }
266    /// <p>Enables basic authorization for the branch.</p>
267    pub fn enable_basic_auth(mut self, input: bool) -> Self {
268        self.inner = self.inner.enable_basic_auth(input);
269        self
270    }
271    /// <p>Enables basic authorization for the branch.</p>
272    pub fn set_enable_basic_auth(mut self, input: ::std::option::Option<bool>) -> Self {
273        self.inner = self.inner.set_enable_basic_auth(input);
274        self
275    }
276    /// <p>Enables basic authorization for the branch.</p>
277    pub fn get_enable_basic_auth(&self) -> &::std::option::Option<bool> {
278        self.inner.get_enable_basic_auth()
279    }
280    /// <p>Enables performance mode for the branch.</p>
281    /// <p>Performance mode optimizes for faster hosting performance by keeping content cached at the edge for a longer interval. When performance mode is enabled, hosting configuration or code changes can take up to 10 minutes to roll out.</p>
282    pub fn enable_performance_mode(mut self, input: bool) -> Self {
283        self.inner = self.inner.enable_performance_mode(input);
284        self
285    }
286    /// <p>Enables performance mode for the branch.</p>
287    /// <p>Performance mode optimizes for faster hosting performance by keeping content cached at the edge for a longer interval. When performance mode is enabled, hosting configuration or code changes can take up to 10 minutes to roll out.</p>
288    pub fn set_enable_performance_mode(mut self, input: ::std::option::Option<bool>) -> Self {
289        self.inner = self.inner.set_enable_performance_mode(input);
290        self
291    }
292    /// <p>Enables performance mode for the branch.</p>
293    /// <p>Performance mode optimizes for faster hosting performance by keeping content cached at the edge for a longer interval. When performance mode is enabled, hosting configuration or code changes can take up to 10 minutes to roll out.</p>
294    pub fn get_enable_performance_mode(&self) -> &::std::option::Option<bool> {
295        self.inner.get_enable_performance_mode()
296    }
297    /// <p>The build specification (build spec) for the branch.</p>
298    pub fn build_spec(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
299        self.inner = self.inner.build_spec(input.into());
300        self
301    }
302    /// <p>The build specification (build spec) for the branch.</p>
303    pub fn set_build_spec(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
304        self.inner = self.inner.set_build_spec(input);
305        self
306    }
307    /// <p>The build specification (build spec) for the branch.</p>
308    pub fn get_build_spec(&self) -> &::std::option::Option<::std::string::String> {
309        self.inner.get_build_spec()
310    }
311    /// <p>The content Time to Live (TTL) for the website in seconds.</p>
312    pub fn ttl(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
313        self.inner = self.inner.ttl(input.into());
314        self
315    }
316    /// <p>The content Time to Live (TTL) for the website in seconds.</p>
317    pub fn set_ttl(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
318        self.inner = self.inner.set_ttl(input);
319        self
320    }
321    /// <p>The content Time to Live (TTL) for the website in seconds.</p>
322    pub fn get_ttl(&self) -> &::std::option::Option<::std::string::String> {
323        self.inner.get_ttl()
324    }
325    /// <p>The display name for a branch. This is used as the default domain prefix.</p>
326    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
327        self.inner = self.inner.display_name(input.into());
328        self
329    }
330    /// <p>The display name for a branch. This is used as the default domain prefix.</p>
331    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
332        self.inner = self.inner.set_display_name(input);
333        self
334    }
335    /// <p>The display name for a branch. This is used as the default domain prefix.</p>
336    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
337        self.inner.get_display_name()
338    }
339    /// <p>Enables pull request previews for this branch.</p>
340    pub fn enable_pull_request_preview(mut self, input: bool) -> Self {
341        self.inner = self.inner.enable_pull_request_preview(input);
342        self
343    }
344    /// <p>Enables pull request previews for this branch.</p>
345    pub fn set_enable_pull_request_preview(mut self, input: ::std::option::Option<bool>) -> Self {
346        self.inner = self.inner.set_enable_pull_request_preview(input);
347        self
348    }
349    /// <p>Enables pull request previews for this branch.</p>
350    pub fn get_enable_pull_request_preview(&self) -> &::std::option::Option<bool> {
351        self.inner.get_enable_pull_request_preview()
352    }
353    /// <p>The Amplify environment name for the pull request.</p>
354    pub fn pull_request_environment_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
355        self.inner = self.inner.pull_request_environment_name(input.into());
356        self
357    }
358    /// <p>The Amplify environment name for the pull request.</p>
359    pub fn set_pull_request_environment_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
360        self.inner = self.inner.set_pull_request_environment_name(input);
361        self
362    }
363    /// <p>The Amplify environment name for the pull request.</p>
364    pub fn get_pull_request_environment_name(&self) -> &::std::option::Option<::std::string::String> {
365        self.inner.get_pull_request_environment_name()
366    }
367    /// <p>The Amazon Resource Name (ARN) for a backend environment that is part of a Gen 1 Amplify app.</p>
368    /// <p>This field is available to Amplify Gen 1 apps only where the backend is created using Amplify Studio or the Amplify command line interface (CLI).</p>
369    pub fn backend_environment_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
370        self.inner = self.inner.backend_environment_arn(input.into());
371        self
372    }
373    /// <p>The Amazon Resource Name (ARN) for a backend environment that is part of a Gen 1 Amplify app.</p>
374    /// <p>This field is available to Amplify Gen 1 apps only where the backend is created using Amplify Studio or the Amplify command line interface (CLI).</p>
375    pub fn set_backend_environment_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
376        self.inner = self.inner.set_backend_environment_arn(input);
377        self
378    }
379    /// <p>The Amazon Resource Name (ARN) for a backend environment that is part of a Gen 1 Amplify app.</p>
380    /// <p>This field is available to Amplify Gen 1 apps only where the backend is created using Amplify Studio or the Amplify command line interface (CLI).</p>
381    pub fn get_backend_environment_arn(&self) -> &::std::option::Option<::std::string::String> {
382        self.inner.get_backend_environment_arn()
383    }
384    /// <p>The backend for a <code>Branch</code> of an Amplify app. Use for a backend created from an CloudFormation stack.</p>
385    /// <p>This field is available to Amplify Gen 2 apps only. When you deploy an application with Amplify Gen 2, you provision the app's backend infrastructure using Typescript code.</p>
386    pub fn backend(mut self, input: crate::types::Backend) -> Self {
387        self.inner = self.inner.backend(input);
388        self
389    }
390    /// <p>The backend for a <code>Branch</code> of an Amplify app. Use for a backend created from an CloudFormation stack.</p>
391    /// <p>This field is available to Amplify Gen 2 apps only. When you deploy an application with Amplify Gen 2, you provision the app's backend infrastructure using Typescript code.</p>
392    pub fn set_backend(mut self, input: ::std::option::Option<crate::types::Backend>) -> Self {
393        self.inner = self.inner.set_backend(input);
394        self
395    }
396    /// <p>The backend for a <code>Branch</code> of an Amplify app. Use for a backend created from an CloudFormation stack.</p>
397    /// <p>This field is available to Amplify Gen 2 apps only. When you deploy an application with Amplify Gen 2, you provision the app's backend infrastructure using Typescript code.</p>
398    pub fn get_backend(&self) -> &::std::option::Option<crate::types::Backend> {
399        self.inner.get_backend()
400    }
401    /// <p>The Amazon Resource Name (ARN) of the IAM role to assign to a branch of an SSR app. The SSR Compute role allows the Amplify Hosting compute service to securely access specific Amazon Web Services resources based on the role's permissions. For more information about the SSR Compute role, see <a href="https://docs.aws.amazon.com/amplify/latest/userguide/amplify-SSR-compute-role.html">Adding an SSR Compute role</a> in the <i>Amplify User Guide</i>.</p>
402    pub fn compute_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
403        self.inner = self.inner.compute_role_arn(input.into());
404        self
405    }
406    /// <p>The Amazon Resource Name (ARN) of the IAM role to assign to a branch of an SSR app. The SSR Compute role allows the Amplify Hosting compute service to securely access specific Amazon Web Services resources based on the role's permissions. For more information about the SSR Compute role, see <a href="https://docs.aws.amazon.com/amplify/latest/userguide/amplify-SSR-compute-role.html">Adding an SSR Compute role</a> in the <i>Amplify User Guide</i>.</p>
407    pub fn set_compute_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
408        self.inner = self.inner.set_compute_role_arn(input);
409        self
410    }
411    /// <p>The Amazon Resource Name (ARN) of the IAM role to assign to a branch of an SSR app. The SSR Compute role allows the Amplify Hosting compute service to securely access specific Amazon Web Services resources based on the role's permissions. For more information about the SSR Compute role, see <a href="https://docs.aws.amazon.com/amplify/latest/userguide/amplify-SSR-compute-role.html">Adding an SSR Compute role</a> in the <i>Amplify User Guide</i>.</p>
412    pub fn get_compute_role_arn(&self) -> &::std::option::Option<::std::string::String> {
413        self.inner.get_compute_role_arn()
414    }
415}