// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::create_file_cache::_create_file_cache_output::CreateFileCacheOutputBuilder;
pub use crate::operation::create_file_cache::_create_file_cache_input::CreateFileCacheInputBuilder;
impl crate::operation::create_file_cache::builders::CreateFileCacheInputBuilder {
/// 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_file_cache::CreateFileCacheOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::create_file_cache::CreateFileCacheError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.create_file_cache();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `CreateFileCache`.
///
/// <p>Creates a new Amazon File Cache resource.</p>
/// <p>You can use this operation with a client request token in the request that Amazon File Cache uses to ensure idempotent creation. If a cache with the specified client request token exists and the parameters match, <code>CreateFileCache</code> returns the description of the existing cache. If a cache with the specified client request token exists and the parameters don't match, this call returns <code>IncompatibleParameterError</code>. If a file cache with the specified client request token doesn't exist, <code>CreateFileCache</code> does the following:</p>
/// <ul>
/// <li>
/// <p>Creates a new, empty Amazon File Cache resource with an assigned ID, and an initial lifecycle state of <code>CREATING</code>.</p></li>
/// <li>
/// <p>Returns the description of the cache in JSON format.</p></li>
/// </ul><note>
/// <p>The <code>CreateFileCache</code> call returns while the cache's lifecycle state is still <code>CREATING</code>. You can check the cache creation status by calling the <a href="https://docs.aws.amazon.com/fsx/latest/APIReference/API_DescribeFileCaches.html">DescribeFileCaches</a> operation, which returns the cache state along with other information.</p>
/// </note>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CreateFileCacheFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::create_file_cache::builders::CreateFileCacheInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::create_file_cache::CreateFileCacheOutput,
crate::operation::create_file_cache::CreateFileCacheError,
> for CreateFileCacheFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::create_file_cache::CreateFileCacheOutput,
crate::operation::create_file_cache::CreateFileCacheError,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl CreateFileCacheFluentBuilder {
/// Creates a new `CreateFileCacheFluentBuilder`.
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 CreateFileCache as a reference.
pub fn as_input(&self) -> &crate::operation::create_file_cache::builders::CreateFileCacheInputBuilder {
&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_file_cache::CreateFileCacheOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::create_file_cache::CreateFileCacheError,
::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_file_cache::CreateFileCache::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::create_file_cache::CreateFileCache::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_file_cache::CreateFileCacheOutput,
crate::operation::create_file_cache::CreateFileCacheError,
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>An idempotency token for resource creation, in a string of up to 63 ASCII characters. This token is automatically filled on your behalf when you use the Command Line Interface (CLI) or an Amazon Web Services SDK.</p>
/// <p>By using the idempotent operation, you can retry a <code>CreateFileCache</code> operation without the risk of creating an extra cache. This approach can be useful when an initial call fails in a way that makes it unclear whether a cache was created. Examples are if a transport level timeout occurred, or your connection was reset. If you use the same client request token and the initial call created a cache, the client receives success as long as the parameters are the same.</p>
pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.client_request_token(input.into());
self
}
/// <p>An idempotency token for resource creation, in a string of up to 63 ASCII characters. This token is automatically filled on your behalf when you use the Command Line Interface (CLI) or an Amazon Web Services SDK.</p>
/// <p>By using the idempotent operation, you can retry a <code>CreateFileCache</code> operation without the risk of creating an extra cache. This approach can be useful when an initial call fails in a way that makes it unclear whether a cache was created. Examples are if a transport level timeout occurred, or your connection was reset. If you use the same client request token and the initial call created a cache, the client receives success as long as the parameters are the same.</p>
pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_client_request_token(input);
self
}
/// <p>An idempotency token for resource creation, in a string of up to 63 ASCII characters. This token is automatically filled on your behalf when you use the Command Line Interface (CLI) or an Amazon Web Services SDK.</p>
/// <p>By using the idempotent operation, you can retry a <code>CreateFileCache</code> operation without the risk of creating an extra cache. This approach can be useful when an initial call fails in a way that makes it unclear whether a cache was created. Examples are if a transport level timeout occurred, or your connection was reset. If you use the same client request token and the initial call created a cache, the client receives success as long as the parameters are the same.</p>
pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_client_request_token()
}
/// <p>The type of cache that you're creating, which must be <code>LUSTRE</code>.</p>
pub fn file_cache_type(mut self, input: crate::types::FileCacheType) -> Self {
self.inner = self.inner.file_cache_type(input);
self
}
/// <p>The type of cache that you're creating, which must be <code>LUSTRE</code>.</p>
pub fn set_file_cache_type(mut self, input: ::std::option::Option<crate::types::FileCacheType>) -> Self {
self.inner = self.inner.set_file_cache_type(input);
self
}
/// <p>The type of cache that you're creating, which must be <code>LUSTRE</code>.</p>
pub fn get_file_cache_type(&self) -> &::std::option::Option<crate::types::FileCacheType> {
self.inner.get_file_cache_type()
}
/// <p>Sets the Lustre version for the cache that you're creating, which must be <code>2.12</code>.</p>
pub fn file_cache_type_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.file_cache_type_version(input.into());
self
}
/// <p>Sets the Lustre version for the cache that you're creating, which must be <code>2.12</code>.</p>
pub fn set_file_cache_type_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_file_cache_type_version(input);
self
}
/// <p>Sets the Lustre version for the cache that you're creating, which must be <code>2.12</code>.</p>
pub fn get_file_cache_type_version(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_file_cache_type_version()
}
/// <p>The storage capacity of the cache in gibibytes (GiB). Valid values are 1200 GiB, 2400 GiB, and increments of 2400 GiB.</p>
pub fn storage_capacity(mut self, input: i32) -> Self {
self.inner = self.inner.storage_capacity(input);
self
}
/// <p>The storage capacity of the cache in gibibytes (GiB). Valid values are 1200 GiB, 2400 GiB, and increments of 2400 GiB.</p>
pub fn set_storage_capacity(mut self, input: ::std::option::Option<i32>) -> Self {
self.inner = self.inner.set_storage_capacity(input);
self
}
/// <p>The storage capacity of the cache in gibibytes (GiB). Valid values are 1200 GiB, 2400 GiB, and increments of 2400 GiB.</p>
pub fn get_storage_capacity(&self) -> &::std::option::Option<i32> {
self.inner.get_storage_capacity()
}
///
/// Appends an item to `SubnetIds`.
///
/// To override the contents of this collection use [`set_subnet_ids`](Self::set_subnet_ids).
///
/// <p>A list of subnet IDs that the cache will be accessible from. You can specify only one subnet ID in a call to the <code>CreateFileCache</code> operation.</p>
pub fn subnet_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.subnet_ids(input.into());
self
}
/// <p>A list of subnet IDs that the cache will be accessible from. You can specify only one subnet ID in a call to the <code>CreateFileCache</code> operation.</p>
pub fn set_subnet_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.inner = self.inner.set_subnet_ids(input);
self
}
/// <p>A list of subnet IDs that the cache will be accessible from. You can specify only one subnet ID in a call to the <code>CreateFileCache</code> operation.</p>
pub fn get_subnet_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
self.inner.get_subnet_ids()
}
///
/// Appends an item to `SecurityGroupIds`.
///
/// To override the contents of this collection use [`set_security_group_ids`](Self::set_security_group_ids).
///
/// <p>A list of IDs specifying the security groups to apply to all network interfaces created for Amazon File Cache access. This list isn't returned in later requests to describe the cache.</p>
pub fn security_group_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.security_group_ids(input.into());
self
}
/// <p>A list of IDs specifying the security groups to apply to all network interfaces created for Amazon File Cache access. This list isn't returned in later requests to describe the cache.</p>
pub fn set_security_group_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.inner = self.inner.set_security_group_ids(input);
self
}
/// <p>A list of IDs specifying the security groups to apply to all network interfaces created for Amazon File Cache access. This list isn't returned in later requests to describe the cache.</p>
pub fn get_security_group_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
self.inner.get_security_group_ids()
}
///
/// Appends an item to `Tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>A list of <code>Tag</code> values, with a maximum of 50 elements.</p>
pub fn tags(mut self, input: crate::types::Tag) -> Self {
self.inner = self.inner.tags(input);
self
}
/// <p>A list of <code>Tag</code> values, with a maximum of 50 elements.</p>
pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
self.inner = self.inner.set_tags(input);
self
}
/// <p>A list of <code>Tag</code> values, with a maximum of 50 elements.</p>
pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
self.inner.get_tags()
}
/// <p>A boolean flag indicating whether tags for the cache should be copied to data repository associations. This value defaults to false.</p>
pub fn copy_tags_to_data_repository_associations(mut self, input: bool) -> Self {
self.inner = self.inner.copy_tags_to_data_repository_associations(input);
self
}
/// <p>A boolean flag indicating whether tags for the cache should be copied to data repository associations. This value defaults to false.</p>
pub fn set_copy_tags_to_data_repository_associations(mut self, input: ::std::option::Option<bool>) -> Self {
self.inner = self.inner.set_copy_tags_to_data_repository_associations(input);
self
}
/// <p>A boolean flag indicating whether tags for the cache should be copied to data repository associations. This value defaults to false.</p>
pub fn get_copy_tags_to_data_repository_associations(&self) -> &::std::option::Option<bool> {
self.inner.get_copy_tags_to_data_repository_associations()
}
/// <p>Specifies the ID of the Key Management Service (KMS) key to use for encrypting data on an Amazon File Cache. If a <code>KmsKeyId</code> isn't specified, the Amazon FSx-managed KMS key for your account is used. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/APIReference/API_Encrypt.html">Encrypt</a> in the <i>Key Management Service API Reference</i>.</p>
pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.kms_key_id(input.into());
self
}
/// <p>Specifies the ID of the Key Management Service (KMS) key to use for encrypting data on an Amazon File Cache. If a <code>KmsKeyId</code> isn't specified, the Amazon FSx-managed KMS key for your account is used. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/APIReference/API_Encrypt.html">Encrypt</a> in the <i>Key Management Service API Reference</i>.</p>
pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_kms_key_id(input);
self
}
/// <p>Specifies the ID of the Key Management Service (KMS) key to use for encrypting data on an Amazon File Cache. If a <code>KmsKeyId</code> isn't specified, the Amazon FSx-managed KMS key for your account is used. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/APIReference/API_Encrypt.html">Encrypt</a> in the <i>Key Management Service API Reference</i>.</p>
pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_kms_key_id()
}
/// <p>The configuration for the Amazon File Cache resource being created.</p>
pub fn lustre_configuration(mut self, input: crate::types::CreateFileCacheLustreConfiguration) -> Self {
self.inner = self.inner.lustre_configuration(input);
self
}
/// <p>The configuration for the Amazon File Cache resource being created.</p>
pub fn set_lustre_configuration(mut self, input: ::std::option::Option<crate::types::CreateFileCacheLustreConfiguration>) -> Self {
self.inner = self.inner.set_lustre_configuration(input);
self
}
/// <p>The configuration for the Amazon File Cache resource being created.</p>
pub fn get_lustre_configuration(&self) -> &::std::option::Option<crate::types::CreateFileCacheLustreConfiguration> {
self.inner.get_lustre_configuration()
}
///
/// Appends an item to `DataRepositoryAssociations`.
///
/// To override the contents of this collection use [`set_data_repository_associations`](Self::set_data_repository_associations).
///
/// <p>A list of up to 8 configurations for data repository associations (DRAs) to be created during the cache creation. The DRAs link the cache to either an Amazon S3 data repository or a Network File System (NFS) data repository that supports the NFSv3 protocol.</p>
/// <p>The DRA configurations must meet the following requirements:</p>
/// <ul>
/// <li>
/// <p>All configurations on the list must be of the same data repository type, either all S3 or all NFS. A cache can't link to different data repository types at the same time.</p></li>
/// <li>
/// <p>An NFS DRA must link to an NFS file system that supports the NFSv3 protocol.</p></li>
/// </ul>
/// <p>DRA automatic import and automatic export is not supported.</p>
pub fn data_repository_associations(mut self, input: crate::types::FileCacheDataRepositoryAssociation) -> Self {
self.inner = self.inner.data_repository_associations(input);
self
}
/// <p>A list of up to 8 configurations for data repository associations (DRAs) to be created during the cache creation. The DRAs link the cache to either an Amazon S3 data repository or a Network File System (NFS) data repository that supports the NFSv3 protocol.</p>
/// <p>The DRA configurations must meet the following requirements:</p>
/// <ul>
/// <li>
/// <p>All configurations on the list must be of the same data repository type, either all S3 or all NFS. A cache can't link to different data repository types at the same time.</p></li>
/// <li>
/// <p>An NFS DRA must link to an NFS file system that supports the NFSv3 protocol.</p></li>
/// </ul>
/// <p>DRA automatic import and automatic export is not supported.</p>
pub fn set_data_repository_associations(
mut self,
input: ::std::option::Option<::std::vec::Vec<crate::types::FileCacheDataRepositoryAssociation>>,
) -> Self {
self.inner = self.inner.set_data_repository_associations(input);
self
}
/// <p>A list of up to 8 configurations for data repository associations (DRAs) to be created during the cache creation. The DRAs link the cache to either an Amazon S3 data repository or a Network File System (NFS) data repository that supports the NFSv3 protocol.</p>
/// <p>The DRA configurations must meet the following requirements:</p>
/// <ul>
/// <li>
/// <p>All configurations on the list must be of the same data repository type, either all S3 or all NFS. A cache can't link to different data repository types at the same time.</p></li>
/// <li>
/// <p>An NFS DRA must link to an NFS file system that supports the NFSv3 protocol.</p></li>
/// </ul>
/// <p>DRA automatic import and automatic export is not supported.</p>
pub fn get_data_repository_associations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FileCacheDataRepositoryAssociation>> {
self.inner.get_data_repository_associations()
}
}