aws_sdk_route53resolver/operation/list_firewall_rules/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::list_firewall_rules::_list_firewall_rules_output::ListFirewallRulesOutputBuilder;
3
4pub use crate::operation::list_firewall_rules::_list_firewall_rules_input::ListFirewallRulesInputBuilder;
5
6impl crate::operation::list_firewall_rules::builders::ListFirewallRulesInputBuilder {
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::list_firewall_rules::ListFirewallRulesOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::list_firewall_rules::ListFirewallRulesError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.list_firewall_rules();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ListFirewallRules`.
24///
25/// <p>Retrieves the firewall rules that you have defined for the specified firewall rule group. DNS Firewall uses the rules in a rule group to filter DNS network traffic for a VPC.</p>
26/// <p>A single call might return only a partial list of the rules. For information, see <code>MaxResults</code>.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct ListFirewallRulesFluentBuilder {
29    handle: ::std::sync::Arc<crate::client::Handle>,
30    inner: crate::operation::list_firewall_rules::builders::ListFirewallRulesInputBuilder,
31    config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34    crate::client::customize::internal::CustomizableSend<
35        crate::operation::list_firewall_rules::ListFirewallRulesOutput,
36        crate::operation::list_firewall_rules::ListFirewallRulesError,
37    > for ListFirewallRulesFluentBuilder
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::list_firewall_rules::ListFirewallRulesOutput,
45            crate::operation::list_firewall_rules::ListFirewallRulesError,
46        >,
47    > {
48        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49    }
50}
51impl ListFirewallRulesFluentBuilder {
52    /// Creates a new `ListFirewallRulesFluentBuilder`.
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 ListFirewallRules as a reference.
61    pub fn as_input(&self) -> &crate::operation::list_firewall_rules::builders::ListFirewallRulesInputBuilder {
62        &self.inner
63    }
64    /// Sends the request and returns the response.
65    ///
66    /// If an error occurs, an `SdkError` will be returned with additional details that
67    /// can be matched against.
68    ///
69    /// By default, any retryable failures will be retried twice. Retry behavior
70    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
71    /// set when configuring the client.
72    pub async fn send(
73        self,
74    ) -> ::std::result::Result<
75        crate::operation::list_firewall_rules::ListFirewallRulesOutput,
76        ::aws_smithy_runtime_api::client::result::SdkError<
77            crate::operation::list_firewall_rules::ListFirewallRulesError,
78            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
79        >,
80    > {
81        let input = self
82            .inner
83            .build()
84            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
85        let runtime_plugins = crate::operation::list_firewall_rules::ListFirewallRules::operation_runtime_plugins(
86            self.handle.runtime_plugins.clone(),
87            &self.handle.conf,
88            self.config_override,
89        );
90        crate::operation::list_firewall_rules::ListFirewallRules::orchestrate(&runtime_plugins, input).await
91    }
92
93    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
94    pub fn customize(
95        self,
96    ) -> crate::client::customize::CustomizableOperation<
97        crate::operation::list_firewall_rules::ListFirewallRulesOutput,
98        crate::operation::list_firewall_rules::ListFirewallRulesError,
99        Self,
100    > {
101        crate::client::customize::CustomizableOperation::new(self)
102    }
103    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
104        self.set_config_override(::std::option::Option::Some(config_override.into()));
105        self
106    }
107
108    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
109        self.config_override = config_override;
110        self
111    }
112    /// Create a paginator for this request
113    ///
114    /// Paginators are used by calling [`send().await`](crate::operation::list_firewall_rules::paginator::ListFirewallRulesPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
115    pub fn into_paginator(self) -> crate::operation::list_firewall_rules::paginator::ListFirewallRulesPaginator {
116        crate::operation::list_firewall_rules::paginator::ListFirewallRulesPaginator::new(self.handle, self.inner)
117    }
118    /// <p>The unique identifier of the firewall rule group that you want to retrieve the rules for.</p>
119    pub fn firewall_rule_group_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120        self.inner = self.inner.firewall_rule_group_id(input.into());
121        self
122    }
123    /// <p>The unique identifier of the firewall rule group that you want to retrieve the rules for.</p>
124    pub fn set_firewall_rule_group_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125        self.inner = self.inner.set_firewall_rule_group_id(input);
126        self
127    }
128    /// <p>The unique identifier of the firewall rule group that you want to retrieve the rules for.</p>
129    pub fn get_firewall_rule_group_id(&self) -> &::std::option::Option<::std::string::String> {
130        self.inner.get_firewall_rule_group_id()
131    }
132    /// <p>Optional additional filter for the rules to retrieve.</p>
133    /// <p>The setting that determines the processing order of the rules in a rule group. DNS Firewall processes the rules in a rule group by order of priority, starting from the lowest setting.</p>
134    pub fn priority(mut self, input: i32) -> Self {
135        self.inner = self.inner.priority(input);
136        self
137    }
138    /// <p>Optional additional filter for the rules to retrieve.</p>
139    /// <p>The setting that determines the processing order of the rules in a rule group. DNS Firewall processes the rules in a rule group by order of priority, starting from the lowest setting.</p>
140    pub fn set_priority(mut self, input: ::std::option::Option<i32>) -> Self {
141        self.inner = self.inner.set_priority(input);
142        self
143    }
144    /// <p>Optional additional filter for the rules to retrieve.</p>
145    /// <p>The setting that determines the processing order of the rules in a rule group. DNS Firewall processes the rules in a rule group by order of priority, starting from the lowest setting.</p>
146    pub fn get_priority(&self) -> &::std::option::Option<i32> {
147        self.inner.get_priority()
148    }
149    /// <p>Optional additional filter for the rules to retrieve.</p>
150    /// <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>
151    /// <ul>
152    /// <li>
153    /// <p><code>ALLOW</code> - Permit the request to go through. Not availabe for DNS Firewall Advanced rules.</p></li>
154    /// <li>
155    /// <p><code>ALERT</code> - Permit the request to go through but send an alert to the logs.</p></li>
156    /// <li>
157    /// <p><code>BLOCK</code> - Disallow the request. If this is specified, additional handling details are provided in the rule's <code>BlockResponse</code> setting.</p></li>
158    /// </ul>
159    pub fn action(mut self, input: crate::types::Action) -> Self {
160        self.inner = self.inner.action(input);
161        self
162    }
163    /// <p>Optional additional filter for the rules to retrieve.</p>
164    /// <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>
165    /// <ul>
166    /// <li>
167    /// <p><code>ALLOW</code> - Permit the request to go through. Not availabe for DNS Firewall Advanced rules.</p></li>
168    /// <li>
169    /// <p><code>ALERT</code> - Permit the request to go through but send an alert to the logs.</p></li>
170    /// <li>
171    /// <p><code>BLOCK</code> - Disallow the request. If this is specified, additional handling details are provided in the rule's <code>BlockResponse</code> setting.</p></li>
172    /// </ul>
173    pub fn set_action(mut self, input: ::std::option::Option<crate::types::Action>) -> Self {
174        self.inner = self.inner.set_action(input);
175        self
176    }
177    /// <p>Optional additional filter for the rules to retrieve.</p>
178    /// <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>
179    /// <ul>
180    /// <li>
181    /// <p><code>ALLOW</code> - Permit the request to go through. Not availabe for DNS Firewall Advanced rules.</p></li>
182    /// <li>
183    /// <p><code>ALERT</code> - Permit the request to go through but send an alert to the logs.</p></li>
184    /// <li>
185    /// <p><code>BLOCK</code> - Disallow the request. If this is specified, additional handling details are provided in the rule's <code>BlockResponse</code> setting.</p></li>
186    /// </ul>
187    pub fn get_action(&self) -> &::std::option::Option<crate::types::Action> {
188        self.inner.get_action()
189    }
190    /// <p>The maximum number of objects that you want Resolver to return for this request. If more objects are available, in the response, Resolver provides a <code>NextToken</code> value that you can use in a subsequent call to get the next batch of objects.</p>
191    /// <p>If you don't specify a value for <code>MaxResults</code>, Resolver returns up to 100 objects.</p>
192    pub fn max_results(mut self, input: i32) -> Self {
193        self.inner = self.inner.max_results(input);
194        self
195    }
196    /// <p>The maximum number of objects that you want Resolver to return for this request. If more objects are available, in the response, Resolver provides a <code>NextToken</code> value that you can use in a subsequent call to get the next batch of objects.</p>
197    /// <p>If you don't specify a value for <code>MaxResults</code>, Resolver returns up to 100 objects.</p>
198    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
199        self.inner = self.inner.set_max_results(input);
200        self
201    }
202    /// <p>The maximum number of objects that you want Resolver to return for this request. If more objects are available, in the response, Resolver provides a <code>NextToken</code> value that you can use in a subsequent call to get the next batch of objects.</p>
203    /// <p>If you don't specify a value for <code>MaxResults</code>, Resolver returns up to 100 objects.</p>
204    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
205        self.inner.get_max_results()
206    }
207    /// <p>For the first call to this list request, omit this value.</p>
208    /// <p>When you request a list of objects, Resolver returns at most the number of objects specified in <code>MaxResults</code>. If more objects are available for retrieval, Resolver returns a <code>NextToken</code> value in the response. To retrieve the next batch of objects, use the token that was returned for the prior request in your next request.</p>
209    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
210        self.inner = self.inner.next_token(input.into());
211        self
212    }
213    /// <p>For the first call to this list request, omit this value.</p>
214    /// <p>When you request a list of objects, Resolver returns at most the number of objects specified in <code>MaxResults</code>. If more objects are available for retrieval, Resolver returns a <code>NextToken</code> value in the response. To retrieve the next batch of objects, use the token that was returned for the prior request in your next request.</p>
215    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
216        self.inner = self.inner.set_next_token(input);
217        self
218    }
219    /// <p>For the first call to this list request, omit this value.</p>
220    /// <p>When you request a list of objects, Resolver returns at most the number of objects specified in <code>MaxResults</code>. If more objects are available for retrieval, Resolver returns a <code>NextToken</code> value in the response. To retrieve the next batch of objects, use the token that was returned for the prior request in your next request.</p>
221    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
222        self.inner.get_next_token()
223    }
224}