aws_sdk_ec2/types/
_transit_gateway_route_table_association.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct TransitGatewayRouteTableAssociation {
7 pub transit_gateway_attachment_id: ::std::option::Option<::std::string::String>,
9 pub resource_id: ::std::option::Option<::std::string::String>,
11 pub resource_type: ::std::option::Option<crate::types::TransitGatewayAttachmentResourceType>,
13 pub state: ::std::option::Option<crate::types::TransitGatewayAssociationState>,
15}
16impl TransitGatewayRouteTableAssociation {
17 pub fn transit_gateway_attachment_id(&self) -> ::std::option::Option<&str> {
19 self.transit_gateway_attachment_id.as_deref()
20 }
21 pub fn resource_id(&self) -> ::std::option::Option<&str> {
23 self.resource_id.as_deref()
24 }
25 pub fn resource_type(&self) -> ::std::option::Option<&crate::types::TransitGatewayAttachmentResourceType> {
27 self.resource_type.as_ref()
28 }
29 pub fn state(&self) -> ::std::option::Option<&crate::types::TransitGatewayAssociationState> {
31 self.state.as_ref()
32 }
33}
34impl TransitGatewayRouteTableAssociation {
35 pub fn builder() -> crate::types::builders::TransitGatewayRouteTableAssociationBuilder {
37 crate::types::builders::TransitGatewayRouteTableAssociationBuilder::default()
38 }
39}
40
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
43#[non_exhaustive]
44pub struct TransitGatewayRouteTableAssociationBuilder {
45 pub(crate) transit_gateway_attachment_id: ::std::option::Option<::std::string::String>,
46 pub(crate) resource_id: ::std::option::Option<::std::string::String>,
47 pub(crate) resource_type: ::std::option::Option<crate::types::TransitGatewayAttachmentResourceType>,
48 pub(crate) state: ::std::option::Option<crate::types::TransitGatewayAssociationState>,
49}
50impl TransitGatewayRouteTableAssociationBuilder {
51 pub fn transit_gateway_attachment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53 self.transit_gateway_attachment_id = ::std::option::Option::Some(input.into());
54 self
55 }
56 pub fn set_transit_gateway_attachment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58 self.transit_gateway_attachment_id = input;
59 self
60 }
61 pub fn get_transit_gateway_attachment_id(&self) -> &::std::option::Option<::std::string::String> {
63 &self.transit_gateway_attachment_id
64 }
65 pub fn resource_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67 self.resource_id = ::std::option::Option::Some(input.into());
68 self
69 }
70 pub fn set_resource_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72 self.resource_id = input;
73 self
74 }
75 pub fn get_resource_id(&self) -> &::std::option::Option<::std::string::String> {
77 &self.resource_id
78 }
79 pub fn resource_type(mut self, input: crate::types::TransitGatewayAttachmentResourceType) -> Self {
81 self.resource_type = ::std::option::Option::Some(input);
82 self
83 }
84 pub fn set_resource_type(mut self, input: ::std::option::Option<crate::types::TransitGatewayAttachmentResourceType>) -> Self {
86 self.resource_type = input;
87 self
88 }
89 pub fn get_resource_type(&self) -> &::std::option::Option<crate::types::TransitGatewayAttachmentResourceType> {
91 &self.resource_type
92 }
93 pub fn state(mut self, input: crate::types::TransitGatewayAssociationState) -> Self {
95 self.state = ::std::option::Option::Some(input);
96 self
97 }
98 pub fn set_state(mut self, input: ::std::option::Option<crate::types::TransitGatewayAssociationState>) -> Self {
100 self.state = input;
101 self
102 }
103 pub fn get_state(&self) -> &::std::option::Option<crate::types::TransitGatewayAssociationState> {
105 &self.state
106 }
107 pub fn build(self) -> crate::types::TransitGatewayRouteTableAssociation {
109 crate::types::TransitGatewayRouteTableAssociation {
110 transit_gateway_attachment_id: self.transit_gateway_attachment_id,
111 resource_id: self.resource_id,
112 resource_type: self.resource_type,
113 state: self.state,
114 }
115 }
116}