aws_sdk_redshift/operation/describe_usage_limits/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_usage_limits::_describe_usage_limits_output::DescribeUsageLimitsOutputBuilder;
3
4pub use crate::operation::describe_usage_limits::_describe_usage_limits_input::DescribeUsageLimitsInputBuilder;
5
6impl crate::operation::describe_usage_limits::builders::DescribeUsageLimitsInputBuilder {
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_usage_limits::DescribeUsageLimitsOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::describe_usage_limits::DescribeUsageLimitsError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.describe_usage_limits();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `DescribeUsageLimits`.
24///
25/// <p>Shows usage limits on a cluster. Results are filtered based on the combination of input usage limit identifier, cluster identifier, and feature type parameters:</p>
26/// <ul>
27/// <li>
28/// <p>If usage limit identifier, cluster identifier, and feature type are not provided, then all usage limit objects for the current account in the current region are returned.</p></li>
29/// <li>
30/// <p>If usage limit identifier is provided, then the corresponding usage limit object is returned.</p></li>
31/// <li>
32/// <p>If cluster identifier is provided, then all usage limit objects for the specified cluster are returned.</p></li>
33/// <li>
34/// <p>If cluster identifier and feature type are provided, then all usage limit objects for the combination of cluster and feature are returned.</p></li>
35/// </ul>
36#[derive(::std::clone::Clone, ::std::fmt::Debug)]
37pub struct DescribeUsageLimitsFluentBuilder {
38 handle: ::std::sync::Arc<crate::client::Handle>,
39 inner: crate::operation::describe_usage_limits::builders::DescribeUsageLimitsInputBuilder,
40 config_override: ::std::option::Option<crate::config::Builder>,
41}
42impl
43 crate::client::customize::internal::CustomizableSend<
44 crate::operation::describe_usage_limits::DescribeUsageLimitsOutput,
45 crate::operation::describe_usage_limits::DescribeUsageLimitsError,
46 > for DescribeUsageLimitsFluentBuilder
47{
48 fn send(
49 self,
50 config_override: crate::config::Builder,
51 ) -> crate::client::customize::internal::BoxFuture<
52 crate::client::customize::internal::SendResult<
53 crate::operation::describe_usage_limits::DescribeUsageLimitsOutput,
54 crate::operation::describe_usage_limits::DescribeUsageLimitsError,
55 >,
56 > {
57 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
58 }
59}
60impl DescribeUsageLimitsFluentBuilder {
61 /// Creates a new `DescribeUsageLimitsFluentBuilder`.
62 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
63 Self {
64 handle,
65 inner: ::std::default::Default::default(),
66 config_override: ::std::option::Option::None,
67 }
68 }
69 /// Access the DescribeUsageLimits as a reference.
70 pub fn as_input(&self) -> &crate::operation::describe_usage_limits::builders::DescribeUsageLimitsInputBuilder {
71 &self.inner
72 }
73 /// Sends the request and returns the response.
74 ///
75 /// If an error occurs, an `SdkError` will be returned with additional details that
76 /// can be matched against.
77 ///
78 /// By default, any retryable failures will be retried twice. Retry behavior
79 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
80 /// set when configuring the client.
81 pub async fn send(
82 self,
83 ) -> ::std::result::Result<
84 crate::operation::describe_usage_limits::DescribeUsageLimitsOutput,
85 ::aws_smithy_runtime_api::client::result::SdkError<
86 crate::operation::describe_usage_limits::DescribeUsageLimitsError,
87 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
88 >,
89 > {
90 let input = self
91 .inner
92 .build()
93 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
94 let runtime_plugins = crate::operation::describe_usage_limits::DescribeUsageLimits::operation_runtime_plugins(
95 self.handle.runtime_plugins.clone(),
96 &self.handle.conf,
97 self.config_override,
98 );
99 crate::operation::describe_usage_limits::DescribeUsageLimits::orchestrate(&runtime_plugins, input).await
100 }
101
102 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
103 pub fn customize(
104 self,
105 ) -> crate::client::customize::CustomizableOperation<
106 crate::operation::describe_usage_limits::DescribeUsageLimitsOutput,
107 crate::operation::describe_usage_limits::DescribeUsageLimitsError,
108 Self,
109 > {
110 crate::client::customize::CustomizableOperation::new(self)
111 }
112 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
113 self.set_config_override(::std::option::Option::Some(config_override.into()));
114 self
115 }
116
117 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
118 self.config_override = config_override;
119 self
120 }
121 /// Create a paginator for this request
122 ///
123 /// Paginators are used by calling [`send().await`](crate::operation::describe_usage_limits::paginator::DescribeUsageLimitsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
124 pub fn into_paginator(self) -> crate::operation::describe_usage_limits::paginator::DescribeUsageLimitsPaginator {
125 crate::operation::describe_usage_limits::paginator::DescribeUsageLimitsPaginator::new(self.handle, self.inner)
126 }
127 /// <p>The identifier of the usage limit to describe.</p>
128 pub fn usage_limit_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129 self.inner = self.inner.usage_limit_id(input.into());
130 self
131 }
132 /// <p>The identifier of the usage limit to describe.</p>
133 pub fn set_usage_limit_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134 self.inner = self.inner.set_usage_limit_id(input);
135 self
136 }
137 /// <p>The identifier of the usage limit to describe.</p>
138 pub fn get_usage_limit_id(&self) -> &::std::option::Option<::std::string::String> {
139 self.inner.get_usage_limit_id()
140 }
141 /// <p>The identifier of the cluster for which you want to describe usage limits.</p>
142 pub fn cluster_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
143 self.inner = self.inner.cluster_identifier(input.into());
144 self
145 }
146 /// <p>The identifier of the cluster for which you want to describe usage limits.</p>
147 pub fn set_cluster_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
148 self.inner = self.inner.set_cluster_identifier(input);
149 self
150 }
151 /// <p>The identifier of the cluster for which you want to describe usage limits.</p>
152 pub fn get_cluster_identifier(&self) -> &::std::option::Option<::std::string::String> {
153 self.inner.get_cluster_identifier()
154 }
155 /// <p>The feature type for which you want to describe usage limits.</p>
156 pub fn feature_type(mut self, input: crate::types::UsageLimitFeatureType) -> Self {
157 self.inner = self.inner.feature_type(input);
158 self
159 }
160 /// <p>The feature type for which you want to describe usage limits.</p>
161 pub fn set_feature_type(mut self, input: ::std::option::Option<crate::types::UsageLimitFeatureType>) -> Self {
162 self.inner = self.inner.set_feature_type(input);
163 self
164 }
165 /// <p>The feature type for which you want to describe usage limits.</p>
166 pub fn get_feature_type(&self) -> &::std::option::Option<crate::types::UsageLimitFeatureType> {
167 self.inner.get_feature_type()
168 }
169 /// <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>
170 /// <p>Default: <code>100</code></p>
171 /// <p>Constraints: minimum 20, maximum 100.</p>
172 pub fn max_records(mut self, input: i32) -> Self {
173 self.inner = self.inner.max_records(input);
174 self
175 }
176 /// <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>
177 /// <p>Default: <code>100</code></p>
178 /// <p>Constraints: minimum 20, maximum 100.</p>
179 pub fn set_max_records(mut self, input: ::std::option::Option<i32>) -> Self {
180 self.inner = self.inner.set_max_records(input);
181 self
182 }
183 /// <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>
184 /// <p>Default: <code>100</code></p>
185 /// <p>Constraints: minimum 20, maximum 100.</p>
186 pub fn get_max_records(&self) -> &::std::option::Option<i32> {
187 self.inner.get_max_records()
188 }
189 /// <p>An optional parameter that specifies the starting point to return a set of response records. When the results of a <code>DescribeUsageLimits</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>
190 pub fn marker(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
191 self.inner = self.inner.marker(input.into());
192 self
193 }
194 /// <p>An optional parameter that specifies the starting point to return a set of response records. When the results of a <code>DescribeUsageLimits</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>
195 pub fn set_marker(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
196 self.inner = self.inner.set_marker(input);
197 self
198 }
199 /// <p>An optional parameter that specifies the starting point to return a set of response records. When the results of a <code>DescribeUsageLimits</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>
200 pub fn get_marker(&self) -> &::std::option::Option<::std::string::String> {
201 self.inner.get_marker()
202 }
203 ///
204 /// Appends an item to `TagKeys`.
205 ///
206 /// To override the contents of this collection use [`set_tag_keys`](Self::set_tag_keys).
207 ///
208 /// <p>A tag key or keys for which you want to return all matching usage limit objects that are associated with the specified key or keys. For example, suppose that you have parameter groups 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 usage limit objects have either or both of these tag keys associated with them.</p>
209 pub fn tag_keys(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
210 self.inner = self.inner.tag_keys(input.into());
211 self
212 }
213 /// <p>A tag key or keys for which you want to return all matching usage limit objects that are associated with the specified key or keys. For example, suppose that you have parameter groups 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 usage limit objects have either or both of these tag keys associated with them.</p>
214 pub fn set_tag_keys(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
215 self.inner = self.inner.set_tag_keys(input);
216 self
217 }
218 /// <p>A tag key or keys for which you want to return all matching usage limit objects that are associated with the specified key or keys. For example, suppose that you have parameter groups 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 usage limit objects have either or both of these tag keys associated with them.</p>
219 pub fn get_tag_keys(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
220 self.inner.get_tag_keys()
221 }
222 ///
223 /// Appends an item to `TagValues`.
224 ///
225 /// To override the contents of this collection use [`set_tag_values`](Self::set_tag_values).
226 ///
227 /// <p>A tag value or values for which you want to return all matching usage limit objects that are associated with the specified tag value or values. For example, suppose that you have parameter groups 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 usage limit objects that have either or both of these tag values associated with them.</p>
228 pub fn tag_values(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
229 self.inner = self.inner.tag_values(input.into());
230 self
231 }
232 /// <p>A tag value or values for which you want to return all matching usage limit objects that are associated with the specified tag value or values. For example, suppose that you have parameter groups 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 usage limit objects that have either or both of these tag values associated with them.</p>
233 pub fn set_tag_values(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
234 self.inner = self.inner.set_tag_values(input);
235 self
236 }
237 /// <p>A tag value or values for which you want to return all matching usage limit objects that are associated with the specified tag value or values. For example, suppose that you have parameter groups 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 usage limit objects that have either or both of these tag values associated with them.</p>
238 pub fn get_tag_values(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
239 self.inner.get_tag_values()
240 }
241}