aws_sdk_networkfirewall/operation/update_firewall_delete_protection/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_firewall_delete_protection::_update_firewall_delete_protection_output::UpdateFirewallDeleteProtectionOutputBuilder;
3
4pub use crate::operation::update_firewall_delete_protection::_update_firewall_delete_protection_input::UpdateFirewallDeleteProtectionInputBuilder;
5
6impl crate::operation::update_firewall_delete_protection::builders::UpdateFirewallDeleteProtectionInputBuilder {
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_delete_protection::UpdateFirewallDeleteProtectionOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::update_firewall_delete_protection::UpdateFirewallDeleteProtectionError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.update_firewall_delete_protection();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `UpdateFirewallDeleteProtection`.
24///
25/// <p>Modifies the flag, <code>DeleteProtection</code>, which indicates whether it is possible to delete the firewall. If the flag is set to <code>TRUE</code>, the firewall is protected against deletion. This setting helps protect against accidentally deleting a firewall that's in use.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdateFirewallDeleteProtectionFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::update_firewall_delete_protection::builders::UpdateFirewallDeleteProtectionInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::update_firewall_delete_protection::UpdateFirewallDeleteProtectionOutput,
35 crate::operation::update_firewall_delete_protection::UpdateFirewallDeleteProtectionError,
36 > for UpdateFirewallDeleteProtectionFluentBuilder
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_delete_protection::UpdateFirewallDeleteProtectionOutput,
44 crate::operation::update_firewall_delete_protection::UpdateFirewallDeleteProtectionError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl UpdateFirewallDeleteProtectionFluentBuilder {
51 /// Creates a new `UpdateFirewallDeleteProtectionFluentBuilder`.
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 UpdateFirewallDeleteProtection as a reference.
60 pub fn as_input(&self) -> &crate::operation::update_firewall_delete_protection::builders::UpdateFirewallDeleteProtectionInputBuilder {
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_delete_protection::UpdateFirewallDeleteProtectionOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::update_firewall_delete_protection::UpdateFirewallDeleteProtectionError,
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_delete_protection::UpdateFirewallDeleteProtection::operation_runtime_plugins(
85 self.handle.runtime_plugins.clone(),
86 &self.handle.conf,
87 self.config_override,
88 );
89 crate::operation::update_firewall_delete_protection::UpdateFirewallDeleteProtection::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_delete_protection::UpdateFirewallDeleteProtectionOutput,
97 crate::operation::update_firewall_delete_protection::UpdateFirewallDeleteProtectionError,
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>An optional token that you can use for optimistic locking. Network Firewall returns a token to your requests that access the firewall. The token marks the state of the firewall resource at the time of the request.</p>
112 /// <p>To make an unconditional change to the firewall, omit the token in your update request. Without the token, Network Firewall performs your updates regardless of whether the firewall has changed since you last retrieved it.</p>
113 /// <p>To make a conditional change to the firewall, provide the token in your update request. Network Firewall uses the token to ensure that the firewall 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 again to get a current copy of it with a new 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>An optional token that you can use for optimistic locking. Network Firewall returns a token to your requests that access the firewall. The token marks the state of the firewall resource at the time of the request.</p>
119 /// <p>To make an unconditional change to the firewall, omit the token in your update request. Without the token, Network Firewall performs your updates regardless of whether the firewall has changed since you last retrieved it.</p>
120 /// <p>To make a conditional change to the firewall, provide the token in your update request. Network Firewall uses the token to ensure that the firewall 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 again to get a current copy of it with a new token. Reapply your changes as needed, then try the operation again using the new token.</p>
121 pub fn set_update_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122 self.inner = self.inner.set_update_token(input);
123 self
124 }
125 /// <p>An optional token that you can use for optimistic locking. Network Firewall returns a token to your requests that access the firewall. The token marks the state of the firewall resource at the time of the request.</p>
126 /// <p>To make an unconditional change to the firewall, omit the token in your update request. Without the token, Network Firewall performs your updates regardless of whether the firewall has changed since you last retrieved it.</p>
127 /// <p>To make a conditional change to the firewall, provide the token in your update request. Network Firewall uses the token to ensure that the firewall 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 again to get a current copy of it with a new token. Reapply your changes as needed, then try the operation again using the new token.</p>
128 pub fn get_update_token(&self) -> &::std::option::Option<::std::string::String> {
129 self.inner.get_update_token()
130 }
131 /// <p>The Amazon Resource Name (ARN) of the firewall.</p>
132 /// <p>You must specify the ARN or the name, and you can specify both.</p>
133 pub fn firewall_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134 self.inner = self.inner.firewall_arn(input.into());
135 self
136 }
137 /// <p>The Amazon Resource Name (ARN) of the firewall.</p>
138 /// <p>You must specify the ARN or the name, and you can specify both.</p>
139 pub fn set_firewall_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140 self.inner = self.inner.set_firewall_arn(input);
141 self
142 }
143 /// <p>The Amazon Resource Name (ARN) of the firewall.</p>
144 /// <p>You must specify the ARN or the name, and you can specify both.</p>
145 pub fn get_firewall_arn(&self) -> &::std::option::Option<::std::string::String> {
146 self.inner.get_firewall_arn()
147 }
148 /// <p>The descriptive name of the firewall. You can't change the name of a firewall after you create it.</p>
149 /// <p>You must specify the ARN or the name, and you can specify both.</p>
150 pub fn firewall_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
151 self.inner = self.inner.firewall_name(input.into());
152 self
153 }
154 /// <p>The descriptive name of the firewall. You can't change the name of a firewall after you create it.</p>
155 /// <p>You must specify the ARN or the name, and you can specify both.</p>
156 pub fn set_firewall_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
157 self.inner = self.inner.set_firewall_name(input);
158 self
159 }
160 /// <p>The descriptive name of the firewall. You can't change the name of a firewall after you create it.</p>
161 /// <p>You must specify the ARN or the name, and you can specify both.</p>
162 pub fn get_firewall_name(&self) -> &::std::option::Option<::std::string::String> {
163 self.inner.get_firewall_name()
164 }
165 /// <p>A flag indicating whether it is possible to delete the firewall. A setting of <code>TRUE</code> indicates that the firewall is protected against deletion. Use this setting to protect against accidentally deleting a firewall that is in use. When you create a firewall, the operation initializes this flag to <code>TRUE</code>.</p>
166 pub fn delete_protection(mut self, input: bool) -> Self {
167 self.inner = self.inner.delete_protection(input);
168 self
169 }
170 /// <p>A flag indicating whether it is possible to delete the firewall. A setting of <code>TRUE</code> indicates that the firewall is protected against deletion. Use this setting to protect against accidentally deleting a firewall that is in use. When you create a firewall, the operation initializes this flag to <code>TRUE</code>.</p>
171 pub fn set_delete_protection(mut self, input: ::std::option::Option<bool>) -> Self {
172 self.inner = self.inner.set_delete_protection(input);
173 self
174 }
175 /// <p>A flag indicating whether it is possible to delete the firewall. A setting of <code>TRUE</code> indicates that the firewall is protected against deletion. Use this setting to protect against accidentally deleting a firewall that is in use. When you create a firewall, the operation initializes this flag to <code>TRUE</code>.</p>
176 pub fn get_delete_protection(&self) -> &::std::option::Option<bool> {
177 self.inner.get_delete_protection()
178 }
179}