aws_sdk_networkfirewall/operation/update_availability_zone_change_protection/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_availability_zone_change_protection::_update_availability_zone_change_protection_input::UpdateAvailabilityZoneChangeProtectionInputBuilder;
3
4pub use crate::operation::update_availability_zone_change_protection::_update_availability_zone_change_protection_output::UpdateAvailabilityZoneChangeProtectionOutputBuilder;
5
6impl crate::operation::update_availability_zone_change_protection::builders::UpdateAvailabilityZoneChangeProtectionInputBuilder {
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_availability_zone_change_protection::UpdateAvailabilityZoneChangeProtectionOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::update_availability_zone_change_protection::UpdateAvailabilityZoneChangeProtectionError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.update_availability_zone_change_protection();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `UpdateAvailabilityZoneChangeProtection`.
24///
25/// <p>Modifies the <code>AvailabilityZoneChangeProtection</code> setting for a transit gateway-attached firewall. When enabled, this setting prevents accidental changes to the firewall's Availability Zone configuration. This helps protect against disrupting traffic flow in production environments.</p>
26/// <p>When enabled, you must disable this protection before using <code>AssociateAvailabilityZones</code> or <code>DisassociateAvailabilityZones</code> to modify the firewall's Availability Zone configuration.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct UpdateAvailabilityZoneChangeProtectionFluentBuilder {
29 handle: ::std::sync::Arc<crate::client::Handle>,
30 inner: crate::operation::update_availability_zone_change_protection::builders::UpdateAvailabilityZoneChangeProtectionInputBuilder,
31 config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34 crate::client::customize::internal::CustomizableSend<
35 crate::operation::update_availability_zone_change_protection::UpdateAvailabilityZoneChangeProtectionOutput,
36 crate::operation::update_availability_zone_change_protection::UpdateAvailabilityZoneChangeProtectionError,
37 > for UpdateAvailabilityZoneChangeProtectionFluentBuilder
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_availability_zone_change_protection::UpdateAvailabilityZoneChangeProtectionOutput,
45 crate::operation::update_availability_zone_change_protection::UpdateAvailabilityZoneChangeProtectionError,
46 >,
47 > {
48 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49 }
50}
51impl UpdateAvailabilityZoneChangeProtectionFluentBuilder {
52 /// Creates a new `UpdateAvailabilityZoneChangeProtectionFluentBuilder`.
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 UpdateAvailabilityZoneChangeProtection as a reference.
61 pub fn as_input(
62 &self,
63 ) -> &crate::operation::update_availability_zone_change_protection::builders::UpdateAvailabilityZoneChangeProtectionInputBuilder {
64 &self.inner
65 }
66 /// Sends the request and returns the response.
67 ///
68 /// If an error occurs, an `SdkError` will be returned with additional details that
69 /// can be matched against.
70 ///
71 /// By default, any retryable failures will be retried twice. Retry behavior
72 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
73 /// set when configuring the client.
74 pub async fn send(
75 self,
76 ) -> ::std::result::Result<
77 crate::operation::update_availability_zone_change_protection::UpdateAvailabilityZoneChangeProtectionOutput,
78 ::aws_smithy_runtime_api::client::result::SdkError<
79 crate::operation::update_availability_zone_change_protection::UpdateAvailabilityZoneChangeProtectionError,
80 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
81 >,
82 > {
83 let input = self
84 .inner
85 .build()
86 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
87 let runtime_plugins =
88 crate::operation::update_availability_zone_change_protection::UpdateAvailabilityZoneChangeProtection::operation_runtime_plugins(
89 self.handle.runtime_plugins.clone(),
90 &self.handle.conf,
91 self.config_override,
92 );
93 crate::operation::update_availability_zone_change_protection::UpdateAvailabilityZoneChangeProtection::orchestrate(&runtime_plugins, input)
94 .await
95 }
96
97 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
98 pub fn customize(
99 self,
100 ) -> crate::client::customize::CustomizableOperation<
101 crate::operation::update_availability_zone_change_protection::UpdateAvailabilityZoneChangeProtectionOutput,
102 crate::operation::update_availability_zone_change_protection::UpdateAvailabilityZoneChangeProtectionError,
103 Self,
104 > {
105 crate::client::customize::CustomizableOperation::new(self)
106 }
107 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
108 self.set_config_override(::std::option::Option::Some(config_override.into()));
109 self
110 }
111
112 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
113 self.config_override = config_override;
114 self
115 }
116 /// <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>
117 /// <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>
118 /// <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>
119 pub fn update_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120 self.inner = self.inner.update_token(input.into());
121 self
122 }
123 /// <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>
124 /// <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>
125 /// <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>
126 pub fn set_update_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
127 self.inner = self.inner.set_update_token(input);
128 self
129 }
130 /// <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>
131 /// <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>
132 /// <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>
133 pub fn get_update_token(&self) -> &::std::option::Option<::std::string::String> {
134 self.inner.get_update_token()
135 }
136 /// <p>The Amazon Resource Name (ARN) of the firewall.</p>
137 /// <p>You must specify the ARN or the name, and you can specify both.</p>
138 pub fn firewall_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
139 self.inner = self.inner.firewall_arn(input.into());
140 self
141 }
142 /// <p>The Amazon Resource Name (ARN) of the firewall.</p>
143 /// <p>You must specify the ARN or the name, and you can specify both.</p>
144 pub fn set_firewall_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
145 self.inner = self.inner.set_firewall_arn(input);
146 self
147 }
148 /// <p>The Amazon Resource Name (ARN) of the firewall.</p>
149 /// <p>You must specify the ARN or the name, and you can specify both.</p>
150 pub fn get_firewall_arn(&self) -> &::std::option::Option<::std::string::String> {
151 self.inner.get_firewall_arn()
152 }
153 /// <p>The descriptive name of the firewall. You can't change the name of a firewall after you create it.</p>
154 /// <p>You must specify the ARN or the name, and you can specify both.</p>
155 pub fn firewall_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
156 self.inner = self.inner.firewall_name(input.into());
157 self
158 }
159 /// <p>The descriptive name of the firewall. You can't change the name of a firewall after you create it.</p>
160 /// <p>You must specify the ARN or the name, and you can specify both.</p>
161 pub fn set_firewall_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
162 self.inner = self.inner.set_firewall_name(input);
163 self
164 }
165 /// <p>The descriptive name of the firewall. You can't change the name of a firewall after you create it.</p>
166 /// <p>You must specify the ARN or the name, and you can specify both.</p>
167 pub fn get_firewall_name(&self) -> &::std::option::Option<::std::string::String> {
168 self.inner.get_firewall_name()
169 }
170 /// <p>A setting indicating whether the firewall is protected against changes to the subnet associations. Use this setting to protect against accidentally modifying the subnet associations for a firewall that is in use. When you create a firewall, the operation initializes this setting to <code>TRUE</code>.</p>
171 pub fn availability_zone_change_protection(mut self, input: bool) -> Self {
172 self.inner = self.inner.availability_zone_change_protection(input);
173 self
174 }
175 /// <p>A setting indicating whether the firewall is protected against changes to the subnet associations. Use this setting to protect against accidentally modifying the subnet associations for a firewall that is in use. When you create a firewall, the operation initializes this setting to <code>TRUE</code>.</p>
176 pub fn set_availability_zone_change_protection(mut self, input: ::std::option::Option<bool>) -> Self {
177 self.inner = self.inner.set_availability_zone_change_protection(input);
178 self
179 }
180 /// <p>A setting indicating whether the firewall is protected against changes to the subnet associations. Use this setting to protect against accidentally modifying the subnet associations for a firewall that is in use. When you create a firewall, the operation initializes this setting to <code>TRUE</code>.</p>
181 pub fn get_availability_zone_change_protection(&self) -> &::std::option::Option<bool> {
182 self.inner.get_availability_zone_change_protection()
183 }
184}