aws_sdk_networkfirewall/operation/start_flow_flush/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::start_flow_flush::_start_flow_flush_output::StartFlowFlushOutputBuilder;
3
4pub use crate::operation::start_flow_flush::_start_flow_flush_input::StartFlowFlushInputBuilder;
5
6impl crate::operation::start_flow_flush::builders::StartFlowFlushInputBuilder {
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::start_flow_flush::StartFlowFlushOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::start_flow_flush::StartFlowFlushError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.start_flow_flush();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `StartFlowFlush`.
24///
25/// <p>Begins the flushing of traffic from the firewall, according to the filters you define. When the operation starts, impacted flows are temporarily marked as timed out before the Suricata engine prunes, or flushes, the flows from the firewall table.</p><important>
26/// <p>While the flush completes, impacted flows are processed as midstream traffic. This may result in a temporary increase in midstream traffic metrics. We recommend that you double check your stream exception policy before you perform a flush operation.</p>
27/// </important>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct StartFlowFlushFluentBuilder {
30    handle: ::std::sync::Arc<crate::client::Handle>,
31    inner: crate::operation::start_flow_flush::builders::StartFlowFlushInputBuilder,
32    config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35    crate::client::customize::internal::CustomizableSend<
36        crate::operation::start_flow_flush::StartFlowFlushOutput,
37        crate::operation::start_flow_flush::StartFlowFlushError,
38    > for StartFlowFlushFluentBuilder
39{
40    fn send(
41        self,
42        config_override: crate::config::Builder,
43    ) -> crate::client::customize::internal::BoxFuture<
44        crate::client::customize::internal::SendResult<
45            crate::operation::start_flow_flush::StartFlowFlushOutput,
46            crate::operation::start_flow_flush::StartFlowFlushError,
47        >,
48    > {
49        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50    }
51}
52impl StartFlowFlushFluentBuilder {
53    /// Creates a new `StartFlowFlushFluentBuilder`.
54    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
55        Self {
56            handle,
57            inner: ::std::default::Default::default(),
58            config_override: ::std::option::Option::None,
59        }
60    }
61    /// Access the StartFlowFlush as a reference.
62    pub fn as_input(&self) -> &crate::operation::start_flow_flush::builders::StartFlowFlushInputBuilder {
63        &self.inner
64    }
65    /// Sends the request and returns the response.
66    ///
67    /// If an error occurs, an `SdkError` will be returned with additional details that
68    /// can be matched against.
69    ///
70    /// By default, any retryable failures will be retried twice. Retry behavior
71    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
72    /// set when configuring the client.
73    pub async fn send(
74        self,
75    ) -> ::std::result::Result<
76        crate::operation::start_flow_flush::StartFlowFlushOutput,
77        ::aws_smithy_runtime_api::client::result::SdkError<
78            crate::operation::start_flow_flush::StartFlowFlushError,
79            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
80        >,
81    > {
82        let input = self
83            .inner
84            .build()
85            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
86        let runtime_plugins = crate::operation::start_flow_flush::StartFlowFlush::operation_runtime_plugins(
87            self.handle.runtime_plugins.clone(),
88            &self.handle.conf,
89            self.config_override,
90        );
91        crate::operation::start_flow_flush::StartFlowFlush::orchestrate(&runtime_plugins, input).await
92    }
93
94    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
95    pub fn customize(
96        self,
97    ) -> crate::client::customize::CustomizableOperation<
98        crate::operation::start_flow_flush::StartFlowFlushOutput,
99        crate::operation::start_flow_flush::StartFlowFlushError,
100        Self,
101    > {
102        crate::client::customize::CustomizableOperation::new(self)
103    }
104    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
105        self.set_config_override(::std::option::Option::Some(config_override.into()));
106        self
107    }
108
109    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
110        self.config_override = config_override;
111        self
112    }
113    /// <p>The Amazon Resource Name (ARN) of the firewall.</p>
114    pub fn firewall_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115        self.inner = self.inner.firewall_arn(input.into());
116        self
117    }
118    /// <p>The Amazon Resource Name (ARN) of the firewall.</p>
119    pub fn set_firewall_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120        self.inner = self.inner.set_firewall_arn(input);
121        self
122    }
123    /// <p>The Amazon Resource Name (ARN) of the firewall.</p>
124    pub fn get_firewall_arn(&self) -> &::std::option::Option<::std::string::String> {
125        self.inner.get_firewall_arn()
126    }
127    /// <p>The ID of the Availability Zone where the firewall is located. For example, <code>us-east-2a</code>.</p>
128    /// <p>Defines the scope a flow operation. You can use up to 20 filters to configure a single flow operation.</p>
129    pub fn availability_zone(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130        self.inner = self.inner.availability_zone(input.into());
131        self
132    }
133    /// <p>The ID of the Availability Zone where the firewall is located. For example, <code>us-east-2a</code>.</p>
134    /// <p>Defines the scope a flow operation. You can use up to 20 filters to configure a single flow operation.</p>
135    pub fn set_availability_zone(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136        self.inner = self.inner.set_availability_zone(input);
137        self
138    }
139    /// <p>The ID of the Availability Zone where the firewall is located. For example, <code>us-east-2a</code>.</p>
140    /// <p>Defines the scope a flow operation. You can use up to 20 filters to configure a single flow operation.</p>
141    pub fn get_availability_zone(&self) -> &::std::option::Option<::std::string::String> {
142        self.inner.get_availability_zone()
143    }
144    /// <p>The Amazon Resource Name (ARN) of a VPC endpoint association.</p>
145    pub fn vpc_endpoint_association_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
146        self.inner = self.inner.vpc_endpoint_association_arn(input.into());
147        self
148    }
149    /// <p>The Amazon Resource Name (ARN) of a VPC endpoint association.</p>
150    pub fn set_vpc_endpoint_association_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
151        self.inner = self.inner.set_vpc_endpoint_association_arn(input);
152        self
153    }
154    /// <p>The Amazon Resource Name (ARN) of a VPC endpoint association.</p>
155    pub fn get_vpc_endpoint_association_arn(&self) -> &::std::option::Option<::std::string::String> {
156        self.inner.get_vpc_endpoint_association_arn()
157    }
158    /// <p>A unique identifier for the primary endpoint associated with a firewall.</p>
159    pub fn vpc_endpoint_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
160        self.inner = self.inner.vpc_endpoint_id(input.into());
161        self
162    }
163    /// <p>A unique identifier for the primary endpoint associated with a firewall.</p>
164    pub fn set_vpc_endpoint_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
165        self.inner = self.inner.set_vpc_endpoint_id(input);
166        self
167    }
168    /// <p>A unique identifier for the primary endpoint associated with a firewall.</p>
169    pub fn get_vpc_endpoint_id(&self) -> &::std::option::Option<::std::string::String> {
170        self.inner.get_vpc_endpoint_id()
171    }
172    /// <p>The reqested <code>FlowOperation</code> ignores flows with an age (in seconds) lower than <code>MinimumFlowAgeInSeconds</code>. You provide this for start commands.</p>
173    pub fn minimum_flow_age_in_seconds(mut self, input: i32) -> Self {
174        self.inner = self.inner.minimum_flow_age_in_seconds(input);
175        self
176    }
177    /// <p>The reqested <code>FlowOperation</code> ignores flows with an age (in seconds) lower than <code>MinimumFlowAgeInSeconds</code>. You provide this for start commands.</p>
178    pub fn set_minimum_flow_age_in_seconds(mut self, input: ::std::option::Option<i32>) -> Self {
179        self.inner = self.inner.set_minimum_flow_age_in_seconds(input);
180        self
181    }
182    /// <p>The reqested <code>FlowOperation</code> ignores flows with an age (in seconds) lower than <code>MinimumFlowAgeInSeconds</code>. You provide this for start commands.</p>
183    pub fn get_minimum_flow_age_in_seconds(&self) -> &::std::option::Option<i32> {
184        self.inner.get_minimum_flow_age_in_seconds()
185    }
186    ///
187    /// Appends an item to `FlowFilters`.
188    ///
189    /// To override the contents of this collection use [`set_flow_filters`](Self::set_flow_filters).
190    ///
191    /// <p>Defines the scope a flow operation. You can use up to 20 filters to configure a single flow operation.</p>
192    pub fn flow_filters(mut self, input: crate::types::FlowFilter) -> Self {
193        self.inner = self.inner.flow_filters(input);
194        self
195    }
196    /// <p>Defines the scope a flow operation. You can use up to 20 filters to configure a single flow operation.</p>
197    pub fn set_flow_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FlowFilter>>) -> Self {
198        self.inner = self.inner.set_flow_filters(input);
199        self
200    }
201    /// <p>Defines the scope a flow operation. You can use up to 20 filters to configure a single flow operation.</p>
202    pub fn get_flow_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FlowFilter>> {
203        self.inner.get_flow_filters()
204    }
205}