aws-sdk-pi 1.101.0

AWS SDK for AWS Performance Insights
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetResourceMetricsInput {
    /// <p>The Amazon Web Services service for which Performance Insights returns metrics. Valid values are as follows:</p>
    /// <ul>
    /// <li>
    /// <p><code>RDS</code></p></li>
    /// <li>
    /// <p><code>DOCDB</code></p></li>
    /// </ul>
    pub service_type: ::std::option::Option<crate::types::ServiceType>,
    /// <p>An immutable identifier for a data source that is unique for an Amazon Web Services Region. Performance Insights gathers metrics from this data source. In the console, the identifier is shown as <i>ResourceID</i>. When you call <code>DescribeDBInstances</code>, the identifier is returned as <code>DbiResourceId</code>.</p>
    /// <p>To use a DB instance as a data source, specify its <code>DbiResourceId</code> value. For example, specify <code>db-ABCDEFGHIJKLMNOPQRSTU1VW2X</code>.</p>
    pub identifier: ::std::option::Option<::std::string::String>,
    /// <p>An array of one or more queries to perform. Each query must specify a Performance Insights metric and specify an aggregate function, and you can provide filtering criteria. You must append the aggregate function to the metric. For example, to find the average for the metric <code>db.load</code> you must use <code>db.load.avg</code>. Valid values for aggregate functions include <code>.avg</code>, <code>.min</code>, <code>.max</code>, and <code>.sum</code>.</p>
    pub metric_queries: ::std::option::Option<::std::vec::Vec<crate::types::MetricQuery>>,
    /// <p>The date and time specifying the beginning of the requested time series query range. You can't specify a <code>StartTime</code> that is earlier than 7 days ago. By default, Performance Insights has 7 days of retention, but you can extend this range up to 2 years. The value specified is <i>inclusive</i>. Thus, the command returns data points equal to or greater than <code>StartTime</code>.</p>
    /// <p>The value for <code>StartTime</code> must be earlier than the value for <code>EndTime</code>.</p>
    pub start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The date and time specifying the end of the requested time series query range. The value specified is <i>exclusive</i>. Thus, the command returns data points less than (but not equal to) <code>EndTime</code>.</p>
    /// <p>The value for <code>EndTime</code> must be later than the value for <code>StartTime</code>.</p>
    pub end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <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 will choose a value for you, with a goal of returning roughly 100-200 data points in the response.</p>
    pub period_in_seconds: ::std::option::Option<i32>,
    /// <p>The maximum number of items to return in the response.</p>
    pub max_results: ::std::option::Option<i32>,
    /// <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 next_token: ::std::option::Option<::std::string::String>,
    /// <p>The returned timestamp which is the start or end time of the time periods. The default value is <code>END_TIME</code>.</p>
    pub period_alignment: ::std::option::Option<crate::types::PeriodAlignment>,
}
impl GetResourceMetricsInput {
    /// <p>The Amazon Web Services service for which Performance Insights returns 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(&self) -> ::std::option::Option<&crate::types::ServiceType> {
        self.service_type.as_ref()
    }
    /// <p>An immutable identifier for a data source that is unique for an Amazon Web Services Region. Performance Insights gathers metrics from this data source. In the console, the identifier is shown as <i>ResourceID</i>. When you call <code>DescribeDBInstances</code>, the identifier is returned as <code>DbiResourceId</code>.</p>
    /// <p>To use a DB instance as a data source, specify its <code>DbiResourceId</code> value. For example, specify <code>db-ABCDEFGHIJKLMNOPQRSTU1VW2X</code>.</p>
    pub fn identifier(&self) -> ::std::option::Option<&str> {
        self.identifier.as_deref()
    }
    /// <p>An array of one or more queries to perform. Each query must specify a Performance Insights metric and specify an aggregate function, and you can provide filtering criteria. You must append the aggregate function to the metric. For example, to find the average for the metric <code>db.load</code> you must use <code>db.load.avg</code>. Valid values for aggregate functions include <code>.avg</code>, <code>.min</code>, <code>.max</code>, and <code>.sum</code>.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.metric_queries.is_none()`.
    pub fn metric_queries(&self) -> &[crate::types::MetricQuery] {
        self.metric_queries.as_deref().unwrap_or_default()
    }
    /// <p>The date and time specifying the beginning of the requested time series query range. You can't specify a <code>StartTime</code> that is earlier than 7 days ago. By default, Performance Insights has 7 days of retention, but you can extend this range up to 2 years. The value specified is <i>inclusive</i>. Thus, the command returns data points equal to or greater than <code>StartTime</code>.</p>
    /// <p>The value for <code>StartTime</code> must be earlier than the value for <code>EndTime</code>.</p>
    pub fn start_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.start_time.as_ref()
    }
    /// <p>The date and time specifying the end of the requested time series query range. The value specified is <i>exclusive</i>. Thus, the command returns data points less than (but not equal to) <code>EndTime</code>.</p>
    /// <p>The value for <code>EndTime</code> must be later than the value for <code>StartTime</code>.</p>
    pub fn end_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.end_time.as_ref()
    }
    /// <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 will choose a value for you, with a goal of returning roughly 100-200 data points in the response.</p>
    pub fn period_in_seconds(&self) -> ::std::option::Option<i32> {
        self.period_in_seconds
    }
    /// <p>The maximum number of items to return in the response.</p>
    pub fn max_results(&self) -> ::std::option::Option<i32> {
        self.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(&self) -> ::std::option::Option<&str> {
        self.next_token.as_deref()
    }
    /// <p>The returned timestamp which is the start or end time of the time periods. The default value is <code>END_TIME</code>.</p>
    pub fn period_alignment(&self) -> ::std::option::Option<&crate::types::PeriodAlignment> {
        self.period_alignment.as_ref()
    }
}
impl GetResourceMetricsInput {
    /// Creates a new builder-style object to manufacture [`GetResourceMetricsInput`](crate::operation::get_resource_metrics::GetResourceMetricsInput).
    pub fn builder() -> crate::operation::get_resource_metrics::builders::GetResourceMetricsInputBuilder {
        crate::operation::get_resource_metrics::builders::GetResourceMetricsInputBuilder::default()
    }
}

/// A builder for [`GetResourceMetricsInput`](crate::operation::get_resource_metrics::GetResourceMetricsInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetResourceMetricsInputBuilder {
    pub(crate) service_type: ::std::option::Option<crate::types::ServiceType>,
    pub(crate) identifier: ::std::option::Option<::std::string::String>,
    pub(crate) metric_queries: ::std::option::Option<::std::vec::Vec<crate::types::MetricQuery>>,
    pub(crate) start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) period_in_seconds: ::std::option::Option<i32>,
    pub(crate) max_results: ::std::option::Option<i32>,
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
    pub(crate) period_alignment: ::std::option::Option<crate::types::PeriodAlignment>,
}
impl GetResourceMetricsInputBuilder {
    /// <p>The Amazon Web Services service for which Performance Insights returns metrics. Valid values are as follows:</p>
    /// <ul>
    /// <li>
    /// <p><code>RDS</code></p></li>
    /// <li>
    /// <p><code>DOCDB</code></p></li>
    /// </ul>
    /// This field is required.
    pub fn service_type(mut self, input: crate::types::ServiceType) -> Self {
        self.service_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The Amazon Web Services service for which Performance Insights returns 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.service_type = input;
        self
    }
    /// <p>The Amazon Web Services service for which Performance Insights returns 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.service_type
    }
    /// <p>An immutable identifier for a data source that is unique for an Amazon Web Services Region. Performance Insights gathers metrics from this data source. In the console, the identifier is shown as <i>ResourceID</i>. When you call <code>DescribeDBInstances</code>, the identifier is returned as <code>DbiResourceId</code>.</p>
    /// <p>To use a DB instance as a data source, specify its <code>DbiResourceId</code> value. For example, specify <code>db-ABCDEFGHIJKLMNOPQRSTU1VW2X</code>.</p>
    /// This field is required.
    pub fn identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.identifier = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>An immutable identifier for a data source that is unique for an Amazon Web Services Region. Performance Insights gathers metrics from this data source. In the console, the identifier is shown as <i>ResourceID</i>. When you call <code>DescribeDBInstances</code>, the identifier is returned as <code>DbiResourceId</code>.</p>
    /// <p>To use a DB instance as a data source, specify its <code>DbiResourceId</code> value. For example, specify <code>db-ABCDEFGHIJKLMNOPQRSTU1VW2X</code>.</p>
    pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.identifier = input;
        self
    }
    /// <p>An immutable identifier for a data source that is unique for an Amazon Web Services Region. Performance Insights gathers metrics from this data source. In the console, the identifier is shown as <i>ResourceID</i>. When you call <code>DescribeDBInstances</code>, the identifier is returned as <code>DbiResourceId</code>.</p>
    /// <p>To use a DB instance as a data source, specify its <code>DbiResourceId</code> value. For example, specify <code>db-ABCDEFGHIJKLMNOPQRSTU1VW2X</code>.</p>
    pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
        &self.identifier
    }
    /// Appends an item to `metric_queries`.
    ///
    /// To override the contents of this collection use [`set_metric_queries`](Self::set_metric_queries).
    ///
    /// <p>An array of one or more queries to perform. Each query must specify a Performance Insights metric and specify an aggregate function, and you can provide filtering criteria. You must append the aggregate function to the metric. For example, to find the average for the metric <code>db.load</code> you must use <code>db.load.avg</code>. Valid values for aggregate functions include <code>.avg</code>, <code>.min</code>, <code>.max</code>, and <code>.sum</code>.</p>
    pub fn metric_queries(mut self, input: crate::types::MetricQuery) -> Self {
        let mut v = self.metric_queries.unwrap_or_default();
        v.push(input);
        self.metric_queries = ::std::option::Option::Some(v);
        self
    }
    /// <p>An array of one or more queries to perform. Each query must specify a Performance Insights metric and specify an aggregate function, and you can provide filtering criteria. You must append the aggregate function to the metric. For example, to find the average for the metric <code>db.load</code> you must use <code>db.load.avg</code>. Valid values for aggregate functions include <code>.avg</code>, <code>.min</code>, <code>.max</code>, and <code>.sum</code>.</p>
    pub fn set_metric_queries(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::MetricQuery>>) -> Self {
        self.metric_queries = input;
        self
    }
    /// <p>An array of one or more queries to perform. Each query must specify a Performance Insights metric and specify an aggregate function, and you can provide filtering criteria. You must append the aggregate function to the metric. For example, to find the average for the metric <code>db.load</code> you must use <code>db.load.avg</code>. Valid values for aggregate functions include <code>.avg</code>, <code>.min</code>, <code>.max</code>, and <code>.sum</code>.</p>
    pub fn get_metric_queries(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::MetricQuery>> {
        &self.metric_queries
    }
    /// <p>The date and time specifying the beginning of the requested time series query range. You can't specify a <code>StartTime</code> that is earlier than 7 days ago. By default, Performance Insights has 7 days of retention, but you can extend this range up to 2 years. The value specified is <i>inclusive</i>. Thus, the command returns data points equal to or greater than <code>StartTime</code>.</p>
    /// <p>The value for <code>StartTime</code> must be earlier than the value for <code>EndTime</code>.</p>
    /// This field is required.
    pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.start_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date and time specifying the beginning of the requested time series query range. You can't specify a <code>StartTime</code> that is earlier than 7 days ago. By default, Performance Insights has 7 days of retention, but you can extend this range up to 2 years. The value specified is <i>inclusive</i>. Thus, the command returns data points equal to or greater than <code>StartTime</code>.</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.start_time = input;
        self
    }
    /// <p>The date and time specifying the beginning of the requested time series query range. You can't specify a <code>StartTime</code> that is earlier than 7 days ago. By default, Performance Insights has 7 days of retention, but you can extend this range up to 2 years. The value specified is <i>inclusive</i>. Thus, the command returns data points equal to or greater than <code>StartTime</code>.</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.start_time
    }
    /// <p>The date and time specifying the end of the requested time series query range. The value specified is <i>exclusive</i>. Thus, the command returns data points less than (but not equal to) <code>EndTime</code>.</p>
    /// <p>The value for <code>EndTime</code> must be later than the value for <code>StartTime</code>.</p>
    /// This field is required.
    pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.end_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date and time specifying the end of the requested time series query range. The value specified is <i>exclusive</i>. Thus, the command returns data points less than (but not equal to) <code>EndTime</code>.</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.end_time = input;
        self
    }
    /// <p>The date and time specifying the end of the requested time series query range. The value specified is <i>exclusive</i>. Thus, the command returns data points less than (but not equal to) <code>EndTime</code>.</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.end_time
    }
    /// <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 will choose 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.period_in_seconds = ::std::option::Option::Some(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 will choose 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.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 will choose 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.period_in_seconds
    }
    /// <p>The maximum number of items to return in the response.</p>
    pub fn max_results(mut self, input: i32) -> Self {
        self.max_results = ::std::option::Option::Some(input);
        self
    }
    /// <p>The maximum number of items to return in the response.</p>
    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
        self.max_results = input;
        self
    }
    /// <p>The maximum number of items to return in the response.</p>
    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
        &self.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.next_token = ::std::option::Option::Some(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.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.next_token
    }
    /// <p>The returned timestamp which is the start or end time of the time periods. The default value is <code>END_TIME</code>.</p>
    pub fn period_alignment(mut self, input: crate::types::PeriodAlignment) -> Self {
        self.period_alignment = ::std::option::Option::Some(input);
        self
    }
    /// <p>The returned timestamp which is the start or end time of the time periods. The default value is <code>END_TIME</code>.</p>
    pub fn set_period_alignment(mut self, input: ::std::option::Option<crate::types::PeriodAlignment>) -> Self {
        self.period_alignment = input;
        self
    }
    /// <p>The returned timestamp which is the start or end time of the time periods. The default value is <code>END_TIME</code>.</p>
    pub fn get_period_alignment(&self) -> &::std::option::Option<crate::types::PeriodAlignment> {
        &self.period_alignment
    }
    /// Consumes the builder and constructs a [`GetResourceMetricsInput`](crate::operation::get_resource_metrics::GetResourceMetricsInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::get_resource_metrics::GetResourceMetricsInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::get_resource_metrics::GetResourceMetricsInput {
            service_type: self.service_type,
            identifier: self.identifier,
            metric_queries: self.metric_queries,
            start_time: self.start_time,
            end_time: self.end_time,
            period_in_seconds: self.period_in_seconds,
            max_results: self.max_results,
            next_token: self.next_token,
            period_alignment: self.period_alignment,
        })
    }
}