aws-sdk-costexplorer 1.121.0

AWS SDK for AWS Cost Explorer Service
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::get_anomalies::_get_anomalies_input::GetAnomaliesInputBuilder;

pub use crate::operation::get_anomalies::_get_anomalies_output::GetAnomaliesOutputBuilder;

impl crate::operation::get_anomalies::builders::GetAnomaliesInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::get_anomalies::GetAnomaliesOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::get_anomalies::GetAnomaliesError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.get_anomalies();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `GetAnomalies`.
///
/// <p>Retrieves all of the cost anomalies detected on your account during the time period that's specified by the <code>DateInterval</code> object. Anomalies are available for up to 90 days.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct GetAnomaliesFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::get_anomalies::builders::GetAnomaliesInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::get_anomalies::GetAnomaliesOutput,
        crate::operation::get_anomalies::GetAnomaliesError,
    > for GetAnomaliesFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::get_anomalies::GetAnomaliesOutput,
            crate::operation::get_anomalies::GetAnomaliesError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl GetAnomaliesFluentBuilder {
    /// Creates a new `GetAnomaliesFluentBuilder`.
    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 GetAnomalies as a reference.
    pub fn as_input(&self) -> &crate::operation::get_anomalies::builders::GetAnomaliesInputBuilder {
        &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::get_anomalies::GetAnomaliesOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::get_anomalies::GetAnomaliesError,
            ::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::get_anomalies::GetAnomalies::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::get_anomalies::GetAnomalies::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::get_anomalies::GetAnomaliesOutput,
        crate::operation::get_anomalies::GetAnomaliesError,
        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::get_anomalies::paginator::GetAnomaliesPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
    pub fn into_paginator(self) -> crate::operation::get_anomalies::paginator::GetAnomaliesPaginator {
        crate::operation::get_anomalies::paginator::GetAnomaliesPaginator::new(self.handle, self.inner)
    }
    /// <p>Retrieves all of the cost anomalies detected for a specific cost anomaly monitor Amazon Resource Name (ARN).</p>
    pub fn monitor_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.monitor_arn(input.into());
        self
    }
    /// <p>Retrieves all of the cost anomalies detected for a specific cost anomaly monitor Amazon Resource Name (ARN).</p>
    pub fn set_monitor_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_monitor_arn(input);
        self
    }
    /// <p>Retrieves all of the cost anomalies detected for a specific cost anomaly monitor Amazon Resource Name (ARN).</p>
    pub fn get_monitor_arn(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_monitor_arn()
    }
    /// <p>Assigns the start and end dates for retrieving cost anomalies. The returned anomaly object will have an <code>AnomalyEndDate</code> in the specified time range.</p>
    pub fn date_interval(mut self, input: crate::types::AnomalyDateInterval) -> Self {
        self.inner = self.inner.date_interval(input);
        self
    }
    /// <p>Assigns the start and end dates for retrieving cost anomalies. The returned anomaly object will have an <code>AnomalyEndDate</code> in the specified time range.</p>
    pub fn set_date_interval(mut self, input: ::std::option::Option<crate::types::AnomalyDateInterval>) -> Self {
        self.inner = self.inner.set_date_interval(input);
        self
    }
    /// <p>Assigns the start and end dates for retrieving cost anomalies. The returned anomaly object will have an <code>AnomalyEndDate</code> in the specified time range.</p>
    pub fn get_date_interval(&self) -> &::std::option::Option<crate::types::AnomalyDateInterval> {
        self.inner.get_date_interval()
    }
    /// <p>Filters anomaly results by the feedback field on the anomaly object.</p>
    pub fn feedback(mut self, input: crate::types::AnomalyFeedbackType) -> Self {
        self.inner = self.inner.feedback(input);
        self
    }
    /// <p>Filters anomaly results by the feedback field on the anomaly object.</p>
    pub fn set_feedback(mut self, input: ::std::option::Option<crate::types::AnomalyFeedbackType>) -> Self {
        self.inner = self.inner.set_feedback(input);
        self
    }
    /// <p>Filters anomaly results by the feedback field on the anomaly object.</p>
    pub fn get_feedback(&self) -> &::std::option::Option<crate::types::AnomalyFeedbackType> {
        self.inner.get_feedback()
    }
    /// <p>Filters anomaly results by the total impact field on the anomaly object. For example, you can filter anomalies <code>GREATER_THAN 200.00</code> to retrieve anomalies, with an estimated dollar impact greater than 200.</p>
    pub fn total_impact(mut self, input: crate::types::TotalImpactFilter) -> Self {
        self.inner = self.inner.total_impact(input);
        self
    }
    /// <p>Filters anomaly results by the total impact field on the anomaly object. For example, you can filter anomalies <code>GREATER_THAN 200.00</code> to retrieve anomalies, with an estimated dollar impact greater than 200.</p>
    pub fn set_total_impact(mut self, input: ::std::option::Option<crate::types::TotalImpactFilter>) -> Self {
        self.inner = self.inner.set_total_impact(input);
        self
    }
    /// <p>Filters anomaly results by the total impact field on the anomaly object. For example, you can filter anomalies <code>GREATER_THAN 200.00</code> to retrieve anomalies, with an estimated dollar impact greater than 200.</p>
    pub fn get_total_impact(&self) -> &::std::option::Option<crate::types::TotalImpactFilter> {
        self.inner.get_total_impact()
    }
    /// <p>The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.</p>
    pub fn next_page_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.next_page_token(input.into());
        self
    }
    /// <p>The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.</p>
    pub fn set_next_page_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_next_page_token(input);
        self
    }
    /// <p>The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.</p>
    pub fn get_next_page_token(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_next_page_token()
    }
    /// <p>The number of entries a paginated response contains.</p>
    pub fn max_results(mut self, input: i32) -> Self {
        self.inner = self.inner.max_results(input);
        self
    }
    /// <p>The number of entries a paginated response contains.</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 number of entries a paginated response contains.</p>
    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
        self.inner.get_max_results()
    }
}