// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::describe_dimension_keys::_describe_dimension_keys_input::DescribeDimensionKeysInputBuilder;
pub use crate::operation::describe_dimension_keys::_describe_dimension_keys_output::DescribeDimensionKeysOutputBuilder;
impl crate::operation::describe_dimension_keys::builders::DescribeDimensionKeysInputBuilder {
/// Sends a request with this input using the given client.
pub async fn send_with(
self,
client: &crate::Client,
) -> ::std::result::Result<
crate::operation::describe_dimension_keys::DescribeDimensionKeysOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::describe_dimension_keys::DescribeDimensionKeysError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.describe_dimension_keys();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `DescribeDimensionKeys`.
///
/// <p>For a specific time period, retrieve the top <code>N</code> dimension keys for a metric.</p><note>
/// <p>Each response element returns a maximum of 500 bytes. For larger elements, such as SQL statements, only the first 500 bytes are returned.</p>
/// </note>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct DescribeDimensionKeysFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::describe_dimension_keys::builders::DescribeDimensionKeysInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::describe_dimension_keys::DescribeDimensionKeysOutput,
crate::operation::describe_dimension_keys::DescribeDimensionKeysError,
> for DescribeDimensionKeysFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::describe_dimension_keys::DescribeDimensionKeysOutput,
crate::operation::describe_dimension_keys::DescribeDimensionKeysError,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl DescribeDimensionKeysFluentBuilder {
/// Creates a new `DescribeDimensionKeysFluentBuilder`.
pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
Self {
handle,
inner: ::std::default::Default::default(),
config_override: ::std::option::Option::None,
}
}
/// Access the DescribeDimensionKeys as a reference.
pub fn as_input(&self) -> &crate::operation::describe_dimension_keys::builders::DescribeDimensionKeysInputBuilder {
&self.inner
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> ::std::result::Result<
crate::operation::describe_dimension_keys::DescribeDimensionKeysOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::describe_dimension_keys::DescribeDimensionKeysError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let input = self
.inner
.build()
.map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
let runtime_plugins = crate::operation::describe_dimension_keys::DescribeDimensionKeys::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::describe_dimension_keys::DescribeDimensionKeys::orchestrate(&runtime_plugins, input).await
}
/// Consumes this builder, creating a customizable operation that can be modified before being sent.
pub fn customize(
self,
) -> crate::client::customize::CustomizableOperation<
crate::operation::describe_dimension_keys::DescribeDimensionKeysOutput,
crate::operation::describe_dimension_keys::DescribeDimensionKeysError,
Self,
> {
crate::client::customize::CustomizableOperation::new(self)
}
pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
self.set_config_override(::std::option::Option::Some(config_override.into()));
self
}
pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
self.config_override = config_override;
self
}
/// Create a paginator for this request
///
/// Paginators are used by calling [`send().await`](crate::operation::describe_dimension_keys::paginator::DescribeDimensionKeysPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
pub fn into_paginator(self) -> crate::operation::describe_dimension_keys::paginator::DescribeDimensionKeysPaginator {
crate::operation::describe_dimension_keys::paginator::DescribeDimensionKeysPaginator::new(self.handle, self.inner)
}
/// <p>The Amazon Web Services service for which Performance Insights will return metrics. Valid values are as follows:</p>
/// <ul>
/// <li>
/// <p><code>RDS</code></p></li>
/// <li>
/// <p><code>DOCDB</code></p></li>
/// </ul>
pub fn service_type(mut self, input: crate::types::ServiceType) -> Self {
self.inner = self.inner.service_type(input);
self
}
/// <p>The Amazon Web Services service for which Performance Insights will return metrics. Valid values are as follows:</p>
/// <ul>
/// <li>
/// <p><code>RDS</code></p></li>
/// <li>
/// <p><code>DOCDB</code></p></li>
/// </ul>
pub fn set_service_type(mut self, input: ::std::option::Option<crate::types::ServiceType>) -> Self {
self.inner = self.inner.set_service_type(input);
self
}
/// <p>The Amazon Web Services service for which Performance Insights will return metrics. Valid values are as follows:</p>
/// <ul>
/// <li>
/// <p><code>RDS</code></p></li>
/// <li>
/// <p><code>DOCDB</code></p></li>
/// </ul>
pub fn get_service_type(&self) -> &::std::option::Option<crate::types::ServiceType> {
self.inner.get_service_type()
}
/// <p>An immutable, Amazon Web Services Region-unique identifier for a data source. Performance Insights gathers metrics from this data source.</p>
/// <p>To use an Amazon RDS instance as a data source, you specify its <code>DbiResourceId</code> value. For example, specify <code>db-FAIHNTYBKTGAUSUZQYPDS2GW4A</code>.</p>
pub fn identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.identifier(input.into());
self
}
/// <p>An immutable, Amazon Web Services Region-unique identifier for a data source. Performance Insights gathers metrics from this data source.</p>
/// <p>To use an Amazon RDS instance as a data source, you specify its <code>DbiResourceId</code> value. For example, specify <code>db-FAIHNTYBKTGAUSUZQYPDS2GW4A</code>.</p>
pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_identifier(input);
self
}
/// <p>An immutable, Amazon Web Services Region-unique identifier for a data source. Performance Insights gathers metrics from this data source.</p>
/// <p>To use an Amazon RDS instance as a data source, you specify its <code>DbiResourceId</code> value. For example, specify <code>db-FAIHNTYBKTGAUSUZQYPDS2GW4A</code>.</p>
pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_identifier()
}
/// <p>The date and time specifying the beginning of the requested time series data. You must specify a <code>StartTime</code> within the past 7 days. The value specified is <i>inclusive</i>, which means that data points equal to or greater than <code>StartTime</code> are returned.</p>
/// <p>The value for <code>StartTime</code> must be earlier than the value for <code>EndTime</code>.</p>
pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.inner = self.inner.start_time(input);
self
}
/// <p>The date and time specifying the beginning of the requested time series data. You must specify a <code>StartTime</code> within the past 7 days. The value specified is <i>inclusive</i>, which means that data points equal to or greater than <code>StartTime</code> are returned.</p>
/// <p>The value for <code>StartTime</code> must be earlier than the value for <code>EndTime</code>.</p>
pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.inner = self.inner.set_start_time(input);
self
}
/// <p>The date and time specifying the beginning of the requested time series data. You must specify a <code>StartTime</code> within the past 7 days. The value specified is <i>inclusive</i>, which means that data points equal to or greater than <code>StartTime</code> are returned.</p>
/// <p>The value for <code>StartTime</code> must be earlier than the value for <code>EndTime</code>.</p>
pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
self.inner.get_start_time()
}
/// <p>The date and time specifying the end of the requested time series data. The value specified is <i>exclusive</i>, which means that data points less than (but not equal to) <code>EndTime</code> are returned.</p>
/// <p>The value for <code>EndTime</code> must be later than the value for <code>StartTime</code>.</p>
pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.inner = self.inner.end_time(input);
self
}
/// <p>The date and time specifying the end of the requested time series data. The value specified is <i>exclusive</i>, which means that data points less than (but not equal to) <code>EndTime</code> are returned.</p>
/// <p>The value for <code>EndTime</code> must be later than the value for <code>StartTime</code>.</p>
pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.inner = self.inner.set_end_time(input);
self
}
/// <p>The date and time specifying the end of the requested time series data. The value specified is <i>exclusive</i>, which means that data points less than (but not equal to) <code>EndTime</code> are returned.</p>
/// <p>The value for <code>EndTime</code> must be later than the value for <code>StartTime</code>.</p>
pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
self.inner.get_end_time()
}
/// <p>The name of a Performance Insights metric to be measured.</p>
/// <p>Valid values for <code>Metric</code> are:</p>
/// <ul>
/// <li>
/// <p><code>db.load.avg</code> - A scaled representation of the number of active sessions for the database engine.</p></li>
/// <li>
/// <p><code>db.sampledload.avg</code> - The raw number of active sessions for the database engine.</p></li>
/// </ul>
/// <p>If the number of active sessions is less than an internal Performance Insights threshold, <code>db.load.avg</code> and <code>db.sampledload.avg</code> are the same value. If the number of active sessions is greater than the internal threshold, Performance Insights samples the active sessions, with <code>db.load.avg</code> showing the scaled values, <code>db.sampledload.avg</code> showing the raw values, and <code>db.sampledload.avg</code> less than <code>db.load.avg</code>. For most use cases, you can query <code>db.load.avg</code> only.</p>
pub fn metric(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.metric(input.into());
self
}
/// <p>The name of a Performance Insights metric to be measured.</p>
/// <p>Valid values for <code>Metric</code> are:</p>
/// <ul>
/// <li>
/// <p><code>db.load.avg</code> - A scaled representation of the number of active sessions for the database engine.</p></li>
/// <li>
/// <p><code>db.sampledload.avg</code> - The raw number of active sessions for the database engine.</p></li>
/// </ul>
/// <p>If the number of active sessions is less than an internal Performance Insights threshold, <code>db.load.avg</code> and <code>db.sampledload.avg</code> are the same value. If the number of active sessions is greater than the internal threshold, Performance Insights samples the active sessions, with <code>db.load.avg</code> showing the scaled values, <code>db.sampledload.avg</code> showing the raw values, and <code>db.sampledload.avg</code> less than <code>db.load.avg</code>. For most use cases, you can query <code>db.load.avg</code> only.</p>
pub fn set_metric(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_metric(input);
self
}
/// <p>The name of a Performance Insights metric to be measured.</p>
/// <p>Valid values for <code>Metric</code> are:</p>
/// <ul>
/// <li>
/// <p><code>db.load.avg</code> - A scaled representation of the number of active sessions for the database engine.</p></li>
/// <li>
/// <p><code>db.sampledload.avg</code> - The raw number of active sessions for the database engine.</p></li>
/// </ul>
/// <p>If the number of active sessions is less than an internal Performance Insights threshold, <code>db.load.avg</code> and <code>db.sampledload.avg</code> are the same value. If the number of active sessions is greater than the internal threshold, Performance Insights samples the active sessions, with <code>db.load.avg</code> showing the scaled values, <code>db.sampledload.avg</code> showing the raw values, and <code>db.sampledload.avg</code> less than <code>db.load.avg</code>. For most use cases, you can query <code>db.load.avg</code> only.</p>
pub fn get_metric(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_metric()
}
/// <p>The granularity, in seconds, of the data points returned from Performance Insights. A period can be as short as one second, or as long as one day (86400 seconds). Valid values are:</p>
/// <ul>
/// <li>
/// <p><code>1</code> (one second)</p></li>
/// <li>
/// <p><code>60</code> (one minute)</p></li>
/// <li>
/// <p><code>300</code> (five minutes)</p></li>
/// <li>
/// <p><code>3600</code> (one hour)</p></li>
/// <li>
/// <p><code>86400</code> (twenty-four hours)</p></li>
/// </ul>
/// <p>If you don't specify <code>PeriodInSeconds</code>, then Performance Insights chooses a value for you, with a goal of returning roughly 100-200 data points in the response.</p>
pub fn period_in_seconds(mut self, input: i32) -> Self {
self.inner = self.inner.period_in_seconds(input);
self
}
/// <p>The granularity, in seconds, of the data points returned from Performance Insights. A period can be as short as one second, or as long as one day (86400 seconds). Valid values are:</p>
/// <ul>
/// <li>
/// <p><code>1</code> (one second)</p></li>
/// <li>
/// <p><code>60</code> (one minute)</p></li>
/// <li>
/// <p><code>300</code> (five minutes)</p></li>
/// <li>
/// <p><code>3600</code> (one hour)</p></li>
/// <li>
/// <p><code>86400</code> (twenty-four hours)</p></li>
/// </ul>
/// <p>If you don't specify <code>PeriodInSeconds</code>, then Performance Insights chooses a value for you, with a goal of returning roughly 100-200 data points in the response.</p>
pub fn set_period_in_seconds(mut self, input: ::std::option::Option<i32>) -> Self {
self.inner = self.inner.set_period_in_seconds(input);
self
}
/// <p>The granularity, in seconds, of the data points returned from Performance Insights. A period can be as short as one second, or as long as one day (86400 seconds). Valid values are:</p>
/// <ul>
/// <li>
/// <p><code>1</code> (one second)</p></li>
/// <li>
/// <p><code>60</code> (one minute)</p></li>
/// <li>
/// <p><code>300</code> (five minutes)</p></li>
/// <li>
/// <p><code>3600</code> (one hour)</p></li>
/// <li>
/// <p><code>86400</code> (twenty-four hours)</p></li>
/// </ul>
/// <p>If you don't specify <code>PeriodInSeconds</code>, then Performance Insights chooses a value for you, with a goal of returning roughly 100-200 data points in the response.</p>
pub fn get_period_in_seconds(&self) -> &::std::option::Option<i32> {
self.inner.get_period_in_seconds()
}
/// <p>A specification for how to aggregate the data points from a query result. You must specify a valid dimension group. Performance Insights returns all dimensions within this group, unless you provide the names of specific dimensions within this group. You can also request that Performance Insights return a limited number of values for a dimension.</p>
pub fn group_by(mut self, input: crate::types::DimensionGroup) -> Self {
self.inner = self.inner.group_by(input);
self
}
/// <p>A specification for how to aggregate the data points from a query result. You must specify a valid dimension group. Performance Insights returns all dimensions within this group, unless you provide the names of specific dimensions within this group. You can also request that Performance Insights return a limited number of values for a dimension.</p>
pub fn set_group_by(mut self, input: ::std::option::Option<crate::types::DimensionGroup>) -> Self {
self.inner = self.inner.set_group_by(input);
self
}
/// <p>A specification for how to aggregate the data points from a query result. You must specify a valid dimension group. Performance Insights returns all dimensions within this group, unless you provide the names of specific dimensions within this group. You can also request that Performance Insights return a limited number of values for a dimension.</p>
pub fn get_group_by(&self) -> &::std::option::Option<crate::types::DimensionGroup> {
self.inner.get_group_by()
}
///
/// Appends an item to `AdditionalMetrics`.
///
/// To override the contents of this collection use [`set_additional_metrics`](Self::set_additional_metrics).
///
/// <p>Additional metrics for the top <code>N</code> dimension keys. If the specified dimension group in the <code>GroupBy</code> parameter is <code>db.sql_tokenized</code>, you can specify per-SQL metrics to get the values for the top <code>N</code> SQL digests. The response syntax is as follows: <code>"AdditionalMetrics" : { "<i>string</i>" : "<i>string</i>" }</code>.</p>
/// <p>The only supported statistic function is <code>.avg</code>.</p>
pub fn additional_metrics(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.additional_metrics(input.into());
self
}
/// <p>Additional metrics for the top <code>N</code> dimension keys. If the specified dimension group in the <code>GroupBy</code> parameter is <code>db.sql_tokenized</code>, you can specify per-SQL metrics to get the values for the top <code>N</code> SQL digests. The response syntax is as follows: <code>"AdditionalMetrics" : { "<i>string</i>" : "<i>string</i>" }</code>.</p>
/// <p>The only supported statistic function is <code>.avg</code>.</p>
pub fn set_additional_metrics(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.inner = self.inner.set_additional_metrics(input);
self
}
/// <p>Additional metrics for the top <code>N</code> dimension keys. If the specified dimension group in the <code>GroupBy</code> parameter is <code>db.sql_tokenized</code>, you can specify per-SQL metrics to get the values for the top <code>N</code> SQL digests. The response syntax is as follows: <code>"AdditionalMetrics" : { "<i>string</i>" : "<i>string</i>" }</code>.</p>
/// <p>The only supported statistic function is <code>.avg</code>.</p>
pub fn get_additional_metrics(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
self.inner.get_additional_metrics()
}
/// <p>For each dimension specified in <code>GroupBy</code>, specify a secondary dimension to further subdivide the partition keys in the response.</p>
pub fn partition_by(mut self, input: crate::types::DimensionGroup) -> Self {
self.inner = self.inner.partition_by(input);
self
}
/// <p>For each dimension specified in <code>GroupBy</code>, specify a secondary dimension to further subdivide the partition keys in the response.</p>
pub fn set_partition_by(mut self, input: ::std::option::Option<crate::types::DimensionGroup>) -> Self {
self.inner = self.inner.set_partition_by(input);
self
}
/// <p>For each dimension specified in <code>GroupBy</code>, specify a secondary dimension to further subdivide the partition keys in the response.</p>
pub fn get_partition_by(&self) -> &::std::option::Option<crate::types::DimensionGroup> {
self.inner.get_partition_by()
}
///
/// Adds a key-value pair to `Filter`.
///
/// To override the contents of this collection use [`set_filter`](Self::set_filter).
///
/// <p>One or more filters to apply in the request. Restrictions:</p>
/// <ul>
/// <li>
/// <p>Any number of filters by the same dimension, as specified in the <code>GroupBy</code> or <code>Partition</code> parameters.</p></li>
/// <li>
/// <p>A single filter for any other dimension in this dimension group.</p></li>
/// </ul><note>
/// <p>The <code>db.sql.db_id</code> filter isn't available for RDS for SQL Server DB instances.</p>
/// </note>
pub fn filter(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.filter(k.into(), v.into());
self
}
/// <p>One or more filters to apply in the request. Restrictions:</p>
/// <ul>
/// <li>
/// <p>Any number of filters by the same dimension, as specified in the <code>GroupBy</code> or <code>Partition</code> parameters.</p></li>
/// <li>
/// <p>A single filter for any other dimension in this dimension group.</p></li>
/// </ul><note>
/// <p>The <code>db.sql.db_id</code> filter isn't available for RDS for SQL Server DB instances.</p>
/// </note>
pub fn set_filter(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
self.inner = self.inner.set_filter(input);
self
}
/// <p>One or more filters to apply in the request. Restrictions:</p>
/// <ul>
/// <li>
/// <p>Any number of filters by the same dimension, as specified in the <code>GroupBy</code> or <code>Partition</code> parameters.</p></li>
/// <li>
/// <p>A single filter for any other dimension in this dimension group.</p></li>
/// </ul><note>
/// <p>The <code>db.sql.db_id</code> filter isn't available for RDS for SQL Server DB instances.</p>
/// </note>
pub fn get_filter(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.inner.get_filter()
}
/// <p>The maximum number of items to return in the response. If more items exist than the specified <code>MaxRecords</code> value, a pagination token is included in the response so that the remaining results can be retrieved.</p>
pub fn max_results(mut self, input: i32) -> Self {
self.inner = self.inner.max_results(input);
self
}
/// <p>The maximum number of items to return in the response. If more items exist than the specified <code>MaxRecords</code> value, a pagination token is included in the response so that the remaining results can be retrieved.</p>
pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
self.inner = self.inner.set_max_results(input);
self
}
/// <p>The maximum number of items to return in the response. If more items exist than the specified <code>MaxRecords</code> value, a pagination token is included in the response so that the remaining results can be retrieved.</p>
pub fn get_max_results(&self) -> &::std::option::Option<i32> {
self.inner.get_max_results()
}
/// <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>
pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.next_token(input.into());
self
}
/// <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>
pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_next_token(input);
self
}
/// <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>
pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_next_token()
}
}