aws_sdk_networkfirewall/operation/update_rule_group/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_rule_group::_update_rule_group_output::UpdateRuleGroupOutputBuilder;
3
4pub use crate::operation::update_rule_group::_update_rule_group_input::UpdateRuleGroupInputBuilder;
5
6impl crate::operation::update_rule_group::builders::UpdateRuleGroupInputBuilder {
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::update_rule_group::UpdateRuleGroupOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_rule_group::UpdateRuleGroupError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_rule_group();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateRuleGroup`.
24///
25/// <p>Updates the rule settings for the specified rule group. You use a rule group by reference in one or more firewall policies. When you modify a rule group, you modify all firewall policies that use the rule group.</p>
26/// <p>To update a rule group, first call <code>DescribeRuleGroup</code> to retrieve the current <code>RuleGroup</code> object, update the object as needed, and then provide the updated object to this call.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct UpdateRuleGroupFluentBuilder {
29    handle: ::std::sync::Arc<crate::client::Handle>,
30    inner: crate::operation::update_rule_group::builders::UpdateRuleGroupInputBuilder,
31    config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34    crate::client::customize::internal::CustomizableSend<
35        crate::operation::update_rule_group::UpdateRuleGroupOutput,
36        crate::operation::update_rule_group::UpdateRuleGroupError,
37    > for UpdateRuleGroupFluentBuilder
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::update_rule_group::UpdateRuleGroupOutput,
45            crate::operation::update_rule_group::UpdateRuleGroupError,
46        >,
47    > {
48        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49    }
50}
51impl UpdateRuleGroupFluentBuilder {
52    /// Creates a new `UpdateRuleGroupFluentBuilder`.
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 UpdateRuleGroup as a reference.
61    pub fn as_input(&self) -> &crate::operation::update_rule_group::builders::UpdateRuleGroupInputBuilder {
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::update_rule_group::UpdateRuleGroupOutput,
76        ::aws_smithy_runtime_api::client::result::SdkError<
77            crate::operation::update_rule_group::UpdateRuleGroupError,
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::update_rule_group::UpdateRuleGroup::operation_runtime_plugins(
86            self.handle.runtime_plugins.clone(),
87            &self.handle.conf,
88            self.config_override,
89        );
90        crate::operation::update_rule_group::UpdateRuleGroup::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::update_rule_group::UpdateRuleGroupOutput,
98        crate::operation::update_rule_group::UpdateRuleGroupError,
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>A token used for optimistic locking. Network Firewall returns a token to your requests that access the rule group. The token marks the state of the rule group resource at the time of the request.</p>
113    /// <p>To make changes to the rule group, you provide the token in your request. Network Firewall uses the token to ensure that the rule group hasn't changed since you last retrieved it. If it has changed, the operation fails with an <code>InvalidTokenException</code>. If this happens, retrieve the rule group again to get a current copy of it with a current token. Reapply your changes as needed, then try the operation again using the new token.</p>
114    pub fn update_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115        self.inner = self.inner.update_token(input.into());
116        self
117    }
118    /// <p>A token used for optimistic locking. Network Firewall returns a token to your requests that access the rule group. The token marks the state of the rule group resource at the time of the request.</p>
119    /// <p>To make changes to the rule group, you provide the token in your request. Network Firewall uses the token to ensure that the rule group hasn't changed since you last retrieved it. If it has changed, the operation fails with an <code>InvalidTokenException</code>. If this happens, retrieve the rule group again to get a current copy of it with a current token. Reapply your changes as needed, then try the operation again using the new token.</p>
120    pub fn set_update_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121        self.inner = self.inner.set_update_token(input);
122        self
123    }
124    /// <p>A token used for optimistic locking. Network Firewall returns a token to your requests that access the rule group. The token marks the state of the rule group resource at the time of the request.</p>
125    /// <p>To make changes to the rule group, you provide the token in your request. Network Firewall uses the token to ensure that the rule group hasn't changed since you last retrieved it. If it has changed, the operation fails with an <code>InvalidTokenException</code>. If this happens, retrieve the rule group again to get a current copy of it with a current token. Reapply your changes as needed, then try the operation again using the new token.</p>
126    pub fn get_update_token(&self) -> &::std::option::Option<::std::string::String> {
127        self.inner.get_update_token()
128    }
129    /// <p>The Amazon Resource Name (ARN) of the rule group.</p>
130    /// <p>You must specify the ARN or the name, and you can specify both.</p>
131    pub fn rule_group_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
132        self.inner = self.inner.rule_group_arn(input.into());
133        self
134    }
135    /// <p>The Amazon Resource Name (ARN) of the rule group.</p>
136    /// <p>You must specify the ARN or the name, and you can specify both.</p>
137    pub fn set_rule_group_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138        self.inner = self.inner.set_rule_group_arn(input);
139        self
140    }
141    /// <p>The Amazon Resource Name (ARN) of the rule group.</p>
142    /// <p>You must specify the ARN or the name, and you can specify both.</p>
143    pub fn get_rule_group_arn(&self) -> &::std::option::Option<::std::string::String> {
144        self.inner.get_rule_group_arn()
145    }
146    /// <p>The descriptive name of the rule group. You can't change the name of a rule group after you create it.</p>
147    /// <p>You must specify the ARN or the name, and you can specify both.</p>
148    pub fn rule_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
149        self.inner = self.inner.rule_group_name(input.into());
150        self
151    }
152    /// <p>The descriptive name of the rule group. You can't change the name of a rule group after you create it.</p>
153    /// <p>You must specify the ARN or the name, and you can specify both.</p>
154    pub fn set_rule_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
155        self.inner = self.inner.set_rule_group_name(input);
156        self
157    }
158    /// <p>The descriptive name of the rule group. You can't change the name of a rule group after you create it.</p>
159    /// <p>You must specify the ARN or the name, and you can specify both.</p>
160    pub fn get_rule_group_name(&self) -> &::std::option::Option<::std::string::String> {
161        self.inner.get_rule_group_name()
162    }
163    /// <p>An object that defines the rule group rules.</p><note>
164    /// <p>You must provide either this rule group setting or a <code>Rules</code> setting, but not both.</p>
165    /// </note>
166    pub fn rule_group(mut self, input: crate::types::RuleGroup) -> Self {
167        self.inner = self.inner.rule_group(input);
168        self
169    }
170    /// <p>An object that defines the rule group rules.</p><note>
171    /// <p>You must provide either this rule group setting or a <code>Rules</code> setting, but not both.</p>
172    /// </note>
173    pub fn set_rule_group(mut self, input: ::std::option::Option<crate::types::RuleGroup>) -> Self {
174        self.inner = self.inner.set_rule_group(input);
175        self
176    }
177    /// <p>An object that defines the rule group rules.</p><note>
178    /// <p>You must provide either this rule group setting or a <code>Rules</code> setting, but not both.</p>
179    /// </note>
180    pub fn get_rule_group(&self) -> &::std::option::Option<crate::types::RuleGroup> {
181        self.inner.get_rule_group()
182    }
183    /// <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>
184    /// <p>You must provide either this rules setting or a populated <code>RuleGroup</code> setting, but not both.</p>
185    /// </note>
186    /// <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>
187    pub fn rules(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
188        self.inner = self.inner.rules(input.into());
189        self
190    }
191    /// <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>
192    /// <p>You must provide either this rules setting or a populated <code>RuleGroup</code> setting, but not both.</p>
193    /// </note>
194    /// <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>
195    pub fn set_rules(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
196        self.inner = self.inner.set_rules(input);
197        self
198    }
199    /// <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>
200    /// <p>You must provide either this rules setting or a populated <code>RuleGroup</code> setting, but not both.</p>
201    /// </note>
202    /// <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>
203    pub fn get_rules(&self) -> &::std::option::Option<::std::string::String> {
204        self.inner.get_rules()
205    }
206    /// <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><note>
207    /// <p>This setting is required for requests that do not include the <code>RuleGroupARN</code>.</p>
208    /// </note>
209    pub fn r#type(mut self, input: crate::types::RuleGroupType) -> Self {
210        self.inner = self.inner.r#type(input);
211        self
212    }
213    /// <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><note>
214    /// <p>This setting is required for requests that do not include the <code>RuleGroupARN</code>.</p>
215    /// </note>
216    pub fn set_type(mut self, input: ::std::option::Option<crate::types::RuleGroupType>) -> Self {
217        self.inner = self.inner.set_type(input);
218        self
219    }
220    /// <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><note>
221    /// <p>This setting is required for requests that do not include the <code>RuleGroupARN</code>.</p>
222    /// </note>
223    pub fn get_type(&self) -> &::std::option::Option<crate::types::RuleGroupType> {
224        self.inner.get_type()
225    }
226    /// <p>A description of the rule group.</p>
227    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
228        self.inner = self.inner.description(input.into());
229        self
230    }
231    /// <p>A description of the rule group.</p>
232    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
233        self.inner = self.inner.set_description(input);
234        self
235    }
236    /// <p>A description of the rule group.</p>
237    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
238        self.inner.get_description()
239    }
240    /// <p>Indicates whether you want Network Firewall to just check the validity of the request, rather than run the request.</p>
241    /// <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>
242    /// <p>If set to <code>FALSE</code>, Network Firewall makes the requested changes to your resources.</p>
243    pub fn dry_run(mut self, input: bool) -> Self {
244        self.inner = self.inner.dry_run(input);
245        self
246    }
247    /// <p>Indicates whether you want Network Firewall to just check the validity of the request, rather than run the request.</p>
248    /// <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>
249    /// <p>If set to <code>FALSE</code>, Network Firewall makes the requested changes to your resources.</p>
250    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
251        self.inner = self.inner.set_dry_run(input);
252        self
253    }
254    /// <p>Indicates whether you want Network Firewall to just check the validity of the request, rather than run the request.</p>
255    /// <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>
256    /// <p>If set to <code>FALSE</code>, Network Firewall makes the requested changes to your resources.</p>
257    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
258        self.inner.get_dry_run()
259    }
260    /// <p>A complex type that contains settings for encryption of your rule group resources.</p>
261    pub fn encryption_configuration(mut self, input: crate::types::EncryptionConfiguration) -> Self {
262        self.inner = self.inner.encryption_configuration(input);
263        self
264    }
265    /// <p>A complex type that contains settings for encryption of your rule group resources.</p>
266    pub fn set_encryption_configuration(mut self, input: ::std::option::Option<crate::types::EncryptionConfiguration>) -> Self {
267        self.inner = self.inner.set_encryption_configuration(input);
268        self
269    }
270    /// <p>A complex type that contains settings for encryption of your rule group resources.</p>
271    pub fn get_encryption_configuration(&self) -> &::std::option::Option<crate::types::EncryptionConfiguration> {
272        self.inner.get_encryption_configuration()
273    }
274    /// <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>
275    pub fn source_metadata(mut self, input: crate::types::SourceMetadata) -> Self {
276        self.inner = self.inner.source_metadata(input);
277        self
278    }
279    /// <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>
280    pub fn set_source_metadata(mut self, input: ::std::option::Option<crate::types::SourceMetadata>) -> Self {
281        self.inner = self.inner.set_source_metadata(input);
282        self
283    }
284    /// <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>
285    pub fn get_source_metadata(&self) -> &::std::option::Option<crate::types::SourceMetadata> {
286        self.inner.get_source_metadata()
287    }
288    /// <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 updates the rule group for you. To run the stateless rule group analyzer without updating the rule group, set <code>DryRun</code> to <code>TRUE</code>.</p>
289    pub fn analyze_rule_group(mut self, input: bool) -> Self {
290        self.inner = self.inner.analyze_rule_group(input);
291        self
292    }
293    /// <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 updates the rule group for you. To run the stateless rule group analyzer without updating the rule group, set <code>DryRun</code> to <code>TRUE</code>.</p>
294    pub fn set_analyze_rule_group(mut self, input: ::std::option::Option<bool>) -> Self {
295        self.inner = self.inner.set_analyze_rule_group(input);
296        self
297    }
298    /// <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 updates the rule group for you. To run the stateless rule group analyzer without updating the rule group, set <code>DryRun</code> to <code>TRUE</code>.</p>
299    pub fn get_analyze_rule_group(&self) -> &::std::option::Option<bool> {
300        self.inner.get_analyze_rule_group()
301    }
302}