aws_sdk_networkmanager/types/
_peering.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Peering {
7 pub core_network_id: ::std::option::Option<::std::string::String>,
9 pub core_network_arn: ::std::option::Option<::std::string::String>,
11 pub peering_id: ::std::option::Option<::std::string::String>,
13 pub owner_account_id: ::std::option::Option<::std::string::String>,
15 pub peering_type: ::std::option::Option<crate::types::PeeringType>,
17 pub state: ::std::option::Option<crate::types::PeeringState>,
19 pub edge_location: ::std::option::Option<::std::string::String>,
21 pub resource_arn: ::std::option::Option<::std::string::String>,
23 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
25 pub created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
27 pub last_modification_errors: ::std::option::Option<::std::vec::Vec<crate::types::PeeringError>>,
29}
30impl Peering {
31 pub fn core_network_id(&self) -> ::std::option::Option<&str> {
33 self.core_network_id.as_deref()
34 }
35 pub fn core_network_arn(&self) -> ::std::option::Option<&str> {
37 self.core_network_arn.as_deref()
38 }
39 pub fn peering_id(&self) -> ::std::option::Option<&str> {
41 self.peering_id.as_deref()
42 }
43 pub fn owner_account_id(&self) -> ::std::option::Option<&str> {
45 self.owner_account_id.as_deref()
46 }
47 pub fn peering_type(&self) -> ::std::option::Option<&crate::types::PeeringType> {
49 self.peering_type.as_ref()
50 }
51 pub fn state(&self) -> ::std::option::Option<&crate::types::PeeringState> {
53 self.state.as_ref()
54 }
55 pub fn edge_location(&self) -> ::std::option::Option<&str> {
57 self.edge_location.as_deref()
58 }
59 pub fn resource_arn(&self) -> ::std::option::Option<&str> {
61 self.resource_arn.as_deref()
62 }
63 pub fn tags(&self) -> &[crate::types::Tag] {
67 self.tags.as_deref().unwrap_or_default()
68 }
69 pub fn created_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
71 self.created_at.as_ref()
72 }
73 pub fn last_modification_errors(&self) -> &[crate::types::PeeringError] {
77 self.last_modification_errors.as_deref().unwrap_or_default()
78 }
79}
80impl Peering {
81 pub fn builder() -> crate::types::builders::PeeringBuilder {
83 crate::types::builders::PeeringBuilder::default()
84 }
85}
86
87#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
89#[non_exhaustive]
90pub struct PeeringBuilder {
91 pub(crate) core_network_id: ::std::option::Option<::std::string::String>,
92 pub(crate) core_network_arn: ::std::option::Option<::std::string::String>,
93 pub(crate) peering_id: ::std::option::Option<::std::string::String>,
94 pub(crate) owner_account_id: ::std::option::Option<::std::string::String>,
95 pub(crate) peering_type: ::std::option::Option<crate::types::PeeringType>,
96 pub(crate) state: ::std::option::Option<crate::types::PeeringState>,
97 pub(crate) edge_location: ::std::option::Option<::std::string::String>,
98 pub(crate) resource_arn: ::std::option::Option<::std::string::String>,
99 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
100 pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
101 pub(crate) last_modification_errors: ::std::option::Option<::std::vec::Vec<crate::types::PeeringError>>,
102}
103impl PeeringBuilder {
104 pub fn core_network_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
106 self.core_network_id = ::std::option::Option::Some(input.into());
107 self
108 }
109 pub fn set_core_network_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
111 self.core_network_id = input;
112 self
113 }
114 pub fn get_core_network_id(&self) -> &::std::option::Option<::std::string::String> {
116 &self.core_network_id
117 }
118 pub fn core_network_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120 self.core_network_arn = ::std::option::Option::Some(input.into());
121 self
122 }
123 pub fn set_core_network_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125 self.core_network_arn = input;
126 self
127 }
128 pub fn get_core_network_arn(&self) -> &::std::option::Option<::std::string::String> {
130 &self.core_network_arn
131 }
132 pub fn peering_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134 self.peering_id = ::std::option::Option::Some(input.into());
135 self
136 }
137 pub fn set_peering_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139 self.peering_id = input;
140 self
141 }
142 pub fn get_peering_id(&self) -> &::std::option::Option<::std::string::String> {
144 &self.peering_id
145 }
146 pub fn owner_account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148 self.owner_account_id = ::std::option::Option::Some(input.into());
149 self
150 }
151 pub fn set_owner_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
153 self.owner_account_id = input;
154 self
155 }
156 pub fn get_owner_account_id(&self) -> &::std::option::Option<::std::string::String> {
158 &self.owner_account_id
159 }
160 pub fn peering_type(mut self, input: crate::types::PeeringType) -> Self {
162 self.peering_type = ::std::option::Option::Some(input);
163 self
164 }
165 pub fn set_peering_type(mut self, input: ::std::option::Option<crate::types::PeeringType>) -> Self {
167 self.peering_type = input;
168 self
169 }
170 pub fn get_peering_type(&self) -> &::std::option::Option<crate::types::PeeringType> {
172 &self.peering_type
173 }
174 pub fn state(mut self, input: crate::types::PeeringState) -> Self {
176 self.state = ::std::option::Option::Some(input);
177 self
178 }
179 pub fn set_state(mut self, input: ::std::option::Option<crate::types::PeeringState>) -> Self {
181 self.state = input;
182 self
183 }
184 pub fn get_state(&self) -> &::std::option::Option<crate::types::PeeringState> {
186 &self.state
187 }
188 pub fn edge_location(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
190 self.edge_location = ::std::option::Option::Some(input.into());
191 self
192 }
193 pub fn set_edge_location(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
195 self.edge_location = input;
196 self
197 }
198 pub fn get_edge_location(&self) -> &::std::option::Option<::std::string::String> {
200 &self.edge_location
201 }
202 pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
204 self.resource_arn = ::std::option::Option::Some(input.into());
205 self
206 }
207 pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
209 self.resource_arn = input;
210 self
211 }
212 pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
214 &self.resource_arn
215 }
216 pub fn tags(mut self, input: crate::types::Tag) -> Self {
222 let mut v = self.tags.unwrap_or_default();
223 v.push(input);
224 self.tags = ::std::option::Option::Some(v);
225 self
226 }
227 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
229 self.tags = input;
230 self
231 }
232 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
234 &self.tags
235 }
236 pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
238 self.created_at = ::std::option::Option::Some(input);
239 self
240 }
241 pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
243 self.created_at = input;
244 self
245 }
246 pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
248 &self.created_at
249 }
250 pub fn last_modification_errors(mut self, input: crate::types::PeeringError) -> Self {
256 let mut v = self.last_modification_errors.unwrap_or_default();
257 v.push(input);
258 self.last_modification_errors = ::std::option::Option::Some(v);
259 self
260 }
261 pub fn set_last_modification_errors(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PeeringError>>) -> Self {
263 self.last_modification_errors = input;
264 self
265 }
266 pub fn get_last_modification_errors(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PeeringError>> {
268 &self.last_modification_errors
269 }
270 pub fn build(self) -> crate::types::Peering {
272 crate::types::Peering {
273 core_network_id: self.core_network_id,
274 core_network_arn: self.core_network_arn,
275 peering_id: self.peering_id,
276 owner_account_id: self.owner_account_id,
277 peering_type: self.peering_type,
278 state: self.state,
279 edge_location: self.edge_location,
280 resource_arn: self.resource_arn,
281 tags: self.tags,
282 created_at: self.created_at,
283 last_modification_errors: self.last_modification_errors,
284 }
285 }
286}