aws_sdk_fsx/operation/describe_backups/_describe_backups_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The request object for the <code>DescribeBackups</code> operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct DescribeBackupsInput {
7 /// <p>The IDs of the backups that you want to retrieve. This parameter value overrides any filters. If any IDs aren't found, a <code>BackupNotFound</code> error occurs.</p>
8 pub backup_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
9 /// <p>The filters structure. The supported names are <code>file-system-id</code>, <code>backup-type</code>, <code>file-system-type</code>, and <code>volume-id</code>.</p>
10 pub filters: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>,
11 /// <p>Maximum number of backups to return in the response. This parameter value must be greater than 0. The number of items that Amazon FSx returns is the minimum of the <code>MaxResults</code> parameter specified in the request and the service's internal maximum number of items per page.</p>
12 pub max_results: ::std::option::Option<i32>,
13 /// <p>An opaque pagination token returned from a previous <code>DescribeBackups</code> operation. If a token is present, the operation continues the list from where the returning call left off.</p>
14 pub next_token: ::std::option::Option<::std::string::String>,
15}
16impl DescribeBackupsInput {
17 /// <p>The IDs of the backups that you want to retrieve. This parameter value overrides any filters. If any IDs aren't found, a <code>BackupNotFound</code> error occurs.</p>
18 ///
19 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.backup_ids.is_none()`.
20 pub fn backup_ids(&self) -> &[::std::string::String] {
21 self.backup_ids.as_deref().unwrap_or_default()
22 }
23 /// <p>The filters structure. The supported names are <code>file-system-id</code>, <code>backup-type</code>, <code>file-system-type</code>, and <code>volume-id</code>.</p>
24 ///
25 /// 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()`.
26 pub fn filters(&self) -> &[crate::types::Filter] {
27 self.filters.as_deref().unwrap_or_default()
28 }
29 /// <p>Maximum number of backups to return in the response. This parameter value must be greater than 0. The number of items that Amazon FSx returns is the minimum of the <code>MaxResults</code> parameter specified in the request and the service's internal maximum number of items per page.</p>
30 pub fn max_results(&self) -> ::std::option::Option<i32> {
31 self.max_results
32 }
33 /// <p>An opaque pagination token returned from a previous <code>DescribeBackups</code> operation. If a token is present, the operation continues the list from where the returning call left off.</p>
34 pub fn next_token(&self) -> ::std::option::Option<&str> {
35 self.next_token.as_deref()
36 }
37}
38impl DescribeBackupsInput {
39 /// Creates a new builder-style object to manufacture [`DescribeBackupsInput`](crate::operation::describe_backups::DescribeBackupsInput).
40 pub fn builder() -> crate::operation::describe_backups::builders::DescribeBackupsInputBuilder {
41 crate::operation::describe_backups::builders::DescribeBackupsInputBuilder::default()
42 }
43}
44
45/// A builder for [`DescribeBackupsInput`](crate::operation::describe_backups::DescribeBackupsInput).
46#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
47#[non_exhaustive]
48pub struct DescribeBackupsInputBuilder {
49 pub(crate) backup_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
50 pub(crate) filters: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>,
51 pub(crate) max_results: ::std::option::Option<i32>,
52 pub(crate) next_token: ::std::option::Option<::std::string::String>,
53}
54impl DescribeBackupsInputBuilder {
55 /// Appends an item to `backup_ids`.
56 ///
57 /// To override the contents of this collection use [`set_backup_ids`](Self::set_backup_ids).
58 ///
59 /// <p>The IDs of the backups that you want to retrieve. This parameter value overrides any filters. If any IDs aren't found, a <code>BackupNotFound</code> error occurs.</p>
60 pub fn backup_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61 let mut v = self.backup_ids.unwrap_or_default();
62 v.push(input.into());
63 self.backup_ids = ::std::option::Option::Some(v);
64 self
65 }
66 /// <p>The IDs of the backups that you want to retrieve. This parameter value overrides any filters. If any IDs aren't found, a <code>BackupNotFound</code> error occurs.</p>
67 pub fn set_backup_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
68 self.backup_ids = input;
69 self
70 }
71 /// <p>The IDs of the backups that you want to retrieve. This parameter value overrides any filters. If any IDs aren't found, a <code>BackupNotFound</code> error occurs.</p>
72 pub fn get_backup_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
73 &self.backup_ids
74 }
75 /// Appends an item to `filters`.
76 ///
77 /// To override the contents of this collection use [`set_filters`](Self::set_filters).
78 ///
79 /// <p>The filters structure. The supported names are <code>file-system-id</code>, <code>backup-type</code>, <code>file-system-type</code>, and <code>volume-id</code>.</p>
80 pub fn filters(mut self, input: crate::types::Filter) -> Self {
81 let mut v = self.filters.unwrap_or_default();
82 v.push(input);
83 self.filters = ::std::option::Option::Some(v);
84 self
85 }
86 /// <p>The filters structure. The supported names are <code>file-system-id</code>, <code>backup-type</code>, <code>file-system-type</code>, and <code>volume-id</code>.</p>
87 pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
88 self.filters = input;
89 self
90 }
91 /// <p>The filters structure. The supported names are <code>file-system-id</code>, <code>backup-type</code>, <code>file-system-type</code>, and <code>volume-id</code>.</p>
92 pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
93 &self.filters
94 }
95 /// <p>Maximum number of backups to return in the response. This parameter value must be greater than 0. The number of items that Amazon FSx returns is the minimum of the <code>MaxResults</code> parameter specified in the request and the service's internal maximum number of items per page.</p>
96 pub fn max_results(mut self, input: i32) -> Self {
97 self.max_results = ::std::option::Option::Some(input);
98 self
99 }
100 /// <p>Maximum number of backups to return in the response. This parameter value must be greater than 0. The number of items that Amazon FSx returns is the minimum of the <code>MaxResults</code> parameter specified in the request and the service's internal maximum number of items per page.</p>
101 pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
102 self.max_results = input;
103 self
104 }
105 /// <p>Maximum number of backups to return in the response. This parameter value must be greater than 0. The number of items that Amazon FSx returns is the minimum of the <code>MaxResults</code> parameter specified in the request and the service's internal maximum number of items per page.</p>
106 pub fn get_max_results(&self) -> &::std::option::Option<i32> {
107 &self.max_results
108 }
109 /// <p>An opaque pagination token returned from a previous <code>DescribeBackups</code> operation. If a token is present, the operation continues the list from where the returning call left off.</p>
110 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
111 self.next_token = ::std::option::Option::Some(input.into());
112 self
113 }
114 /// <p>An opaque pagination token returned from a previous <code>DescribeBackups</code> operation. If a token is present, the operation continues the list from where the returning call left off.</p>
115 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
116 self.next_token = input;
117 self
118 }
119 /// <p>An opaque pagination token returned from a previous <code>DescribeBackups</code> operation. If a token is present, the operation continues the list from where the returning call left off.</p>
120 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
121 &self.next_token
122 }
123 /// Consumes the builder and constructs a [`DescribeBackupsInput`](crate::operation::describe_backups::DescribeBackupsInput).
124 pub fn build(
125 self,
126 ) -> ::std::result::Result<crate::operation::describe_backups::DescribeBackupsInput, ::aws_smithy_types::error::operation::BuildError> {
127 ::std::result::Result::Ok(crate::operation::describe_backups::DescribeBackupsInput {
128 backup_ids: self.backup_ids,
129 filters: self.filters,
130 max_results: self.max_results,
131 next_token: self.next_token,
132 })
133 }
134}