aws_sdk_fsx/operation/describe_snapshots/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_snapshots::_describe_snapshots_output::DescribeSnapshotsOutputBuilder;
3
4pub use crate::operation::describe_snapshots::_describe_snapshots_input::DescribeSnapshotsInputBuilder;
5
6impl crate::operation::describe_snapshots::builders::DescribeSnapshotsInputBuilder {
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_snapshots::DescribeSnapshotsOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::describe_snapshots::DescribeSnapshotsError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.describe_snapshots();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `DescribeSnapshots`.
24///
25/// <p>Returns the description of specific Amazon FSx for OpenZFS snapshots, if a <code>SnapshotIds</code> value is provided. Otherwise, this operation returns all snapshots owned by your Amazon Web Services account in the Amazon Web Services Region of the endpoint that you're calling.</p>
26/// <p>When retrieving all snapshots, you can optionally specify the <code>MaxResults</code> parameter to limit the number of snapshots in a response. If more backups remain, Amazon FSx returns a <code>NextToken</code> value in the response. In this case, send a later request with the <code>NextToken</code> request parameter set to the value of <code>NextToken</code> from the last response.</p>
27/// <p>Use this operation in an iterative process to retrieve a list of your snapshots. <code>DescribeSnapshots</code> is called first without a <code>NextToken</code> value. Then the operation continues to be called with the <code>NextToken</code> parameter set to the value of the last <code>NextToken</code> value until a response has no <code>NextToken</code> value.</p>
28/// <p>When using this operation, keep the following in mind:</p>
29/// <ul>
30/// <li>
31/// <p>The operation might return fewer than the <code>MaxResults</code> value of snapshot descriptions while still including a <code>NextToken</code> value.</p></li>
32/// <li>
33/// <p>The order of snapshots returned in the response of one <code>DescribeSnapshots</code> call and the order of backups returned across the responses of a multi-call iteration is unspecified.</p></li>
34/// </ul>
35#[derive(::std::clone::Clone, ::std::fmt::Debug)]
36pub struct DescribeSnapshotsFluentBuilder {
37 handle: ::std::sync::Arc<crate::client::Handle>,
38 inner: crate::operation::describe_snapshots::builders::DescribeSnapshotsInputBuilder,
39 config_override: ::std::option::Option<crate::config::Builder>,
40}
41impl
42 crate::client::customize::internal::CustomizableSend<
43 crate::operation::describe_snapshots::DescribeSnapshotsOutput,
44 crate::operation::describe_snapshots::DescribeSnapshotsError,
45 > for DescribeSnapshotsFluentBuilder
46{
47 fn send(
48 self,
49 config_override: crate::config::Builder,
50 ) -> crate::client::customize::internal::BoxFuture<
51 crate::client::customize::internal::SendResult<
52 crate::operation::describe_snapshots::DescribeSnapshotsOutput,
53 crate::operation::describe_snapshots::DescribeSnapshotsError,
54 >,
55 > {
56 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
57 }
58}
59impl DescribeSnapshotsFluentBuilder {
60 /// Creates a new `DescribeSnapshotsFluentBuilder`.
61 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
62 Self {
63 handle,
64 inner: ::std::default::Default::default(),
65 config_override: ::std::option::Option::None,
66 }
67 }
68 /// Access the DescribeSnapshots as a reference.
69 pub fn as_input(&self) -> &crate::operation::describe_snapshots::builders::DescribeSnapshotsInputBuilder {
70 &self.inner
71 }
72 /// Sends the request and returns the response.
73 ///
74 /// If an error occurs, an `SdkError` will be returned with additional details that
75 /// can be matched against.
76 ///
77 /// By default, any retryable failures will be retried twice. Retry behavior
78 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
79 /// set when configuring the client.
80 pub async fn send(
81 self,
82 ) -> ::std::result::Result<
83 crate::operation::describe_snapshots::DescribeSnapshotsOutput,
84 ::aws_smithy_runtime_api::client::result::SdkError<
85 crate::operation::describe_snapshots::DescribeSnapshotsError,
86 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
87 >,
88 > {
89 let input = self
90 .inner
91 .build()
92 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
93 let runtime_plugins = crate::operation::describe_snapshots::DescribeSnapshots::operation_runtime_plugins(
94 self.handle.runtime_plugins.clone(),
95 &self.handle.conf,
96 self.config_override,
97 );
98 crate::operation::describe_snapshots::DescribeSnapshots::orchestrate(&runtime_plugins, input).await
99 }
100
101 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
102 pub fn customize(
103 self,
104 ) -> crate::client::customize::CustomizableOperation<
105 crate::operation::describe_snapshots::DescribeSnapshotsOutput,
106 crate::operation::describe_snapshots::DescribeSnapshotsError,
107 Self,
108 > {
109 crate::client::customize::CustomizableOperation::new(self)
110 }
111 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
112 self.set_config_override(::std::option::Option::Some(config_override.into()));
113 self
114 }
115
116 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
117 self.config_override = config_override;
118 self
119 }
120 /// Create a paginator for this request
121 ///
122 /// Paginators are used by calling [`send().await`](crate::operation::describe_snapshots::paginator::DescribeSnapshotsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
123 pub fn into_paginator(self) -> crate::operation::describe_snapshots::paginator::DescribeSnapshotsPaginator {
124 crate::operation::describe_snapshots::paginator::DescribeSnapshotsPaginator::new(self.handle, self.inner)
125 }
126 ///
127 /// Appends an item to `SnapshotIds`.
128 ///
129 /// To override the contents of this collection use [`set_snapshot_ids`](Self::set_snapshot_ids).
130 ///
131 /// <p>The IDs of the snapshots that you want to retrieve. This parameter value overrides any filters. If any IDs aren't found, a <code>SnapshotNotFound</code> error occurs.</p>
132 pub fn snapshot_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133 self.inner = self.inner.snapshot_ids(input.into());
134 self
135 }
136 /// <p>The IDs of the snapshots that you want to retrieve. This parameter value overrides any filters. If any IDs aren't found, a <code>SnapshotNotFound</code> error occurs.</p>
137 pub fn set_snapshot_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
138 self.inner = self.inner.set_snapshot_ids(input);
139 self
140 }
141 /// <p>The IDs of the snapshots that you want to retrieve. This parameter value overrides any filters. If any IDs aren't found, a <code>SnapshotNotFound</code> error occurs.</p>
142 pub fn get_snapshot_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
143 self.inner.get_snapshot_ids()
144 }
145 ///
146 /// Appends an item to `Filters`.
147 ///
148 /// To override the contents of this collection use [`set_filters`](Self::set_filters).
149 ///
150 /// <p>The filters structure. The supported names are <code>file-system-id</code> or <code>volume-id</code>.</p>
151 pub fn filters(mut self, input: crate::types::SnapshotFilter) -> Self {
152 self.inner = self.inner.filters(input);
153 self
154 }
155 /// <p>The filters structure. The supported names are <code>file-system-id</code> or <code>volume-id</code>.</p>
156 pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SnapshotFilter>>) -> Self {
157 self.inner = self.inner.set_filters(input);
158 self
159 }
160 /// <p>The filters structure. The supported names are <code>file-system-id</code> or <code>volume-id</code>.</p>
161 pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SnapshotFilter>> {
162 self.inner.get_filters()
163 }
164 /// <p>The maximum number of resources to return in the response. This value must be an integer greater than zero.</p>
165 pub fn max_results(mut self, input: i32) -> Self {
166 self.inner = self.inner.max_results(input);
167 self
168 }
169 /// <p>The maximum number of resources to return in the response. This value must be an integer greater than zero.</p>
170 pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
171 self.inner = self.inner.set_max_results(input);
172 self
173 }
174 /// <p>The maximum number of resources to return in the response. This value must be an integer greater than zero.</p>
175 pub fn get_max_results(&self) -> &::std::option::Option<i32> {
176 self.inner.get_max_results()
177 }
178 /// <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>
179 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
180 self.inner = self.inner.next_token(input.into());
181 self
182 }
183 /// <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>
184 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
185 self.inner = self.inner.set_next_token(input);
186 self
187 }
188 /// <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>
189 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
190 self.inner.get_next_token()
191 }
192 /// <p>Set to <code>false</code> (default) if you want to only see the snapshots owned by your Amazon Web Services account. Set to <code>true</code> if you want to see the snapshots in your account and the ones shared with you from another account.</p>
193 pub fn include_shared(mut self, input: bool) -> Self {
194 self.inner = self.inner.include_shared(input);
195 self
196 }
197 /// <p>Set to <code>false</code> (default) if you want to only see the snapshots owned by your Amazon Web Services account. Set to <code>true</code> if you want to see the snapshots in your account and the ones shared with you from another account.</p>
198 pub fn set_include_shared(mut self, input: ::std::option::Option<bool>) -> Self {
199 self.inner = self.inner.set_include_shared(input);
200 self
201 }
202 /// <p>Set to <code>false</code> (default) if you want to only see the snapshots owned by your Amazon Web Services account. Set to <code>true</code> if you want to see the snapshots in your account and the ones shared with you from another account.</p>
203 pub fn get_include_shared(&self) -> &::std::option::Option<bool> {
204 self.inner.get_include_shared()
205 }
206}