// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::get_revenue_statistics::_get_revenue_statistics_input::GetRevenueStatisticsInputBuilder;
pub use crate::operation::get_revenue_statistics::_get_revenue_statistics_output::GetRevenueStatisticsOutputBuilder;
impl crate::operation::get_revenue_statistics::builders::GetRevenueStatisticsInputBuilder {
/// 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_revenue_statistics::GetRevenueStatisticsOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::get_revenue_statistics::GetRevenueStatisticsError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.get_revenue_statistics();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `GetRevenueStatistics`.
///
/// <p>Retrieves ranked monetization statistics. Use the <code>StatisticType</code> parameter to specify the ranking: <code>TOP_SOURCES_BY_REVENUE</code> for top sources by revenue, or <code>TOP_PATHS_BY_REVENUE</code> for top content paths by revenue. This operation is only available for <code>CLOUDFRONT</code> scope. The maximum supported time window is 90 days. When no <code>CurrencyMode</code> filter is provided, results default to <code>REAL</code>. To retrieve test data, include a <code>CurrencyMode</code> filter with the value <code>TEST</code>.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct GetRevenueStatisticsFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::get_revenue_statistics::builders::GetRevenueStatisticsInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::get_revenue_statistics::GetRevenueStatisticsOutput,
crate::operation::get_revenue_statistics::GetRevenueStatisticsError,
> for GetRevenueStatisticsFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::get_revenue_statistics::GetRevenueStatisticsOutput,
crate::operation::get_revenue_statistics::GetRevenueStatisticsError,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl GetRevenueStatisticsFluentBuilder {
/// Creates a new `GetRevenueStatisticsFluentBuilder`.
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 GetRevenueStatistics as a reference.
pub fn as_input(&self) -> &crate::operation::get_revenue_statistics::builders::GetRevenueStatisticsInputBuilder {
&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_revenue_statistics::GetRevenueStatisticsOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::get_revenue_statistics::GetRevenueStatisticsError,
::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_revenue_statistics::GetRevenueStatistics::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::get_revenue_statistics::GetRevenueStatistics::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_revenue_statistics::GetRevenueStatisticsOutput,
crate::operation::get_revenue_statistics::GetRevenueStatisticsError,
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
}
/// <p><code>TOP_SOURCES_BY_REVENUE</code> ranks revenue from AI bot traffic, grouped by the dimension you specify in the <code>GroupBy</code> parameter (<code>NAME</code>, <code>CATEGORY</code>, <code>INTENT</code>, <code>ORGANIZATION</code>, or <code>WEBACL</code>); <code>GroupBy</code> is required for this statistic type. <code>TOP_PATHS_BY_REVENUE</code> ranks revenue by path.</p>
pub fn statistic_type(mut self, input: crate::types::RankingStatisticType) -> Self {
self.inner = self.inner.statistic_type(input);
self
}
/// <p><code>TOP_SOURCES_BY_REVENUE</code> ranks revenue from AI bot traffic, grouped by the dimension you specify in the <code>GroupBy</code> parameter (<code>NAME</code>, <code>CATEGORY</code>, <code>INTENT</code>, <code>ORGANIZATION</code>, or <code>WEBACL</code>); <code>GroupBy</code> is required for this statistic type. <code>TOP_PATHS_BY_REVENUE</code> ranks revenue by path.</p>
pub fn set_statistic_type(mut self, input: ::std::option::Option<crate::types::RankingStatisticType>) -> Self {
self.inner = self.inner.set_statistic_type(input);
self
}
/// <p><code>TOP_SOURCES_BY_REVENUE</code> ranks revenue from AI bot traffic, grouped by the dimension you specify in the <code>GroupBy</code> parameter (<code>NAME</code>, <code>CATEGORY</code>, <code>INTENT</code>, <code>ORGANIZATION</code>, or <code>WEBACL</code>); <code>GroupBy</code> is required for this statistic type. <code>TOP_PATHS_BY_REVENUE</code> ranks revenue by path.</p>
pub fn get_statistic_type(&self) -> &::std::option::Option<crate::types::RankingStatisticType> {
self.inner.get_statistic_type()
}
/// <p>The time range for the query. Specify start and end timestamps.</p>
pub fn time_window(mut self, input: crate::types::TimeWindow) -> Self {
self.inner = self.inner.time_window(input);
self
}
/// <p>The time range for the query. Specify start and end timestamps.</p>
pub fn set_time_window(mut self, input: ::std::option::Option<crate::types::TimeWindow>) -> Self {
self.inner = self.inner.set_time_window(input);
self
}
/// <p>The time range for the query. Specify start and end timestamps.</p>
pub fn get_time_window(&self) -> &::std::option::Option<crate::types::TimeWindow> {
self.inner.get_time_window()
}
/// <p>Specifies whether this is for a Amazon CloudFront distribution (<code>CLOUDFRONT</code>) or for a regional application (<code>REGIONAL</code>).</p>
pub fn scope(mut self, input: crate::types::Scope) -> Self {
self.inner = self.inner.scope(input);
self
}
/// <p>Specifies whether this is for a Amazon CloudFront distribution (<code>CLOUDFRONT</code>) or for a regional application (<code>REGIONAL</code>).</p>
pub fn set_scope(mut self, input: ::std::option::Option<crate::types::Scope>) -> Self {
self.inner = self.inner.set_scope(input);
self
}
/// <p>Specifies whether this is for a Amazon CloudFront distribution (<code>CLOUDFRONT</code>) or for a regional application (<code>REGIONAL</code>).</p>
pub fn get_scope(&self) -> &::std::option::Option<crate::types::Scope> {
self.inner.get_scope()
}
/// <p>The currency for the revenue amounts in the response.</p>
pub fn currency(mut self, input: crate::types::Currency) -> Self {
self.inner = self.inner.currency(input);
self
}
/// <p>The currency for the revenue amounts in the response.</p>
pub fn set_currency(mut self, input: ::std::option::Option<crate::types::Currency>) -> Self {
self.inner = self.inner.set_currency(input);
self
}
/// <p>The currency for the revenue amounts in the response.</p>
pub fn get_currency(&self) -> &::std::option::Option<crate::types::Currency> {
self.inner.get_currency()
}
/// <p>The dimension to group results by: <code>NAME</code>, <code>CATEGORY</code>, <code>INTENT</code>, <code>ORGANIZATION</code>, or <code>WEBACL</code>. Required when <code>StatisticType</code> is <code>TOP_SOURCES_BY_REVENUE</code>. Not required for <code>TOP_PATHS_BY_REVENUE</code>, where results are grouped by content path. If <code>StatisticType</code> is <code>TOP_SOURCES_BY_REVENUE</code> and <code>GroupBy</code> is omitted, the request is rejected with a <code>WAFInvalidParameterException</code>.</p>
pub fn group_by(mut self, input: crate::types::GroupByType) -> Self {
self.inner = self.inner.group_by(input);
self
}
/// <p>The dimension to group results by: <code>NAME</code>, <code>CATEGORY</code>, <code>INTENT</code>, <code>ORGANIZATION</code>, or <code>WEBACL</code>. Required when <code>StatisticType</code> is <code>TOP_SOURCES_BY_REVENUE</code>. Not required for <code>TOP_PATHS_BY_REVENUE</code>, where results are grouped by content path. If <code>StatisticType</code> is <code>TOP_SOURCES_BY_REVENUE</code> and <code>GroupBy</code> is omitted, the request is rejected with a <code>WAFInvalidParameterException</code>.</p>
pub fn set_group_by(mut self, input: ::std::option::Option<crate::types::GroupByType>) -> Self {
self.inner = self.inner.set_group_by(input);
self
}
/// <p>The dimension to group results by: <code>NAME</code>, <code>CATEGORY</code>, <code>INTENT</code>, <code>ORGANIZATION</code>, or <code>WEBACL</code>. Required when <code>StatisticType</code> is <code>TOP_SOURCES_BY_REVENUE</code>. Not required for <code>TOP_PATHS_BY_REVENUE</code>, where results are grouped by content path. If <code>StatisticType</code> is <code>TOP_SOURCES_BY_REVENUE</code> and <code>GroupBy</code> is omitted, the request is rejected with a <code>WAFInvalidParameterException</code>.</p>
pub fn get_group_by(&self) -> &::std::option::Option<crate::types::GroupByType> {
self.inner.get_group_by()
}
///
/// Appends an item to `Filters`.
///
/// To override the contents of this collection use [`set_filters`](Self::set_filters).
///
/// <p>Optional filters to narrow the results.</p>
pub fn filters(mut self, input: crate::types::MonetizationFilter) -> Self {
self.inner = self.inner.filters(input);
self
}
/// <p>Optional filters to narrow the results.</p>
pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::MonetizationFilter>>) -> Self {
self.inner = self.inner.set_filters(input);
self
}
/// <p>Optional filters to narrow the results.</p>
pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::MonetizationFilter>> {
self.inner.get_filters()
}
/// <p>When you get a paginated response, this marker indicates that additional results are available. Use it in a subsequent request to retrieve the next page of results.</p>
pub fn next_marker(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.next_marker(input.into());
self
}
/// <p>When you get a paginated response, this marker indicates that additional results are available. Use it in a subsequent request to retrieve the next page of results.</p>
pub fn set_next_marker(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_next_marker(input);
self
}
/// <p>When you get a paginated response, this marker indicates that additional results are available. Use it in a subsequent request to retrieve the next page of results.</p>
pub fn get_next_marker(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_next_marker()
}
/// <p>The maximum number of results to return.</p>
pub fn limit(mut self, input: i32) -> Self {
self.inner = self.inner.limit(input);
self
}
/// <p>The maximum number of results to return.</p>
pub fn set_limit(mut self, input: ::std::option::Option<i32>) -> Self {
self.inner = self.inner.set_limit(input);
self
}
/// <p>The maximum number of results to return.</p>
pub fn get_limit(&self) -> &::std::option::Option<i32> {
self.inner.get_limit()
}
/// <p>The field to sort results by: <code>REVENUE</code>, <code>PERCENTAGE</code>, or <code>NAME</code>.</p>
pub fn sort_by(mut self, input: crate::types::RankingSortBy) -> Self {
self.inner = self.inner.sort_by(input);
self
}
/// <p>The field to sort results by: <code>REVENUE</code>, <code>PERCENTAGE</code>, or <code>NAME</code>.</p>
pub fn set_sort_by(mut self, input: ::std::option::Option<crate::types::RankingSortBy>) -> Self {
self.inner = self.inner.set_sort_by(input);
self
}
/// <p>The field to sort results by: <code>REVENUE</code>, <code>PERCENTAGE</code>, or <code>NAME</code>.</p>
pub fn get_sort_by(&self) -> &::std::option::Option<crate::types::RankingSortBy> {
self.inner.get_sort_by()
}
/// <p>The sort order: <code>ASC</code> for ascending or <code>DESC</code> for descending.</p>
pub fn sort_order(mut self, input: crate::types::SortOrder) -> Self {
self.inner = self.inner.sort_order(input);
self
}
/// <p>The sort order: <code>ASC</code> for ascending or <code>DESC</code> for descending.</p>
pub fn set_sort_order(mut self, input: ::std::option::Option<crate::types::SortOrder>) -> Self {
self.inner = self.inner.set_sort_order(input);
self
}
/// <p>The sort order: <code>ASC</code> for ascending or <code>DESC</code> for descending.</p>
pub fn get_sort_order(&self) -> &::std::option::Option<crate::types::SortOrder> {
self.inner.get_sort_order()
}
}