aws-sdk-storagegateway 1.115.0

AWS SDK for AWS Storage Gateway
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>AttachVolumeInput</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct DetachVolumeInput {
    /// <p>The Amazon Resource Name (ARN) of the volume to detach from the gateway.</p>
    pub volume_arn: ::std::option::Option<::std::string::String>,
    /// <p>Set to <code>true</code> to forcibly remove the iSCSI connection of the target volume and detach the volume. The default is <code>false</code>. If this value is set to <code>false</code>, you must manually disconnect the iSCSI connection from the target volume.</p>
    /// <p>Valid Values: <code>true</code> | <code>false</code></p>
    pub force_detach: ::std::option::Option<bool>,
}
impl DetachVolumeInput {
    /// <p>The Amazon Resource Name (ARN) of the volume to detach from the gateway.</p>
    pub fn volume_arn(&self) -> ::std::option::Option<&str> {
        self.volume_arn.as_deref()
    }
    /// <p>Set to <code>true</code> to forcibly remove the iSCSI connection of the target volume and detach the volume. The default is <code>false</code>. If this value is set to <code>false</code>, you must manually disconnect the iSCSI connection from the target volume.</p>
    /// <p>Valid Values: <code>true</code> | <code>false</code></p>
    pub fn force_detach(&self) -> ::std::option::Option<bool> {
        self.force_detach
    }
}
impl DetachVolumeInput {
    /// Creates a new builder-style object to manufacture [`DetachVolumeInput`](crate::operation::detach_volume::DetachVolumeInput).
    pub fn builder() -> crate::operation::detach_volume::builders::DetachVolumeInputBuilder {
        crate::operation::detach_volume::builders::DetachVolumeInputBuilder::default()
    }
}

/// A builder for [`DetachVolumeInput`](crate::operation::detach_volume::DetachVolumeInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct DetachVolumeInputBuilder {
    pub(crate) volume_arn: ::std::option::Option<::std::string::String>,
    pub(crate) force_detach: ::std::option::Option<bool>,
}
impl DetachVolumeInputBuilder {
    /// <p>The Amazon Resource Name (ARN) of the volume to detach from the gateway.</p>
    /// This field is required.
    pub fn volume_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.volume_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the volume to detach from the gateway.</p>
    pub fn set_volume_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.volume_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the volume to detach from the gateway.</p>
    pub fn get_volume_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.volume_arn
    }
    /// <p>Set to <code>true</code> to forcibly remove the iSCSI connection of the target volume and detach the volume. The default is <code>false</code>. If this value is set to <code>false</code>, you must manually disconnect the iSCSI connection from the target volume.</p>
    /// <p>Valid Values: <code>true</code> | <code>false</code></p>
    pub fn force_detach(mut self, input: bool) -> Self {
        self.force_detach = ::std::option::Option::Some(input);
        self
    }
    /// <p>Set to <code>true</code> to forcibly remove the iSCSI connection of the target volume and detach the volume. The default is <code>false</code>. If this value is set to <code>false</code>, you must manually disconnect the iSCSI connection from the target volume.</p>
    /// <p>Valid Values: <code>true</code> | <code>false</code></p>
    pub fn set_force_detach(mut self, input: ::std::option::Option<bool>) -> Self {
        self.force_detach = input;
        self
    }
    /// <p>Set to <code>true</code> to forcibly remove the iSCSI connection of the target volume and detach the volume. The default is <code>false</code>. If this value is set to <code>false</code>, you must manually disconnect the iSCSI connection from the target volume.</p>
    /// <p>Valid Values: <code>true</code> | <code>false</code></p>
    pub fn get_force_detach(&self) -> &::std::option::Option<bool> {
        &self.force_detach
    }
    /// Consumes the builder and constructs a [`DetachVolumeInput`](crate::operation::detach_volume::DetachVolumeInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::detach_volume::DetachVolumeInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::detach_volume::DetachVolumeInput {
            volume_arn: self.volume_arn,
            force_detach: self.force_detach,
        })
    }
}