aws_sdk_waf/operation/put_logging_configuration/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::put_logging_configuration::_put_logging_configuration_output::PutLoggingConfigurationOutputBuilder;
3
4pub use crate::operation::put_logging_configuration::_put_logging_configuration_input::PutLoggingConfigurationInputBuilder;
5
6impl crate::operation::put_logging_configuration::builders::PutLoggingConfigurationInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::put_logging_configuration::PutLoggingConfigurationOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::put_logging_configuration::PutLoggingConfigurationError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.put_logging_configuration();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `PutLoggingConfiguration`.
24///
25/// <note>
26/// <p>This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS WAF Classic</a> in the developer guide.</p>
27/// <p><b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints for regional and global use.</p>
28/// </note>
29/// <p>Associates a <code>LoggingConfiguration</code> with a specified web ACL.</p>
30/// <p>You can access information about all traffic that AWS WAF inspects using the following steps:</p>
31/// <ol>
32/// <li>
33/// <p>Create an Amazon Kinesis Data Firehose.</p>
34/// <p>Create the data firehose with a PUT source and in the region that you are operating. However, if you are capturing logs for Amazon CloudFront, always create the firehose in US East (N. Virginia).</p><note>
35/// <p>Do not create the data firehose using a <code>Kinesis stream</code> as your source.</p>
36/// </note></li>
37/// <li>
38/// <p>Associate that firehose to your web ACL using a <code>PutLoggingConfiguration</code> request.</p></li>
39/// </ol>
40/// <p>When you successfully enable logging using a <code>PutLoggingConfiguration</code> request, AWS WAF will create a service linked role with the necessary permissions to write logs to the Amazon Kinesis Data Firehose. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/logging.html">Logging Web ACL Traffic Information</a> in the <i>AWS WAF Developer Guide</i>.</p>
41#[derive(::std::clone::Clone, ::std::fmt::Debug)]
42pub struct PutLoggingConfigurationFluentBuilder {
43    handle: ::std::sync::Arc<crate::client::Handle>,
44    inner: crate::operation::put_logging_configuration::builders::PutLoggingConfigurationInputBuilder,
45    config_override: ::std::option::Option<crate::config::Builder>,
46}
47impl
48    crate::client::customize::internal::CustomizableSend<
49        crate::operation::put_logging_configuration::PutLoggingConfigurationOutput,
50        crate::operation::put_logging_configuration::PutLoggingConfigurationError,
51    > for PutLoggingConfigurationFluentBuilder
52{
53    fn send(
54        self,
55        config_override: crate::config::Builder,
56    ) -> crate::client::customize::internal::BoxFuture<
57        crate::client::customize::internal::SendResult<
58            crate::operation::put_logging_configuration::PutLoggingConfigurationOutput,
59            crate::operation::put_logging_configuration::PutLoggingConfigurationError,
60        >,
61    > {
62        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
63    }
64}
65impl PutLoggingConfigurationFluentBuilder {
66    /// Creates a new `PutLoggingConfigurationFluentBuilder`.
67    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
68        Self {
69            handle,
70            inner: ::std::default::Default::default(),
71            config_override: ::std::option::Option::None,
72        }
73    }
74    /// Access the PutLoggingConfiguration as a reference.
75    pub fn as_input(&self) -> &crate::operation::put_logging_configuration::builders::PutLoggingConfigurationInputBuilder {
76        &self.inner
77    }
78    /// Sends the request and returns the response.
79    ///
80    /// If an error occurs, an `SdkError` will be returned with additional details that
81    /// can be matched against.
82    ///
83    /// By default, any retryable failures will be retried twice. Retry behavior
84    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
85    /// set when configuring the client.
86    pub async fn send(
87        self,
88    ) -> ::std::result::Result<
89        crate::operation::put_logging_configuration::PutLoggingConfigurationOutput,
90        ::aws_smithy_runtime_api::client::result::SdkError<
91            crate::operation::put_logging_configuration::PutLoggingConfigurationError,
92            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
93        >,
94    > {
95        let input = self
96            .inner
97            .build()
98            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
99        let runtime_plugins = crate::operation::put_logging_configuration::PutLoggingConfiguration::operation_runtime_plugins(
100            self.handle.runtime_plugins.clone(),
101            &self.handle.conf,
102            self.config_override,
103        );
104        crate::operation::put_logging_configuration::PutLoggingConfiguration::orchestrate(&runtime_plugins, input).await
105    }
106
107    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
108    pub fn customize(
109        self,
110    ) -> crate::client::customize::CustomizableOperation<
111        crate::operation::put_logging_configuration::PutLoggingConfigurationOutput,
112        crate::operation::put_logging_configuration::PutLoggingConfigurationError,
113        Self,
114    > {
115        crate::client::customize::CustomizableOperation::new(self)
116    }
117    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
118        self.set_config_override(::std::option::Option::Some(config_override.into()));
119        self
120    }
121
122    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
123        self.config_override = config_override;
124        self
125    }
126    /// <p>The Amazon Kinesis Data Firehose that contains the inspected traffic information, the redacted fields details, and the Amazon Resource Name (ARN) of the web ACL to monitor.</p><note>
127    /// <p>When specifying <code>Type</code> in <code>RedactedFields</code>, you must use one of the following values: <code>URI</code>, <code>QUERY_STRING</code>, <code>HEADER</code>, or <code>METHOD</code>.</p>
128    /// </note>
129    pub fn logging_configuration(mut self, input: crate::types::LoggingConfiguration) -> Self {
130        self.inner = self.inner.logging_configuration(input);
131        self
132    }
133    /// <p>The Amazon Kinesis Data Firehose that contains the inspected traffic information, the redacted fields details, and the Amazon Resource Name (ARN) of the web ACL to monitor.</p><note>
134    /// <p>When specifying <code>Type</code> in <code>RedactedFields</code>, you must use one of the following values: <code>URI</code>, <code>QUERY_STRING</code>, <code>HEADER</code>, or <code>METHOD</code>.</p>
135    /// </note>
136    pub fn set_logging_configuration(mut self, input: ::std::option::Option<crate::types::LoggingConfiguration>) -> Self {
137        self.inner = self.inner.set_logging_configuration(input);
138        self
139    }
140    /// <p>The Amazon Kinesis Data Firehose that contains the inspected traffic information, the redacted fields details, and the Amazon Resource Name (ARN) of the web ACL to monitor.</p><note>
141    /// <p>When specifying <code>Type</code> in <code>RedactedFields</code>, you must use one of the following values: <code>URI</code>, <code>QUERY_STRING</code>, <code>HEADER</code>, or <code>METHOD</code>.</p>
142    /// </note>
143    pub fn get_logging_configuration(&self) -> &::std::option::Option<crate::types::LoggingConfiguration> {
144        self.inner.get_logging_configuration()
145    }
146}