aws_sdk_redshift/operation/describe_clusters/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_clusters::_describe_clusters_output::DescribeClustersOutputBuilder;
3
4pub use crate::operation::describe_clusters::_describe_clusters_input::DescribeClustersInputBuilder;
5
6impl crate::operation::describe_clusters::builders::DescribeClustersInputBuilder {
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_clusters::DescribeClustersOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::describe_clusters::DescribeClustersError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.describe_clusters();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `DescribeClusters`.
24///
25/// <p>Returns properties of provisioned clusters including general cluster properties, cluster database properties, maintenance and backup properties, and security and access properties. This operation supports pagination. For more information about managing clusters, go to <a href="https://docs.aws.amazon.com/redshift/latest/mgmt/working-with-clusters.html">Amazon Redshift Clusters</a> in the <i>Amazon Redshift Cluster Management Guide</i>.</p>
26/// <p>If you specify both tag keys and tag values in the same request, Amazon Redshift returns all clusters that match any combination of the specified keys and values. For example, if you have <code>owner</code> and <code>environment</code> for tag keys, and <code>admin</code> and <code>test</code> for tag values, all clusters that have any combination of those values are returned.</p>
27/// <p>If both tag keys and values are omitted from the request, clusters are returned regardless of whether they have tag keys or values associated with them.</p>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct DescribeClustersFluentBuilder {
30 handle: ::std::sync::Arc<crate::client::Handle>,
31 inner: crate::operation::describe_clusters::builders::DescribeClustersInputBuilder,
32 config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35 crate::client::customize::internal::CustomizableSend<
36 crate::operation::describe_clusters::DescribeClustersOutput,
37 crate::operation::describe_clusters::DescribeClustersError,
38 > for DescribeClustersFluentBuilder
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_clusters::DescribeClustersOutput,
46 crate::operation::describe_clusters::DescribeClustersError,
47 >,
48 > {
49 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50 }
51}
52impl DescribeClustersFluentBuilder {
53 /// Creates a new `DescribeClustersFluentBuilder`.
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 DescribeClusters as a reference.
62 pub fn as_input(&self) -> &crate::operation::describe_clusters::builders::DescribeClustersInputBuilder {
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_clusters::DescribeClustersOutput,
77 ::aws_smithy_runtime_api::client::result::SdkError<
78 crate::operation::describe_clusters::DescribeClustersError,
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_clusters::DescribeClusters::operation_runtime_plugins(
87 self.handle.runtime_plugins.clone(),
88 &self.handle.conf,
89 self.config_override,
90 );
91 crate::operation::describe_clusters::DescribeClusters::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_clusters::DescribeClustersOutput,
99 crate::operation::describe_clusters::DescribeClustersError,
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_clusters::paginator::DescribeClustersPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
116 pub fn into_paginator(self) -> crate::operation::describe_clusters::paginator::DescribeClustersPaginator {
117 crate::operation::describe_clusters::paginator::DescribeClustersPaginator::new(self.handle, self.inner)
118 }
119 /// <p>The unique identifier of a cluster whose properties you are requesting. This parameter is case sensitive.</p>
120 /// <p>The default is that all clusters defined for an account are returned.</p>
121 pub fn cluster_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
122 self.inner = self.inner.cluster_identifier(input.into());
123 self
124 }
125 /// <p>The unique identifier of a cluster whose properties you are requesting. This parameter is case sensitive.</p>
126 /// <p>The default is that all clusters defined for an account are returned.</p>
127 pub fn set_cluster_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
128 self.inner = self.inner.set_cluster_identifier(input);
129 self
130 }
131 /// <p>The unique identifier of a cluster whose properties you are requesting. This parameter is case sensitive.</p>
132 /// <p>The default is that all clusters defined for an account are returned.</p>
133 pub fn get_cluster_identifier(&self) -> &::std::option::Option<::std::string::String> {
134 self.inner.get_cluster_identifier()
135 }
136 /// <p>The maximum number of response records to return in each call. If the number of remaining response records exceeds the specified <code>MaxRecords</code> value, a value is returned in a <code>marker</code> field of the response. You can retrieve the next set of records by retrying the command with the returned marker value.</p>
137 /// <p>Default: <code>100</code></p>
138 /// <p>Constraints: minimum 20, maximum 100.</p>
139 pub fn max_records(mut self, input: i32) -> Self {
140 self.inner = self.inner.max_records(input);
141 self
142 }
143 /// <p>The maximum number of response records to return in each call. If the number of remaining response records exceeds the specified <code>MaxRecords</code> value, a value is returned in a <code>marker</code> field of the response. You can retrieve the next set of records by retrying the command with the returned marker value.</p>
144 /// <p>Default: <code>100</code></p>
145 /// <p>Constraints: minimum 20, maximum 100.</p>
146 pub fn set_max_records(mut self, input: ::std::option::Option<i32>) -> Self {
147 self.inner = self.inner.set_max_records(input);
148 self
149 }
150 /// <p>The maximum number of response records to return in each call. If the number of remaining response records exceeds the specified <code>MaxRecords</code> value, a value is returned in a <code>marker</code> field of the response. You can retrieve the next set of records by retrying the command with the returned marker value.</p>
151 /// <p>Default: <code>100</code></p>
152 /// <p>Constraints: minimum 20, maximum 100.</p>
153 pub fn get_max_records(&self) -> &::std::option::Option<i32> {
154 self.inner.get_max_records()
155 }
156 /// <p>An optional parameter that specifies the starting point to return a set of response records. When the results of a <code>DescribeClusters</code> request exceed the value specified in <code>MaxRecords</code>, Amazon Web Services returns a value in the <code>Marker</code> field of the response. You can retrieve the next set of response records by providing the returned marker value in the <code>Marker</code> parameter and retrying the request.</p>
157 /// <p>Constraints: You can specify either the <b>ClusterIdentifier</b> parameter or the <b>Marker</b> parameter, but not both.</p>
158 pub fn marker(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
159 self.inner = self.inner.marker(input.into());
160 self
161 }
162 /// <p>An optional parameter that specifies the starting point to return a set of response records. When the results of a <code>DescribeClusters</code> request exceed the value specified in <code>MaxRecords</code>, Amazon Web Services returns a value in the <code>Marker</code> field of the response. You can retrieve the next set of response records by providing the returned marker value in the <code>Marker</code> parameter and retrying the request.</p>
163 /// <p>Constraints: You can specify either the <b>ClusterIdentifier</b> parameter or the <b>Marker</b> parameter, but not both.</p>
164 pub fn set_marker(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
165 self.inner = self.inner.set_marker(input);
166 self
167 }
168 /// <p>An optional parameter that specifies the starting point to return a set of response records. When the results of a <code>DescribeClusters</code> request exceed the value specified in <code>MaxRecords</code>, Amazon Web Services returns a value in the <code>Marker</code> field of the response. You can retrieve the next set of response records by providing the returned marker value in the <code>Marker</code> parameter and retrying the request.</p>
169 /// <p>Constraints: You can specify either the <b>ClusterIdentifier</b> parameter or the <b>Marker</b> parameter, but not both.</p>
170 pub fn get_marker(&self) -> &::std::option::Option<::std::string::String> {
171 self.inner.get_marker()
172 }
173 ///
174 /// Appends an item to `TagKeys`.
175 ///
176 /// To override the contents of this collection use [`set_tag_keys`](Self::set_tag_keys).
177 ///
178 /// <p>A tag key or keys for which you want to return all matching clusters that are associated with the specified key or keys. For example, suppose that you have clusters that are tagged with keys called <code>owner</code> and <code>environment</code>. If you specify both of these tag keys in the request, Amazon Redshift returns a response with the clusters that have either or both of these tag keys associated with them.</p>
179 pub fn tag_keys(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
180 self.inner = self.inner.tag_keys(input.into());
181 self
182 }
183 /// <p>A tag key or keys for which you want to return all matching clusters that are associated with the specified key or keys. For example, suppose that you have clusters that are tagged with keys called <code>owner</code> and <code>environment</code>. If you specify both of these tag keys in the request, Amazon Redshift returns a response with the clusters that have either or both of these tag keys associated with them.</p>
184 pub fn set_tag_keys(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
185 self.inner = self.inner.set_tag_keys(input);
186 self
187 }
188 /// <p>A tag key or keys for which you want to return all matching clusters that are associated with the specified key or keys. For example, suppose that you have clusters that are tagged with keys called <code>owner</code> and <code>environment</code>. If you specify both of these tag keys in the request, Amazon Redshift returns a response with the clusters that have either or both of these tag keys associated with them.</p>
189 pub fn get_tag_keys(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
190 self.inner.get_tag_keys()
191 }
192 ///
193 /// Appends an item to `TagValues`.
194 ///
195 /// To override the contents of this collection use [`set_tag_values`](Self::set_tag_values).
196 ///
197 /// <p>A tag value or values for which you want to return all matching clusters that are associated with the specified tag value or values. For example, suppose that you have clusters that are tagged with values called <code>admin</code> and <code>test</code>. If you specify both of these tag values in the request, Amazon Redshift returns a response with the clusters that have either or both of these tag values associated with them.</p>
198 pub fn tag_values(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
199 self.inner = self.inner.tag_values(input.into());
200 self
201 }
202 /// <p>A tag value or values for which you want to return all matching clusters that are associated with the specified tag value or values. For example, suppose that you have clusters that are tagged with values called <code>admin</code> and <code>test</code>. If you specify both of these tag values in the request, Amazon Redshift returns a response with the clusters that have either or both of these tag values associated with them.</p>
203 pub fn set_tag_values(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
204 self.inner = self.inner.set_tag_values(input);
205 self
206 }
207 /// <p>A tag value or values for which you want to return all matching clusters that are associated with the specified tag value or values. For example, suppose that you have clusters that are tagged with values called <code>admin</code> and <code>test</code>. If you specify both of these tag values in the request, Amazon Redshift returns a response with the clusters that have either or both of these tag values associated with them.</p>
208 pub fn get_tag_values(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
209 self.inner.get_tag_values()
210 }
211}