aws_sdk_networkfirewall/operation/create_rule_group/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_rule_group::_create_rule_group_output::CreateRuleGroupOutputBuilder;
3
4pub use crate::operation::create_rule_group::_create_rule_group_input::CreateRuleGroupInputBuilder;
5
6impl crate::operation::create_rule_group::builders::CreateRuleGroupInputBuilder {
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::create_rule_group::CreateRuleGroupOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_rule_group::CreateRuleGroupError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_rule_group();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateRuleGroup`.
24///
25/// <p>Creates the specified stateless or stateful rule group, which includes the rules for network traffic inspection, a capacity setting, and tags.</p>
26/// <p>You provide your rule group specification in your request using either <code>RuleGroup</code> or <code>Rules</code>.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct CreateRuleGroupFluentBuilder {
29 handle: ::std::sync::Arc<crate::client::Handle>,
30 inner: crate::operation::create_rule_group::builders::CreateRuleGroupInputBuilder,
31 config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34 crate::client::customize::internal::CustomizableSend<
35 crate::operation::create_rule_group::CreateRuleGroupOutput,
36 crate::operation::create_rule_group::CreateRuleGroupError,
37 > for CreateRuleGroupFluentBuilder
38{
39 fn send(
40 self,
41 config_override: crate::config::Builder,
42 ) -> crate::client::customize::internal::BoxFuture<
43 crate::client::customize::internal::SendResult<
44 crate::operation::create_rule_group::CreateRuleGroupOutput,
45 crate::operation::create_rule_group::CreateRuleGroupError,
46 >,
47 > {
48 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49 }
50}
51impl CreateRuleGroupFluentBuilder {
52 /// Creates a new `CreateRuleGroupFluentBuilder`.
53 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
54 Self {
55 handle,
56 inner: ::std::default::Default::default(),
57 config_override: ::std::option::Option::None,
58 }
59 }
60 /// Access the CreateRuleGroup as a reference.
61 pub fn as_input(&self) -> &crate::operation::create_rule_group::builders::CreateRuleGroupInputBuilder {
62 &self.inner
63 }
64 /// Sends the request and returns the response.
65 ///
66 /// If an error occurs, an `SdkError` will be returned with additional details that
67 /// can be matched against.
68 ///
69 /// By default, any retryable failures will be retried twice. Retry behavior
70 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
71 /// set when configuring the client.
72 pub async fn send(
73 self,
74 ) -> ::std::result::Result<
75 crate::operation::create_rule_group::CreateRuleGroupOutput,
76 ::aws_smithy_runtime_api::client::result::SdkError<
77 crate::operation::create_rule_group::CreateRuleGroupError,
78 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
79 >,
80 > {
81 let input = self
82 .inner
83 .build()
84 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
85 let runtime_plugins = crate::operation::create_rule_group::CreateRuleGroup::operation_runtime_plugins(
86 self.handle.runtime_plugins.clone(),
87 &self.handle.conf,
88 self.config_override,
89 );
90 crate::operation::create_rule_group::CreateRuleGroup::orchestrate(&runtime_plugins, input).await
91 }
92
93 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
94 pub fn customize(
95 self,
96 ) -> crate::client::customize::CustomizableOperation<
97 crate::operation::create_rule_group::CreateRuleGroupOutput,
98 crate::operation::create_rule_group::CreateRuleGroupError,
99 Self,
100 > {
101 crate::client::customize::CustomizableOperation::new(self)
102 }
103 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
104 self.set_config_override(::std::option::Option::Some(config_override.into()));
105 self
106 }
107
108 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
109 self.config_override = config_override;
110 self
111 }
112 /// <p>The descriptive name of the rule group. You can't change the name of a rule group after you create it.</p>
113 pub fn rule_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114 self.inner = self.inner.rule_group_name(input.into());
115 self
116 }
117 /// <p>The descriptive name of the rule group. You can't change the name of a rule group after you create it.</p>
118 pub fn set_rule_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
119 self.inner = self.inner.set_rule_group_name(input);
120 self
121 }
122 /// <p>The descriptive name of the rule group. You can't change the name of a rule group after you create it.</p>
123 pub fn get_rule_group_name(&self) -> &::std::option::Option<::std::string::String> {
124 self.inner.get_rule_group_name()
125 }
126 /// <p>An object that defines the rule group rules.</p><note>
127 /// <p>You must provide either this rule group setting or a <code>Rules</code> setting, but not both.</p>
128 /// </note>
129 pub fn rule_group(mut self, input: crate::types::RuleGroup) -> Self {
130 self.inner = self.inner.rule_group(input);
131 self
132 }
133 /// <p>An object that defines the rule group rules.</p><note>
134 /// <p>You must provide either this rule group setting or a <code>Rules</code> setting, but not both.</p>
135 /// </note>
136 pub fn set_rule_group(mut self, input: ::std::option::Option<crate::types::RuleGroup>) -> Self {
137 self.inner = self.inner.set_rule_group(input);
138 self
139 }
140 /// <p>An object that defines the rule group rules.</p><note>
141 /// <p>You must provide either this rule group setting or a <code>Rules</code> setting, but not both.</p>
142 /// </note>
143 pub fn get_rule_group(&self) -> &::std::option::Option<crate::types::RuleGroup> {
144 self.inner.get_rule_group()
145 }
146 /// <p>A string containing stateful rule group rules specifications in Suricata flat format, with one rule per line. Use this to import your existing Suricata compatible rule groups.</p><note>
147 /// <p>You must provide either this rules setting or a populated <code>RuleGroup</code> setting, but not both.</p>
148 /// </note>
149 /// <p>You can provide your rule group specification in Suricata flat format through this setting when you create or update your rule group. The call response returns a <code>RuleGroup</code> object that Network Firewall has populated from your string.</p>
150 pub fn rules(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
151 self.inner = self.inner.rules(input.into());
152 self
153 }
154 /// <p>A string containing stateful rule group rules specifications in Suricata flat format, with one rule per line. Use this to import your existing Suricata compatible rule groups.</p><note>
155 /// <p>You must provide either this rules setting or a populated <code>RuleGroup</code> setting, but not both.</p>
156 /// </note>
157 /// <p>You can provide your rule group specification in Suricata flat format through this setting when you create or update your rule group. The call response returns a <code>RuleGroup</code> object that Network Firewall has populated from your string.</p>
158 pub fn set_rules(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
159 self.inner = self.inner.set_rules(input);
160 self
161 }
162 /// <p>A string containing stateful rule group rules specifications in Suricata flat format, with one rule per line. Use this to import your existing Suricata compatible rule groups.</p><note>
163 /// <p>You must provide either this rules setting or a populated <code>RuleGroup</code> setting, but not both.</p>
164 /// </note>
165 /// <p>You can provide your rule group specification in Suricata flat format through this setting when you create or update your rule group. The call response returns a <code>RuleGroup</code> object that Network Firewall has populated from your string.</p>
166 pub fn get_rules(&self) -> &::std::option::Option<::std::string::String> {
167 self.inner.get_rules()
168 }
169 /// <p>Indicates whether the rule group is stateless or stateful. If the rule group is stateless, it contains stateless rules. If it is stateful, it contains stateful rules.</p>
170 pub fn r#type(mut self, input: crate::types::RuleGroupType) -> Self {
171 self.inner = self.inner.r#type(input);
172 self
173 }
174 /// <p>Indicates whether the rule group is stateless or stateful. If the rule group is stateless, it contains stateless rules. If it is stateful, it contains stateful rules.</p>
175 pub fn set_type(mut self, input: ::std::option::Option<crate::types::RuleGroupType>) -> Self {
176 self.inner = self.inner.set_type(input);
177 self
178 }
179 /// <p>Indicates whether the rule group is stateless or stateful. If the rule group is stateless, it contains stateless rules. If it is stateful, it contains stateful rules.</p>
180 pub fn get_type(&self) -> &::std::option::Option<crate::types::RuleGroupType> {
181 self.inner.get_type()
182 }
183 /// <p>A description of the rule group.</p>
184 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
185 self.inner = self.inner.description(input.into());
186 self
187 }
188 /// <p>A description of the rule group.</p>
189 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
190 self.inner = self.inner.set_description(input);
191 self
192 }
193 /// <p>A description of the rule group.</p>
194 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
195 self.inner.get_description()
196 }
197 /// <p>The maximum operating resources that this rule group can use. Rule group capacity is fixed at creation. When you update a rule group, you are limited to this capacity. When you reference a rule group from a firewall policy, Network Firewall reserves this capacity for the rule group.</p>
198 /// <p>You can retrieve the capacity that would be required for a rule group before you create the rule group by calling <code>CreateRuleGroup</code> with <code>DryRun</code> set to <code>TRUE</code>.</p><note>
199 /// <p>You can't change or exceed this capacity when you update the rule group, so leave room for your rule group to grow.</p>
200 /// </note>
201 /// <p><b>Capacity for a stateless rule group</b></p>
202 /// <p>For a stateless rule group, the capacity required is the sum of the capacity requirements of the individual rules that you expect to have in the rule group.</p>
203 /// <p>To calculate the capacity requirement of a single rule, multiply the capacity requirement values of each of the rule's match settings:</p>
204 /// <ul>
205 /// <li>
206 /// <p>A match setting with no criteria specified has a value of 1.</p></li>
207 /// <li>
208 /// <p>A match setting with <code>Any</code> specified has a value of 1.</p></li>
209 /// <li>
210 /// <p>All other match settings have a value equal to the number of elements provided in the setting. For example, a protocol setting \["UDP"\] and a source setting \["10.0.0.0/24"\] each have a value of 1. A protocol setting \["UDP","TCP"\] has a value of 2. A source setting \["10.0.0.0/24","10.0.0.1/24","10.0.0.2/24"\] has a value of 3.</p></li>
211 /// </ul>
212 /// <p>A rule with no criteria specified in any of its match settings has a capacity requirement of 1. A rule with protocol setting \["UDP","TCP"\], source setting \["10.0.0.0/24","10.0.0.1/24","10.0.0.2/24"\], and a single specification or no specification for each of the other match settings has a capacity requirement of 6.</p>
213 /// <p><b>Capacity for a stateful rule group</b></p>
214 /// <p>For a stateful rule group, the minimum capacity required is the number of individual rules that you expect to have in the rule group.</p>
215 pub fn capacity(mut self, input: i32) -> Self {
216 self.inner = self.inner.capacity(input);
217 self
218 }
219 /// <p>The maximum operating resources that this rule group can use. Rule group capacity is fixed at creation. When you update a rule group, you are limited to this capacity. When you reference a rule group from a firewall policy, Network Firewall reserves this capacity for the rule group.</p>
220 /// <p>You can retrieve the capacity that would be required for a rule group before you create the rule group by calling <code>CreateRuleGroup</code> with <code>DryRun</code> set to <code>TRUE</code>.</p><note>
221 /// <p>You can't change or exceed this capacity when you update the rule group, so leave room for your rule group to grow.</p>
222 /// </note>
223 /// <p><b>Capacity for a stateless rule group</b></p>
224 /// <p>For a stateless rule group, the capacity required is the sum of the capacity requirements of the individual rules that you expect to have in the rule group.</p>
225 /// <p>To calculate the capacity requirement of a single rule, multiply the capacity requirement values of each of the rule's match settings:</p>
226 /// <ul>
227 /// <li>
228 /// <p>A match setting with no criteria specified has a value of 1.</p></li>
229 /// <li>
230 /// <p>A match setting with <code>Any</code> specified has a value of 1.</p></li>
231 /// <li>
232 /// <p>All other match settings have a value equal to the number of elements provided in the setting. For example, a protocol setting \["UDP"\] and a source setting \["10.0.0.0/24"\] each have a value of 1. A protocol setting \["UDP","TCP"\] has a value of 2. A source setting \["10.0.0.0/24","10.0.0.1/24","10.0.0.2/24"\] has a value of 3.</p></li>
233 /// </ul>
234 /// <p>A rule with no criteria specified in any of its match settings has a capacity requirement of 1. A rule with protocol setting \["UDP","TCP"\], source setting \["10.0.0.0/24","10.0.0.1/24","10.0.0.2/24"\], and a single specification or no specification for each of the other match settings has a capacity requirement of 6.</p>
235 /// <p><b>Capacity for a stateful rule group</b></p>
236 /// <p>For a stateful rule group, the minimum capacity required is the number of individual rules that you expect to have in the rule group.</p>
237 pub fn set_capacity(mut self, input: ::std::option::Option<i32>) -> Self {
238 self.inner = self.inner.set_capacity(input);
239 self
240 }
241 /// <p>The maximum operating resources that this rule group can use. Rule group capacity is fixed at creation. When you update a rule group, you are limited to this capacity. When you reference a rule group from a firewall policy, Network Firewall reserves this capacity for the rule group.</p>
242 /// <p>You can retrieve the capacity that would be required for a rule group before you create the rule group by calling <code>CreateRuleGroup</code> with <code>DryRun</code> set to <code>TRUE</code>.</p><note>
243 /// <p>You can't change or exceed this capacity when you update the rule group, so leave room for your rule group to grow.</p>
244 /// </note>
245 /// <p><b>Capacity for a stateless rule group</b></p>
246 /// <p>For a stateless rule group, the capacity required is the sum of the capacity requirements of the individual rules that you expect to have in the rule group.</p>
247 /// <p>To calculate the capacity requirement of a single rule, multiply the capacity requirement values of each of the rule's match settings:</p>
248 /// <ul>
249 /// <li>
250 /// <p>A match setting with no criteria specified has a value of 1.</p></li>
251 /// <li>
252 /// <p>A match setting with <code>Any</code> specified has a value of 1.</p></li>
253 /// <li>
254 /// <p>All other match settings have a value equal to the number of elements provided in the setting. For example, a protocol setting \["UDP"\] and a source setting \["10.0.0.0/24"\] each have a value of 1. A protocol setting \["UDP","TCP"\] has a value of 2. A source setting \["10.0.0.0/24","10.0.0.1/24","10.0.0.2/24"\] has a value of 3.</p></li>
255 /// </ul>
256 /// <p>A rule with no criteria specified in any of its match settings has a capacity requirement of 1. A rule with protocol setting \["UDP","TCP"\], source setting \["10.0.0.0/24","10.0.0.1/24","10.0.0.2/24"\], and a single specification or no specification for each of the other match settings has a capacity requirement of 6.</p>
257 /// <p><b>Capacity for a stateful rule group</b></p>
258 /// <p>For a stateful rule group, the minimum capacity required is the number of individual rules that you expect to have in the rule group.</p>
259 pub fn get_capacity(&self) -> &::std::option::Option<i32> {
260 self.inner.get_capacity()
261 }
262 ///
263 /// Appends an item to `Tags`.
264 ///
265 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
266 ///
267 /// <p>The key:value pairs to associate with the resource.</p>
268 pub fn tags(mut self, input: crate::types::Tag) -> Self {
269 self.inner = self.inner.tags(input);
270 self
271 }
272 /// <p>The key:value pairs to associate with the resource.</p>
273 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
274 self.inner = self.inner.set_tags(input);
275 self
276 }
277 /// <p>The key:value pairs to associate with the resource.</p>
278 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
279 self.inner.get_tags()
280 }
281 /// <p>Indicates whether you want Network Firewall to just check the validity of the request, rather than run the request.</p>
282 /// <p>If set to <code>TRUE</code>, Network Firewall checks whether the request can run successfully, but doesn't actually make the requested changes. The call returns the value that the request would return if you ran it with dry run set to <code>FALSE</code>, but doesn't make additions or changes to your resources. This option allows you to make sure that you have the required permissions to run the request and that your request parameters are valid.</p>
283 /// <p>If set to <code>FALSE</code>, Network Firewall makes the requested changes to your resources.</p>
284 pub fn dry_run(mut self, input: bool) -> Self {
285 self.inner = self.inner.dry_run(input);
286 self
287 }
288 /// <p>Indicates whether you want Network Firewall to just check the validity of the request, rather than run the request.</p>
289 /// <p>If set to <code>TRUE</code>, Network Firewall checks whether the request can run successfully, but doesn't actually make the requested changes. The call returns the value that the request would return if you ran it with dry run set to <code>FALSE</code>, but doesn't make additions or changes to your resources. This option allows you to make sure that you have the required permissions to run the request and that your request parameters are valid.</p>
290 /// <p>If set to <code>FALSE</code>, Network Firewall makes the requested changes to your resources.</p>
291 pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
292 self.inner = self.inner.set_dry_run(input);
293 self
294 }
295 /// <p>Indicates whether you want Network Firewall to just check the validity of the request, rather than run the request.</p>
296 /// <p>If set to <code>TRUE</code>, Network Firewall checks whether the request can run successfully, but doesn't actually make the requested changes. The call returns the value that the request would return if you ran it with dry run set to <code>FALSE</code>, but doesn't make additions or changes to your resources. This option allows you to make sure that you have the required permissions to run the request and that your request parameters are valid.</p>
297 /// <p>If set to <code>FALSE</code>, Network Firewall makes the requested changes to your resources.</p>
298 pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
299 self.inner.get_dry_run()
300 }
301 /// <p>A complex type that contains settings for encryption of your rule group resources.</p>
302 pub fn encryption_configuration(mut self, input: crate::types::EncryptionConfiguration) -> Self {
303 self.inner = self.inner.encryption_configuration(input);
304 self
305 }
306 /// <p>A complex type that contains settings for encryption of your rule group resources.</p>
307 pub fn set_encryption_configuration(mut self, input: ::std::option::Option<crate::types::EncryptionConfiguration>) -> Self {
308 self.inner = self.inner.set_encryption_configuration(input);
309 self
310 }
311 /// <p>A complex type that contains settings for encryption of your rule group resources.</p>
312 pub fn get_encryption_configuration(&self) -> &::std::option::Option<crate::types::EncryptionConfiguration> {
313 self.inner.get_encryption_configuration()
314 }
315 /// <p>A complex type that contains metadata about the rule group that your own rule group is copied from. You can use the metadata to keep track of updates made to the originating rule group.</p>
316 pub fn source_metadata(mut self, input: crate::types::SourceMetadata) -> Self {
317 self.inner = self.inner.source_metadata(input);
318 self
319 }
320 /// <p>A complex type that contains metadata about the rule group that your own rule group is copied from. You can use the metadata to keep track of updates made to the originating rule group.</p>
321 pub fn set_source_metadata(mut self, input: ::std::option::Option<crate::types::SourceMetadata>) -> Self {
322 self.inner = self.inner.set_source_metadata(input);
323 self
324 }
325 /// <p>A complex type that contains metadata about the rule group that your own rule group is copied from. You can use the metadata to keep track of updates made to the originating rule group.</p>
326 pub fn get_source_metadata(&self) -> &::std::option::Option<crate::types::SourceMetadata> {
327 self.inner.get_source_metadata()
328 }
329 /// <p>Indicates whether you want Network Firewall to analyze the stateless rules in the rule group for rule behavior such as asymmetric routing. If set to <code>TRUE</code>, Network Firewall runs the analysis and then creates the rule group for you. To run the stateless rule group analyzer without creating the rule group, set <code>DryRun</code> to <code>TRUE</code>.</p>
330 pub fn analyze_rule_group(mut self, input: bool) -> Self {
331 self.inner = self.inner.analyze_rule_group(input);
332 self
333 }
334 /// <p>Indicates whether you want Network Firewall to analyze the stateless rules in the rule group for rule behavior such as asymmetric routing. If set to <code>TRUE</code>, Network Firewall runs the analysis and then creates the rule group for you. To run the stateless rule group analyzer without creating the rule group, set <code>DryRun</code> to <code>TRUE</code>.</p>
335 pub fn set_analyze_rule_group(mut self, input: ::std::option::Option<bool>) -> Self {
336 self.inner = self.inner.set_analyze_rule_group(input);
337 self
338 }
339 /// <p>Indicates whether you want Network Firewall to analyze the stateless rules in the rule group for rule behavior such as asymmetric routing. If set to <code>TRUE</code>, Network Firewall runs the analysis and then creates the rule group for you. To run the stateless rule group analyzer without creating the rule group, set <code>DryRun</code> to <code>TRUE</code>.</p>
340 pub fn get_analyze_rule_group(&self) -> &::std::option::Option<bool> {
341 self.inner.get_analyze_rule_group()
342 }
343}