aws_sdk_waf/operation/get_ip_set/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_ip_set::_get_ip_set_output::GetIpSetOutputBuilder;
3
4pub use crate::operation::get_ip_set::_get_ip_set_input::GetIpSetInputBuilder;
5
6impl crate::operation::get_ip_set::builders::GetIpSetInputBuilder {
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_ip_set::GetIpSetOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_ip_set::GetIPSetError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_ip_set();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetIPSet`.
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>IPSet</code> that is specified by <code>IPSetId</code>.</p>
30#[derive(::std::clone::Clone, ::std::fmt::Debug)]
31pub struct GetIPSetFluentBuilder {
32    handle: ::std::sync::Arc<crate::client::Handle>,
33    inner: crate::operation::get_ip_set::builders::GetIpSetInputBuilder,
34    config_override: ::std::option::Option<crate::config::Builder>,
35}
36impl crate::client::customize::internal::CustomizableSend<crate::operation::get_ip_set::GetIpSetOutput, crate::operation::get_ip_set::GetIPSetError>
37    for GetIPSetFluentBuilder
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_ip_set::GetIpSetOutput, crate::operation::get_ip_set::GetIPSetError>,
44    > {
45        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
46    }
47}
48impl GetIPSetFluentBuilder {
49    /// Creates a new `GetIPSetFluentBuilder`.
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 GetIPSet as a reference.
58    pub fn as_input(&self) -> &crate::operation::get_ip_set::builders::GetIpSetInputBuilder {
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_ip_set::GetIpSetOutput,
73        ::aws_smithy_runtime_api::client::result::SdkError<
74            crate::operation::get_ip_set::GetIPSetError,
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_ip_set::GetIPSet::operation_runtime_plugins(
83            self.handle.runtime_plugins.clone(),
84            &self.handle.conf,
85            self.config_override,
86        );
87        crate::operation::get_ip_set::GetIPSet::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<
94        crate::operation::get_ip_set::GetIpSetOutput,
95        crate::operation::get_ip_set::GetIPSetError,
96        Self,
97    > {
98        crate::client::customize::CustomizableOperation::new(self)
99    }
100    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
101        self.set_config_override(::std::option::Option::Some(config_override.into()));
102        self
103    }
104
105    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
106        self.config_override = config_override;
107        self
108    }
109    /// <p>The <code>IPSetId</code> of the <code>IPSet</code> that you want to get. <code>IPSetId</code> is returned by <code>CreateIPSet</code> and by <code>ListIPSets</code>.</p>
110    pub fn ip_set_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
111        self.inner = self.inner.ip_set_id(input.into());
112        self
113    }
114    /// <p>The <code>IPSetId</code> of the <code>IPSet</code> that you want to get. <code>IPSetId</code> is returned by <code>CreateIPSet</code> and by <code>ListIPSets</code>.</p>
115    pub fn set_ip_set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
116        self.inner = self.inner.set_ip_set_id(input);
117        self
118    }
119    /// <p>The <code>IPSetId</code> of the <code>IPSet</code> that you want to get. <code>IPSetId</code> is returned by <code>CreateIPSet</code> and by <code>ListIPSets</code>.</p>
120    pub fn get_ip_set_id(&self) -> &::std::option::Option<::std::string::String> {
121        self.inner.get_ip_set_id()
122    }
123}