aws_sdk_finspace/types/
_volume.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The structure that consists of name and type of volume.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Volume {
7    /// <p>A unique identifier for the volume.</p>
8    pub volume_name: ::std::option::Option<::std::string::String>,
9    /// <p>The type of file system volume. Currently, FinSpace only supports <code>NAS_1</code> volume type.</p>
10    pub volume_type: ::std::option::Option<crate::types::VolumeType>,
11}
12impl Volume {
13    /// <p>A unique identifier for the volume.</p>
14    pub fn volume_name(&self) -> ::std::option::Option<&str> {
15        self.volume_name.as_deref()
16    }
17    /// <p>The type of file system volume. Currently, FinSpace only supports <code>NAS_1</code> volume type.</p>
18    pub fn volume_type(&self) -> ::std::option::Option<&crate::types::VolumeType> {
19        self.volume_type.as_ref()
20    }
21}
22impl Volume {
23    /// Creates a new builder-style object to manufacture [`Volume`](crate::types::Volume).
24    pub fn builder() -> crate::types::builders::VolumeBuilder {
25        crate::types::builders::VolumeBuilder::default()
26    }
27}
28
29/// A builder for [`Volume`](crate::types::Volume).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct VolumeBuilder {
33    pub(crate) volume_name: ::std::option::Option<::std::string::String>,
34    pub(crate) volume_type: ::std::option::Option<crate::types::VolumeType>,
35}
36impl VolumeBuilder {
37    /// <p>A unique identifier for the volume.</p>
38    pub fn volume_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
39        self.volume_name = ::std::option::Option::Some(input.into());
40        self
41    }
42    /// <p>A unique identifier for the volume.</p>
43    pub fn set_volume_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
44        self.volume_name = input;
45        self
46    }
47    /// <p>A unique identifier for the volume.</p>
48    pub fn get_volume_name(&self) -> &::std::option::Option<::std::string::String> {
49        &self.volume_name
50    }
51    /// <p>The type of file system volume. Currently, FinSpace only supports <code>NAS_1</code> volume type.</p>
52    pub fn volume_type(mut self, input: crate::types::VolumeType) -> Self {
53        self.volume_type = ::std::option::Option::Some(input);
54        self
55    }
56    /// <p>The type of file system volume. Currently, FinSpace only supports <code>NAS_1</code> volume type.</p>
57    pub fn set_volume_type(mut self, input: ::std::option::Option<crate::types::VolumeType>) -> Self {
58        self.volume_type = input;
59        self
60    }
61    /// <p>The type of file system volume. Currently, FinSpace only supports <code>NAS_1</code> volume type.</p>
62    pub fn get_volume_type(&self) -> &::std::option::Option<crate::types::VolumeType> {
63        &self.volume_type
64    }
65    /// Consumes the builder and constructs a [`Volume`](crate::types::Volume).
66    pub fn build(self) -> crate::types::Volume {
67        crate::types::Volume {
68            volume_name: self.volume_name,
69            volume_type: self.volume_type,
70        }
71    }
72}