aws_sdk_elasticache/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 information about cluster or replication group snapshots. By default, <code>DescribeSnapshots</code> lists all of your snapshots; it can optionally describe a single snapshot, or just the snapshots associated with a particular cache cluster.</p><note>
26/// <p>This operation is valid for Valkey or Redis OSS only.</p>
27/// </note>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct DescribeSnapshotsFluentBuilder {
30    handle: ::std::sync::Arc<crate::client::Handle>,
31    inner: crate::operation::describe_snapshots::builders::DescribeSnapshotsInputBuilder,
32    config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35    crate::client::customize::internal::CustomizableSend<
36        crate::operation::describe_snapshots::DescribeSnapshotsOutput,
37        crate::operation::describe_snapshots::DescribeSnapshotsError,
38    > for DescribeSnapshotsFluentBuilder
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_snapshots::DescribeSnapshotsOutput,
46            crate::operation::describe_snapshots::DescribeSnapshotsError,
47        >,
48    > {
49        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50    }
51}
52impl DescribeSnapshotsFluentBuilder {
53    /// Creates a new `DescribeSnapshotsFluentBuilder`.
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 DescribeSnapshots as a reference.
62    pub fn as_input(&self) -> &crate::operation::describe_snapshots::builders::DescribeSnapshotsInputBuilder {
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_snapshots::DescribeSnapshotsOutput,
77        ::aws_smithy_runtime_api::client::result::SdkError<
78            crate::operation::describe_snapshots::DescribeSnapshotsError,
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_snapshots::DescribeSnapshots::operation_runtime_plugins(
87            self.handle.runtime_plugins.clone(),
88            &self.handle.conf,
89            self.config_override,
90        );
91        crate::operation::describe_snapshots::DescribeSnapshots::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_snapshots::DescribeSnapshotsOutput,
99        crate::operation::describe_snapshots::DescribeSnapshotsError,
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_snapshots::paginator::DescribeSnapshotsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
116    pub fn into_paginator(self) -> crate::operation::describe_snapshots::paginator::DescribeSnapshotsPaginator {
117        crate::operation::describe_snapshots::paginator::DescribeSnapshotsPaginator::new(self.handle, self.inner)
118    }
119    /// <p>A user-supplied replication group identifier. If this parameter is specified, only snapshots associated with that specific replication group are described.</p>
120    pub fn replication_group_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121        self.inner = self.inner.replication_group_id(input.into());
122        self
123    }
124    /// <p>A user-supplied replication group identifier. If this parameter is specified, only snapshots associated with that specific replication group are described.</p>
125    pub fn set_replication_group_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126        self.inner = self.inner.set_replication_group_id(input);
127        self
128    }
129    /// <p>A user-supplied replication group identifier. If this parameter is specified, only snapshots associated with that specific replication group are described.</p>
130    pub fn get_replication_group_id(&self) -> &::std::option::Option<::std::string::String> {
131        self.inner.get_replication_group_id()
132    }
133    /// <p>A user-supplied cluster identifier. If this parameter is specified, only snapshots associated with that specific cluster are described.</p>
134    pub fn cache_cluster_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135        self.inner = self.inner.cache_cluster_id(input.into());
136        self
137    }
138    /// <p>A user-supplied cluster identifier. If this parameter is specified, only snapshots associated with that specific cluster are described.</p>
139    pub fn set_cache_cluster_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140        self.inner = self.inner.set_cache_cluster_id(input);
141        self
142    }
143    /// <p>A user-supplied cluster identifier. If this parameter is specified, only snapshots associated with that specific cluster are described.</p>
144    pub fn get_cache_cluster_id(&self) -> &::std::option::Option<::std::string::String> {
145        self.inner.get_cache_cluster_id()
146    }
147    /// <p>A user-supplied name of the snapshot. If this parameter is specified, only this snapshot are described.</p>
148    pub fn snapshot_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
149        self.inner = self.inner.snapshot_name(input.into());
150        self
151    }
152    /// <p>A user-supplied name of the snapshot. If this parameter is specified, only this snapshot are described.</p>
153    pub fn set_snapshot_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154        self.inner = self.inner.set_snapshot_name(input);
155        self
156    }
157    /// <p>A user-supplied name of the snapshot. If this parameter is specified, only this snapshot are described.</p>
158    pub fn get_snapshot_name(&self) -> &::std::option::Option<::std::string::String> {
159        self.inner.get_snapshot_name()
160    }
161    /// <p>If set to <code>system</code>, the output shows snapshots that were automatically created by ElastiCache. If set to <code>user</code> the output shows snapshots that were manually created. If omitted, the output shows both automatically and manually created snapshots.</p>
162    pub fn snapshot_source(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
163        self.inner = self.inner.snapshot_source(input.into());
164        self
165    }
166    /// <p>If set to <code>system</code>, the output shows snapshots that were automatically created by ElastiCache. If set to <code>user</code> the output shows snapshots that were manually created. If omitted, the output shows both automatically and manually created snapshots.</p>
167    pub fn set_snapshot_source(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
168        self.inner = self.inner.set_snapshot_source(input);
169        self
170    }
171    /// <p>If set to <code>system</code>, the output shows snapshots that were automatically created by ElastiCache. If set to <code>user</code> the output shows snapshots that were manually created. If omitted, the output shows both automatically and manually created snapshots.</p>
172    pub fn get_snapshot_source(&self) -> &::std::option::Option<::std::string::String> {
173        self.inner.get_snapshot_source()
174    }
175    /// <p>An optional marker returned from a prior request. Use this marker for pagination of results from this operation. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by <code>MaxRecords</code>.</p>
176    pub fn marker(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
177        self.inner = self.inner.marker(input.into());
178        self
179    }
180    /// <p>An optional marker returned from a prior request. Use this marker for pagination of results from this operation. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by <code>MaxRecords</code>.</p>
181    pub fn set_marker(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
182        self.inner = self.inner.set_marker(input);
183        self
184    }
185    /// <p>An optional marker returned from a prior request. Use this marker for pagination of results from this operation. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by <code>MaxRecords</code>.</p>
186    pub fn get_marker(&self) -> &::std::option::Option<::std::string::String> {
187        self.inner.get_marker()
188    }
189    /// <p>The maximum number of records to include in the response. If more records exist than the specified <code>MaxRecords</code> value, a marker is included in the response so that the remaining results can be retrieved.</p>
190    /// <p>Default: 50</p>
191    /// <p>Constraints: minimum 20; maximum 50.</p>
192    pub fn max_records(mut self, input: i32) -> Self {
193        self.inner = self.inner.max_records(input);
194        self
195    }
196    /// <p>The maximum number of records to include in the response. If more records exist than the specified <code>MaxRecords</code> value, a marker is included in the response so that the remaining results can be retrieved.</p>
197    /// <p>Default: 50</p>
198    /// <p>Constraints: minimum 20; maximum 50.</p>
199    pub fn set_max_records(mut self, input: ::std::option::Option<i32>) -> Self {
200        self.inner = self.inner.set_max_records(input);
201        self
202    }
203    /// <p>The maximum number of records to include in the response. If more records exist than the specified <code>MaxRecords</code> value, a marker is included in the response so that the remaining results can be retrieved.</p>
204    /// <p>Default: 50</p>
205    /// <p>Constraints: minimum 20; maximum 50.</p>
206    pub fn get_max_records(&self) -> &::std::option::Option<i32> {
207        self.inner.get_max_records()
208    }
209    /// <p>A Boolean value which if true, the node group (shard) configuration is included in the snapshot description.</p>
210    pub fn show_node_group_config(mut self, input: bool) -> Self {
211        self.inner = self.inner.show_node_group_config(input);
212        self
213    }
214    /// <p>A Boolean value which if true, the node group (shard) configuration is included in the snapshot description.</p>
215    pub fn set_show_node_group_config(mut self, input: ::std::option::Option<bool>) -> Self {
216        self.inner = self.inner.set_show_node_group_config(input);
217        self
218    }
219    /// <p>A Boolean value which if true, the node group (shard) configuration is included in the snapshot description.</p>
220    pub fn get_show_node_group_config(&self) -> &::std::option::Option<bool> {
221        self.inner.get_show_node_group_config()
222    }
223}