aws_sdk_rtbfabric/operation/get_link/
_get_link_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetLinkOutput {
6 pub gateway_id: ::std::string::String,
8 pub peer_gateway_id: ::std::string::String,
10 pub status: crate::types::LinkStatus,
12 pub created_at: ::aws_smithy_types::DateTime,
14 pub updated_at: ::aws_smithy_types::DateTime,
16 pub direction: ::std::option::Option<crate::types::LinkDirection>,
18 pub flow_modules: ::std::option::Option<::std::vec::Vec<crate::types::ModuleConfiguration>>,
20 pub pending_flow_modules: ::std::option::Option<::std::vec::Vec<crate::types::ModuleConfiguration>>,
22 pub attributes: ::std::option::Option<crate::types::LinkAttributes>,
24 pub link_id: ::std::string::String,
26 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
28 pub log_settings: ::std::option::Option<crate::types::LinkLogSettings>,
30 _request_id: Option<String>,
31}
32impl GetLinkOutput {
33 pub fn gateway_id(&self) -> &str {
35 use std::ops::Deref;
36 self.gateway_id.deref()
37 }
38 pub fn peer_gateway_id(&self) -> &str {
40 use std::ops::Deref;
41 self.peer_gateway_id.deref()
42 }
43 pub fn status(&self) -> &crate::types::LinkStatus {
45 &self.status
46 }
47 pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
49 &self.created_at
50 }
51 pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
53 &self.updated_at
54 }
55 pub fn direction(&self) -> ::std::option::Option<&crate::types::LinkDirection> {
57 self.direction.as_ref()
58 }
59 pub fn flow_modules(&self) -> &[crate::types::ModuleConfiguration] {
63 self.flow_modules.as_deref().unwrap_or_default()
64 }
65 pub fn pending_flow_modules(&self) -> &[crate::types::ModuleConfiguration] {
69 self.pending_flow_modules.as_deref().unwrap_or_default()
70 }
71 pub fn attributes(&self) -> ::std::option::Option<&crate::types::LinkAttributes> {
73 self.attributes.as_ref()
74 }
75 pub fn link_id(&self) -> &str {
77 use std::ops::Deref;
78 self.link_id.deref()
79 }
80 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
82 self.tags.as_ref()
83 }
84 pub fn log_settings(&self) -> ::std::option::Option<&crate::types::LinkLogSettings> {
86 self.log_settings.as_ref()
87 }
88}
89impl ::aws_types::request_id::RequestId for GetLinkOutput {
90 fn request_id(&self) -> Option<&str> {
91 self._request_id.as_deref()
92 }
93}
94impl GetLinkOutput {
95 pub fn builder() -> crate::operation::get_link::builders::GetLinkOutputBuilder {
97 crate::operation::get_link::builders::GetLinkOutputBuilder::default()
98 }
99}
100
101#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
103#[non_exhaustive]
104pub struct GetLinkOutputBuilder {
105 pub(crate) gateway_id: ::std::option::Option<::std::string::String>,
106 pub(crate) peer_gateway_id: ::std::option::Option<::std::string::String>,
107 pub(crate) status: ::std::option::Option<crate::types::LinkStatus>,
108 pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
109 pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
110 pub(crate) direction: ::std::option::Option<crate::types::LinkDirection>,
111 pub(crate) flow_modules: ::std::option::Option<::std::vec::Vec<crate::types::ModuleConfiguration>>,
112 pub(crate) pending_flow_modules: ::std::option::Option<::std::vec::Vec<crate::types::ModuleConfiguration>>,
113 pub(crate) attributes: ::std::option::Option<crate::types::LinkAttributes>,
114 pub(crate) link_id: ::std::option::Option<::std::string::String>,
115 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
116 pub(crate) log_settings: ::std::option::Option<crate::types::LinkLogSettings>,
117 _request_id: Option<String>,
118}
119impl GetLinkOutputBuilder {
120 pub fn gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
123 self.gateway_id = ::std::option::Option::Some(input.into());
124 self
125 }
126 pub fn set_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
128 self.gateway_id = input;
129 self
130 }
131 pub fn get_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
133 &self.gateway_id
134 }
135 pub fn peer_gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
138 self.peer_gateway_id = ::std::option::Option::Some(input.into());
139 self
140 }
141 pub fn set_peer_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
143 self.peer_gateway_id = input;
144 self
145 }
146 pub fn get_peer_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
148 &self.peer_gateway_id
149 }
150 pub fn status(mut self, input: crate::types::LinkStatus) -> Self {
153 self.status = ::std::option::Option::Some(input);
154 self
155 }
156 pub fn set_status(mut self, input: ::std::option::Option<crate::types::LinkStatus>) -> Self {
158 self.status = input;
159 self
160 }
161 pub fn get_status(&self) -> &::std::option::Option<crate::types::LinkStatus> {
163 &self.status
164 }
165 pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
168 self.created_at = ::std::option::Option::Some(input);
169 self
170 }
171 pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
173 self.created_at = input;
174 self
175 }
176 pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
178 &self.created_at
179 }
180 pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
183 self.updated_at = ::std::option::Option::Some(input);
184 self
185 }
186 pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
188 self.updated_at = input;
189 self
190 }
191 pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
193 &self.updated_at
194 }
195 pub fn direction(mut self, input: crate::types::LinkDirection) -> Self {
197 self.direction = ::std::option::Option::Some(input);
198 self
199 }
200 pub fn set_direction(mut self, input: ::std::option::Option<crate::types::LinkDirection>) -> Self {
202 self.direction = input;
203 self
204 }
205 pub fn get_direction(&self) -> &::std::option::Option<crate::types::LinkDirection> {
207 &self.direction
208 }
209 pub fn flow_modules(mut self, input: crate::types::ModuleConfiguration) -> Self {
215 let mut v = self.flow_modules.unwrap_or_default();
216 v.push(input);
217 self.flow_modules = ::std::option::Option::Some(v);
218 self
219 }
220 pub fn set_flow_modules(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ModuleConfiguration>>) -> Self {
222 self.flow_modules = input;
223 self
224 }
225 pub fn get_flow_modules(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ModuleConfiguration>> {
227 &self.flow_modules
228 }
229 pub fn pending_flow_modules(mut self, input: crate::types::ModuleConfiguration) -> Self {
235 let mut v = self.pending_flow_modules.unwrap_or_default();
236 v.push(input);
237 self.pending_flow_modules = ::std::option::Option::Some(v);
238 self
239 }
240 pub fn set_pending_flow_modules(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ModuleConfiguration>>) -> Self {
242 self.pending_flow_modules = input;
243 self
244 }
245 pub fn get_pending_flow_modules(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ModuleConfiguration>> {
247 &self.pending_flow_modules
248 }
249 pub fn attributes(mut self, input: crate::types::LinkAttributes) -> Self {
251 self.attributes = ::std::option::Option::Some(input);
252 self
253 }
254 pub fn set_attributes(mut self, input: ::std::option::Option<crate::types::LinkAttributes>) -> Self {
256 self.attributes = input;
257 self
258 }
259 pub fn get_attributes(&self) -> &::std::option::Option<crate::types::LinkAttributes> {
261 &self.attributes
262 }
263 pub fn link_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
266 self.link_id = ::std::option::Option::Some(input.into());
267 self
268 }
269 pub fn set_link_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
271 self.link_id = input;
272 self
273 }
274 pub fn get_link_id(&self) -> &::std::option::Option<::std::string::String> {
276 &self.link_id
277 }
278 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
284 let mut hash_map = self.tags.unwrap_or_default();
285 hash_map.insert(k.into(), v.into());
286 self.tags = ::std::option::Option::Some(hash_map);
287 self
288 }
289 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
291 self.tags = input;
292 self
293 }
294 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
296 &self.tags
297 }
298 pub fn log_settings(mut self, input: crate::types::LinkLogSettings) -> Self {
300 self.log_settings = ::std::option::Option::Some(input);
301 self
302 }
303 pub fn set_log_settings(mut self, input: ::std::option::Option<crate::types::LinkLogSettings>) -> Self {
305 self.log_settings = input;
306 self
307 }
308 pub fn get_log_settings(&self) -> &::std::option::Option<crate::types::LinkLogSettings> {
310 &self.log_settings
311 }
312 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
313 self._request_id = Some(request_id.into());
314 self
315 }
316
317 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
318 self._request_id = request_id;
319 self
320 }
321 pub fn build(self) -> ::std::result::Result<crate::operation::get_link::GetLinkOutput, ::aws_smithy_types::error::operation::BuildError> {
330 ::std::result::Result::Ok(crate::operation::get_link::GetLinkOutput {
331 gateway_id: self.gateway_id.ok_or_else(|| {
332 ::aws_smithy_types::error::operation::BuildError::missing_field(
333 "gateway_id",
334 "gateway_id was not specified but it is required when building GetLinkOutput",
335 )
336 })?,
337 peer_gateway_id: self.peer_gateway_id.ok_or_else(|| {
338 ::aws_smithy_types::error::operation::BuildError::missing_field(
339 "peer_gateway_id",
340 "peer_gateway_id was not specified but it is required when building GetLinkOutput",
341 )
342 })?,
343 status: self.status.ok_or_else(|| {
344 ::aws_smithy_types::error::operation::BuildError::missing_field(
345 "status",
346 "status was not specified but it is required when building GetLinkOutput",
347 )
348 })?,
349 created_at: self.created_at.ok_or_else(|| {
350 ::aws_smithy_types::error::operation::BuildError::missing_field(
351 "created_at",
352 "created_at was not specified but it is required when building GetLinkOutput",
353 )
354 })?,
355 updated_at: self.updated_at.ok_or_else(|| {
356 ::aws_smithy_types::error::operation::BuildError::missing_field(
357 "updated_at",
358 "updated_at was not specified but it is required when building GetLinkOutput",
359 )
360 })?,
361 direction: self.direction,
362 flow_modules: self.flow_modules,
363 pending_flow_modules: self.pending_flow_modules,
364 attributes: self.attributes,
365 link_id: self.link_id.ok_or_else(|| {
366 ::aws_smithy_types::error::operation::BuildError::missing_field(
367 "link_id",
368 "link_id was not specified but it is required when building GetLinkOutput",
369 )
370 })?,
371 tags: self.tags,
372 log_settings: self.log_settings,
373 _request_id: self._request_id,
374 })
375 }
376}