aws_sdk_waf/operation/get_rule/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_rule::_get_rule_output::GetRuleOutputBuilder;
3
4pub use crate::operation::get_rule::_get_rule_input::GetRuleInputBuilder;
5
6impl crate::operation::get_rule::builders::GetRuleInputBuilder {
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::get_rule::GetRuleOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_rule::GetRuleError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_rule();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetRule`.
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>Returns the <code>Rule</code> that is specified by the <code>RuleId</code> that you included in the <code>GetRule</code> request.</p>
30#[derive(::std::clone::Clone, ::std::fmt::Debug)]
31pub struct GetRuleFluentBuilder {
32    handle: ::std::sync::Arc<crate::client::Handle>,
33    inner: crate::operation::get_rule::builders::GetRuleInputBuilder,
34    config_override: ::std::option::Option<crate::config::Builder>,
35}
36impl crate::client::customize::internal::CustomizableSend<crate::operation::get_rule::GetRuleOutput, crate::operation::get_rule::GetRuleError>
37    for GetRuleFluentBuilder
38{
39    fn send(
40        self,
41        config_override: crate::config::Builder,
42    ) -> crate::client::customize::internal::BoxFuture<
43        crate::client::customize::internal::SendResult<crate::operation::get_rule::GetRuleOutput, crate::operation::get_rule::GetRuleError>,
44    > {
45        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
46    }
47}
48impl GetRuleFluentBuilder {
49    /// Creates a new `GetRuleFluentBuilder`.
50    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
51        Self {
52            handle,
53            inner: ::std::default::Default::default(),
54            config_override: ::std::option::Option::None,
55        }
56    }
57    /// Access the GetRule as a reference.
58    pub fn as_input(&self) -> &crate::operation::get_rule::builders::GetRuleInputBuilder {
59        &self.inner
60    }
61    /// Sends the request and returns the response.
62    ///
63    /// If an error occurs, an `SdkError` will be returned with additional details that
64    /// can be matched against.
65    ///
66    /// By default, any retryable failures will be retried twice. Retry behavior
67    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
68    /// set when configuring the client.
69    pub async fn send(
70        self,
71    ) -> ::std::result::Result<
72        crate::operation::get_rule::GetRuleOutput,
73        ::aws_smithy_runtime_api::client::result::SdkError<
74            crate::operation::get_rule::GetRuleError,
75            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
76        >,
77    > {
78        let input = self
79            .inner
80            .build()
81            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
82        let runtime_plugins = crate::operation::get_rule::GetRule::operation_runtime_plugins(
83            self.handle.runtime_plugins.clone(),
84            &self.handle.conf,
85            self.config_override,
86        );
87        crate::operation::get_rule::GetRule::orchestrate(&runtime_plugins, input).await
88    }
89
90    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
91    pub fn customize(
92        self,
93    ) -> crate::client::customize::CustomizableOperation<crate::operation::get_rule::GetRuleOutput, crate::operation::get_rule::GetRuleError, Self>
94    {
95        crate::client::customize::CustomizableOperation::new(self)
96    }
97    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
98        self.set_config_override(::std::option::Option::Some(config_override.into()));
99        self
100    }
101
102    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
103        self.config_override = config_override;
104        self
105    }
106    /// <p>The <code>RuleId</code> of the <code>Rule</code> that you want to get. <code>RuleId</code> is returned by <code>CreateRule</code> and by <code>ListRules</code>.</p>
107    pub fn rule_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
108        self.inner = self.inner.rule_id(input.into());
109        self
110    }
111    /// <p>The <code>RuleId</code> of the <code>Rule</code> that you want to get. <code>RuleId</code> is returned by <code>CreateRule</code> and by <code>ListRules</code>.</p>
112    pub fn set_rule_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
113        self.inner = self.inner.set_rule_id(input);
114        self
115    }
116    /// <p>The <code>RuleId</code> of the <code>Rule</code> that you want to get. <code>RuleId</code> is returned by <code>CreateRule</code> and by <code>ListRules</code>.</p>
117    pub fn get_rule_id(&self) -> &::std::option::Option<::std::string::String> {
118        self.inner.get_rule_id()
119    }
120}