aws_sdk_ec2/operation/replace_route/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::replace_route::_replace_route_output::ReplaceRouteOutputBuilder;
3
4pub use crate::operation::replace_route::_replace_route_input::ReplaceRouteInputBuilder;
5
6impl crate::operation::replace_route::builders::ReplaceRouteInputBuilder {
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_route::ReplaceRouteOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::replace_route::ReplaceRouteError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.replace_route();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ReplaceRoute`.
24///
25/// <p>Replaces an existing route within a route table in a VPC.</p>
26/// <p>You must specify either a destination CIDR block or a prefix list ID. You must also specify exactly one of the resources from the parameter list, or reset the local route to its default target.</p>
27/// <p>For more information, see <a href="https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Route_Tables.html">Route tables</a> in the <i>Amazon VPC User Guide</i>.</p>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct ReplaceRouteFluentBuilder {
30    handle: ::std::sync::Arc<crate::client::Handle>,
31    inner: crate::operation::replace_route::builders::ReplaceRouteInputBuilder,
32    config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35    crate::client::customize::internal::CustomizableSend<
36        crate::operation::replace_route::ReplaceRouteOutput,
37        crate::operation::replace_route::ReplaceRouteError,
38    > for ReplaceRouteFluentBuilder
39{
40    fn send(
41        self,
42        config_override: crate::config::Builder,
43    ) -> crate::client::customize::internal::BoxFuture<
44        crate::client::customize::internal::SendResult<
45            crate::operation::replace_route::ReplaceRouteOutput,
46            crate::operation::replace_route::ReplaceRouteError,
47        >,
48    > {
49        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50    }
51}
52impl ReplaceRouteFluentBuilder {
53    /// Creates a new `ReplaceRouteFluentBuilder`.
54    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
55        Self {
56            handle,
57            inner: ::std::default::Default::default(),
58            config_override: ::std::option::Option::None,
59        }
60    }
61    /// Access the ReplaceRoute as a reference.
62    pub fn as_input(&self) -> &crate::operation::replace_route::builders::ReplaceRouteInputBuilder {
63        &self.inner
64    }
65    /// Sends the request and returns the response.
66    ///
67    /// If an error occurs, an `SdkError` will be returned with additional details that
68    /// can be matched against.
69    ///
70    /// By default, any retryable failures will be retried twice. Retry behavior
71    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
72    /// set when configuring the client.
73    pub async fn send(
74        self,
75    ) -> ::std::result::Result<
76        crate::operation::replace_route::ReplaceRouteOutput,
77        ::aws_smithy_runtime_api::client::result::SdkError<
78            crate::operation::replace_route::ReplaceRouteError,
79            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
80        >,
81    > {
82        let input = self
83            .inner
84            .build()
85            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
86        let runtime_plugins = crate::operation::replace_route::ReplaceRoute::operation_runtime_plugins(
87            self.handle.runtime_plugins.clone(),
88            &self.handle.conf,
89            self.config_override,
90        );
91        crate::operation::replace_route::ReplaceRoute::orchestrate(&runtime_plugins, input).await
92    }
93
94    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
95    pub fn customize(
96        self,
97    ) -> crate::client::customize::CustomizableOperation<
98        crate::operation::replace_route::ReplaceRouteOutput,
99        crate::operation::replace_route::ReplaceRouteError,
100        Self,
101    > {
102        crate::client::customize::CustomizableOperation::new(self)
103    }
104    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
105        self.set_config_override(::std::option::Option::Some(config_override.into()));
106        self
107    }
108
109    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
110        self.config_override = config_override;
111        self
112    }
113    /// <p>The ID of the prefix list for the route.</p>
114    pub fn destination_prefix_list_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115        self.inner = self.inner.destination_prefix_list_id(input.into());
116        self
117    }
118    /// <p>The ID of the prefix list for the route.</p>
119    pub fn set_destination_prefix_list_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120        self.inner = self.inner.set_destination_prefix_list_id(input);
121        self
122    }
123    /// <p>The ID of the prefix list for the route.</p>
124    pub fn get_destination_prefix_list_id(&self) -> &::std::option::Option<::std::string::String> {
125        self.inner.get_destination_prefix_list_id()
126    }
127    /// <p>The ID of a VPC endpoint. Supported for Gateway Load Balancer endpoints only.</p>
128    pub fn vpc_endpoint_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129        self.inner = self.inner.vpc_endpoint_id(input.into());
130        self
131    }
132    /// <p>The ID of a VPC endpoint. Supported for Gateway Load Balancer endpoints only.</p>
133    pub fn set_vpc_endpoint_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134        self.inner = self.inner.set_vpc_endpoint_id(input);
135        self
136    }
137    /// <p>The ID of a VPC endpoint. Supported for Gateway Load Balancer endpoints only.</p>
138    pub fn get_vpc_endpoint_id(&self) -> &::std::option::Option<::std::string::String> {
139        self.inner.get_vpc_endpoint_id()
140    }
141    /// <p>Specifies whether to reset the local route to its default target (<code>local</code>).</p>
142    pub fn local_target(mut self, input: bool) -> Self {
143        self.inner = self.inner.local_target(input);
144        self
145    }
146    /// <p>Specifies whether to reset the local route to its default target (<code>local</code>).</p>
147    pub fn set_local_target(mut self, input: ::std::option::Option<bool>) -> Self {
148        self.inner = self.inner.set_local_target(input);
149        self
150    }
151    /// <p>Specifies whether to reset the local route to its default target (<code>local</code>).</p>
152    pub fn get_local_target(&self) -> &::std::option::Option<bool> {
153        self.inner.get_local_target()
154    }
155    /// <p>The ID of a transit gateway.</p>
156    pub fn transit_gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
157        self.inner = self.inner.transit_gateway_id(input.into());
158        self
159    }
160    /// <p>The ID of a transit gateway.</p>
161    pub fn set_transit_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
162        self.inner = self.inner.set_transit_gateway_id(input);
163        self
164    }
165    /// <p>The ID of a transit gateway.</p>
166    pub fn get_transit_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
167        self.inner.get_transit_gateway_id()
168    }
169    /// <p>The ID of the local gateway.</p>
170    pub fn local_gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
171        self.inner = self.inner.local_gateway_id(input.into());
172        self
173    }
174    /// <p>The ID of the local gateway.</p>
175    pub fn set_local_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
176        self.inner = self.inner.set_local_gateway_id(input);
177        self
178    }
179    /// <p>The ID of the local gateway.</p>
180    pub fn get_local_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
181        self.inner.get_local_gateway_id()
182    }
183    /// <p>\[IPv4 traffic only\] The ID of a carrier gateway.</p>
184    pub fn carrier_gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
185        self.inner = self.inner.carrier_gateway_id(input.into());
186        self
187    }
188    /// <p>\[IPv4 traffic only\] The ID of a carrier gateway.</p>
189    pub fn set_carrier_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
190        self.inner = self.inner.set_carrier_gateway_id(input);
191        self
192    }
193    /// <p>\[IPv4 traffic only\] The ID of a carrier gateway.</p>
194    pub fn get_carrier_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
195        self.inner.get_carrier_gateway_id()
196    }
197    /// <p>The Amazon Resource Name (ARN) of the core network.</p>
198    pub fn core_network_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
199        self.inner = self.inner.core_network_arn(input.into());
200        self
201    }
202    /// <p>The Amazon Resource Name (ARN) of the core network.</p>
203    pub fn set_core_network_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
204        self.inner = self.inner.set_core_network_arn(input);
205        self
206    }
207    /// <p>The Amazon Resource Name (ARN) of the core network.</p>
208    pub fn get_core_network_arn(&self) -> &::std::option::Option<::std::string::String> {
209        self.inner.get_core_network_arn()
210    }
211    /// <p>The Amazon Resource Name (ARN) of the ODB network.</p>
212    pub fn odb_network_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
213        self.inner = self.inner.odb_network_arn(input.into());
214        self
215    }
216    /// <p>The Amazon Resource Name (ARN) of the ODB network.</p>
217    pub fn set_odb_network_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
218        self.inner = self.inner.set_odb_network_arn(input);
219        self
220    }
221    /// <p>The Amazon Resource Name (ARN) of the ODB network.</p>
222    pub fn get_odb_network_arn(&self) -> &::std::option::Option<::std::string::String> {
223        self.inner.get_odb_network_arn()
224    }
225    /// <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>
226    pub fn dry_run(mut self, input: bool) -> Self {
227        self.inner = self.inner.dry_run(input);
228        self
229    }
230    /// <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>
231    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
232        self.inner = self.inner.set_dry_run(input);
233        self
234    }
235    /// <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>
236    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
237        self.inner.get_dry_run()
238    }
239    /// <p>The ID of the route table.</p>
240    pub fn route_table_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
241        self.inner = self.inner.route_table_id(input.into());
242        self
243    }
244    /// <p>The ID of the route table.</p>
245    pub fn set_route_table_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
246        self.inner = self.inner.set_route_table_id(input);
247        self
248    }
249    /// <p>The ID of the route table.</p>
250    pub fn get_route_table_id(&self) -> &::std::option::Option<::std::string::String> {
251        self.inner.get_route_table_id()
252    }
253    /// <p>The IPv4 CIDR address block used for the destination match. The value that you provide must match the CIDR of an existing route in the table.</p>
254    pub fn destination_cidr_block(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
255        self.inner = self.inner.destination_cidr_block(input.into());
256        self
257    }
258    /// <p>The IPv4 CIDR address block used for the destination match. The value that you provide must match the CIDR of an existing route in the table.</p>
259    pub fn set_destination_cidr_block(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
260        self.inner = self.inner.set_destination_cidr_block(input);
261        self
262    }
263    /// <p>The IPv4 CIDR address block used for the destination match. The value that you provide must match the CIDR of an existing route in the table.</p>
264    pub fn get_destination_cidr_block(&self) -> &::std::option::Option<::std::string::String> {
265        self.inner.get_destination_cidr_block()
266    }
267    /// <p>The ID of an internet gateway or virtual private gateway.</p>
268    pub fn gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
269        self.inner = self.inner.gateway_id(input.into());
270        self
271    }
272    /// <p>The ID of an internet gateway or virtual private gateway.</p>
273    pub fn set_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
274        self.inner = self.inner.set_gateway_id(input);
275        self
276    }
277    /// <p>The ID of an internet gateway or virtual private gateway.</p>
278    pub fn get_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
279        self.inner.get_gateway_id()
280    }
281    /// <p>The IPv6 CIDR address block used for the destination match. The value that you provide must match the CIDR of an existing route in the table.</p>
282    pub fn destination_ipv6_cidr_block(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
283        self.inner = self.inner.destination_ipv6_cidr_block(input.into());
284        self
285    }
286    /// <p>The IPv6 CIDR address block used for the destination match. The value that you provide must match the CIDR of an existing route in the table.</p>
287    pub fn set_destination_ipv6_cidr_block(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
288        self.inner = self.inner.set_destination_ipv6_cidr_block(input);
289        self
290    }
291    /// <p>The IPv6 CIDR address block used for the destination match. The value that you provide must match the CIDR of an existing route in the table.</p>
292    pub fn get_destination_ipv6_cidr_block(&self) -> &::std::option::Option<::std::string::String> {
293        self.inner.get_destination_ipv6_cidr_block()
294    }
295    /// <p>\[IPv6 traffic only\] The ID of an egress-only internet gateway.</p>
296    pub fn egress_only_internet_gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
297        self.inner = self.inner.egress_only_internet_gateway_id(input.into());
298        self
299    }
300    /// <p>\[IPv6 traffic only\] The ID of an egress-only internet gateway.</p>
301    pub fn set_egress_only_internet_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
302        self.inner = self.inner.set_egress_only_internet_gateway_id(input);
303        self
304    }
305    /// <p>\[IPv6 traffic only\] The ID of an egress-only internet gateway.</p>
306    pub fn get_egress_only_internet_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
307        self.inner.get_egress_only_internet_gateway_id()
308    }
309    /// <p>The ID of a NAT instance in your VPC.</p>
310    pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
311        self.inner = self.inner.instance_id(input.into());
312        self
313    }
314    /// <p>The ID of a NAT instance in your VPC.</p>
315    pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
316        self.inner = self.inner.set_instance_id(input);
317        self
318    }
319    /// <p>The ID of a NAT instance in your VPC.</p>
320    pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
321        self.inner.get_instance_id()
322    }
323    /// <p>The ID of a network interface.</p>
324    pub fn network_interface_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
325        self.inner = self.inner.network_interface_id(input.into());
326        self
327    }
328    /// <p>The ID of a network interface.</p>
329    pub fn set_network_interface_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
330        self.inner = self.inner.set_network_interface_id(input);
331        self
332    }
333    /// <p>The ID of a network interface.</p>
334    pub fn get_network_interface_id(&self) -> &::std::option::Option<::std::string::String> {
335        self.inner.get_network_interface_id()
336    }
337    /// <p>The ID of a VPC peering connection.</p>
338    pub fn vpc_peering_connection_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
339        self.inner = self.inner.vpc_peering_connection_id(input.into());
340        self
341    }
342    /// <p>The ID of a VPC peering connection.</p>
343    pub fn set_vpc_peering_connection_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
344        self.inner = self.inner.set_vpc_peering_connection_id(input);
345        self
346    }
347    /// <p>The ID of a VPC peering connection.</p>
348    pub fn get_vpc_peering_connection_id(&self) -> &::std::option::Option<::std::string::String> {
349        self.inner.get_vpc_peering_connection_id()
350    }
351    /// <p>\[IPv4 traffic only\] The ID of a NAT gateway.</p>
352    pub fn nat_gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
353        self.inner = self.inner.nat_gateway_id(input.into());
354        self
355    }
356    /// <p>\[IPv4 traffic only\] The ID of a NAT gateway.</p>
357    pub fn set_nat_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
358        self.inner = self.inner.set_nat_gateway_id(input);
359        self
360    }
361    /// <p>\[IPv4 traffic only\] The ID of a NAT gateway.</p>
362    pub fn get_nat_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
363        self.inner.get_nat_gateway_id()
364    }
365}