// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::create_instance::_create_instance_input::CreateInstanceInputBuilder;
pub use crate::operation::create_instance::_create_instance_output::CreateInstanceOutputBuilder;
impl crate::operation::create_instance::builders::CreateInstanceInputBuilder {
/// 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_instance::CreateInstanceOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::create_instance::CreateInstanceError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.create_instance();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `CreateInstance`.
///
/// <p>Enables you to programmatically create an Amazon Web Services Supply Chain instance by applying KMS keys and relevant information associated with the API without using the Amazon Web Services console.</p>
/// <p>This is an asynchronous operation. Upon receiving a CreateInstance request, Amazon Web Services Supply Chain immediately returns the instance resource, instance ID, and the initializing state while simultaneously creating all required Amazon Web Services resources for an instance creation. You can use GetInstance to check the status of the instance. If the instance results in an unhealthy state, you need to check the error message, delete the current instance, and recreate a new one based on the mitigation from the error message.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CreateInstanceFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::create_instance::builders::CreateInstanceInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::create_instance::CreateInstanceOutput,
crate::operation::create_instance::CreateInstanceError,
> for CreateInstanceFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::create_instance::CreateInstanceOutput,
crate::operation::create_instance::CreateInstanceError,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl CreateInstanceFluentBuilder {
/// Creates a new `CreateInstanceFluentBuilder`.
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 CreateInstance as a reference.
pub fn as_input(&self) -> &crate::operation::create_instance::builders::CreateInstanceInputBuilder {
&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_instance::CreateInstanceOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::create_instance::CreateInstanceError,
::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_instance::CreateInstance::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::create_instance::CreateInstance::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_instance::CreateInstanceOutput,
crate::operation::create_instance::CreateInstanceError,
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 AWS Supply Chain instance name.</p>
pub fn instance_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.instance_name(input.into());
self
}
/// <p>The AWS Supply Chain instance name.</p>
pub fn set_instance_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_instance_name(input);
self
}
/// <p>The AWS Supply Chain instance name.</p>
pub fn get_instance_name(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_instance_name()
}
/// <p>The AWS Supply Chain instance description.</p>
pub fn instance_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.instance_description(input.into());
self
}
/// <p>The AWS Supply Chain instance description.</p>
pub fn set_instance_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_instance_description(input);
self
}
/// <p>The AWS Supply Chain instance description.</p>
pub fn get_instance_description(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_instance_description()
}
/// <p>The ARN (Amazon Resource Name) of the Key Management Service (KMS) key you provide for encryption. This is required if you do not want to use the Amazon Web Services owned KMS key. If you don't provide anything here, AWS Supply Chain uses the Amazon Web Services owned KMS key.</p>
pub fn kms_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.kms_key_arn(input.into());
self
}
/// <p>The ARN (Amazon Resource Name) of the Key Management Service (KMS) key you provide for encryption. This is required if you do not want to use the Amazon Web Services owned KMS key. If you don't provide anything here, AWS Supply Chain uses the Amazon Web Services owned KMS key.</p>
pub fn set_kms_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_kms_key_arn(input);
self
}
/// <p>The ARN (Amazon Resource Name) of the Key Management Service (KMS) key you provide for encryption. This is required if you do not want to use the Amazon Web Services owned KMS key. If you don't provide anything here, AWS Supply Chain uses the Amazon Web Services owned KMS key.</p>
pub fn get_kms_key_arn(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_kms_key_arn()
}
/// <p>The DNS subdomain of the web app. This would be "example" in the URL "example.scn.global.on.aws". You can set this to a custom value, as long as the domain isn't already being used by someone else. The name may only include alphanumeric characters and hyphens.</p>
pub fn web_app_dns_domain(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.web_app_dns_domain(input.into());
self
}
/// <p>The DNS subdomain of the web app. This would be "example" in the URL "example.scn.global.on.aws". You can set this to a custom value, as long as the domain isn't already being used by someone else. The name may only include alphanumeric characters and hyphens.</p>
pub fn set_web_app_dns_domain(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_web_app_dns_domain(input);
self
}
/// <p>The DNS subdomain of the web app. This would be "example" in the URL "example.scn.global.on.aws". You can set this to a custom value, as long as the domain isn't already being used by someone else. The name may only include alphanumeric characters and hyphens.</p>
pub fn get_web_app_dns_domain(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_web_app_dns_domain()
}
///
/// Adds a key-value pair to `tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>The Amazon Web Services tags of an instance to be created.</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 Amazon Web Services tags of an instance to be created.</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 Amazon Web Services tags of an instance to be created.</p>
pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.inner.get_tags()
}
/// <p>The client token for idempotency.</p>
pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.client_token(input.into());
self
}
/// <p>The client token for idempotency.</p>
pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_client_token(input);
self
}
/// <p>The client token for idempotency.</p>
pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_client_token()
}
}