aws_sdk_cloudhsmv2/operation/describe_backups/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_backups::_describe_backups_output::DescribeBackupsOutputBuilder;
3
4pub use crate::operation::describe_backups::_describe_backups_input::DescribeBackupsInputBuilder;
5
6impl crate::operation::describe_backups::builders::DescribeBackupsInputBuilder {
7 /// Sends a request with this input using the given client.
8 pub async fn send_with(
9 self,
10 client: &crate::Client,
11 ) -> ::std::result::Result<
12 crate::operation::describe_backups::DescribeBackupsOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::describe_backups::DescribeBackupsError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.describe_backups();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `DescribeBackups`.
24///
25/// <p>Gets information about backups of CloudHSM clusters. Lists either the backups you own or the backups shared with you when the Shared parameter is true.</p>
26/// <p>This is a paginated operation, which means that each response might contain only a subset of all the backups. When the response contains only a subset of backups, it includes a <code>NextToken</code> value. Use this value in a subsequent <code>DescribeBackups</code> request to get more backups. When you receive a response with no <code>NextToken</code> (or an empty or null value), that means there are no more backups to get.</p>
27/// <p><b>Cross-account use:</b> Yes. Customers can describe backups in other Amazon Web Services accounts that are shared with them.</p>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct DescribeBackupsFluentBuilder {
30 handle: ::std::sync::Arc<crate::client::Handle>,
31 inner: crate::operation::describe_backups::builders::DescribeBackupsInputBuilder,
32 config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35 crate::client::customize::internal::CustomizableSend<
36 crate::operation::describe_backups::DescribeBackupsOutput,
37 crate::operation::describe_backups::DescribeBackupsError,
38 > for DescribeBackupsFluentBuilder
39{
40 fn send(
41 self,
42 config_override: crate::config::Builder,
43 ) -> crate::client::customize::internal::BoxFuture<
44 crate::client::customize::internal::SendResult<
45 crate::operation::describe_backups::DescribeBackupsOutput,
46 crate::operation::describe_backups::DescribeBackupsError,
47 >,
48 > {
49 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50 }
51}
52impl DescribeBackupsFluentBuilder {
53 /// Creates a new `DescribeBackupsFluentBuilder`.
54 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
55 Self {
56 handle,
57 inner: ::std::default::Default::default(),
58 config_override: ::std::option::Option::None,
59 }
60 }
61 /// Access the DescribeBackups as a reference.
62 pub fn as_input(&self) -> &crate::operation::describe_backups::builders::DescribeBackupsInputBuilder {
63 &self.inner
64 }
65 /// Sends the request and returns the response.
66 ///
67 /// If an error occurs, an `SdkError` will be returned with additional details that
68 /// can be matched against.
69 ///
70 /// By default, any retryable failures will be retried twice. Retry behavior
71 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
72 /// set when configuring the client.
73 pub async fn send(
74 self,
75 ) -> ::std::result::Result<
76 crate::operation::describe_backups::DescribeBackupsOutput,
77 ::aws_smithy_runtime_api::client::result::SdkError<
78 crate::operation::describe_backups::DescribeBackupsError,
79 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
80 >,
81 > {
82 let input = self
83 .inner
84 .build()
85 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
86 let runtime_plugins = crate::operation::describe_backups::DescribeBackups::operation_runtime_plugins(
87 self.handle.runtime_plugins.clone(),
88 &self.handle.conf,
89 self.config_override,
90 );
91 crate::operation::describe_backups::DescribeBackups::orchestrate(&runtime_plugins, input).await
92 }
93
94 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
95 pub fn customize(
96 self,
97 ) -> crate::client::customize::CustomizableOperation<
98 crate::operation::describe_backups::DescribeBackupsOutput,
99 crate::operation::describe_backups::DescribeBackupsError,
100 Self,
101 > {
102 crate::client::customize::CustomizableOperation::new(self)
103 }
104 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
105 self.set_config_override(::std::option::Option::Some(config_override.into()));
106 self
107 }
108
109 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
110 self.config_override = config_override;
111 self
112 }
113 /// Create a paginator for this request
114 ///
115 /// Paginators are used by calling [`send().await`](crate::operation::describe_backups::paginator::DescribeBackupsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
116 pub fn into_paginator(self) -> crate::operation::describe_backups::paginator::DescribeBackupsPaginator {
117 crate::operation::describe_backups::paginator::DescribeBackupsPaginator::new(self.handle, self.inner)
118 }
119 /// <p>The <code>NextToken</code> value that you received in the previous response. Use this value to get more backups.</p>
120 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121 self.inner = self.inner.next_token(input.into());
122 self
123 }
124 /// <p>The <code>NextToken</code> value that you received in the previous response. Use this value to get more backups.</p>
125 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126 self.inner = self.inner.set_next_token(input);
127 self
128 }
129 /// <p>The <code>NextToken</code> value that you received in the previous response. Use this value to get more backups.</p>
130 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
131 self.inner.get_next_token()
132 }
133 /// <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>
134 pub fn max_results(mut self, input: i32) -> Self {
135 self.inner = self.inner.max_results(input);
136 self
137 }
138 /// <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>
139 pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
140 self.inner = self.inner.set_max_results(input);
141 self
142 }
143 /// <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>
144 pub fn get_max_results(&self) -> &::std::option::Option<i32> {
145 self.inner.get_max_results()
146 }
147 ///
148 /// Adds a key-value pair to `Filters`.
149 ///
150 /// To override the contents of this collection use [`set_filters`](Self::set_filters).
151 ///
152 /// <p>One or more filters to limit the items returned in the response.</p>
153 /// <p>Use the <code>backupIds</code> filter to return only the specified backups. Specify backups by their backup identifier (ID).</p>
154 /// <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>
155 /// <p>Use the <code>clusterIds</code> filter to return only the backups for the specified clusters. Specify clusters by their cluster identifier (ID).</p>
156 /// <p>Use the <code>states</code> filter to return only backups that match the specified state.</p>
157 /// <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>
158 pub fn filters(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::vec::Vec<::std::string::String>) -> Self {
159 self.inner = self.inner.filters(k.into(), v);
160 self
161 }
162 /// <p>One or more filters to limit the items returned in the response.</p>
163 /// <p>Use the <code>backupIds</code> filter to return only the specified backups. Specify backups by their backup identifier (ID).</p>
164 /// <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>
165 /// <p>Use the <code>clusterIds</code> filter to return only the backups for the specified clusters. Specify clusters by their cluster identifier (ID).</p>
166 /// <p>Use the <code>states</code> filter to return only backups that match the specified state.</p>
167 /// <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>
168 pub fn set_filters(
169 mut self,
170 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>,
171 ) -> Self {
172 self.inner = self.inner.set_filters(input);
173 self
174 }
175 /// <p>One or more filters to limit the items returned in the response.</p>
176 /// <p>Use the <code>backupIds</code> filter to return only the specified backups. Specify backups by their backup identifier (ID).</p>
177 /// <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>
178 /// <p>Use the <code>clusterIds</code> filter to return only the backups for the specified clusters. Specify clusters by their cluster identifier (ID).</p>
179 /// <p>Use the <code>states</code> filter to return only backups that match the specified state.</p>
180 /// <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>
181 pub fn get_filters(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>> {
182 self.inner.get_filters()
183 }
184 /// <p>Describe backups that are shared with you.</p><note>
185 /// <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>
186 /// </note>
187 pub fn shared(mut self, input: bool) -> Self {
188 self.inner = self.inner.shared(input);
189 self
190 }
191 /// <p>Describe backups that are shared with you.</p><note>
192 /// <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>
193 /// </note>
194 pub fn set_shared(mut self, input: ::std::option::Option<bool>) -> Self {
195 self.inner = self.inner.set_shared(input);
196 self
197 }
198 /// <p>Describe backups that are shared with you.</p><note>
199 /// <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>
200 /// </note>
201 pub fn get_shared(&self) -> &::std::option::Option<bool> {
202 self.inner.get_shared()
203 }
204 /// <p>Designates whether or not to sort the return backups by ascending chronological order of generation.</p>
205 pub fn sort_ascending(mut self, input: bool) -> Self {
206 self.inner = self.inner.sort_ascending(input);
207 self
208 }
209 /// <p>Designates whether or not to sort the return backups by ascending chronological order of generation.</p>
210 pub fn set_sort_ascending(mut self, input: ::std::option::Option<bool>) -> Self {
211 self.inner = self.inner.set_sort_ascending(input);
212 self
213 }
214 /// <p>Designates whether or not to sort the return backups by ascending chronological order of generation.</p>
215 pub fn get_sort_ascending(&self) -> &::std::option::Option<bool> {
216 self.inner.get_sort_ascending()
217 }
218}