aws_sdk_amplify/operation/create_branch/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_branch::_create_branch_output::CreateBranchOutputBuilder;
3
4pub use crate::operation::create_branch::_create_branch_input::CreateBranchInputBuilder;
5
6impl crate::operation::create_branch::builders::CreateBranchInputBuilder {
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::create_branch::CreateBranchOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_branch::CreateBranchError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_branch();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateBranch`.
24///
25/// <p>Creates a new branch for an Amplify app.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateBranchFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_branch::builders::CreateBranchInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_branch::CreateBranchOutput,
35        crate::operation::create_branch::CreateBranchError,
36    > for CreateBranchFluentBuilder
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::create_branch::CreateBranchOutput,
44            crate::operation::create_branch::CreateBranchError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateBranchFluentBuilder {
51    /// Creates a new `CreateBranchFluentBuilder`.
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 CreateBranch as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_branch::builders::CreateBranchInputBuilder {
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::create_branch::CreateBranchOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_branch::CreateBranchError,
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::create_branch::CreateBranch::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_branch::CreateBranch::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::create_branch::CreateBranchOutput,
97        crate::operation::create_branch::CreateBranchError,
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 for 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 for 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 for 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>Describes the current stage for the branch.</p>
154    pub fn stage(mut self, input: crate::types::Stage) -> Self {
155        self.inner = self.inner.stage(input);
156        self
157    }
158    /// <p>Describes the current stage for the branch.</p>
159    pub fn set_stage(mut self, input: ::std::option::Option<crate::types::Stage>) -> Self {
160        self.inner = self.inner.set_stage(input);
161        self
162    }
163    /// <p>Describes the current stage for the branch.</p>
164    pub fn get_stage(&self) -> &::std::option::Option<crate::types::Stage> {
165        self.inner.get_stage()
166    }
167    /// <p>The framework for the branch.</p>
168    pub fn framework(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
169        self.inner = self.inner.framework(input.into());
170        self
171    }
172    /// <p>The framework for the branch.</p>
173    pub fn set_framework(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
174        self.inner = self.inner.set_framework(input);
175        self
176    }
177    /// <p>The framework for the branch.</p>
178    pub fn get_framework(&self) -> &::std::option::Option<::std::string::String> {
179        self.inner.get_framework()
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    ///
298    /// Adds a key-value pair to `tags`.
299    ///
300    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
301    ///
302    /// <p>The tag for the branch.</p>
303    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
304        self.inner = self.inner.tags(k.into(), v.into());
305        self
306    }
307    /// <p>The tag for the branch.</p>
308    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
309        self.inner = self.inner.set_tags(input);
310        self
311    }
312    /// <p>The tag for the branch.</p>
313    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
314        self.inner.get_tags()
315    }
316    /// <p>The build specification (build spec) for the branch.</p>
317    pub fn build_spec(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
318        self.inner = self.inner.build_spec(input.into());
319        self
320    }
321    /// <p>The build specification (build spec) for the branch.</p>
322    pub fn set_build_spec(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
323        self.inner = self.inner.set_build_spec(input);
324        self
325    }
326    /// <p>The build specification (build spec) for the branch.</p>
327    pub fn get_build_spec(&self) -> &::std::option::Option<::std::string::String> {
328        self.inner.get_build_spec()
329    }
330    /// <p>The content Time To Live (TTL) for the website in seconds.</p>
331    pub fn ttl(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
332        self.inner = self.inner.ttl(input.into());
333        self
334    }
335    /// <p>The content Time To Live (TTL) for the website in seconds.</p>
336    pub fn set_ttl(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
337        self.inner = self.inner.set_ttl(input);
338        self
339    }
340    /// <p>The content Time To Live (TTL) for the website in seconds.</p>
341    pub fn get_ttl(&self) -> &::std::option::Option<::std::string::String> {
342        self.inner.get_ttl()
343    }
344    /// <p>The display name for a branch. This is used as the default domain prefix.</p>
345    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
346        self.inner = self.inner.display_name(input.into());
347        self
348    }
349    /// <p>The display name for a branch. This is used as the default domain prefix.</p>
350    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
351        self.inner = self.inner.set_display_name(input);
352        self
353    }
354    /// <p>The display name for a branch. This is used as the default domain prefix.</p>
355    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
356        self.inner.get_display_name()
357    }
358    /// <p>Enables pull request previews for this branch.</p>
359    pub fn enable_pull_request_preview(mut self, input: bool) -> Self {
360        self.inner = self.inner.enable_pull_request_preview(input);
361        self
362    }
363    /// <p>Enables pull request previews for this branch.</p>
364    pub fn set_enable_pull_request_preview(mut self, input: ::std::option::Option<bool>) -> Self {
365        self.inner = self.inner.set_enable_pull_request_preview(input);
366        self
367    }
368    /// <p>Enables pull request previews for this branch.</p>
369    pub fn get_enable_pull_request_preview(&self) -> &::std::option::Option<bool> {
370        self.inner.get_enable_pull_request_preview()
371    }
372    /// <p>The Amplify environment name for the pull request.</p>
373    pub fn pull_request_environment_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
374        self.inner = self.inner.pull_request_environment_name(input.into());
375        self
376    }
377    /// <p>The Amplify environment name for the pull request.</p>
378    pub fn set_pull_request_environment_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
379        self.inner = self.inner.set_pull_request_environment_name(input);
380        self
381    }
382    /// <p>The Amplify environment name for the pull request.</p>
383    pub fn get_pull_request_environment_name(&self) -> &::std::option::Option<::std::string::String> {
384        self.inner.get_pull_request_environment_name()
385    }
386    /// <p>The Amazon Resource Name (ARN) for a backend environment that is part of a Gen 1 Amplify app.</p>
387    /// <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>
388    pub fn backend_environment_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
389        self.inner = self.inner.backend_environment_arn(input.into());
390        self
391    }
392    /// <p>The Amazon Resource Name (ARN) for a backend environment that is part of a Gen 1 Amplify app.</p>
393    /// <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>
394    pub fn set_backend_environment_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
395        self.inner = self.inner.set_backend_environment_arn(input);
396        self
397    }
398    /// <p>The Amazon Resource Name (ARN) for a backend environment that is part of a Gen 1 Amplify app.</p>
399    /// <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>
400    pub fn get_backend_environment_arn(&self) -> &::std::option::Option<::std::string::String> {
401        self.inner.get_backend_environment_arn()
402    }
403    /// <p>The backend for a <code>Branch</code> of an Amplify app. Use for a backend created from an CloudFormation stack.</p>
404    /// <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>
405    pub fn backend(mut self, input: crate::types::Backend) -> Self {
406        self.inner = self.inner.backend(input);
407        self
408    }
409    /// <p>The backend for a <code>Branch</code> of an Amplify app. Use for a backend created from an CloudFormation stack.</p>
410    /// <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>
411    pub fn set_backend(mut self, input: ::std::option::Option<crate::types::Backend>) -> Self {
412        self.inner = self.inner.set_backend(input);
413        self
414    }
415    /// <p>The backend for a <code>Branch</code> of an Amplify app. Use for a backend created from an CloudFormation stack.</p>
416    /// <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>
417    pub fn get_backend(&self) -> &::std::option::Option<crate::types::Backend> {
418        self.inner.get_backend()
419    }
420    /// <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>
421    pub fn compute_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
422        self.inner = self.inner.compute_role_arn(input.into());
423        self
424    }
425    /// <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>
426    pub fn set_compute_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
427        self.inner = self.inner.set_compute_role_arn(input);
428        self
429    }
430    /// <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>
431    pub fn get_compute_role_arn(&self) -> &::std::option::Option<::std::string::String> {
432        self.inner.get_compute_role_arn()
433    }
434}