// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::create_branch::_create_branch_input::CreateBranchInputBuilder;
pub use crate::operation::create_branch::_create_branch_output::CreateBranchOutputBuilder;
impl crate::operation::create_branch::builders::CreateBranchInputBuilder {
/// Sends a request with this input using the given client.
pub async fn send_with(
self,
client: &crate::Client,
) -> ::std::result::Result<
crate::operation::create_branch::CreateBranchOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::create_branch::CreateBranchError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.create_branch();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `CreateBranch`.
///
/// <p>Creates a new branch for an Amplify app.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CreateBranchFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::create_branch::builders::CreateBranchInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::create_branch::CreateBranchOutput,
crate::operation::create_branch::CreateBranchError,
> for CreateBranchFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::create_branch::CreateBranchOutput,
crate::operation::create_branch::CreateBranchError,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl CreateBranchFluentBuilder {
/// Creates a new `CreateBranchFluentBuilder`.
pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
Self {
handle,
inner: ::std::default::Default::default(),
config_override: ::std::option::Option::None,
}
}
/// Access the CreateBranch as a reference.
pub fn as_input(&self) -> &crate::operation::create_branch::builders::CreateBranchInputBuilder {
&self.inner
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> ::std::result::Result<
crate::operation::create_branch::CreateBranchOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::create_branch::CreateBranchError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let input = self
.inner
.build()
.map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
let runtime_plugins = crate::operation::create_branch::CreateBranch::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::create_branch::CreateBranch::orchestrate(&runtime_plugins, input).await
}
/// Consumes this builder, creating a customizable operation that can be modified before being sent.
pub fn customize(
self,
) -> crate::client::customize::CustomizableOperation<
crate::operation::create_branch::CreateBranchOutput,
crate::operation::create_branch::CreateBranchError,
Self,
> {
crate::client::customize::CustomizableOperation::new(self)
}
pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
self.set_config_override(::std::option::Option::Some(config_override.into()));
self
}
pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
self.config_override = config_override;
self
}
/// <p>The unique ID for an Amplify app.</p>
pub fn app_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.app_id(input.into());
self
}
/// <p>The unique ID for an Amplify app.</p>
pub fn set_app_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_app_id(input);
self
}
/// <p>The unique ID for an Amplify app.</p>
pub fn get_app_id(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_app_id()
}
/// <p>The name for the branch.</p>
pub fn branch_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.branch_name(input.into());
self
}
/// <p>The name for the branch.</p>
pub fn set_branch_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_branch_name(input);
self
}
/// <p>The name for the branch.</p>
pub fn get_branch_name(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_branch_name()
}
/// <p>The description for the branch.</p>
pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.description(input.into());
self
}
/// <p>The description for the branch.</p>
pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_description(input);
self
}
/// <p>The description for the branch.</p>
pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_description()
}
/// <p>Describes the current stage for the branch.</p>
pub fn stage(mut self, input: crate::types::Stage) -> Self {
self.inner = self.inner.stage(input);
self
}
/// <p>Describes the current stage for the branch.</p>
pub fn set_stage(mut self, input: ::std::option::Option<crate::types::Stage>) -> Self {
self.inner = self.inner.set_stage(input);
self
}
/// <p>Describes the current stage for the branch.</p>
pub fn get_stage(&self) -> &::std::option::Option<crate::types::Stage> {
self.inner.get_stage()
}
/// <p>The framework for the branch.</p>
pub fn framework(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.framework(input.into());
self
}
/// <p>The framework for the branch.</p>
pub fn set_framework(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_framework(input);
self
}
/// <p>The framework for the branch.</p>
pub fn get_framework(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_framework()
}
/// <p>Enables notifications for the branch.</p>
pub fn enable_notification(mut self, input: bool) -> Self {
self.inner = self.inner.enable_notification(input);
self
}
/// <p>Enables notifications for the branch.</p>
pub fn set_enable_notification(mut self, input: ::std::option::Option<bool>) -> Self {
self.inner = self.inner.set_enable_notification(input);
self
}
/// <p>Enables notifications for the branch.</p>
pub fn get_enable_notification(&self) -> &::std::option::Option<bool> {
self.inner.get_enable_notification()
}
/// <p>Enables auto building for the branch.</p>
pub fn enable_auto_build(mut self, input: bool) -> Self {
self.inner = self.inner.enable_auto_build(input);
self
}
/// <p>Enables auto building for the branch.</p>
pub fn set_enable_auto_build(mut self, input: ::std::option::Option<bool>) -> Self {
self.inner = self.inner.set_enable_auto_build(input);
self
}
/// <p>Enables auto building for the branch.</p>
pub fn get_enable_auto_build(&self) -> &::std::option::Option<bool> {
self.inner.get_enable_auto_build()
}
/// <p>Specifies whether the skew protection feature is enabled for the branch.</p>
/// <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>
pub fn enable_skew_protection(mut self, input: bool) -> Self {
self.inner = self.inner.enable_skew_protection(input);
self
}
/// <p>Specifies whether the skew protection feature is enabled for the branch.</p>
/// <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>
pub fn set_enable_skew_protection(mut self, input: ::std::option::Option<bool>) -> Self {
self.inner = self.inner.set_enable_skew_protection(input);
self
}
/// <p>Specifies whether the skew protection feature is enabled for the branch.</p>
/// <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>
pub fn get_enable_skew_protection(&self) -> &::std::option::Option<bool> {
self.inner.get_enable_skew_protection()
}
///
/// Adds a key-value pair to `environmentVariables`.
///
/// To override the contents of this collection use [`set_environment_variables`](Self::set_environment_variables).
///
/// <p>The environment variables for the branch.</p>
pub fn environment_variables(
mut self,
k: impl ::std::convert::Into<::std::string::String>,
v: impl ::std::convert::Into<::std::string::String>,
) -> Self {
self.inner = self.inner.environment_variables(k.into(), v.into());
self
}
/// <p>The environment variables for the branch.</p>
pub fn set_environment_variables(
mut self,
input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
) -> Self {
self.inner = self.inner.set_environment_variables(input);
self
}
/// <p>The environment variables for the branch.</p>
pub fn get_environment_variables(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.inner.get_environment_variables()
}
/// <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>
pub fn basic_auth_credentials(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.basic_auth_credentials(input.into());
self
}
/// <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>
pub fn set_basic_auth_credentials(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_basic_auth_credentials(input);
self
}
/// <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>
pub fn get_basic_auth_credentials(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_basic_auth_credentials()
}
/// <p>Enables basic authorization for the branch.</p>
pub fn enable_basic_auth(mut self, input: bool) -> Self {
self.inner = self.inner.enable_basic_auth(input);
self
}
/// <p>Enables basic authorization for the branch.</p>
pub fn set_enable_basic_auth(mut self, input: ::std::option::Option<bool>) -> Self {
self.inner = self.inner.set_enable_basic_auth(input);
self
}
/// <p>Enables basic authorization for the branch.</p>
pub fn get_enable_basic_auth(&self) -> &::std::option::Option<bool> {
self.inner.get_enable_basic_auth()
}
/// <p>Enables performance mode for the branch.</p>
/// <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>
pub fn enable_performance_mode(mut self, input: bool) -> Self {
self.inner = self.inner.enable_performance_mode(input);
self
}
/// <p>Enables performance mode for the branch.</p>
/// <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>
pub fn set_enable_performance_mode(mut self, input: ::std::option::Option<bool>) -> Self {
self.inner = self.inner.set_enable_performance_mode(input);
self
}
/// <p>Enables performance mode for the branch.</p>
/// <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>
pub fn get_enable_performance_mode(&self) -> &::std::option::Option<bool> {
self.inner.get_enable_performance_mode()
}
///
/// Adds a key-value pair to `tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>The tag for the branch.</p>
pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.tags(k.into(), v.into());
self
}
/// <p>The tag for the branch.</p>
pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
self.inner = self.inner.set_tags(input);
self
}
/// <p>The tag for the branch.</p>
pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.inner.get_tags()
}
/// <p>The build specification (build spec) for the branch.</p>
pub fn build_spec(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.build_spec(input.into());
self
}
/// <p>The build specification (build spec) for the branch.</p>
pub fn set_build_spec(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_build_spec(input);
self
}
/// <p>The build specification (build spec) for the branch.</p>
pub fn get_build_spec(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_build_spec()
}
/// <p>The content Time To Live (TTL) for the website in seconds.</p>
pub fn ttl(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.ttl(input.into());
self
}
/// <p>The content Time To Live (TTL) for the website in seconds.</p>
pub fn set_ttl(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_ttl(input);
self
}
/// <p>The content Time To Live (TTL) for the website in seconds.</p>
pub fn get_ttl(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_ttl()
}
/// <p>The display name for a branch. This is used as the default domain prefix.</p>
pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.display_name(input.into());
self
}
/// <p>The display name for a branch. This is used as the default domain prefix.</p>
pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_display_name(input);
self
}
/// <p>The display name for a branch. This is used as the default domain prefix.</p>
pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_display_name()
}
/// <p>Enables pull request previews for this branch.</p>
pub fn enable_pull_request_preview(mut self, input: bool) -> Self {
self.inner = self.inner.enable_pull_request_preview(input);
self
}
/// <p>Enables pull request previews for this branch.</p>
pub fn set_enable_pull_request_preview(mut self, input: ::std::option::Option<bool>) -> Self {
self.inner = self.inner.set_enable_pull_request_preview(input);
self
}
/// <p>Enables pull request previews for this branch.</p>
pub fn get_enable_pull_request_preview(&self) -> &::std::option::Option<bool> {
self.inner.get_enable_pull_request_preview()
}
/// <p>The Amplify environment name for the pull request.</p>
pub fn pull_request_environment_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.pull_request_environment_name(input.into());
self
}
/// <p>The Amplify environment name for the pull request.</p>
pub fn set_pull_request_environment_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_pull_request_environment_name(input);
self
}
/// <p>The Amplify environment name for the pull request.</p>
pub fn get_pull_request_environment_name(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_pull_request_environment_name()
}
/// <p>The Amazon Resource Name (ARN) for a backend environment that is part of a Gen 1 Amplify app.</p>
/// <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>
pub fn backend_environment_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.backend_environment_arn(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) for a backend environment that is part of a Gen 1 Amplify app.</p>
/// <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>
pub fn set_backend_environment_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_backend_environment_arn(input);
self
}
/// <p>The Amazon Resource Name (ARN) for a backend environment that is part of a Gen 1 Amplify app.</p>
/// <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>
pub fn get_backend_environment_arn(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_backend_environment_arn()
}
/// <p>The backend for a <code>Branch</code> of an Amplify app. Use for a backend created from an CloudFormation stack.</p>
/// <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>
pub fn backend(mut self, input: crate::types::Backend) -> Self {
self.inner = self.inner.backend(input);
self
}
/// <p>The backend for a <code>Branch</code> of an Amplify app. Use for a backend created from an CloudFormation stack.</p>
/// <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>
pub fn set_backend(mut self, input: ::std::option::Option<crate::types::Backend>) -> Self {
self.inner = self.inner.set_backend(input);
self
}
/// <p>The backend for a <code>Branch</code> of an Amplify app. Use for a backend created from an CloudFormation stack.</p>
/// <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>
pub fn get_backend(&self) -> &::std::option::Option<crate::types::Backend> {
self.inner.get_backend()
}
/// <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>
pub fn compute_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.compute_role_arn(input.into());
self
}
/// <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>
pub fn set_compute_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_compute_role_arn(input);
self
}
/// <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>
pub fn get_compute_role_arn(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_compute_role_arn()
}
}