Skip to main content

aws_sdk_ec2/types/
_transit_gateway_propagation.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Describes route propagation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct TransitGatewayPropagation {
7    /// <p>The ID of the attachment.</p>
8    pub transit_gateway_attachment_id: ::std::option::Option<::std::string::String>,
9    /// <p>The ID of the resource.</p>
10    pub resource_id: ::std::option::Option<::std::string::String>,
11    /// <p>The resource type. Note that the <code>tgw-peering</code> resource type has been deprecated.</p>
12    pub resource_type: ::std::option::Option<crate::types::TransitGatewayAttachmentResourceType>,
13    /// <p>The ID of the transit gateway route table.</p>
14    pub transit_gateway_route_table_id: ::std::option::Option<::std::string::String>,
15    /// <p>The state.</p>
16    pub state: ::std::option::Option<crate::types::TransitGatewayPropagationState>,
17    /// <p>The ID of the transit gateway route table announcement.</p>
18    pub transit_gateway_route_table_announcement_id: ::std::option::Option<::std::string::String>,
19}
20impl TransitGatewayPropagation {
21    /// <p>The ID of the attachment.</p>
22    pub fn transit_gateway_attachment_id(&self) -> ::std::option::Option<&str> {
23        self.transit_gateway_attachment_id.as_deref()
24    }
25    /// <p>The ID of the resource.</p>
26    pub fn resource_id(&self) -> ::std::option::Option<&str> {
27        self.resource_id.as_deref()
28    }
29    /// <p>The resource type. Note that the <code>tgw-peering</code> resource type has been deprecated.</p>
30    pub fn resource_type(&self) -> ::std::option::Option<&crate::types::TransitGatewayAttachmentResourceType> {
31        self.resource_type.as_ref()
32    }
33    /// <p>The ID of the transit gateway route table.</p>
34    pub fn transit_gateway_route_table_id(&self) -> ::std::option::Option<&str> {
35        self.transit_gateway_route_table_id.as_deref()
36    }
37    /// <p>The state.</p>
38    pub fn state(&self) -> ::std::option::Option<&crate::types::TransitGatewayPropagationState> {
39        self.state.as_ref()
40    }
41    /// <p>The ID of the transit gateway route table announcement.</p>
42    pub fn transit_gateway_route_table_announcement_id(&self) -> ::std::option::Option<&str> {
43        self.transit_gateway_route_table_announcement_id.as_deref()
44    }
45}
46impl TransitGatewayPropagation {
47    /// Creates a new builder-style object to manufacture [`TransitGatewayPropagation`](crate::types::TransitGatewayPropagation).
48    pub fn builder() -> crate::types::builders::TransitGatewayPropagationBuilder {
49        crate::types::builders::TransitGatewayPropagationBuilder::default()
50    }
51}
52
53/// A builder for [`TransitGatewayPropagation`](crate::types::TransitGatewayPropagation).
54#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
55#[non_exhaustive]
56pub struct TransitGatewayPropagationBuilder {
57    pub(crate) transit_gateway_attachment_id: ::std::option::Option<::std::string::String>,
58    pub(crate) resource_id: ::std::option::Option<::std::string::String>,
59    pub(crate) resource_type: ::std::option::Option<crate::types::TransitGatewayAttachmentResourceType>,
60    pub(crate) transit_gateway_route_table_id: ::std::option::Option<::std::string::String>,
61    pub(crate) state: ::std::option::Option<crate::types::TransitGatewayPropagationState>,
62    pub(crate) transit_gateway_route_table_announcement_id: ::std::option::Option<::std::string::String>,
63}
64impl TransitGatewayPropagationBuilder {
65    /// <p>The ID of the attachment.</p>
66    pub fn transit_gateway_attachment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67        self.transit_gateway_attachment_id = ::std::option::Option::Some(input.into());
68        self
69    }
70    /// <p>The ID of the attachment.</p>
71    pub fn set_transit_gateway_attachment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72        self.transit_gateway_attachment_id = input;
73        self
74    }
75    /// <p>The ID of the attachment.</p>
76    pub fn get_transit_gateway_attachment_id(&self) -> &::std::option::Option<::std::string::String> {
77        &self.transit_gateway_attachment_id
78    }
79    /// <p>The ID of the resource.</p>
80    pub fn resource_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        self.resource_id = ::std::option::Option::Some(input.into());
82        self
83    }
84    /// <p>The ID of the resource.</p>
85    pub fn set_resource_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86        self.resource_id = input;
87        self
88    }
89    /// <p>The ID of the resource.</p>
90    pub fn get_resource_id(&self) -> &::std::option::Option<::std::string::String> {
91        &self.resource_id
92    }
93    /// <p>The resource type. Note that the <code>tgw-peering</code> resource type has been deprecated.</p>
94    pub fn resource_type(mut self, input: crate::types::TransitGatewayAttachmentResourceType) -> Self {
95        self.resource_type = ::std::option::Option::Some(input);
96        self
97    }
98    /// <p>The resource type. Note that the <code>tgw-peering</code> resource type has been deprecated.</p>
99    pub fn set_resource_type(mut self, input: ::std::option::Option<crate::types::TransitGatewayAttachmentResourceType>) -> Self {
100        self.resource_type = input;
101        self
102    }
103    /// <p>The resource type. Note that the <code>tgw-peering</code> resource type has been deprecated.</p>
104    pub fn get_resource_type(&self) -> &::std::option::Option<crate::types::TransitGatewayAttachmentResourceType> {
105        &self.resource_type
106    }
107    /// <p>The ID of the transit gateway route table.</p>
108    pub fn transit_gateway_route_table_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
109        self.transit_gateway_route_table_id = ::std::option::Option::Some(input.into());
110        self
111    }
112    /// <p>The ID of the transit gateway route table.</p>
113    pub fn set_transit_gateway_route_table_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
114        self.transit_gateway_route_table_id = input;
115        self
116    }
117    /// <p>The ID of the transit gateway route table.</p>
118    pub fn get_transit_gateway_route_table_id(&self) -> &::std::option::Option<::std::string::String> {
119        &self.transit_gateway_route_table_id
120    }
121    /// <p>The state.</p>
122    pub fn state(mut self, input: crate::types::TransitGatewayPropagationState) -> Self {
123        self.state = ::std::option::Option::Some(input);
124        self
125    }
126    /// <p>The state.</p>
127    pub fn set_state(mut self, input: ::std::option::Option<crate::types::TransitGatewayPropagationState>) -> Self {
128        self.state = input;
129        self
130    }
131    /// <p>The state.</p>
132    pub fn get_state(&self) -> &::std::option::Option<crate::types::TransitGatewayPropagationState> {
133        &self.state
134    }
135    /// <p>The ID of the transit gateway route table announcement.</p>
136    pub fn transit_gateway_route_table_announcement_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
137        self.transit_gateway_route_table_announcement_id = ::std::option::Option::Some(input.into());
138        self
139    }
140    /// <p>The ID of the transit gateway route table announcement.</p>
141    pub fn set_transit_gateway_route_table_announcement_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
142        self.transit_gateway_route_table_announcement_id = input;
143        self
144    }
145    /// <p>The ID of the transit gateway route table announcement.</p>
146    pub fn get_transit_gateway_route_table_announcement_id(&self) -> &::std::option::Option<::std::string::String> {
147        &self.transit_gateway_route_table_announcement_id
148    }
149    /// Consumes the builder and constructs a [`TransitGatewayPropagation`](crate::types::TransitGatewayPropagation).
150    pub fn build(self) -> crate::types::TransitGatewayPropagation {
151        crate::types::TransitGatewayPropagation {
152            transit_gateway_attachment_id: self.transit_gateway_attachment_id,
153            resource_id: self.resource_id,
154            resource_type: self.resource_type,
155            transit_gateway_route_table_id: self.transit_gateway_route_table_id,
156            state: self.state,
157            transit_gateway_route_table_announcement_id: self.transit_gateway_route_table_announcement_id,
158        }
159    }
160}