aws_sdk_fsx/operation/describe_volumes/
_describe_volumes_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 DescribeVolumesInput {
6    /// <p>The IDs of the volumes whose descriptions you want to retrieve.</p>
7    pub volume_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
8    /// <p>Enter a filter <code>Name</code> and <code>Values</code> pair to view a select set of volumes.</p>
9    pub filters: ::std::option::Option<::std::vec::Vec<crate::types::VolumeFilter>>,
10    /// <p>The maximum number of resources to return in the response. This value must be an integer greater than zero.</p>
11    pub max_results: ::std::option::Option<i32>,
12    /// <p>(Optional) Opaque pagination token returned from a previous operation (String). If present, this token indicates from what point you can continue processing the request, where the previous <code>NextToken</code> value left off.</p>
13    pub next_token: ::std::option::Option<::std::string::String>,
14}
15impl DescribeVolumesInput {
16    /// <p>The IDs of the volumes whose descriptions you want to retrieve.</p>
17    ///
18    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.volume_ids.is_none()`.
19    pub fn volume_ids(&self) -> &[::std::string::String] {
20        self.volume_ids.as_deref().unwrap_or_default()
21    }
22    /// <p>Enter a filter <code>Name</code> and <code>Values</code> pair to view a select set of volumes.</p>
23    ///
24    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.filters.is_none()`.
25    pub fn filters(&self) -> &[crate::types::VolumeFilter] {
26        self.filters.as_deref().unwrap_or_default()
27    }
28    /// <p>The maximum number of resources to return in the response. This value must be an integer greater than zero.</p>
29    pub fn max_results(&self) -> ::std::option::Option<i32> {
30        self.max_results
31    }
32    /// <p>(Optional) Opaque pagination token returned from a previous operation (String). If present, this token indicates from what point you can continue processing the request, where the previous <code>NextToken</code> value left off.</p>
33    pub fn next_token(&self) -> ::std::option::Option<&str> {
34        self.next_token.as_deref()
35    }
36}
37impl DescribeVolumesInput {
38    /// Creates a new builder-style object to manufacture [`DescribeVolumesInput`](crate::operation::describe_volumes::DescribeVolumesInput).
39    pub fn builder() -> crate::operation::describe_volumes::builders::DescribeVolumesInputBuilder {
40        crate::operation::describe_volumes::builders::DescribeVolumesInputBuilder::default()
41    }
42}
43
44/// A builder for [`DescribeVolumesInput`](crate::operation::describe_volumes::DescribeVolumesInput).
45#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
46#[non_exhaustive]
47pub struct DescribeVolumesInputBuilder {
48    pub(crate) volume_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
49    pub(crate) filters: ::std::option::Option<::std::vec::Vec<crate::types::VolumeFilter>>,
50    pub(crate) max_results: ::std::option::Option<i32>,
51    pub(crate) next_token: ::std::option::Option<::std::string::String>,
52}
53impl DescribeVolumesInputBuilder {
54    /// Appends an item to `volume_ids`.
55    ///
56    /// To override the contents of this collection use [`set_volume_ids`](Self::set_volume_ids).
57    ///
58    /// <p>The IDs of the volumes whose descriptions you want to retrieve.</p>
59    pub fn volume_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
60        let mut v = self.volume_ids.unwrap_or_default();
61        v.push(input.into());
62        self.volume_ids = ::std::option::Option::Some(v);
63        self
64    }
65    /// <p>The IDs of the volumes whose descriptions you want to retrieve.</p>
66    pub fn set_volume_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
67        self.volume_ids = input;
68        self
69    }
70    /// <p>The IDs of the volumes whose descriptions you want to retrieve.</p>
71    pub fn get_volume_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
72        &self.volume_ids
73    }
74    /// Appends an item to `filters`.
75    ///
76    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
77    ///
78    /// <p>Enter a filter <code>Name</code> and <code>Values</code> pair to view a select set of volumes.</p>
79    pub fn filters(mut self, input: crate::types::VolumeFilter) -> Self {
80        let mut v = self.filters.unwrap_or_default();
81        v.push(input);
82        self.filters = ::std::option::Option::Some(v);
83        self
84    }
85    /// <p>Enter a filter <code>Name</code> and <code>Values</code> pair to view a select set of volumes.</p>
86    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::VolumeFilter>>) -> Self {
87        self.filters = input;
88        self
89    }
90    /// <p>Enter a filter <code>Name</code> and <code>Values</code> pair to view a select set of volumes.</p>
91    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::VolumeFilter>> {
92        &self.filters
93    }
94    /// <p>The maximum number of resources to return in the response. This value must be an integer greater than zero.</p>
95    pub fn max_results(mut self, input: i32) -> Self {
96        self.max_results = ::std::option::Option::Some(input);
97        self
98    }
99    /// <p>The maximum number of resources to return in the response. This value must be an integer greater than zero.</p>
100    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
101        self.max_results = input;
102        self
103    }
104    /// <p>The maximum number of resources to return in the response. This value must be an integer greater than zero.</p>
105    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
106        &self.max_results
107    }
108    /// <p>(Optional) Opaque pagination token returned from a previous operation (String). If present, this token indicates from what point you can continue processing the request, where the previous <code>NextToken</code> value left off.</p>
109    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
110        self.next_token = ::std::option::Option::Some(input.into());
111        self
112    }
113    /// <p>(Optional) Opaque pagination token returned from a previous operation (String). If present, this token indicates from what point you can continue processing the request, where the previous <code>NextToken</code> value left off.</p>
114    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
115        self.next_token = input;
116        self
117    }
118    /// <p>(Optional) Opaque pagination token returned from a previous operation (String). If present, this token indicates from what point you can continue processing the request, where the previous <code>NextToken</code> value left off.</p>
119    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
120        &self.next_token
121    }
122    /// Consumes the builder and constructs a [`DescribeVolumesInput`](crate::operation::describe_volumes::DescribeVolumesInput).
123    pub fn build(
124        self,
125    ) -> ::std::result::Result<crate::operation::describe_volumes::DescribeVolumesInput, ::aws_smithy_types::error::operation::BuildError> {
126        ::std::result::Result::Ok(crate::operation::describe_volumes::DescribeVolumesInput {
127            volume_ids: self.volume_ids,
128            filters: self.filters,
129            max_results: self.max_results,
130            next_token: self.next_token,
131        })
132    }
133}