aws_sdk_ec2/operation/delete_route/
_delete_route_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct DeleteRouteInput {
6    /// <p>The ID of the prefix list for the route.</p>
7    pub destination_prefix_list_id: ::std::option::Option<::std::string::String>,
8    /// <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>
9    pub dry_run: ::std::option::Option<bool>,
10    /// <p>The ID of the route table.</p>
11    pub route_table_id: ::std::option::Option<::std::string::String>,
12    /// <p>The IPv4 CIDR range for the route. The value you specify must match the CIDR for the route exactly.</p>
13    pub destination_cidr_block: ::std::option::Option<::std::string::String>,
14    /// <p>The IPv6 CIDR range for the route. The value you specify must match the CIDR for the route exactly.</p>
15    pub destination_ipv6_cidr_block: ::std::option::Option<::std::string::String>,
16}
17impl DeleteRouteInput {
18    /// <p>The ID of the prefix list for the route.</p>
19    pub fn destination_prefix_list_id(&self) -> ::std::option::Option<&str> {
20        self.destination_prefix_list_id.as_deref()
21    }
22    /// <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>
23    pub fn dry_run(&self) -> ::std::option::Option<bool> {
24        self.dry_run
25    }
26    /// <p>The ID of the route table.</p>
27    pub fn route_table_id(&self) -> ::std::option::Option<&str> {
28        self.route_table_id.as_deref()
29    }
30    /// <p>The IPv4 CIDR range for the route. The value you specify must match the CIDR for the route exactly.</p>
31    pub fn destination_cidr_block(&self) -> ::std::option::Option<&str> {
32        self.destination_cidr_block.as_deref()
33    }
34    /// <p>The IPv6 CIDR range for the route. The value you specify must match the CIDR for the route exactly.</p>
35    pub fn destination_ipv6_cidr_block(&self) -> ::std::option::Option<&str> {
36        self.destination_ipv6_cidr_block.as_deref()
37    }
38}
39impl DeleteRouteInput {
40    /// Creates a new builder-style object to manufacture [`DeleteRouteInput`](crate::operation::delete_route::DeleteRouteInput).
41    pub fn builder() -> crate::operation::delete_route::builders::DeleteRouteInputBuilder {
42        crate::operation::delete_route::builders::DeleteRouteInputBuilder::default()
43    }
44}
45
46/// A builder for [`DeleteRouteInput`](crate::operation::delete_route::DeleteRouteInput).
47#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
48#[non_exhaustive]
49pub struct DeleteRouteInputBuilder {
50    pub(crate) destination_prefix_list_id: ::std::option::Option<::std::string::String>,
51    pub(crate) dry_run: ::std::option::Option<bool>,
52    pub(crate) route_table_id: ::std::option::Option<::std::string::String>,
53    pub(crate) destination_cidr_block: ::std::option::Option<::std::string::String>,
54    pub(crate) destination_ipv6_cidr_block: ::std::option::Option<::std::string::String>,
55}
56impl DeleteRouteInputBuilder {
57    /// <p>The ID of the prefix list for the route.</p>
58    pub fn destination_prefix_list_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
59        self.destination_prefix_list_id = ::std::option::Option::Some(input.into());
60        self
61    }
62    /// <p>The ID of the prefix list for the route.</p>
63    pub fn set_destination_prefix_list_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
64        self.destination_prefix_list_id = input;
65        self
66    }
67    /// <p>The ID of the prefix list for the route.</p>
68    pub fn get_destination_prefix_list_id(&self) -> &::std::option::Option<::std::string::String> {
69        &self.destination_prefix_list_id
70    }
71    /// <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>
72    pub fn dry_run(mut self, input: bool) -> Self {
73        self.dry_run = ::std::option::Option::Some(input);
74        self
75    }
76    /// <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>
77    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
78        self.dry_run = input;
79        self
80    }
81    /// <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>
82    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
83        &self.dry_run
84    }
85    /// <p>The ID of the route table.</p>
86    /// This field is required.
87    pub fn route_table_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
88        self.route_table_id = ::std::option::Option::Some(input.into());
89        self
90    }
91    /// <p>The ID of the route table.</p>
92    pub fn set_route_table_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
93        self.route_table_id = input;
94        self
95    }
96    /// <p>The ID of the route table.</p>
97    pub fn get_route_table_id(&self) -> &::std::option::Option<::std::string::String> {
98        &self.route_table_id
99    }
100    /// <p>The IPv4 CIDR range for the route. The value you specify must match the CIDR for the route exactly.</p>
101    pub fn destination_cidr_block(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
102        self.destination_cidr_block = ::std::option::Option::Some(input.into());
103        self
104    }
105    /// <p>The IPv4 CIDR range for the route. The value you specify must match the CIDR for the route exactly.</p>
106    pub fn set_destination_cidr_block(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
107        self.destination_cidr_block = input;
108        self
109    }
110    /// <p>The IPv4 CIDR range for the route. The value you specify must match the CIDR for the route exactly.</p>
111    pub fn get_destination_cidr_block(&self) -> &::std::option::Option<::std::string::String> {
112        &self.destination_cidr_block
113    }
114    /// <p>The IPv6 CIDR range for the route. The value you specify must match the CIDR for the route exactly.</p>
115    pub fn destination_ipv6_cidr_block(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116        self.destination_ipv6_cidr_block = ::std::option::Option::Some(input.into());
117        self
118    }
119    /// <p>The IPv6 CIDR range for the route. The value you specify must match the CIDR for the route exactly.</p>
120    pub fn set_destination_ipv6_cidr_block(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121        self.destination_ipv6_cidr_block = input;
122        self
123    }
124    /// <p>The IPv6 CIDR range for the route. The value you specify must match the CIDR for the route exactly.</p>
125    pub fn get_destination_ipv6_cidr_block(&self) -> &::std::option::Option<::std::string::String> {
126        &self.destination_ipv6_cidr_block
127    }
128    /// Consumes the builder and constructs a [`DeleteRouteInput`](crate::operation::delete_route::DeleteRouteInput).
129    pub fn build(self) -> ::std::result::Result<crate::operation::delete_route::DeleteRouteInput, ::aws_smithy_types::error::operation::BuildError> {
130        ::std::result::Result::Ok(crate::operation::delete_route::DeleteRouteInput {
131            destination_prefix_list_id: self.destination_prefix_list_id,
132            dry_run: self.dry_run,
133            route_table_id: self.route_table_id,
134            destination_cidr_block: self.destination_cidr_block,
135            destination_ipv6_cidr_block: self.destination_ipv6_cidr_block,
136        })
137    }
138}