aws_sdk_route53globalresolver/operation/update_firewall_rule/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_firewall_rule::_update_firewall_rule_output::UpdateFirewallRuleOutputBuilder;
3
4pub use crate::operation::update_firewall_rule::_update_firewall_rule_input::UpdateFirewallRuleInputBuilder;
5
6impl crate::operation::update_firewall_rule::builders::UpdateFirewallRuleInputBuilder {
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_rule::UpdateFirewallRuleOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_firewall_rule::UpdateFirewallRuleError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_firewall_rule();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateFirewallRule`.
24///
25/// <p>Updates the configuration of a DNS firewall rule.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdateFirewallRuleFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::update_firewall_rule::builders::UpdateFirewallRuleInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::update_firewall_rule::UpdateFirewallRuleOutput,
35        crate::operation::update_firewall_rule::UpdateFirewallRuleError,
36    > for UpdateFirewallRuleFluentBuilder
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_rule::UpdateFirewallRuleOutput,
44            crate::operation::update_firewall_rule::UpdateFirewallRuleError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl UpdateFirewallRuleFluentBuilder {
51    /// Creates a new `UpdateFirewallRuleFluentBuilder`.
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 UpdateFirewallRule as a reference.
60    pub fn as_input(&self) -> &crate::operation::update_firewall_rule::builders::UpdateFirewallRuleInputBuilder {
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_rule::UpdateFirewallRuleOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::update_firewall_rule::UpdateFirewallRuleError,
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_rule::UpdateFirewallRule::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::update_firewall_rule::UpdateFirewallRule::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_rule::UpdateFirewallRuleOutput,
97        crate::operation::update_firewall_rule::UpdateFirewallRuleError,
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, or a threat in a DNS Firewall Advanced rule.</p>
112    pub fn action(mut self, input: crate::types::FirewallRuleAction) -> Self {
113        self.inner = self.inner.action(input);
114        self
115    }
116    /// <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, or a threat in a DNS Firewall Advanced rule.</p>
117    pub fn set_action(mut self, input: ::std::option::Option<crate::types::FirewallRuleAction>) -> Self {
118        self.inner = self.inner.set_action(input);
119        self
120    }
121    /// <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, or a threat in a DNS Firewall Advanced rule.</p>
122    pub fn get_action(&self) -> &::std::option::Option<crate::types::FirewallRuleAction> {
123        self.inner.get_action()
124    }
125    /// <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>
126    pub fn block_override_dns_type(mut self, input: crate::types::BlockOverrideDnsQueryType) -> Self {
127        self.inner = self.inner.block_override_dns_type(input);
128        self
129    }
130    /// <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>
131    pub fn set_block_override_dns_type(mut self, input: ::std::option::Option<crate::types::BlockOverrideDnsQueryType>) -> Self {
132        self.inner = self.inner.set_block_override_dns_type(input);
133        self
134    }
135    /// <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>
136    pub fn get_block_override_dns_type(&self) -> &::std::option::Option<crate::types::BlockOverrideDnsQueryType> {
137        self.inner.get_block_override_dns_type()
138    }
139    /// <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>
140    pub fn block_override_domain(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.block_override_domain(input.into());
142        self
143    }
144    /// <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>
145    pub fn set_block_override_domain(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_block_override_domain(input);
147        self
148    }
149    /// <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>
150    pub fn get_block_override_domain(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_block_override_domain()
152    }
153    /// <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>
154    pub fn block_override_ttl(mut self, input: i32) -> Self {
155        self.inner = self.inner.block_override_ttl(input);
156        self
157    }
158    /// <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>
159    pub fn set_block_override_ttl(mut self, input: ::std::option::Option<i32>) -> Self {
160        self.inner = self.inner.set_block_override_ttl(input);
161        self
162    }
163    /// <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>
164    pub fn get_block_override_ttl(&self) -> &::std::option::Option<i32> {
165        self.inner.get_block_override_ttl()
166    }
167    /// <p>The way that you want DNS Firewall to block the request. Used for the rule action setting <code>BLOCK</code>.</p>
168    pub fn block_response(mut self, input: crate::types::FirewallBlockResponse) -> Self {
169        self.inner = self.inner.block_response(input);
170        self
171    }
172    /// <p>The way that you want DNS Firewall to block the request. Used for the rule action setting <code>BLOCK</code>.</p>
173    pub fn set_block_response(mut self, input: ::std::option::Option<crate::types::FirewallBlockResponse>) -> Self {
174        self.inner = self.inner.set_block_response(input);
175        self
176    }
177    /// <p>The way that you want DNS Firewall to block the request. Used for the rule action setting <code>BLOCK</code>.</p>
178    pub fn get_block_response(&self) -> &::std::option::Option<crate::types::FirewallBlockResponse> {
179        self.inner.get_block_response()
180    }
181    /// <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>
182    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
183        self.inner = self.inner.client_token(input.into());
184        self
185    }
186    /// <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>
187    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
188        self.inner = self.inner.set_client_token(input);
189        self
190    }
191    /// <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>
192    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
193        self.inner.get_client_token()
194    }
195    /// <p>The confidence threshold for DNS Firewall Advanced. You must provide this value when you create a DNS Firewall Advanced rule.</p>
196    pub fn confidence_threshold(mut self, input: crate::types::ConfidenceThreshold) -> Self {
197        self.inner = self.inner.confidence_threshold(input);
198        self
199    }
200    /// <p>The confidence threshold for DNS Firewall Advanced. You must provide this value when you create a DNS Firewall Advanced rule.</p>
201    pub fn set_confidence_threshold(mut self, input: ::std::option::Option<crate::types::ConfidenceThreshold>) -> Self {
202        self.inner = self.inner.set_confidence_threshold(input);
203        self
204    }
205    /// <p>The confidence threshold for DNS Firewall Advanced. You must provide this value when you create a DNS Firewall Advanced rule.</p>
206    pub fn get_confidence_threshold(&self) -> &::std::option::Option<crate::types::ConfidenceThreshold> {
207        self.inner.get_confidence_threshold()
208    }
209    /// <p>The description for the Firewall rule.</p>
210    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
211        self.inner = self.inner.description(input.into());
212        self
213    }
214    /// <p>The description for the Firewall rule.</p>
215    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
216        self.inner = self.inner.set_description(input);
217        self
218    }
219    /// <p>The description for the Firewall rule.</p>
220    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
221        self.inner.get_description()
222    }
223    /// <p>The type of the DNS Firewall Advanced rule. Valid values are DGA and DNS_TUNNELING.</p>
224    pub fn dns_advanced_protection(mut self, input: crate::types::DnsAdvancedProtection) -> Self {
225        self.inner = self.inner.dns_advanced_protection(input);
226        self
227    }
228    /// <p>The type of the DNS Firewall Advanced rule. Valid values are DGA and DNS_TUNNELING.</p>
229    pub fn set_dns_advanced_protection(mut self, input: ::std::option::Option<crate::types::DnsAdvancedProtection>) -> Self {
230        self.inner = self.inner.set_dns_advanced_protection(input);
231        self
232    }
233    /// <p>The type of the DNS Firewall Advanced rule. Valid values are DGA and DNS_TUNNELING.</p>
234    pub fn get_dns_advanced_protection(&self) -> &::std::option::Option<crate::types::DnsAdvancedProtection> {
235        self.inner.get_dns_advanced_protection()
236    }
237    /// <p>The ID of the DNS Firewall rule.</p>
238    pub fn firewall_rule_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
239        self.inner = self.inner.firewall_rule_id(input.into());
240        self
241    }
242    /// <p>The ID of the DNS Firewall rule.</p>
243    pub fn set_firewall_rule_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
244        self.inner = self.inner.set_firewall_rule_id(input);
245        self
246    }
247    /// <p>The ID of the DNS Firewall rule.</p>
248    pub fn get_firewall_rule_id(&self) -> &::std::option::Option<::std::string::String> {
249        self.inner.get_firewall_rule_id()
250    }
251    /// <p>The name of the DNS Firewall rule.</p>
252    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
253        self.inner = self.inner.name(input.into());
254        self
255    }
256    /// <p>The name of the DNS Firewall rule.</p>
257    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
258        self.inner = self.inner.set_name(input);
259        self
260    }
261    /// <p>The name of the DNS Firewall rule.</p>
262    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
263        self.inner.get_name()
264    }
265    /// <p>The setting that determines the processing order of the rule in the rule group. DNS Firewall processes the rules in a rule group by order of priority, starting from the lowest setting.</p>
266    pub fn priority(mut self, input: i64) -> Self {
267        self.inner = self.inner.priority(input);
268        self
269    }
270    /// <p>The setting that determines the processing order of the rule in the rule group. DNS Firewall processes the rules in a rule group by order of priority, starting from the lowest setting.</p>
271    pub fn set_priority(mut self, input: ::std::option::Option<i64>) -> Self {
272        self.inner = self.inner.set_priority(input);
273        self
274    }
275    /// <p>The setting that determines the processing order of the rule in the rule group. DNS Firewall processes the rules in a rule group by order of priority, starting from the lowest setting.</p>
276    pub fn get_priority(&self) -> &::std::option::Option<i64> {
277        self.inner.get_priority()
278    }
279}