aws_sdk_route53globalresolver/operation/create_firewall_rule/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_firewall_rule::_create_firewall_rule_output::CreateFirewallRuleOutputBuilder;
3
4pub use crate::operation::create_firewall_rule::_create_firewall_rule_input::CreateFirewallRuleInputBuilder;
5
6impl crate::operation::create_firewall_rule::builders::CreateFirewallRuleInputBuilder {
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::create_firewall_rule::CreateFirewallRuleOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_firewall_rule::CreateFirewallRuleError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_firewall_rule();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateFirewallRule`.
24///
25/// <p>Creates a DNS firewall rule. Firewall rules define actions (ALLOW, BLOCK, or ALERT) to take on DNS queries that match specified domain lists, managed domain lists, or advanced threat protections.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateFirewallRuleFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::create_firewall_rule::builders::CreateFirewallRuleInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::create_firewall_rule::CreateFirewallRuleOutput,
35 crate::operation::create_firewall_rule::CreateFirewallRuleError,
36 > for CreateFirewallRuleFluentBuilder
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::create_firewall_rule::CreateFirewallRuleOutput,
44 crate::operation::create_firewall_rule::CreateFirewallRuleError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl CreateFirewallRuleFluentBuilder {
51 /// Creates a new `CreateFirewallRuleFluentBuilder`.
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 CreateFirewallRule as a reference.
60 pub fn as_input(&self) -> &crate::operation::create_firewall_rule::builders::CreateFirewallRuleInputBuilder {
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::create_firewall_rule::CreateFirewallRuleOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::create_firewall_rule::CreateFirewallRuleError,
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::create_firewall_rule::CreateFirewallRule::operation_runtime_plugins(
85 self.handle.runtime_plugins.clone(),
86 &self.handle.conf,
87 self.config_override,
88 );
89 crate::operation::create_firewall_rule::CreateFirewallRule::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::create_firewall_rule::CreateFirewallRuleOutput,
97 crate::operation::create_firewall_rule::CreateFirewallRuleError,
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>The action that DNS Firewall should take on a DNS query when it matches one of the domains in the rule's domain list:</p>
112 /// <ul>
113 /// <li>
114 /// <p><code>ALLOW</code> - Permit the request to go through.</p></li>
115 /// <li>
116 /// <p><code>ALERT</code> - Permit the request and send metrics and logs to CloudWatch.</p></li>
117 /// <li>
118 /// <p><code>BLOCK</code> - Disallow the request. This option requires additional details in the rule's <code>BlockResponse</code>.</p></li>
119 /// </ul>
120 pub fn action(mut self, input: crate::types::FirewallRuleAction) -> Self {
121 self.inner = self.inner.action(input);
122 self
123 }
124 /// <p>The action that DNS Firewall should take on a DNS query when it matches one of the domains in the rule's domain list:</p>
125 /// <ul>
126 /// <li>
127 /// <p><code>ALLOW</code> - Permit the request to go through.</p></li>
128 /// <li>
129 /// <p><code>ALERT</code> - Permit the request and send metrics and logs to CloudWatch.</p></li>
130 /// <li>
131 /// <p><code>BLOCK</code> - Disallow the request. This option requires additional details in the rule's <code>BlockResponse</code>.</p></li>
132 /// </ul>
133 pub fn set_action(mut self, input: ::std::option::Option<crate::types::FirewallRuleAction>) -> Self {
134 self.inner = self.inner.set_action(input);
135 self
136 }
137 /// <p>The action that DNS Firewall should take on a DNS query when it matches one of the domains in the rule's domain list:</p>
138 /// <ul>
139 /// <li>
140 /// <p><code>ALLOW</code> - Permit the request to go through.</p></li>
141 /// <li>
142 /// <p><code>ALERT</code> - Permit the request and send metrics and logs to CloudWatch.</p></li>
143 /// <li>
144 /// <p><code>BLOCK</code> - Disallow the request. This option requires additional details in the rule's <code>BlockResponse</code>.</p></li>
145 /// </ul>
146 pub fn get_action(&self) -> &::std::option::Option<crate::types::FirewallRuleAction> {
147 self.inner.get_action()
148 }
149 /// <p>The DNS record's type. This determines the format of the record value that you provided in <code>BlockOverrideDomain</code>. Used for the rule action <code>BLOCK</code> with a <code>BlockResponse</code> setting of <code>OVERRIDE</code>.</p>
150 /// <p>This setting is required if the <code>BlockResponse</code> setting is <code>OVERRIDE</code>.</p>
151 pub fn block_override_dns_type(mut self, input: crate::types::BlockOverrideDnsQueryType) -> Self {
152 self.inner = self.inner.block_override_dns_type(input);
153 self
154 }
155 /// <p>The DNS record's type. This determines the format of the record value that you provided in <code>BlockOverrideDomain</code>. Used for the rule action <code>BLOCK</code> with a <code>BlockResponse</code> setting of <code>OVERRIDE</code>.</p>
156 /// <p>This setting is required if the <code>BlockResponse</code> setting is <code>OVERRIDE</code>.</p>
157 pub fn set_block_override_dns_type(mut self, input: ::std::option::Option<crate::types::BlockOverrideDnsQueryType>) -> Self {
158 self.inner = self.inner.set_block_override_dns_type(input);
159 self
160 }
161 /// <p>The DNS record's type. This determines the format of the record value that you provided in <code>BlockOverrideDomain</code>. Used for the rule action <code>BLOCK</code> with a <code>BlockResponse</code> setting of <code>OVERRIDE</code>.</p>
162 /// <p>This setting is required if the <code>BlockResponse</code> setting is <code>OVERRIDE</code>.</p>
163 pub fn get_block_override_dns_type(&self) -> &::std::option::Option<crate::types::BlockOverrideDnsQueryType> {
164 self.inner.get_block_override_dns_type()
165 }
166 /// <p>The custom DNS record to send back in response to the query. Used for the rule action <code>BLOCK</code> with a <code>BlockResponse</code> setting of <code>OVERRIDE</code>.</p>
167 /// <p>This setting is required if the <code>BlockResponse</code> setting is <code>OVERRIDE</code>.</p>
168 pub fn block_override_domain(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
169 self.inner = self.inner.block_override_domain(input.into());
170 self
171 }
172 /// <p>The custom DNS record to send back in response to the query. Used for the rule action <code>BLOCK</code> with a <code>BlockResponse</code> setting of <code>OVERRIDE</code>.</p>
173 /// <p>This setting is required if the <code>BlockResponse</code> setting is <code>OVERRIDE</code>.</p>
174 pub fn set_block_override_domain(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
175 self.inner = self.inner.set_block_override_domain(input);
176 self
177 }
178 /// <p>The custom DNS record to send back in response to the query. Used for the rule action <code>BLOCK</code> with a <code>BlockResponse</code> setting of <code>OVERRIDE</code>.</p>
179 /// <p>This setting is required if the <code>BlockResponse</code> setting is <code>OVERRIDE</code>.</p>
180 pub fn get_block_override_domain(&self) -> &::std::option::Option<::std::string::String> {
181 self.inner.get_block_override_domain()
182 }
183 /// <p>The recommended amount of time, in seconds, for the DNS resolver or web browser to cache the provided override record. Used for the rule action <code>BLOCK</code> with a <code>BlockResponse</code> setting of <code>OVERRIDE</code>.</p>
184 /// <p>This setting is required if the <code>BlockResponse</code> setting is <code>OVERRIDE</code>.</p>
185 pub fn block_override_ttl(mut self, input: i32) -> Self {
186 self.inner = self.inner.block_override_ttl(input);
187 self
188 }
189 /// <p>The recommended amount of time, in seconds, for the DNS resolver or web browser to cache the provided override record. Used for the rule action <code>BLOCK</code> with a <code>BlockResponse</code> setting of <code>OVERRIDE</code>.</p>
190 /// <p>This setting is required if the <code>BlockResponse</code> setting is <code>OVERRIDE</code>.</p>
191 pub fn set_block_override_ttl(mut self, input: ::std::option::Option<i32>) -> Self {
192 self.inner = self.inner.set_block_override_ttl(input);
193 self
194 }
195 /// <p>The recommended amount of time, in seconds, for the DNS resolver or web browser to cache the provided override record. Used for the rule action <code>BLOCK</code> with a <code>BlockResponse</code> setting of <code>OVERRIDE</code>.</p>
196 /// <p>This setting is required if the <code>BlockResponse</code> setting is <code>OVERRIDE</code>.</p>
197 pub fn get_block_override_ttl(&self) -> &::std::option::Option<i32> {
198 self.inner.get_block_override_ttl()
199 }
200 /// <p>The response to return when the action is BLOCK. Valid values are NXDOMAIN (domain does not exist), NODATA (domain exists but no records), or OVERRIDE (return custom response).</p>
201 pub fn block_response(mut self, input: crate::types::FirewallBlockResponse) -> Self {
202 self.inner = self.inner.block_response(input);
203 self
204 }
205 /// <p>The response to return when the action is BLOCK. Valid values are NXDOMAIN (domain does not exist), NODATA (domain exists but no records), or OVERRIDE (return custom response).</p>
206 pub fn set_block_response(mut self, input: ::std::option::Option<crate::types::FirewallBlockResponse>) -> Self {
207 self.inner = self.inner.set_block_response(input);
208 self
209 }
210 /// <p>The response to return when the action is BLOCK. Valid values are NXDOMAIN (domain does not exist), NODATA (domain exists but no records), or OVERRIDE (return custom response).</p>
211 pub fn get_block_response(&self) -> &::std::option::Option<crate::types::FirewallBlockResponse> {
212 self.inner.get_block_response()
213 }
214 /// <p>A unique, case-sensitive identifier to ensure idempotency. This means that making the same request multiple times with the same <code>clientToken</code> has the same result every time.</p>
215 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
216 self.inner = self.inner.client_token(input.into());
217 self
218 }
219 /// <p>A unique, case-sensitive identifier to ensure idempotency. This means that making the same request multiple times with the same <code>clientToken</code> has the same result every time.</p>
220 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
221 self.inner = self.inner.set_client_token(input);
222 self
223 }
224 /// <p>A unique, case-sensitive identifier to ensure idempotency. This means that making the same request multiple times with the same <code>clientToken</code> has the same result every time.</p>
225 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
226 self.inner.get_client_token()
227 }
228 /// <p>The confidence threshold for advanced threat detection. Valid values are HIGH, MEDIUM, or LOW, indicating the accuracy level required for threat detection.</p>
229 pub fn confidence_threshold(mut self, input: crate::types::ConfidenceThreshold) -> Self {
230 self.inner = self.inner.confidence_threshold(input);
231 self
232 }
233 /// <p>The confidence threshold for advanced threat detection. Valid values are HIGH, MEDIUM, or LOW, indicating the accuracy level required for threat detection.</p>
234 pub fn set_confidence_threshold(mut self, input: ::std::option::Option<crate::types::ConfidenceThreshold>) -> Self {
235 self.inner = self.inner.set_confidence_threshold(input);
236 self
237 }
238 /// <p>The confidence threshold for advanced threat detection. Valid values are HIGH, MEDIUM, or LOW, indicating the accuracy level required for threat detection.</p>
239 pub fn get_confidence_threshold(&self) -> &::std::option::Option<crate::types::ConfidenceThreshold> {
240 self.inner.get_confidence_threshold()
241 }
242 /// <p>An optional description for the firewall rule.</p>
243 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
244 self.inner = self.inner.description(input.into());
245 self
246 }
247 /// <p>An optional description for the firewall rule.</p>
248 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
249 self.inner = self.inner.set_description(input);
250 self
251 }
252 /// <p>An optional description for the firewall rule.</p>
253 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
254 self.inner.get_description()
255 }
256 /// <p>Whether to enable advanced DNS threat protection for this rule. Advanced protection can detect and block DNS tunneling and Domain Generation Algorithm (DGA) threats.</p>
257 pub fn dns_advanced_protection(mut self, input: crate::types::DnsAdvancedProtection) -> Self {
258 self.inner = self.inner.dns_advanced_protection(input);
259 self
260 }
261 /// <p>Whether to enable advanced DNS threat protection for this rule. Advanced protection can detect and block DNS tunneling and Domain Generation Algorithm (DGA) threats.</p>
262 pub fn set_dns_advanced_protection(mut self, input: ::std::option::Option<crate::types::DnsAdvancedProtection>) -> Self {
263 self.inner = self.inner.set_dns_advanced_protection(input);
264 self
265 }
266 /// <p>Whether to enable advanced DNS threat protection for this rule. Advanced protection can detect and block DNS tunneling and Domain Generation Algorithm (DGA) threats.</p>
267 pub fn get_dns_advanced_protection(&self) -> &::std::option::Option<crate::types::DnsAdvancedProtection> {
268 self.inner.get_dns_advanced_protection()
269 }
270 /// <p>The ID of the firewall domain list to use in this rule.</p>
271 pub fn firewall_domain_list_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
272 self.inner = self.inner.firewall_domain_list_id(input.into());
273 self
274 }
275 /// <p>The ID of the firewall domain list to use in this rule.</p>
276 pub fn set_firewall_domain_list_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
277 self.inner = self.inner.set_firewall_domain_list_id(input);
278 self
279 }
280 /// <p>The ID of the firewall domain list to use in this rule.</p>
281 pub fn get_firewall_domain_list_id(&self) -> &::std::option::Option<::std::string::String> {
282 self.inner.get_firewall_domain_list_id()
283 }
284 /// <p>A descriptive name for the firewall rule.</p>
285 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
286 self.inner = self.inner.name(input.into());
287 self
288 }
289 /// <p>A descriptive name for the firewall rule.</p>
290 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
291 self.inner = self.inner.set_name(input);
292 self
293 }
294 /// <p>A descriptive name for the firewall rule.</p>
295 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
296 self.inner.get_name()
297 }
298 /// <p>The priority of this rule. Rules are evaluated in priority order, with lower numbers having higher priority. When a DNS query matches multiple rules, the rule with the highest priority (lowest number) is applied.</p>
299 pub fn priority(mut self, input: i64) -> Self {
300 self.inner = self.inner.priority(input);
301 self
302 }
303 /// <p>The priority of this rule. Rules are evaluated in priority order, with lower numbers having higher priority. When a DNS query matches multiple rules, the rule with the highest priority (lowest number) is applied.</p>
304 pub fn set_priority(mut self, input: ::std::option::Option<i64>) -> Self {
305 self.inner = self.inner.set_priority(input);
306 self
307 }
308 /// <p>The priority of this rule. Rules are evaluated in priority order, with lower numbers having higher priority. When a DNS query matches multiple rules, the rule with the highest priority (lowest number) is applied.</p>
309 pub fn get_priority(&self) -> &::std::option::Option<i64> {
310 self.inner.get_priority()
311 }
312 /// <p>The ID of the DNS view to associate with this firewall rule.</p>
313 pub fn dns_view_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
314 self.inner = self.inner.dns_view_id(input.into());
315 self
316 }
317 /// <p>The ID of the DNS view to associate with this firewall rule.</p>
318 pub fn set_dns_view_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
319 self.inner = self.inner.set_dns_view_id(input);
320 self
321 }
322 /// <p>The ID of the DNS view to associate with this firewall rule.</p>
323 pub fn get_dns_view_id(&self) -> &::std::option::Option<::std::string::String> {
324 self.inner.get_dns_view_id()
325 }
326 /// <p>The DNS query type to match for this rule. Examples include A (IPv4 address), AAAA (IPv6 address), MX (mail exchange), or TXT (text record).</p>
327 pub fn q_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
328 self.inner = self.inner.q_type(input.into());
329 self
330 }
331 /// <p>The DNS query type to match for this rule. Examples include A (IPv4 address), AAAA (IPv6 address), MX (mail exchange), or TXT (text record).</p>
332 pub fn set_q_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
333 self.inner = self.inner.set_q_type(input);
334 self
335 }
336 /// <p>The DNS query type to match for this rule. Examples include A (IPv4 address), AAAA (IPv6 address), MX (mail exchange), or TXT (text record).</p>
337 pub fn get_q_type(&self) -> &::std::option::Option<::std::string::String> {
338 self.inner.get_q_type()
339 }
340}