aws_sdk_wafv2/operation/delete_web_acl/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::delete_web_acl::_delete_web_acl_output::DeleteWebAclOutputBuilder;
3
4pub use crate::operation::delete_web_acl::_delete_web_acl_input::DeleteWebAclInputBuilder;
5
6impl crate::operation::delete_web_acl::builders::DeleteWebAclInputBuilder {
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::delete_web_acl::DeleteWebAclOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::delete_web_acl::DeleteWebACLError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.delete_web_acl();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `DeleteWebACL`.
24///
25/// <p>Deletes the specified <code>WebACL</code>.</p>
26/// <p>You can only use this if <code>ManagedByFirewallManager</code> is false in the web ACL.</p><note>
27/// <p>Before deleting any web ACL, first disassociate it from all resources.</p>
28/// <ul>
29/// <li>
30/// <p>To retrieve a list of the resources that are associated with a web ACL, use the following calls:</p>
31/// <ul>
32/// <li>
33/// <p>For Amazon CloudFront distributions, use the CloudFront call <code>ListDistributionsByWebACLId</code>. For information, see <a href="https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_ListDistributionsByWebACLId.html">ListDistributionsByWebACLId</a> in the <i>Amazon CloudFront API Reference</i>.</p></li>
34/// <li>
35/// <p>For all other resources, call <code>ListResourcesForWebACL</code>.</p></li>
36/// </ul></li>
37/// <li>
38/// <p>To disassociate a resource from a web ACL, use the following calls:</p>
39/// <ul>
40/// <li>
41/// <p>For Amazon CloudFront distributions, provide an empty web ACL ID in the CloudFront call <code>UpdateDistribution</code>. For information, see <a href="https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_UpdateDistribution.html">UpdateDistribution</a> in the <i>Amazon CloudFront API Reference</i>.</p></li>
42/// <li>
43/// <p>For all other resources, call <code>DisassociateWebACL</code>.</p></li>
44/// </ul></li>
45/// </ul>
46/// </note>
47#[derive(::std::clone::Clone, ::std::fmt::Debug)]
48pub struct DeleteWebACLFluentBuilder {
49 handle: ::std::sync::Arc<crate::client::Handle>,
50 inner: crate::operation::delete_web_acl::builders::DeleteWebAclInputBuilder,
51 config_override: ::std::option::Option<crate::config::Builder>,
52}
53impl
54 crate::client::customize::internal::CustomizableSend<
55 crate::operation::delete_web_acl::DeleteWebAclOutput,
56 crate::operation::delete_web_acl::DeleteWebACLError,
57 > for DeleteWebACLFluentBuilder
58{
59 fn send(
60 self,
61 config_override: crate::config::Builder,
62 ) -> crate::client::customize::internal::BoxFuture<
63 crate::client::customize::internal::SendResult<
64 crate::operation::delete_web_acl::DeleteWebAclOutput,
65 crate::operation::delete_web_acl::DeleteWebACLError,
66 >,
67 > {
68 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
69 }
70}
71impl DeleteWebACLFluentBuilder {
72 /// Creates a new `DeleteWebACLFluentBuilder`.
73 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
74 Self {
75 handle,
76 inner: ::std::default::Default::default(),
77 config_override: ::std::option::Option::None,
78 }
79 }
80 /// Access the DeleteWebACL as a reference.
81 pub fn as_input(&self) -> &crate::operation::delete_web_acl::builders::DeleteWebAclInputBuilder {
82 &self.inner
83 }
84 /// Sends the request and returns the response.
85 ///
86 /// If an error occurs, an `SdkError` will be returned with additional details that
87 /// can be matched against.
88 ///
89 /// By default, any retryable failures will be retried twice. Retry behavior
90 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
91 /// set when configuring the client.
92 pub async fn send(
93 self,
94 ) -> ::std::result::Result<
95 crate::operation::delete_web_acl::DeleteWebAclOutput,
96 ::aws_smithy_runtime_api::client::result::SdkError<
97 crate::operation::delete_web_acl::DeleteWebACLError,
98 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
99 >,
100 > {
101 let input = self
102 .inner
103 .build()
104 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
105 let runtime_plugins = crate::operation::delete_web_acl::DeleteWebACL::operation_runtime_plugins(
106 self.handle.runtime_plugins.clone(),
107 &self.handle.conf,
108 self.config_override,
109 );
110 crate::operation::delete_web_acl::DeleteWebACL::orchestrate(&runtime_plugins, input).await
111 }
112
113 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
114 pub fn customize(
115 self,
116 ) -> crate::client::customize::CustomizableOperation<
117 crate::operation::delete_web_acl::DeleteWebAclOutput,
118 crate::operation::delete_web_acl::DeleteWebACLError,
119 Self,
120 > {
121 crate::client::customize::CustomizableOperation::new(self)
122 }
123 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
124 self.set_config_override(::std::option::Option::Some(config_override.into()));
125 self
126 }
127
128 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
129 self.config_override = config_override;
130 self
131 }
132 /// <p>The name of the web ACL. You cannot change the name of a web ACL after you create it.</p>
133 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134 self.inner = self.inner.name(input.into());
135 self
136 }
137 /// <p>The name of the web ACL. You cannot change the name of a web ACL after you create it.</p>
138 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139 self.inner = self.inner.set_name(input);
140 self
141 }
142 /// <p>The name of the web ACL. You cannot change the name of a web ACL after you create it.</p>
143 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
144 self.inner.get_name()
145 }
146 /// <p>Specifies whether this is for a global resource type, such as a Amazon CloudFront distribution. For an Amplify application, use <code>CLOUDFRONT</code>.</p>
147 /// <p>To work with CloudFront, you must also specify the Region US East (N. Virginia) as follows:</p>
148 /// <ul>
149 /// <li>
150 /// <p>CLI - Specify the Region when you use the CloudFront scope: <code>--scope=CLOUDFRONT --region=us-east-1</code>.</p></li>
151 /// <li>
152 /// <p>API and SDKs - For all calls, use the Region endpoint us-east-1.</p></li>
153 /// </ul>
154 pub fn scope(mut self, input: crate::types::Scope) -> Self {
155 self.inner = self.inner.scope(input);
156 self
157 }
158 /// <p>Specifies whether this is for a global resource type, such as a Amazon CloudFront distribution. For an Amplify application, use <code>CLOUDFRONT</code>.</p>
159 /// <p>To work with CloudFront, you must also specify the Region US East (N. Virginia) as follows:</p>
160 /// <ul>
161 /// <li>
162 /// <p>CLI - Specify the Region when you use the CloudFront scope: <code>--scope=CLOUDFRONT --region=us-east-1</code>.</p></li>
163 /// <li>
164 /// <p>API and SDKs - For all calls, use the Region endpoint us-east-1.</p></li>
165 /// </ul>
166 pub fn set_scope(mut self, input: ::std::option::Option<crate::types::Scope>) -> Self {
167 self.inner = self.inner.set_scope(input);
168 self
169 }
170 /// <p>Specifies whether this is for a global resource type, such as a Amazon CloudFront distribution. For an Amplify application, use <code>CLOUDFRONT</code>.</p>
171 /// <p>To work with CloudFront, you must also specify the Region US East (N. Virginia) as follows:</p>
172 /// <ul>
173 /// <li>
174 /// <p>CLI - Specify the Region when you use the CloudFront scope: <code>--scope=CLOUDFRONT --region=us-east-1</code>.</p></li>
175 /// <li>
176 /// <p>API and SDKs - For all calls, use the Region endpoint us-east-1.</p></li>
177 /// </ul>
178 pub fn get_scope(&self) -> &::std::option::Option<crate::types::Scope> {
179 self.inner.get_scope()
180 }
181 /// <p>The unique identifier for the web ACL. This ID is returned in the responses to create and list commands. You provide it to operations like update and delete.</p>
182 pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
183 self.inner = self.inner.id(input.into());
184 self
185 }
186 /// <p>The unique identifier for the web ACL. This ID is returned in the responses to create and list commands. You provide it to operations like update and delete.</p>
187 pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
188 self.inner = self.inner.set_id(input);
189 self
190 }
191 /// <p>The unique identifier for the web ACL. This ID is returned in the responses to create and list commands. You provide it to operations like update and delete.</p>
192 pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
193 self.inner.get_id()
194 }
195 /// <p>A token used for optimistic locking. WAF returns a token to your <code>get</code> and <code>list</code> requests, to mark the state of the entity at the time of the request. To make changes to the entity associated with the token, you provide the token to operations like <code>update</code> and <code>delete</code>. WAF uses the token to ensure that no changes have been made to the entity since you last retrieved it. If a change has been made, the update fails with a <code>WAFOptimisticLockException</code>. If this happens, perform another <code>get</code>, and use the new token returned by that operation.</p>
196 pub fn lock_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
197 self.inner = self.inner.lock_token(input.into());
198 self
199 }
200 /// <p>A token used for optimistic locking. WAF returns a token to your <code>get</code> and <code>list</code> requests, to mark the state of the entity at the time of the request. To make changes to the entity associated with the token, you provide the token to operations like <code>update</code> and <code>delete</code>. WAF uses the token to ensure that no changes have been made to the entity since you last retrieved it. If a change has been made, the update fails with a <code>WAFOptimisticLockException</code>. If this happens, perform another <code>get</code>, and use the new token returned by that operation.</p>
201 pub fn set_lock_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
202 self.inner = self.inner.set_lock_token(input);
203 self
204 }
205 /// <p>A token used for optimistic locking. WAF returns a token to your <code>get</code> and <code>list</code> requests, to mark the state of the entity at the time of the request. To make changes to the entity associated with the token, you provide the token to operations like <code>update</code> and <code>delete</code>. WAF uses the token to ensure that no changes have been made to the entity since you last retrieved it. If a change has been made, the update fails with a <code>WAFOptimisticLockException</code>. If this happens, perform another <code>get</code>, and use the new token returned by that operation.</p>
206 pub fn get_lock_token(&self) -> &::std::option::Option<::std::string::String> {
207 self.inner.get_lock_token()
208 }
209}