aws_sdk_networkfirewall/operation/update_firewall_policy/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_firewall_policy::_update_firewall_policy_output::UpdateFirewallPolicyOutputBuilder;
3
4pub use crate::operation::update_firewall_policy::_update_firewall_policy_input::UpdateFirewallPolicyInputBuilder;
5
6impl crate::operation::update_firewall_policy::builders::UpdateFirewallPolicyInputBuilder {
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_firewall_policy::UpdateFirewallPolicyOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_firewall_policy::UpdateFirewallPolicyError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_firewall_policy();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateFirewallPolicy`.
24///
25/// <p>Updates the properties of the specified firewall policy.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdateFirewallPolicyFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::update_firewall_policy::builders::UpdateFirewallPolicyInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::update_firewall_policy::UpdateFirewallPolicyOutput,
35        crate::operation::update_firewall_policy::UpdateFirewallPolicyError,
36    > for UpdateFirewallPolicyFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::update_firewall_policy::UpdateFirewallPolicyOutput,
44            crate::operation::update_firewall_policy::UpdateFirewallPolicyError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl UpdateFirewallPolicyFluentBuilder {
51    /// Creates a new `UpdateFirewallPolicyFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the UpdateFirewallPolicy as a reference.
60    pub fn as_input(&self) -> &crate::operation::update_firewall_policy::builders::UpdateFirewallPolicyInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::update_firewall_policy::UpdateFirewallPolicyOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::update_firewall_policy::UpdateFirewallPolicyError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::update_firewall_policy::UpdateFirewallPolicy::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::update_firewall_policy::UpdateFirewallPolicy::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::update_firewall_policy::UpdateFirewallPolicyOutput,
97        crate::operation::update_firewall_policy::UpdateFirewallPolicyError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>A token used for optimistic locking. Network Firewall returns a token to your requests that access the firewall policy. The token marks the state of the policy resource at the time of the request.</p>
112    /// <p>To make changes to the policy, you provide the token in your request. Network Firewall uses the token to ensure that the policy 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 firewall policy again to get a current copy of it with current token. Reapply your changes as needed, then try the operation again using the new token.</p>
113    pub fn update_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114        self.inner = self.inner.update_token(input.into());
115        self
116    }
117    /// <p>A token used for optimistic locking. Network Firewall returns a token to your requests that access the firewall policy. The token marks the state of the policy resource at the time of the request.</p>
118    /// <p>To make changes to the policy, you provide the token in your request. Network Firewall uses the token to ensure that the policy 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 firewall policy again to get a current copy of it with current token. Reapply your changes as needed, then try the operation again using the new token.</p>
119    pub fn set_update_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120        self.inner = self.inner.set_update_token(input);
121        self
122    }
123    /// <p>A token used for optimistic locking. Network Firewall returns a token to your requests that access the firewall policy. The token marks the state of the policy resource at the time of the request.</p>
124    /// <p>To make changes to the policy, you provide the token in your request. Network Firewall uses the token to ensure that the policy 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 firewall policy again to get a current copy of it with current token. Reapply your changes as needed, then try the operation again using the new token.</p>
125    pub fn get_update_token(&self) -> &::std::option::Option<::std::string::String> {
126        self.inner.get_update_token()
127    }
128    /// <p>The Amazon Resource Name (ARN) of the firewall policy.</p>
129    /// <p>You must specify the ARN or the name, and you can specify both.</p>
130    pub fn firewall_policy_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131        self.inner = self.inner.firewall_policy_arn(input.into());
132        self
133    }
134    /// <p>The Amazon Resource Name (ARN) of the firewall policy.</p>
135    /// <p>You must specify the ARN or the name, and you can specify both.</p>
136    pub fn set_firewall_policy_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137        self.inner = self.inner.set_firewall_policy_arn(input);
138        self
139    }
140    /// <p>The Amazon Resource Name (ARN) of the firewall policy.</p>
141    /// <p>You must specify the ARN or the name, and you can specify both.</p>
142    pub fn get_firewall_policy_arn(&self) -> &::std::option::Option<::std::string::String> {
143        self.inner.get_firewall_policy_arn()
144    }
145    /// <p>The descriptive name of the firewall policy. You can't change the name of a firewall policy after you create it.</p>
146    /// <p>You must specify the ARN or the name, and you can specify both.</p>
147    pub fn firewall_policy_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148        self.inner = self.inner.firewall_policy_name(input.into());
149        self
150    }
151    /// <p>The descriptive name of the firewall policy. You can't change the name of a firewall policy after you create it.</p>
152    /// <p>You must specify the ARN or the name, and you can specify both.</p>
153    pub fn set_firewall_policy_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154        self.inner = self.inner.set_firewall_policy_name(input);
155        self
156    }
157    /// <p>The descriptive name of the firewall policy. You can't change the name of a firewall policy after you create it.</p>
158    /// <p>You must specify the ARN or the name, and you can specify both.</p>
159    pub fn get_firewall_policy_name(&self) -> &::std::option::Option<::std::string::String> {
160        self.inner.get_firewall_policy_name()
161    }
162    /// <p>The updated firewall policy to use for the firewall. You can't add or remove a <code>TLSInspectionConfiguration</code> after you create a firewall policy. However, you can replace an existing TLS inspection configuration with another <code>TLSInspectionConfiguration</code>.</p>
163    pub fn firewall_policy(mut self, input: crate::types::FirewallPolicy) -> Self {
164        self.inner = self.inner.firewall_policy(input);
165        self
166    }
167    /// <p>The updated firewall policy to use for the firewall. You can't add or remove a <code>TLSInspectionConfiguration</code> after you create a firewall policy. However, you can replace an existing TLS inspection configuration with another <code>TLSInspectionConfiguration</code>.</p>
168    pub fn set_firewall_policy(mut self, input: ::std::option::Option<crate::types::FirewallPolicy>) -> Self {
169        self.inner = self.inner.set_firewall_policy(input);
170        self
171    }
172    /// <p>The updated firewall policy to use for the firewall. You can't add or remove a <code>TLSInspectionConfiguration</code> after you create a firewall policy. However, you can replace an existing TLS inspection configuration with another <code>TLSInspectionConfiguration</code>.</p>
173    pub fn get_firewall_policy(&self) -> &::std::option::Option<crate::types::FirewallPolicy> {
174        self.inner.get_firewall_policy()
175    }
176    /// <p>A description of the firewall policy.</p>
177    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
178        self.inner = self.inner.description(input.into());
179        self
180    }
181    /// <p>A description of the firewall policy.</p>
182    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
183        self.inner = self.inner.set_description(input);
184        self
185    }
186    /// <p>A description of the firewall policy.</p>
187    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
188        self.inner.get_description()
189    }
190    /// <p>Indicates whether you want Network Firewall to just check the validity of the request, rather than run the request.</p>
191    /// <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>
192    /// <p>If set to <code>FALSE</code>, Network Firewall makes the requested changes to your resources.</p>
193    pub fn dry_run(mut self, input: bool) -> Self {
194        self.inner = self.inner.dry_run(input);
195        self
196    }
197    /// <p>Indicates whether you want Network Firewall to just check the validity of the request, rather than run the request.</p>
198    /// <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>
199    /// <p>If set to <code>FALSE</code>, Network Firewall makes the requested changes to your resources.</p>
200    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
201        self.inner = self.inner.set_dry_run(input);
202        self
203    }
204    /// <p>Indicates whether you want Network Firewall to just check the validity of the request, rather than run the request.</p>
205    /// <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>
206    /// <p>If set to <code>FALSE</code>, Network Firewall makes the requested changes to your resources.</p>
207    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
208        self.inner.get_dry_run()
209    }
210    /// <p>A complex type that contains settings for encryption of your firewall policy resources.</p>
211    pub fn encryption_configuration(mut self, input: crate::types::EncryptionConfiguration) -> Self {
212        self.inner = self.inner.encryption_configuration(input);
213        self
214    }
215    /// <p>A complex type that contains settings for encryption of your firewall policy resources.</p>
216    pub fn set_encryption_configuration(mut self, input: ::std::option::Option<crate::types::EncryptionConfiguration>) -> Self {
217        self.inner = self.inner.set_encryption_configuration(input);
218        self
219    }
220    /// <p>A complex type that contains settings for encryption of your firewall policy resources.</p>
221    pub fn get_encryption_configuration(&self) -> &::std::option::Option<crate::types::EncryptionConfiguration> {
222        self.inner.get_encryption_configuration()
223    }
224}