aws_sdk_pi/operation/list_available_resource_metrics/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::list_available_resource_metrics::_list_available_resource_metrics_output::ListAvailableResourceMetricsOutputBuilder;
3
4pub use crate::operation::list_available_resource_metrics::_list_available_resource_metrics_input::ListAvailableResourceMetricsInputBuilder;
5
6impl crate::operation::list_available_resource_metrics::builders::ListAvailableResourceMetricsInputBuilder {
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::list_available_resource_metrics::ListAvailableResourceMetricsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::list_available_resource_metrics::ListAvailableResourceMetricsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.list_available_resource_metrics();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ListAvailableResourceMetrics`.
24///
25/// <p>Retrieve metrics of the specified types that can be queried for a specified DB instance.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct ListAvailableResourceMetricsFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::list_available_resource_metrics::builders::ListAvailableResourceMetricsInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::list_available_resource_metrics::ListAvailableResourceMetricsOutput,
35        crate::operation::list_available_resource_metrics::ListAvailableResourceMetricsError,
36    > for ListAvailableResourceMetricsFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::list_available_resource_metrics::ListAvailableResourceMetricsOutput,
44            crate::operation::list_available_resource_metrics::ListAvailableResourceMetricsError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl ListAvailableResourceMetricsFluentBuilder {
51    /// Creates a new `ListAvailableResourceMetricsFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the ListAvailableResourceMetrics as a reference.
60    pub fn as_input(&self) -> &crate::operation::list_available_resource_metrics::builders::ListAvailableResourceMetricsInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::list_available_resource_metrics::ListAvailableResourceMetricsOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::list_available_resource_metrics::ListAvailableResourceMetricsError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::list_available_resource_metrics::ListAvailableResourceMetrics::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::list_available_resource_metrics::ListAvailableResourceMetrics::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::list_available_resource_metrics::ListAvailableResourceMetricsOutput,
97        crate::operation::list_available_resource_metrics::ListAvailableResourceMetricsError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// Create a paginator for this request
112    ///
113    /// Paginators are used by calling [`send().await`](crate::operation::list_available_resource_metrics::paginator::ListAvailableResourceMetricsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
114    pub fn into_paginator(self) -> crate::operation::list_available_resource_metrics::paginator::ListAvailableResourceMetricsPaginator {
115        crate::operation::list_available_resource_metrics::paginator::ListAvailableResourceMetricsPaginator::new(self.handle, self.inner)
116    }
117    /// <p>The Amazon Web Services service for which Performance Insights returns metrics.</p>
118    pub fn service_type(mut self, input: crate::types::ServiceType) -> Self {
119        self.inner = self.inner.service_type(input);
120        self
121    }
122    /// <p>The Amazon Web Services service for which Performance Insights returns metrics.</p>
123    pub fn set_service_type(mut self, input: ::std::option::Option<crate::types::ServiceType>) -> Self {
124        self.inner = self.inner.set_service_type(input);
125        self
126    }
127    /// <p>The Amazon Web Services service for which Performance Insights returns metrics.</p>
128    pub fn get_service_type(&self) -> &::std::option::Option<crate::types::ServiceType> {
129        self.inner.get_service_type()
130    }
131    /// <p>An immutable identifier for a data source that is unique within an Amazon Web Services Region. Performance Insights gathers metrics from this data source. To use an Amazon RDS DB instance as a data source, specify its <code>DbiResourceId</code> value. For example, specify <code>db-ABCDEFGHIJKLMNOPQRSTU1VWZ</code>.</p>
132    pub fn identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133        self.inner = self.inner.identifier(input.into());
134        self
135    }
136    /// <p>An immutable identifier for a data source that is unique within an Amazon Web Services Region. Performance Insights gathers metrics from this data source. To use an Amazon RDS DB instance as a data source, specify its <code>DbiResourceId</code> value. For example, specify <code>db-ABCDEFGHIJKLMNOPQRSTU1VWZ</code>.</p>
137    pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138        self.inner = self.inner.set_identifier(input);
139        self
140    }
141    /// <p>An immutable identifier for a data source that is unique within an Amazon Web Services Region. Performance Insights gathers metrics from this data source. To use an Amazon RDS DB instance as a data source, specify its <code>DbiResourceId</code> value. For example, specify <code>db-ABCDEFGHIJKLMNOPQRSTU1VWZ</code>.</p>
142    pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
143        self.inner.get_identifier()
144    }
145    ///
146    /// Appends an item to `MetricTypes`.
147    ///
148    /// To override the contents of this collection use [`set_metric_types`](Self::set_metric_types).
149    ///
150    /// <p>The types of metrics to return in the response. Valid values in the array include the following:</p>
151    /// <ul>
152    /// <li>
153    /// <p><code>os</code> (OS counter metrics) - All engines</p></li>
154    /// <li>
155    /// <p><code>db</code> (DB load metrics) - All engines except for Amazon DocumentDB</p></li>
156    /// <li>
157    /// <p><code>db.sql.stats</code> (per-SQL metrics) - All engines except for Amazon DocumentDB</p></li>
158    /// <li>
159    /// <p><code>db.sql_tokenized.stats</code> (per-SQL digest metrics) - All engines except for Amazon DocumentDB</p></li>
160    /// </ul>
161    pub fn metric_types(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
162        self.inner = self.inner.metric_types(input.into());
163        self
164    }
165    /// <p>The types of metrics to return in the response. Valid values in the array include the following:</p>
166    /// <ul>
167    /// <li>
168    /// <p><code>os</code> (OS counter metrics) - All engines</p></li>
169    /// <li>
170    /// <p><code>db</code> (DB load metrics) - All engines except for Amazon DocumentDB</p></li>
171    /// <li>
172    /// <p><code>db.sql.stats</code> (per-SQL metrics) - All engines except for Amazon DocumentDB</p></li>
173    /// <li>
174    /// <p><code>db.sql_tokenized.stats</code> (per-SQL digest metrics) - All engines except for Amazon DocumentDB</p></li>
175    /// </ul>
176    pub fn set_metric_types(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
177        self.inner = self.inner.set_metric_types(input);
178        self
179    }
180    /// <p>The types of metrics to return in the response. Valid values in the array include the following:</p>
181    /// <ul>
182    /// <li>
183    /// <p><code>os</code> (OS counter metrics) - All engines</p></li>
184    /// <li>
185    /// <p><code>db</code> (DB load metrics) - All engines except for Amazon DocumentDB</p></li>
186    /// <li>
187    /// <p><code>db.sql.stats</code> (per-SQL metrics) - All engines except for Amazon DocumentDB</p></li>
188    /// <li>
189    /// <p><code>db.sql_tokenized.stats</code> (per-SQL digest metrics) - All engines except for Amazon DocumentDB</p></li>
190    /// </ul>
191    pub fn get_metric_types(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
192        self.inner.get_metric_types()
193    }
194    /// <p>An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the token, up to the value specified by <code>MaxRecords</code>.</p>
195    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
196        self.inner = self.inner.next_token(input.into());
197        self
198    }
199    /// <p>An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the token, up to the value specified by <code>MaxRecords</code>.</p>
200    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
201        self.inner = self.inner.set_next_token(input);
202        self
203    }
204    /// <p>An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the token, up to the value specified by <code>MaxRecords</code>.</p>
205    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
206        self.inner.get_next_token()
207    }
208    /// <p>The maximum number of items to return. If the <code>MaxRecords</code> value is less than the number of existing items, the response includes a pagination token.</p>
209    pub fn max_results(mut self, input: i32) -> Self {
210        self.inner = self.inner.max_results(input);
211        self
212    }
213    /// <p>The maximum number of items to return. If the <code>MaxRecords</code> value is less than the number of existing items, the response includes a pagination token.</p>
214    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
215        self.inner = self.inner.set_max_results(input);
216        self
217    }
218    /// <p>The maximum number of items to return. If the <code>MaxRecords</code> value is less than the number of existing items, the response includes a pagination token.</p>
219    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
220        self.inner.get_max_results()
221    }
222}