aws-sdk-wafv2 1.130.0

AWS SDK for AWS WAFV2
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::get_top_path_statistics_by_traffic::_get_top_path_statistics_by_traffic_input::GetTopPathStatisticsByTrafficInputBuilder;

pub use crate::operation::get_top_path_statistics_by_traffic::_get_top_path_statistics_by_traffic_output::GetTopPathStatisticsByTrafficOutputBuilder;

impl crate::operation::get_top_path_statistics_by_traffic::builders::GetTopPathStatisticsByTrafficInputBuilder {
    /// 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_top_path_statistics_by_traffic::GetTopPathStatisticsByTrafficOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::get_top_path_statistics_by_traffic::GetTopPathStatisticsByTrafficError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.get_top_path_statistics_by_traffic();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `GetTopPathStatisticsByTraffic`.
///
/// <p>Retrieves aggregated statistics about the top URI paths accessed by bot traffic for a specified web ACL and time window. You can use this operation to analyze which paths on your web application receive the most bot traffic and identify the specific bots accessing those paths. The operation supports filtering by bot category, organization, or name, and allows you to drill down into specific path prefixes to view detailed URI-level statistics.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct GetTopPathStatisticsByTrafficFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::get_top_path_statistics_by_traffic::builders::GetTopPathStatisticsByTrafficInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::get_top_path_statistics_by_traffic::GetTopPathStatisticsByTrafficOutput,
        crate::operation::get_top_path_statistics_by_traffic::GetTopPathStatisticsByTrafficError,
    > for GetTopPathStatisticsByTrafficFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::get_top_path_statistics_by_traffic::GetTopPathStatisticsByTrafficOutput,
            crate::operation::get_top_path_statistics_by_traffic::GetTopPathStatisticsByTrafficError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl GetTopPathStatisticsByTrafficFluentBuilder {
    /// Creates a new `GetTopPathStatisticsByTrafficFluentBuilder`.
    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 GetTopPathStatisticsByTraffic as a reference.
    pub fn as_input(&self) -> &crate::operation::get_top_path_statistics_by_traffic::builders::GetTopPathStatisticsByTrafficInputBuilder {
        &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_top_path_statistics_by_traffic::GetTopPathStatisticsByTrafficOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::get_top_path_statistics_by_traffic::GetTopPathStatisticsByTrafficError,
            ::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_top_path_statistics_by_traffic::GetTopPathStatisticsByTraffic::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::get_top_path_statistics_by_traffic::GetTopPathStatisticsByTraffic::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_top_path_statistics_by_traffic::GetTopPathStatisticsByTrafficOutput,
        crate::operation::get_top_path_statistics_by_traffic::GetTopPathStatisticsByTrafficError,
        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>The Amazon Resource Name (ARN) of the web ACL for which you want to retrieve path statistics.</p>
    pub fn web_acl_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.web_acl_arn(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the web ACL for which you want to retrieve path statistics.</p>
    pub fn set_web_acl_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_web_acl_arn(input);
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the web ACL for which you want to retrieve path statistics.</p>
    pub fn get_web_acl_arn(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_web_acl_arn()
    }
    /// <p>Specifies whether the web ACL is for an Amazon Web Services CloudFront distribution or for a regional application. A regional application can be an Application Load Balancer, an AppSync GraphQL API, an Amazon Cognito user pool, an Amazon Web Services App Runner service, or an Amazon Web Services Verified Access instance.</p>
    pub fn scope(mut self, input: crate::types::Scope) -> Self {
        self.inner = self.inner.scope(input);
        self
    }
    /// <p>Specifies whether the web ACL is for an Amazon Web Services CloudFront distribution or for a regional application. A regional application can be an Application Load Balancer, an AppSync GraphQL API, an Amazon Cognito user pool, an Amazon Web Services App Runner service, or an Amazon Web Services Verified Access instance.</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 the web ACL is for an Amazon Web Services CloudFront distribution or for a regional application. A regional application can be an Application Load Balancer, an AppSync GraphQL API, an Amazon Cognito user pool, an Amazon Web Services App Runner service, or an Amazon Web Services Verified Access instance.</p>
    pub fn get_scope(&self) -> &::std::option::Option<crate::types::Scope> {
        self.inner.get_scope()
    }
    /// <p>A URI path prefix to filter the results. When you specify this parameter, the operation returns statistics for individual URIs within the specified path prefix. For example, if you specify <code>/api</code>, the response includes statistics for paths like <code>/api/v1/users</code> and <code>/api/v2/orders</code>. If you don't specify this parameter, the operation returns top-level path statistics.</p>
    pub fn uri_path_prefix(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.uri_path_prefix(input.into());
        self
    }
    /// <p>A URI path prefix to filter the results. When you specify this parameter, the operation returns statistics for individual URIs within the specified path prefix. For example, if you specify <code>/api</code>, the response includes statistics for paths like <code>/api/v1/users</code> and <code>/api/v2/orders</code>. If you don't specify this parameter, the operation returns top-level path statistics.</p>
    pub fn set_uri_path_prefix(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_uri_path_prefix(input);
        self
    }
    /// <p>A URI path prefix to filter the results. When you specify this parameter, the operation returns statistics for individual URIs within the specified path prefix. For example, if you specify <code>/api</code>, the response includes statistics for paths like <code>/api/v1/users</code> and <code>/api/v2/orders</code>. If you don't specify this parameter, the operation returns top-level path statistics.</p>
    pub fn get_uri_path_prefix(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_uri_path_prefix()
    }
    /// <p>The time window for which you want to retrieve path statistics. The time window must be within the data retention period for your web ACL.</p>
    pub fn time_window(mut self, input: crate::types::TimeWindow) -> Self {
        self.inner = self.inner.time_window(input);
        self
    }
    /// <p>The time window for which you want to retrieve path statistics. The time window must be within the data retention period for your web ACL.</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 window for which you want to retrieve path statistics. The time window must be within the data retention period for your web ACL.</p>
    pub fn get_time_window(&self) -> &::std::option::Option<crate::types::TimeWindow> {
        self.inner.get_time_window()
    }
    /// <p>Filters the results to include only traffic from bots in the specified category. For example, you can filter by <code>ai</code> to see only AI crawler traffic, or <code>search_engine</code> to see only search engine bot traffic. When you apply this filter, the <code>Source</code> field is populated in the response.</p>
    pub fn bot_category(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.bot_category(input.into());
        self
    }
    /// <p>Filters the results to include only traffic from bots in the specified category. For example, you can filter by <code>ai</code> to see only AI crawler traffic, or <code>search_engine</code> to see only search engine bot traffic. When you apply this filter, the <code>Source</code> field is populated in the response.</p>
    pub fn set_bot_category(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_bot_category(input);
        self
    }
    /// <p>Filters the results to include only traffic from bots in the specified category. For example, you can filter by <code>ai</code> to see only AI crawler traffic, or <code>search_engine</code> to see only search engine bot traffic. When you apply this filter, the <code>Source</code> field is populated in the response.</p>
    pub fn get_bot_category(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_bot_category()
    }
    /// <p>Filters the results to include only traffic from bots belonging to the specified organization. For example, you can filter by <code>openai</code> or <code>google</code>. When you apply this filter, the <code>Source</code> field is populated in the response.</p>
    pub fn bot_organization(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.bot_organization(input.into());
        self
    }
    /// <p>Filters the results to include only traffic from bots belonging to the specified organization. For example, you can filter by <code>openai</code> or <code>google</code>. When you apply this filter, the <code>Source</code> field is populated in the response.</p>
    pub fn set_bot_organization(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_bot_organization(input);
        self
    }
    /// <p>Filters the results to include only traffic from bots belonging to the specified organization. For example, you can filter by <code>openai</code> or <code>google</code>. When you apply this filter, the <code>Source</code> field is populated in the response.</p>
    pub fn get_bot_organization(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_bot_organization()
    }
    /// <p>Filters the results to include only traffic from the specified bot. For example, you can filter by <code>gptbot</code> or <code>googlebot</code>. When you apply this filter, the <code>Source</code> field is populated in the response.</p>
    pub fn bot_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.bot_name(input.into());
        self
    }
    /// <p>Filters the results to include only traffic from the specified bot. For example, you can filter by <code>gptbot</code> or <code>googlebot</code>. When you apply this filter, the <code>Source</code> field is populated in the response.</p>
    pub fn set_bot_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_bot_name(input);
        self
    }
    /// <p>Filters the results to include only traffic from the specified bot. For example, you can filter by <code>gptbot</code> or <code>googlebot</code>. When you apply this filter, the <code>Source</code> field is populated in the response.</p>
    pub fn get_bot_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_bot_name()
    }
    /// <p>The maximum number of path statistics to return. Valid values are 1 to 100.</p>
    pub fn limit(mut self, input: i32) -> Self {
        self.inner = self.inner.limit(input);
        self
    }
    /// <p>The maximum number of path statistics to return. Valid values are 1 to 100.</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 path statistics to return. Valid values are 1 to 100.</p>
    pub fn get_limit(&self) -> &::std::option::Option<i32> {
        self.inner.get_limit()
    }
    /// <p>The maximum number of top bots to include in the statistics for each path. Valid values are 1 to 10.</p>
    pub fn number_of_top_traffic_bots_per_path(mut self, input: i32) -> Self {
        self.inner = self.inner.number_of_top_traffic_bots_per_path(input);
        self
    }
    /// <p>The maximum number of top bots to include in the statistics for each path. Valid values are 1 to 10.</p>
    pub fn set_number_of_top_traffic_bots_per_path(mut self, input: ::std::option::Option<i32>) -> Self {
        self.inner = self.inner.set_number_of_top_traffic_bots_per_path(input);
        self
    }
    /// <p>The maximum number of top bots to include in the statistics for each path. Valid values are 1 to 10.</p>
    pub fn get_number_of_top_traffic_bots_per_path(&self) -> &::std::option::Option<i32> {
        self.inner.get_number_of_top_traffic_bots_per_path()
    }
    /// <p>When you request a list of objects with a <code>Limit</code> setting, if the number of objects that are still available for retrieval exceeds the limit, WAF returns a <code>NextMarker</code> value in the response. To retrieve the next batch of objects, provide the marker from the prior call in your next request.</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 request a list of objects with a <code>Limit</code> setting, if the number of objects that are still available for retrieval exceeds the limit, WAF returns a <code>NextMarker</code> value in the response. To retrieve the next batch of objects, provide the marker from the prior call in your next request.</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 request a list of objects with a <code>Limit</code> setting, if the number of objects that are still available for retrieval exceeds the limit, WAF returns a <code>NextMarker</code> value in the response. To retrieve the next batch of objects, provide the marker from the prior call in your next request.</p>
    pub fn get_next_marker(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_next_marker()
    }
}