aws_sdk_fsx/operation/delete_volume/
_delete_volume_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct DeleteVolumeInput {
6    /// <p>(Optional) 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>
7    pub client_request_token: ::std::option::Option<::std::string::String>,
8    /// <p>The ID of the volume that you are deleting.</p>
9    pub volume_id: ::std::option::Option<::std::string::String>,
10    /// <p>For Amazon FSx for ONTAP volumes, specify whether to take a final backup of the volume and apply tags to the backup. To apply tags to the backup, you must have the <code>fsx:TagResource</code> permission.</p>
11    pub ontap_configuration: ::std::option::Option<crate::types::DeleteVolumeOntapConfiguration>,
12    /// <p>For Amazon FSx for OpenZFS volumes, specify whether to delete all child volumes and snapshots.</p>
13    pub open_zfs_configuration: ::std::option::Option<crate::types::DeleteVolumeOpenZfsConfiguration>,
14}
15impl DeleteVolumeInput {
16    /// <p>(Optional) 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>
17    pub fn client_request_token(&self) -> ::std::option::Option<&str> {
18        self.client_request_token.as_deref()
19    }
20    /// <p>The ID of the volume that you are deleting.</p>
21    pub fn volume_id(&self) -> ::std::option::Option<&str> {
22        self.volume_id.as_deref()
23    }
24    /// <p>For Amazon FSx for ONTAP volumes, specify whether to take a final backup of the volume and apply tags to the backup. To apply tags to the backup, you must have the <code>fsx:TagResource</code> permission.</p>
25    pub fn ontap_configuration(&self) -> ::std::option::Option<&crate::types::DeleteVolumeOntapConfiguration> {
26        self.ontap_configuration.as_ref()
27    }
28    /// <p>For Amazon FSx for OpenZFS volumes, specify whether to delete all child volumes and snapshots.</p>
29    pub fn open_zfs_configuration(&self) -> ::std::option::Option<&crate::types::DeleteVolumeOpenZfsConfiguration> {
30        self.open_zfs_configuration.as_ref()
31    }
32}
33impl DeleteVolumeInput {
34    /// Creates a new builder-style object to manufacture [`DeleteVolumeInput`](crate::operation::delete_volume::DeleteVolumeInput).
35    pub fn builder() -> crate::operation::delete_volume::builders::DeleteVolumeInputBuilder {
36        crate::operation::delete_volume::builders::DeleteVolumeInputBuilder::default()
37    }
38}
39
40/// A builder for [`DeleteVolumeInput`](crate::operation::delete_volume::DeleteVolumeInput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct DeleteVolumeInputBuilder {
44    pub(crate) client_request_token: ::std::option::Option<::std::string::String>,
45    pub(crate) volume_id: ::std::option::Option<::std::string::String>,
46    pub(crate) ontap_configuration: ::std::option::Option<crate::types::DeleteVolumeOntapConfiguration>,
47    pub(crate) open_zfs_configuration: ::std::option::Option<crate::types::DeleteVolumeOpenZfsConfiguration>,
48}
49impl DeleteVolumeInputBuilder {
50    /// <p>(Optional) 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>
51    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
52        self.client_request_token = ::std::option::Option::Some(input.into());
53        self
54    }
55    /// <p>(Optional) 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>
56    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
57        self.client_request_token = input;
58        self
59    }
60    /// <p>(Optional) 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>
61    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
62        &self.client_request_token
63    }
64    /// <p>The ID of the volume that you are deleting.</p>
65    /// This field is required.
66    pub fn volume_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67        self.volume_id = ::std::option::Option::Some(input.into());
68        self
69    }
70    /// <p>The ID of the volume that you are deleting.</p>
71    pub fn set_volume_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72        self.volume_id = input;
73        self
74    }
75    /// <p>The ID of the volume that you are deleting.</p>
76    pub fn get_volume_id(&self) -> &::std::option::Option<::std::string::String> {
77        &self.volume_id
78    }
79    /// <p>For Amazon FSx for ONTAP volumes, specify whether to take a final backup of the volume and apply tags to the backup. To apply tags to the backup, you must have the <code>fsx:TagResource</code> permission.</p>
80    pub fn ontap_configuration(mut self, input: crate::types::DeleteVolumeOntapConfiguration) -> Self {
81        self.ontap_configuration = ::std::option::Option::Some(input);
82        self
83    }
84    /// <p>For Amazon FSx for ONTAP volumes, specify whether to take a final backup of the volume and apply tags to the backup. To apply tags to the backup, you must have the <code>fsx:TagResource</code> permission.</p>
85    pub fn set_ontap_configuration(mut self, input: ::std::option::Option<crate::types::DeleteVolumeOntapConfiguration>) -> Self {
86        self.ontap_configuration = input;
87        self
88    }
89    /// <p>For Amazon FSx for ONTAP volumes, specify whether to take a final backup of the volume and apply tags to the backup. To apply tags to the backup, you must have the <code>fsx:TagResource</code> permission.</p>
90    pub fn get_ontap_configuration(&self) -> &::std::option::Option<crate::types::DeleteVolumeOntapConfiguration> {
91        &self.ontap_configuration
92    }
93    /// <p>For Amazon FSx for OpenZFS volumes, specify whether to delete all child volumes and snapshots.</p>
94    pub fn open_zfs_configuration(mut self, input: crate::types::DeleteVolumeOpenZfsConfiguration) -> Self {
95        self.open_zfs_configuration = ::std::option::Option::Some(input);
96        self
97    }
98    /// <p>For Amazon FSx for OpenZFS volumes, specify whether to delete all child volumes and snapshots.</p>
99    pub fn set_open_zfs_configuration(mut self, input: ::std::option::Option<crate::types::DeleteVolumeOpenZfsConfiguration>) -> Self {
100        self.open_zfs_configuration = input;
101        self
102    }
103    /// <p>For Amazon FSx for OpenZFS volumes, specify whether to delete all child volumes and snapshots.</p>
104    pub fn get_open_zfs_configuration(&self) -> &::std::option::Option<crate::types::DeleteVolumeOpenZfsConfiguration> {
105        &self.open_zfs_configuration
106    }
107    /// Consumes the builder and constructs a [`DeleteVolumeInput`](crate::operation::delete_volume::DeleteVolumeInput).
108    pub fn build(
109        self,
110    ) -> ::std::result::Result<crate::operation::delete_volume::DeleteVolumeInput, ::aws_smithy_types::error::operation::BuildError> {
111        ::std::result::Result::Ok(crate::operation::delete_volume::DeleteVolumeInput {
112            client_request_token: self.client_request_token,
113            volume_id: self.volume_id,
114            ontap_configuration: self.ontap_configuration,
115            open_zfs_configuration: self.open_zfs_configuration,
116        })
117    }
118}