aws-sdk-workspacesinstances 1.46.0

AWS SDK for Amazon Workspaces Instances
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Contains the parameters for modifying a volume, including the target size, volume type, IOPS, or throughput.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct ModifyVolumeInput {
    /// <p>Specifies the identifier of the volume to modify.</p>
    pub volume_id: ::std::option::Option<::std::string::String>,
    /// <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 size_in_gb: ::std::option::Option<i32>,
    /// <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 volume_type: ::std::option::Option<crate::types::VolumeTypeEnum>,
    /// <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 iops: ::std::option::Option<i32>,
    /// <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 throughput: ::std::option::Option<i32>,
    /// <p>Unique token to ensure idempotent volume modification, preventing duplicate volume modifications.</p>
    pub client_token: ::std::option::Option<::std::string::String>,
}
impl ModifyVolumeInput {
    /// <p>Specifies the identifier of the volume to modify.</p>
    pub fn volume_id(&self) -> ::std::option::Option<&str> {
        self.volume_id.as_deref()
    }
    /// <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(&self) -> ::std::option::Option<i32> {
        self.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(&self) -> ::std::option::Option<&crate::types::VolumeTypeEnum> {
        self.volume_type.as_ref()
    }
    /// <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(&self) -> ::std::option::Option<i32> {
        self.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(&self) -> ::std::option::Option<i32> {
        self.throughput
    }
    /// <p>Unique token to ensure idempotent volume modification, preventing duplicate volume modifications.</p>
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
}
impl ::std::fmt::Debug for ModifyVolumeInput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("ModifyVolumeInput");
        formatter.field("volume_id", &self.volume_id);
        formatter.field("size_in_gb", &self.size_in_gb);
        formatter.field("volume_type", &self.volume_type);
        formatter.field("iops", &self.iops);
        formatter.field("throughput", &self.throughput);
        formatter.field("client_token", &"*** Sensitive Data Redacted ***");
        formatter.finish()
    }
}
impl ModifyVolumeInput {
    /// Creates a new builder-style object to manufacture [`ModifyVolumeInput`](crate::operation::modify_volume::ModifyVolumeInput).
    pub fn builder() -> crate::operation::modify_volume::builders::ModifyVolumeInputBuilder {
        crate::operation::modify_volume::builders::ModifyVolumeInputBuilder::default()
    }
}

/// A builder for [`ModifyVolumeInput`](crate::operation::modify_volume::ModifyVolumeInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct ModifyVolumeInputBuilder {
    pub(crate) volume_id: ::std::option::Option<::std::string::String>,
    pub(crate) size_in_gb: ::std::option::Option<i32>,
    pub(crate) volume_type: ::std::option::Option<crate::types::VolumeTypeEnum>,
    pub(crate) iops: ::std::option::Option<i32>,
    pub(crate) throughput: ::std::option::Option<i32>,
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
}
impl ModifyVolumeInputBuilder {
    /// <p>Specifies the identifier of the volume to modify.</p>
    /// This field is required.
    pub fn volume_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.volume_id = ::std::option::Option::Some(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.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.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.size_in_gb = ::std::option::Option::Some(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.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.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.volume_type = ::std::option::Option::Some(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.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.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.iops = ::std::option::Option::Some(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.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.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.throughput = ::std::option::Option::Some(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.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.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.client_token = ::std::option::Option::Some(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.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.client_token
    }
    /// Consumes the builder and constructs a [`ModifyVolumeInput`](crate::operation::modify_volume::ModifyVolumeInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::modify_volume::ModifyVolumeInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::modify_volume::ModifyVolumeInput {
            volume_id: self.volume_id,
            size_in_gb: self.size_in_gb,
            volume_type: self.volume_type,
            iops: self.iops,
            throughput: self.throughput,
            client_token: self.client_token,
        })
    }
}
impl ::std::fmt::Debug for ModifyVolumeInputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("ModifyVolumeInputBuilder");
        formatter.field("volume_id", &self.volume_id);
        formatter.field("size_in_gb", &self.size_in_gb);
        formatter.field("volume_type", &self.volume_type);
        formatter.field("iops", &self.iops);
        formatter.field("throughput", &self.throughput);
        formatter.field("client_token", &"*** Sensitive Data Redacted ***");
        formatter.finish()
    }
}