aws_sdk_cloudhsmv2/operation/describe_backups/_describe_backups_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 DescribeBackupsInput {
6 /// <p>The <code>NextToken</code> value that you received in the previous response. Use this value to get more backups.</p>
7 pub next_token: ::std::option::Option<::std::string::String>,
8 /// <p>The maximum number of backups to return in the response. When there are more backups than the number you specify, the response contains a <code>NextToken</code> value.</p>
9 pub max_results: ::std::option::Option<i32>,
10 /// <p>One or more filters to limit the items returned in the response.</p>
11 /// <p>Use the <code>backupIds</code> filter to return only the specified backups. Specify backups by their backup identifier (ID).</p>
12 /// <p>Use the <code>sourceBackupIds</code> filter to return only the backups created from a source backup. The <code>sourceBackupID</code> of a source backup is returned by the <code>CopyBackupToRegion</code> operation.</p>
13 /// <p>Use the <code>clusterIds</code> filter to return only the backups for the specified clusters. Specify clusters by their cluster identifier (ID).</p>
14 /// <p>Use the <code>states</code> filter to return only backups that match the specified state.</p>
15 /// <p>Use the <code>neverExpires</code> filter to return backups filtered by the value in the <code>neverExpires</code> parameter. <code>True</code> returns all backups exempt from the backup retention policy. <code>False</code> returns all backups with a backup retention policy defined at the cluster.</p>
16 pub filters: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>,
17 /// <p>Describe backups that are shared with you.</p><note>
18 /// <p>By default when using this option, the command returns backups that have been shared using a standard Resource Access Manager resource share. In order for a backup that was shared using the PutResourcePolicy command to be returned, the share must be promoted to a standard resource share using the RAM <a href="https://docs.aws.amazon.com/cli/latest/reference/ram/promote-resource-share-created-from-policy.html">PromoteResourceShareCreatedFromPolicy</a> API operation. For more information about sharing backups, see <a href="https://docs.aws.amazon.com/cloudhsm/latest/userguide/sharing.html"> Working with shared backups</a> in the CloudHSM User Guide.</p>
19 /// </note>
20 pub shared: ::std::option::Option<bool>,
21 /// <p>Designates whether or not to sort the return backups by ascending chronological order of generation.</p>
22 pub sort_ascending: ::std::option::Option<bool>,
23}
24impl DescribeBackupsInput {
25 /// <p>The <code>NextToken</code> value that you received in the previous response. Use this value to get more backups.</p>
26 pub fn next_token(&self) -> ::std::option::Option<&str> {
27 self.next_token.as_deref()
28 }
29 /// <p>The maximum number of backups to return in the response. When there are more backups than the number you specify, the response contains a <code>NextToken</code> value.</p>
30 pub fn max_results(&self) -> ::std::option::Option<i32> {
31 self.max_results
32 }
33 /// <p>One or more filters to limit the items returned in the response.</p>
34 /// <p>Use the <code>backupIds</code> filter to return only the specified backups. Specify backups by their backup identifier (ID).</p>
35 /// <p>Use the <code>sourceBackupIds</code> filter to return only the backups created from a source backup. The <code>sourceBackupID</code> of a source backup is returned by the <code>CopyBackupToRegion</code> operation.</p>
36 /// <p>Use the <code>clusterIds</code> filter to return only the backups for the specified clusters. Specify clusters by their cluster identifier (ID).</p>
37 /// <p>Use the <code>states</code> filter to return only backups that match the specified state.</p>
38 /// <p>Use the <code>neverExpires</code> filter to return backups filtered by the value in the <code>neverExpires</code> parameter. <code>True</code> returns all backups exempt from the backup retention policy. <code>False</code> returns all backups with a backup retention policy defined at the cluster.</p>
39 pub fn filters(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>> {
40 self.filters.as_ref()
41 }
42 /// <p>Describe backups that are shared with you.</p><note>
43 /// <p>By default when using this option, the command returns backups that have been shared using a standard Resource Access Manager resource share. In order for a backup that was shared using the PutResourcePolicy command to be returned, the share must be promoted to a standard resource share using the RAM <a href="https://docs.aws.amazon.com/cli/latest/reference/ram/promote-resource-share-created-from-policy.html">PromoteResourceShareCreatedFromPolicy</a> API operation. For more information about sharing backups, see <a href="https://docs.aws.amazon.com/cloudhsm/latest/userguide/sharing.html"> Working with shared backups</a> in the CloudHSM User Guide.</p>
44 /// </note>
45 pub fn shared(&self) -> ::std::option::Option<bool> {
46 self.shared
47 }
48 /// <p>Designates whether or not to sort the return backups by ascending chronological order of generation.</p>
49 pub fn sort_ascending(&self) -> ::std::option::Option<bool> {
50 self.sort_ascending
51 }
52}
53impl DescribeBackupsInput {
54 /// Creates a new builder-style object to manufacture [`DescribeBackupsInput`](crate::operation::describe_backups::DescribeBackupsInput).
55 pub fn builder() -> crate::operation::describe_backups::builders::DescribeBackupsInputBuilder {
56 crate::operation::describe_backups::builders::DescribeBackupsInputBuilder::default()
57 }
58}
59
60/// A builder for [`DescribeBackupsInput`](crate::operation::describe_backups::DescribeBackupsInput).
61#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
62#[non_exhaustive]
63pub struct DescribeBackupsInputBuilder {
64 pub(crate) next_token: ::std::option::Option<::std::string::String>,
65 pub(crate) max_results: ::std::option::Option<i32>,
66 pub(crate) filters: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>,
67 pub(crate) shared: ::std::option::Option<bool>,
68 pub(crate) sort_ascending: ::std::option::Option<bool>,
69}
70impl DescribeBackupsInputBuilder {
71 /// <p>The <code>NextToken</code> value that you received in the previous response. Use this value to get more backups.</p>
72 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
73 self.next_token = ::std::option::Option::Some(input.into());
74 self
75 }
76 /// <p>The <code>NextToken</code> value that you received in the previous response. Use this value to get more backups.</p>
77 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
78 self.next_token = input;
79 self
80 }
81 /// <p>The <code>NextToken</code> value that you received in the previous response. Use this value to get more backups.</p>
82 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
83 &self.next_token
84 }
85 /// <p>The maximum number of backups to return in the response. When there are more backups than the number you specify, the response contains a <code>NextToken</code> value.</p>
86 pub fn max_results(mut self, input: i32) -> Self {
87 self.max_results = ::std::option::Option::Some(input);
88 self
89 }
90 /// <p>The maximum number of backups to return in the response. When there are more backups than the number you specify, the response contains a <code>NextToken</code> value.</p>
91 pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
92 self.max_results = input;
93 self
94 }
95 /// <p>The maximum number of backups to return in the response. When there are more backups than the number you specify, the response contains a <code>NextToken</code> value.</p>
96 pub fn get_max_results(&self) -> &::std::option::Option<i32> {
97 &self.max_results
98 }
99 /// Adds a key-value pair to `filters`.
100 ///
101 /// To override the contents of this collection use [`set_filters`](Self::set_filters).
102 ///
103 /// <p>One or more filters to limit the items returned in the response.</p>
104 /// <p>Use the <code>backupIds</code> filter to return only the specified backups. Specify backups by their backup identifier (ID).</p>
105 /// <p>Use the <code>sourceBackupIds</code> filter to return only the backups created from a source backup. The <code>sourceBackupID</code> of a source backup is returned by the <code>CopyBackupToRegion</code> operation.</p>
106 /// <p>Use the <code>clusterIds</code> filter to return only the backups for the specified clusters. Specify clusters by their cluster identifier (ID).</p>
107 /// <p>Use the <code>states</code> filter to return only backups that match the specified state.</p>
108 /// <p>Use the <code>neverExpires</code> filter to return backups filtered by the value in the <code>neverExpires</code> parameter. <code>True</code> returns all backups exempt from the backup retention policy. <code>False</code> returns all backups with a backup retention policy defined at the cluster.</p>
109 pub fn filters(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::vec::Vec<::std::string::String>) -> Self {
110 let mut hash_map = self.filters.unwrap_or_default();
111 hash_map.insert(k.into(), v);
112 self.filters = ::std::option::Option::Some(hash_map);
113 self
114 }
115 /// <p>One or more filters to limit the items returned in the response.</p>
116 /// <p>Use the <code>backupIds</code> filter to return only the specified backups. Specify backups by their backup identifier (ID).</p>
117 /// <p>Use the <code>sourceBackupIds</code> filter to return only the backups created from a source backup. The <code>sourceBackupID</code> of a source backup is returned by the <code>CopyBackupToRegion</code> operation.</p>
118 /// <p>Use the <code>clusterIds</code> filter to return only the backups for the specified clusters. Specify clusters by their cluster identifier (ID).</p>
119 /// <p>Use the <code>states</code> filter to return only backups that match the specified state.</p>
120 /// <p>Use the <code>neverExpires</code> filter to return backups filtered by the value in the <code>neverExpires</code> parameter. <code>True</code> returns all backups exempt from the backup retention policy. <code>False</code> returns all backups with a backup retention policy defined at the cluster.</p>
121 pub fn set_filters(
122 mut self,
123 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>,
124 ) -> Self {
125 self.filters = input;
126 self
127 }
128 /// <p>One or more filters to limit the items returned in the response.</p>
129 /// <p>Use the <code>backupIds</code> filter to return only the specified backups. Specify backups by their backup identifier (ID).</p>
130 /// <p>Use the <code>sourceBackupIds</code> filter to return only the backups created from a source backup. The <code>sourceBackupID</code> of a source backup is returned by the <code>CopyBackupToRegion</code> operation.</p>
131 /// <p>Use the <code>clusterIds</code> filter to return only the backups for the specified clusters. Specify clusters by their cluster identifier (ID).</p>
132 /// <p>Use the <code>states</code> filter to return only backups that match the specified state.</p>
133 /// <p>Use the <code>neverExpires</code> filter to return backups filtered by the value in the <code>neverExpires</code> parameter. <code>True</code> returns all backups exempt from the backup retention policy. <code>False</code> returns all backups with a backup retention policy defined at the cluster.</p>
134 pub fn get_filters(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>> {
135 &self.filters
136 }
137 /// <p>Describe backups that are shared with you.</p><note>
138 /// <p>By default when using this option, the command returns backups that have been shared using a standard Resource Access Manager resource share. In order for a backup that was shared using the PutResourcePolicy command to be returned, the share must be promoted to a standard resource share using the RAM <a href="https://docs.aws.amazon.com/cli/latest/reference/ram/promote-resource-share-created-from-policy.html">PromoteResourceShareCreatedFromPolicy</a> API operation. For more information about sharing backups, see <a href="https://docs.aws.amazon.com/cloudhsm/latest/userguide/sharing.html"> Working with shared backups</a> in the CloudHSM User Guide.</p>
139 /// </note>
140 pub fn shared(mut self, input: bool) -> Self {
141 self.shared = ::std::option::Option::Some(input);
142 self
143 }
144 /// <p>Describe backups that are shared with you.</p><note>
145 /// <p>By default when using this option, the command returns backups that have been shared using a standard Resource Access Manager resource share. In order for a backup that was shared using the PutResourcePolicy command to be returned, the share must be promoted to a standard resource share using the RAM <a href="https://docs.aws.amazon.com/cli/latest/reference/ram/promote-resource-share-created-from-policy.html">PromoteResourceShareCreatedFromPolicy</a> API operation. For more information about sharing backups, see <a href="https://docs.aws.amazon.com/cloudhsm/latest/userguide/sharing.html"> Working with shared backups</a> in the CloudHSM User Guide.</p>
146 /// </note>
147 pub fn set_shared(mut self, input: ::std::option::Option<bool>) -> Self {
148 self.shared = input;
149 self
150 }
151 /// <p>Describe backups that are shared with you.</p><note>
152 /// <p>By default when using this option, the command returns backups that have been shared using a standard Resource Access Manager resource share. In order for a backup that was shared using the PutResourcePolicy command to be returned, the share must be promoted to a standard resource share using the RAM <a href="https://docs.aws.amazon.com/cli/latest/reference/ram/promote-resource-share-created-from-policy.html">PromoteResourceShareCreatedFromPolicy</a> API operation. For more information about sharing backups, see <a href="https://docs.aws.amazon.com/cloudhsm/latest/userguide/sharing.html"> Working with shared backups</a> in the CloudHSM User Guide.</p>
153 /// </note>
154 pub fn get_shared(&self) -> &::std::option::Option<bool> {
155 &self.shared
156 }
157 /// <p>Designates whether or not to sort the return backups by ascending chronological order of generation.</p>
158 pub fn sort_ascending(mut self, input: bool) -> Self {
159 self.sort_ascending = ::std::option::Option::Some(input);
160 self
161 }
162 /// <p>Designates whether or not to sort the return backups by ascending chronological order of generation.</p>
163 pub fn set_sort_ascending(mut self, input: ::std::option::Option<bool>) -> Self {
164 self.sort_ascending = input;
165 self
166 }
167 /// <p>Designates whether or not to sort the return backups by ascending chronological order of generation.</p>
168 pub fn get_sort_ascending(&self) -> &::std::option::Option<bool> {
169 &self.sort_ascending
170 }
171 /// Consumes the builder and constructs a [`DescribeBackupsInput`](crate::operation::describe_backups::DescribeBackupsInput).
172 pub fn build(
173 self,
174 ) -> ::std::result::Result<crate::operation::describe_backups::DescribeBackupsInput, ::aws_smithy_types::error::operation::BuildError> {
175 ::std::result::Result::Ok(crate::operation::describe_backups::DescribeBackupsInput {
176 next_token: self.next_token,
177 max_results: self.max_results,
178 filters: self.filters,
179 shared: self.shared,
180 sort_ascending: self.sort_ascending,
181 })
182 }
183}