// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::modify_volume::_modify_volume_input::ModifyVolumeInputBuilder;
pub use crate::operation::modify_volume::_modify_volume_output::ModifyVolumeOutputBuilder;
impl crate::operation::modify_volume::builders::ModifyVolumeInputBuilder {
/// Sends a request with this input using the given client.
pub async fn send_with(
self,
client: &crate::Client,
) -> ::std::result::Result<
crate::operation::modify_volume::ModifyVolumeOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::modify_volume::ModifyVolumeError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.modify_volume();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `ModifyVolume`.
///
/// <p>Modifies the size, volume type, IOPS (input/output operations per second), or throughput of a volume. When you modify a volume, you must specify at least one of these parameters. You can modify a volume only after any previous modification for that volume has finished.</p>
/// <p>To track the progress of a modification, use the Amazon EC2 <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVolumesModifications.html">DescribeVolumesModifications</a> operation. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/monitoring-volume-modifications.html">Monitor the progress of Amazon EBS volume modifications</a> in the <i>Amazon EBS User Guide</i>.</p>
/// <p>After you increase the size of a volume, you must extend the partition and file system to use the new storage capacity. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/recognize-expanded-volume-linux.html">Extend the file system after resizing an Amazon EBS volume</a> in the <i>Amazon EBS User Guide</i>, which covers both <a href="https://docs.aws.amazon.com/ebs/latest/userguide/recognize-expanded-volume-linux.html#extend-linux">Linux</a> and <a href="https://docs.aws.amazon.com/ebs/latest/userguide/recognize-expanded-volume-linux.html#extend-windows">Windows</a> instances.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct ModifyVolumeFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::modify_volume::builders::ModifyVolumeInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::modify_volume::ModifyVolumeOutput,
crate::operation::modify_volume::ModifyVolumeError,
> for ModifyVolumeFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::modify_volume::ModifyVolumeOutput,
crate::operation::modify_volume::ModifyVolumeError,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl ModifyVolumeFluentBuilder {
/// Creates a new `ModifyVolumeFluentBuilder`.
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 ModifyVolume as a reference.
pub fn as_input(&self) -> &crate::operation::modify_volume::builders::ModifyVolumeInputBuilder {
&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::modify_volume::ModifyVolumeOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::modify_volume::ModifyVolumeError,
::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::modify_volume::ModifyVolume::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::modify_volume::ModifyVolume::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::modify_volume::ModifyVolumeOutput,
crate::operation::modify_volume::ModifyVolumeError,
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>Specifies the identifier of the volume to modify.</p>
pub fn volume_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.volume_id(input.into());
self
}
/// <p>Specifies the identifier of the volume to modify.</p>
pub fn set_volume_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_volume_id(input);
self
}
/// <p>Specifies the identifier of the volume to modify.</p>
pub fn get_volume_id(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_volume_id()
}
/// <p>Specifies the target size of the volume, in GiB. The target size must be greater than or equal to the current size of the volume. If you don't specify a size, the current size is retained.</p>
pub fn size_in_gb(mut self, input: i32) -> Self {
self.inner = self.inner.size_in_gb(input);
self
}
/// <p>Specifies the target size of the volume, in GiB. The target size must be greater than or equal to the current size of the volume. If you don't specify a size, the current size is retained.</p>
pub fn set_size_in_gb(mut self, input: ::std::option::Option<i32>) -> Self {
self.inner = self.inner.set_size_in_gb(input);
self
}
/// <p>Specifies the target size of the volume, in GiB. The target size must be greater than or equal to the current size of the volume. If you don't specify a size, the current size is retained.</p>
pub fn get_size_in_gb(&self) -> &::std::option::Option<i32> {
self.inner.get_size_in_gb()
}
/// <p>Specifies the target Amazon Elastic Block Store (Amazon EBS) volume type. If you don't specify a volume type, the current volume type is retained.</p>
pub fn volume_type(mut self, input: crate::types::VolumeTypeEnum) -> Self {
self.inner = self.inner.volume_type(input);
self
}
/// <p>Specifies the target Amazon Elastic Block Store (Amazon EBS) volume type. If you don't specify a volume type, the current volume type is retained.</p>
pub fn set_volume_type(mut self, input: ::std::option::Option<crate::types::VolumeTypeEnum>) -> Self {
self.inner = self.inner.set_volume_type(input);
self
}
/// <p>Specifies the target Amazon Elastic Block Store (Amazon EBS) volume type. If you don't specify a volume type, the current volume type is retained.</p>
pub fn get_volume_type(&self) -> &::std::option::Option<crate::types::VolumeTypeEnum> {
self.inner.get_volume_type()
}
/// <p>Specifies the target IOPS rate of the volume. This parameter is valid only for <code>gp3</code>, <code>io1</code>, and <code>io2</code> volumes. If you don't specify IOPS and keep the same volume type, the current IOPS rate is retained.</p>
pub fn iops(mut self, input: i32) -> Self {
self.inner = self.inner.iops(input);
self
}
/// <p>Specifies the target IOPS rate of the volume. This parameter is valid only for <code>gp3</code>, <code>io1</code>, and <code>io2</code> volumes. If you don't specify IOPS and keep the same volume type, the current IOPS rate is retained.</p>
pub fn set_iops(mut self, input: ::std::option::Option<i32>) -> Self {
self.inner = self.inner.set_iops(input);
self
}
/// <p>Specifies the target IOPS rate of the volume. This parameter is valid only for <code>gp3</code>, <code>io1</code>, and <code>io2</code> volumes. If you don't specify IOPS and keep the same volume type, the current IOPS rate is retained.</p>
pub fn get_iops(&self) -> &::std::option::Option<i32> {
self.inner.get_iops()
}
/// <p>Specifies the target throughput of the volume, in MiB/s. This parameter is valid only for <code>gp3</code> volumes. If you don't specify throughput and the volume remains <code>gp3</code>, the current throughput is retained.</p>
pub fn throughput(mut self, input: i32) -> Self {
self.inner = self.inner.throughput(input);
self
}
/// <p>Specifies the target throughput of the volume, in MiB/s. This parameter is valid only for <code>gp3</code> volumes. If you don't specify throughput and the volume remains <code>gp3</code>, the current throughput is retained.</p>
pub fn set_throughput(mut self, input: ::std::option::Option<i32>) -> Self {
self.inner = self.inner.set_throughput(input);
self
}
/// <p>Specifies the target throughput of the volume, in MiB/s. This parameter is valid only for <code>gp3</code> volumes. If you don't specify throughput and the volume remains <code>gp3</code>, the current throughput is retained.</p>
pub fn get_throughput(&self) -> &::std::option::Option<i32> {
self.inner.get_throughput()
}
/// <p>Unique token to ensure idempotent volume modification, preventing duplicate volume modifications.</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>Unique token to ensure idempotent volume modification, preventing duplicate volume modifications.</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>Unique token to ensure idempotent volume modification, preventing duplicate volume modifications.</p>
pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_client_token()
}
}