aws_sdk_fsx/operation/create_volume/
_create_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 CreateVolumeInput {
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>Specifies the type of volume to create; <code>ONTAP</code> and <code>OPENZFS</code> are the only valid volume types.</p>
9    pub volume_type: ::std::option::Option<crate::types::VolumeType>,
10    /// <p>Specifies the name of the volume that you're creating.</p>
11    pub name: ::std::option::Option<::std::string::String>,
12    /// <p>Specifies the configuration to use when creating the ONTAP volume.</p>
13    pub ontap_configuration: ::std::option::Option<crate::types::CreateOntapVolumeConfiguration>,
14    /// <p>A list of <code>Tag</code> values, with a maximum of 50 elements.</p>
15    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
16    /// <p>Specifies the configuration to use when creating the OpenZFS volume.</p>
17    pub open_zfs_configuration: ::std::option::Option<crate::types::CreateOpenZfsVolumeConfiguration>,
18}
19impl CreateVolumeInput {
20    /// <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>
21    pub fn client_request_token(&self) -> ::std::option::Option<&str> {
22        self.client_request_token.as_deref()
23    }
24    /// <p>Specifies the type of volume to create; <code>ONTAP</code> and <code>OPENZFS</code> are the only valid volume types.</p>
25    pub fn volume_type(&self) -> ::std::option::Option<&crate::types::VolumeType> {
26        self.volume_type.as_ref()
27    }
28    /// <p>Specifies the name of the volume that you're creating.</p>
29    pub fn name(&self) -> ::std::option::Option<&str> {
30        self.name.as_deref()
31    }
32    /// <p>Specifies the configuration to use when creating the ONTAP volume.</p>
33    pub fn ontap_configuration(&self) -> ::std::option::Option<&crate::types::CreateOntapVolumeConfiguration> {
34        self.ontap_configuration.as_ref()
35    }
36    /// <p>A list of <code>Tag</code> values, with a maximum of 50 elements.</p>
37    ///
38    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
39    pub fn tags(&self) -> &[crate::types::Tag] {
40        self.tags.as_deref().unwrap_or_default()
41    }
42    /// <p>Specifies the configuration to use when creating the OpenZFS volume.</p>
43    pub fn open_zfs_configuration(&self) -> ::std::option::Option<&crate::types::CreateOpenZfsVolumeConfiguration> {
44        self.open_zfs_configuration.as_ref()
45    }
46}
47impl CreateVolumeInput {
48    /// Creates a new builder-style object to manufacture [`CreateVolumeInput`](crate::operation::create_volume::CreateVolumeInput).
49    pub fn builder() -> crate::operation::create_volume::builders::CreateVolumeInputBuilder {
50        crate::operation::create_volume::builders::CreateVolumeInputBuilder::default()
51    }
52}
53
54/// A builder for [`CreateVolumeInput`](crate::operation::create_volume::CreateVolumeInput).
55#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
56#[non_exhaustive]
57pub struct CreateVolumeInputBuilder {
58    pub(crate) client_request_token: ::std::option::Option<::std::string::String>,
59    pub(crate) volume_type: ::std::option::Option<crate::types::VolumeType>,
60    pub(crate) name: ::std::option::Option<::std::string::String>,
61    pub(crate) ontap_configuration: ::std::option::Option<crate::types::CreateOntapVolumeConfiguration>,
62    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
63    pub(crate) open_zfs_configuration: ::std::option::Option<crate::types::CreateOpenZfsVolumeConfiguration>,
64}
65impl CreateVolumeInputBuilder {
66    /// <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>
67    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
68        self.client_request_token = ::std::option::Option::Some(input.into());
69        self
70    }
71    /// <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>
72    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
73        self.client_request_token = input;
74        self
75    }
76    /// <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>
77    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
78        &self.client_request_token
79    }
80    /// <p>Specifies the type of volume to create; <code>ONTAP</code> and <code>OPENZFS</code> are the only valid volume types.</p>
81    /// This field is required.
82    pub fn volume_type(mut self, input: crate::types::VolumeType) -> Self {
83        self.volume_type = ::std::option::Option::Some(input);
84        self
85    }
86    /// <p>Specifies the type of volume to create; <code>ONTAP</code> and <code>OPENZFS</code> are the only valid volume types.</p>
87    pub fn set_volume_type(mut self, input: ::std::option::Option<crate::types::VolumeType>) -> Self {
88        self.volume_type = input;
89        self
90    }
91    /// <p>Specifies the type of volume to create; <code>ONTAP</code> and <code>OPENZFS</code> are the only valid volume types.</p>
92    pub fn get_volume_type(&self) -> &::std::option::Option<crate::types::VolumeType> {
93        &self.volume_type
94    }
95    /// <p>Specifies the name of the volume that you're creating.</p>
96    /// This field is required.
97    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
98        self.name = ::std::option::Option::Some(input.into());
99        self
100    }
101    /// <p>Specifies the name of the volume that you're creating.</p>
102    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
103        self.name = input;
104        self
105    }
106    /// <p>Specifies the name of the volume that you're creating.</p>
107    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
108        &self.name
109    }
110    /// <p>Specifies the configuration to use when creating the ONTAP volume.</p>
111    pub fn ontap_configuration(mut self, input: crate::types::CreateOntapVolumeConfiguration) -> Self {
112        self.ontap_configuration = ::std::option::Option::Some(input);
113        self
114    }
115    /// <p>Specifies the configuration to use when creating the ONTAP volume.</p>
116    pub fn set_ontap_configuration(mut self, input: ::std::option::Option<crate::types::CreateOntapVolumeConfiguration>) -> Self {
117        self.ontap_configuration = input;
118        self
119    }
120    /// <p>Specifies the configuration to use when creating the ONTAP volume.</p>
121    pub fn get_ontap_configuration(&self) -> &::std::option::Option<crate::types::CreateOntapVolumeConfiguration> {
122        &self.ontap_configuration
123    }
124    /// Appends an item to `tags`.
125    ///
126    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
127    ///
128    /// <p>A list of <code>Tag</code> values, with a maximum of 50 elements.</p>
129    pub fn tags(mut self, input: crate::types::Tag) -> Self {
130        let mut v = self.tags.unwrap_or_default();
131        v.push(input);
132        self.tags = ::std::option::Option::Some(v);
133        self
134    }
135    /// <p>A list of <code>Tag</code> values, with a maximum of 50 elements.</p>
136    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
137        self.tags = input;
138        self
139    }
140    /// <p>A list of <code>Tag</code> values, with a maximum of 50 elements.</p>
141    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
142        &self.tags
143    }
144    /// <p>Specifies the configuration to use when creating the OpenZFS volume.</p>
145    pub fn open_zfs_configuration(mut self, input: crate::types::CreateOpenZfsVolumeConfiguration) -> Self {
146        self.open_zfs_configuration = ::std::option::Option::Some(input);
147        self
148    }
149    /// <p>Specifies the configuration to use when creating the OpenZFS volume.</p>
150    pub fn set_open_zfs_configuration(mut self, input: ::std::option::Option<crate::types::CreateOpenZfsVolumeConfiguration>) -> Self {
151        self.open_zfs_configuration = input;
152        self
153    }
154    /// <p>Specifies the configuration to use when creating the OpenZFS volume.</p>
155    pub fn get_open_zfs_configuration(&self) -> &::std::option::Option<crate::types::CreateOpenZfsVolumeConfiguration> {
156        &self.open_zfs_configuration
157    }
158    /// Consumes the builder and constructs a [`CreateVolumeInput`](crate::operation::create_volume::CreateVolumeInput).
159    pub fn build(
160        self,
161    ) -> ::std::result::Result<crate::operation::create_volume::CreateVolumeInput, ::aws_smithy_types::error::operation::BuildError> {
162        ::std::result::Result::Ok(crate::operation::create_volume::CreateVolumeInput {
163            client_request_token: self.client_request_token,
164            volume_type: self.volume_type,
165            name: self.name,
166            ontap_configuration: self.ontap_configuration,
167            tags: self.tags,
168            open_zfs_configuration: self.open_zfs_configuration,
169        })
170    }
171}