aws_sdk_ec2/operation/replace_network_acl_entry/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::replace_network_acl_entry::_replace_network_acl_entry_output::ReplaceNetworkAclEntryOutputBuilder;
3
4pub use crate::operation::replace_network_acl_entry::_replace_network_acl_entry_input::ReplaceNetworkAclEntryInputBuilder;
5
6impl crate::operation::replace_network_acl_entry::builders::ReplaceNetworkAclEntryInputBuilder {
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::replace_network_acl_entry::ReplaceNetworkAclEntryOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::replace_network_acl_entry::ReplaceNetworkAclEntryError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.replace_network_acl_entry();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ReplaceNetworkAclEntry`.
24///
25/// <p>Replaces an entry (rule) in a network ACL. For more information, see <a href="https://docs.aws.amazon.com/vpc/latest/userguide/vpc-network-acls.html">Network ACLs</a> in the <i>Amazon VPC User Guide</i>.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct ReplaceNetworkAclEntryFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::replace_network_acl_entry::builders::ReplaceNetworkAclEntryInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::replace_network_acl_entry::ReplaceNetworkAclEntryOutput,
35        crate::operation::replace_network_acl_entry::ReplaceNetworkAclEntryError,
36    > for ReplaceNetworkAclEntryFluentBuilder
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::replace_network_acl_entry::ReplaceNetworkAclEntryOutput,
44            crate::operation::replace_network_acl_entry::ReplaceNetworkAclEntryError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl ReplaceNetworkAclEntryFluentBuilder {
51    /// Creates a new `ReplaceNetworkAclEntryFluentBuilder`.
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 ReplaceNetworkAclEntry as a reference.
60    pub fn as_input(&self) -> &crate::operation::replace_network_acl_entry::builders::ReplaceNetworkAclEntryInputBuilder {
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::replace_network_acl_entry::ReplaceNetworkAclEntryOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::replace_network_acl_entry::ReplaceNetworkAclEntryError,
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::replace_network_acl_entry::ReplaceNetworkAclEntry::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::replace_network_acl_entry::ReplaceNetworkAclEntry::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::replace_network_acl_entry::ReplaceNetworkAclEntryOutput,
97        crate::operation::replace_network_acl_entry::ReplaceNetworkAclEntryError,
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>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
112    pub fn dry_run(mut self, input: bool) -> Self {
113        self.inner = self.inner.dry_run(input);
114        self
115    }
116    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
117    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
118        self.inner = self.inner.set_dry_run(input);
119        self
120    }
121    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
122    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
123        self.inner.get_dry_run()
124    }
125    /// <p>The ID of the ACL.</p>
126    pub fn network_acl_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.network_acl_id(input.into());
128        self
129    }
130    /// <p>The ID of the ACL.</p>
131    pub fn set_network_acl_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_network_acl_id(input);
133        self
134    }
135    /// <p>The ID of the ACL.</p>
136    pub fn get_network_acl_id(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_network_acl_id()
138    }
139    /// <p>The rule number of the entry to replace.</p>
140    pub fn rule_number(mut self, input: i32) -> Self {
141        self.inner = self.inner.rule_number(input);
142        self
143    }
144    /// <p>The rule number of the entry to replace.</p>
145    pub fn set_rule_number(mut self, input: ::std::option::Option<i32>) -> Self {
146        self.inner = self.inner.set_rule_number(input);
147        self
148    }
149    /// <p>The rule number of the entry to replace.</p>
150    pub fn get_rule_number(&self) -> &::std::option::Option<i32> {
151        self.inner.get_rule_number()
152    }
153    /// <p>The protocol number. A value of "-1" means all protocols. If you specify "-1" or a protocol number other than "6" (TCP), "17" (UDP), or "1" (ICMP), traffic on all ports is allowed, regardless of any ports or ICMP types or codes that you specify. If you specify protocol "58" (ICMPv6) and specify an IPv4 CIDR block, traffic for all ICMP types and codes allowed, regardless of any that you specify. If you specify protocol "58" (ICMPv6) and specify an IPv6 CIDR block, you must specify an ICMP type and code.</p>
154    pub fn protocol(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155        self.inner = self.inner.protocol(input.into());
156        self
157    }
158    /// <p>The protocol number. A value of "-1" means all protocols. If you specify "-1" or a protocol number other than "6" (TCP), "17" (UDP), or "1" (ICMP), traffic on all ports is allowed, regardless of any ports or ICMP types or codes that you specify. If you specify protocol "58" (ICMPv6) and specify an IPv4 CIDR block, traffic for all ICMP types and codes allowed, regardless of any that you specify. If you specify protocol "58" (ICMPv6) and specify an IPv6 CIDR block, you must specify an ICMP type and code.</p>
159    pub fn set_protocol(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160        self.inner = self.inner.set_protocol(input);
161        self
162    }
163    /// <p>The protocol number. A value of "-1" means all protocols. If you specify "-1" or a protocol number other than "6" (TCP), "17" (UDP), or "1" (ICMP), traffic on all ports is allowed, regardless of any ports or ICMP types or codes that you specify. If you specify protocol "58" (ICMPv6) and specify an IPv4 CIDR block, traffic for all ICMP types and codes allowed, regardless of any that you specify. If you specify protocol "58" (ICMPv6) and specify an IPv6 CIDR block, you must specify an ICMP type and code.</p>
164    pub fn get_protocol(&self) -> &::std::option::Option<::std::string::String> {
165        self.inner.get_protocol()
166    }
167    /// <p>Indicates whether to allow or deny the traffic that matches the rule.</p>
168    pub fn rule_action(mut self, input: crate::types::RuleAction) -> Self {
169        self.inner = self.inner.rule_action(input);
170        self
171    }
172    /// <p>Indicates whether to allow or deny the traffic that matches the rule.</p>
173    pub fn set_rule_action(mut self, input: ::std::option::Option<crate::types::RuleAction>) -> Self {
174        self.inner = self.inner.set_rule_action(input);
175        self
176    }
177    /// <p>Indicates whether to allow or deny the traffic that matches the rule.</p>
178    pub fn get_rule_action(&self) -> &::std::option::Option<crate::types::RuleAction> {
179        self.inner.get_rule_action()
180    }
181    /// <p>Indicates whether to replace the egress rule.</p>
182    /// <p>Default: If no value is specified, we replace the ingress rule.</p>
183    pub fn egress(mut self, input: bool) -> Self {
184        self.inner = self.inner.egress(input);
185        self
186    }
187    /// <p>Indicates whether to replace the egress rule.</p>
188    /// <p>Default: If no value is specified, we replace the ingress rule.</p>
189    pub fn set_egress(mut self, input: ::std::option::Option<bool>) -> Self {
190        self.inner = self.inner.set_egress(input);
191        self
192    }
193    /// <p>Indicates whether to replace the egress rule.</p>
194    /// <p>Default: If no value is specified, we replace the ingress rule.</p>
195    pub fn get_egress(&self) -> &::std::option::Option<bool> {
196        self.inner.get_egress()
197    }
198    /// <p>The IPv4 network range to allow or deny, in CIDR notation (for example <code>172.16.0.0/24</code>).</p>
199    pub fn cidr_block(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
200        self.inner = self.inner.cidr_block(input.into());
201        self
202    }
203    /// <p>The IPv4 network range to allow or deny, in CIDR notation (for example <code>172.16.0.0/24</code>).</p>
204    pub fn set_cidr_block(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
205        self.inner = self.inner.set_cidr_block(input);
206        self
207    }
208    /// <p>The IPv4 network range to allow or deny, in CIDR notation (for example <code>172.16.0.0/24</code>).</p>
209    pub fn get_cidr_block(&self) -> &::std::option::Option<::std::string::String> {
210        self.inner.get_cidr_block()
211    }
212    /// <p>The IPv6 network range to allow or deny, in CIDR notation (for example <code>2001:bd8:1234:1a00::/64</code>).</p>
213    pub fn ipv6_cidr_block(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
214        self.inner = self.inner.ipv6_cidr_block(input.into());
215        self
216    }
217    /// <p>The IPv6 network range to allow or deny, in CIDR notation (for example <code>2001:bd8:1234:1a00::/64</code>).</p>
218    pub fn set_ipv6_cidr_block(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
219        self.inner = self.inner.set_ipv6_cidr_block(input);
220        self
221    }
222    /// <p>The IPv6 network range to allow or deny, in CIDR notation (for example <code>2001:bd8:1234:1a00::/64</code>).</p>
223    pub fn get_ipv6_cidr_block(&self) -> &::std::option::Option<::std::string::String> {
224        self.inner.get_ipv6_cidr_block()
225    }
226    /// <p>ICMP protocol: The ICMP or ICMPv6 type and code. Required if specifying protocol 1 (ICMP) or protocol 58 (ICMPv6) with an IPv6 CIDR block.</p>
227    pub fn icmp_type_code(mut self, input: crate::types::IcmpTypeCode) -> Self {
228        self.inner = self.inner.icmp_type_code(input);
229        self
230    }
231    /// <p>ICMP protocol: The ICMP or ICMPv6 type and code. Required if specifying protocol 1 (ICMP) or protocol 58 (ICMPv6) with an IPv6 CIDR block.</p>
232    pub fn set_icmp_type_code(mut self, input: ::std::option::Option<crate::types::IcmpTypeCode>) -> Self {
233        self.inner = self.inner.set_icmp_type_code(input);
234        self
235    }
236    /// <p>ICMP protocol: The ICMP or ICMPv6 type and code. Required if specifying protocol 1 (ICMP) or protocol 58 (ICMPv6) with an IPv6 CIDR block.</p>
237    pub fn get_icmp_type_code(&self) -> &::std::option::Option<crate::types::IcmpTypeCode> {
238        self.inner.get_icmp_type_code()
239    }
240    /// <p>TCP or UDP protocols: The range of ports the rule applies to. Required if specifying protocol 6 (TCP) or 17 (UDP).</p>
241    pub fn port_range(mut self, input: crate::types::PortRange) -> Self {
242        self.inner = self.inner.port_range(input);
243        self
244    }
245    /// <p>TCP or UDP protocols: The range of ports the rule applies to. Required if specifying protocol 6 (TCP) or 17 (UDP).</p>
246    pub fn set_port_range(mut self, input: ::std::option::Option<crate::types::PortRange>) -> Self {
247        self.inner = self.inner.set_port_range(input);
248        self
249    }
250    /// <p>TCP or UDP protocols: The range of ports the rule applies to. Required if specifying protocol 6 (TCP) or 17 (UDP).</p>
251    pub fn get_port_range(&self) -> &::std::option::Option<crate::types::PortRange> {
252        self.inner.get_port_range()
253    }
254}