aws_sdk_rtbfabric/operation/get_link/
_get_link_output.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 GetLinkOutput {
6    /// <p>The unique identifier of the gateway.</p>
7    pub gateway_id: ::std::string::String,
8    /// <p>The unique identifier of the peer gateway.</p>
9    pub peer_gateway_id: ::std::string::String,
10    /// <p>The status of the link.</p>
11    pub status: crate::types::LinkStatus,
12    /// <p>The timestamp of when the link was created.</p>
13    pub created_at: ::aws_smithy_types::DateTime,
14    /// <p>The timestamp of when the link was updated.</p>
15    pub updated_at: ::aws_smithy_types::DateTime,
16    /// <p>The direction of the link.</p>
17    pub direction: ::std::option::Option<crate::types::LinkDirection>,
18    /// <p>The configuration of flow modules.</p>
19    pub flow_modules: ::std::option::Option<::std::vec::Vec<crate::types::ModuleConfiguration>>,
20    /// <p>The configuration of pending flow modules.</p>
21    pub pending_flow_modules: ::std::option::Option<::std::vec::Vec<crate::types::ModuleConfiguration>>,
22    /// <p>Attributes of the link.</p>
23    pub attributes: ::std::option::Option<crate::types::LinkAttributes>,
24    /// <p>The unique identifier of the link.</p>
25    pub link_id: ::std::string::String,
26    /// <p>A map of the key-value pairs for the tag or tags assigned to the specified resource.</p>
27    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
28    /// <p>Settings for the application logs.</p>
29    pub log_settings: ::std::option::Option<crate::types::LinkLogSettings>,
30    _request_id: Option<String>,
31}
32impl GetLinkOutput {
33    /// <p>The unique identifier of the gateway.</p>
34    pub fn gateway_id(&self) -> &str {
35        use std::ops::Deref;
36        self.gateway_id.deref()
37    }
38    /// <p>The unique identifier of the peer gateway.</p>
39    pub fn peer_gateway_id(&self) -> &str {
40        use std::ops::Deref;
41        self.peer_gateway_id.deref()
42    }
43    /// <p>The status of the link.</p>
44    pub fn status(&self) -> &crate::types::LinkStatus {
45        &self.status
46    }
47    /// <p>The timestamp of when the link was created.</p>
48    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
49        &self.created_at
50    }
51    /// <p>The timestamp of when the link was updated.</p>
52    pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
53        &self.updated_at
54    }
55    /// <p>The direction of the link.</p>
56    pub fn direction(&self) -> ::std::option::Option<&crate::types::LinkDirection> {
57        self.direction.as_ref()
58    }
59    /// <p>The configuration of flow modules.</p>
60    ///
61    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.flow_modules.is_none()`.
62    pub fn flow_modules(&self) -> &[crate::types::ModuleConfiguration] {
63        self.flow_modules.as_deref().unwrap_or_default()
64    }
65    /// <p>The configuration of pending flow modules.</p>
66    ///
67    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.pending_flow_modules.is_none()`.
68    pub fn pending_flow_modules(&self) -> &[crate::types::ModuleConfiguration] {
69        self.pending_flow_modules.as_deref().unwrap_or_default()
70    }
71    /// <p>Attributes of the link.</p>
72    pub fn attributes(&self) -> ::std::option::Option<&crate::types::LinkAttributes> {
73        self.attributes.as_ref()
74    }
75    /// <p>The unique identifier of the link.</p>
76    pub fn link_id(&self) -> &str {
77        use std::ops::Deref;
78        self.link_id.deref()
79    }
80    /// <p>A map of the key-value pairs for the tag or tags assigned to the specified resource.</p>
81    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
82        self.tags.as_ref()
83    }
84    /// <p>Settings for the application logs.</p>
85    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    /// Creates a new builder-style object to manufacture [`GetLinkOutput`](crate::operation::get_link::GetLinkOutput).
96    pub fn builder() -> crate::operation::get_link::builders::GetLinkOutputBuilder {
97        crate::operation::get_link::builders::GetLinkOutputBuilder::default()
98    }
99}
100
101/// A builder for [`GetLinkOutput`](crate::operation::get_link::GetLinkOutput).
102#[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    /// <p>The unique identifier of the gateway.</p>
121    /// This field is required.
122    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    /// <p>The unique identifier of the gateway.</p>
127    pub fn set_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
128        self.gateway_id = input;
129        self
130    }
131    /// <p>The unique identifier of the gateway.</p>
132    pub fn get_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
133        &self.gateway_id
134    }
135    /// <p>The unique identifier of the peer gateway.</p>
136    /// This field is required.
137    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    /// <p>The unique identifier of the peer gateway.</p>
142    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    /// <p>The unique identifier of the peer gateway.</p>
147    pub fn get_peer_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
148        &self.peer_gateway_id
149    }
150    /// <p>The status of the link.</p>
151    /// This field is required.
152    pub fn status(mut self, input: crate::types::LinkStatus) -> Self {
153        self.status = ::std::option::Option::Some(input);
154        self
155    }
156    /// <p>The status of the link.</p>
157    pub fn set_status(mut self, input: ::std::option::Option<crate::types::LinkStatus>) -> Self {
158        self.status = input;
159        self
160    }
161    /// <p>The status of the link.</p>
162    pub fn get_status(&self) -> &::std::option::Option<crate::types::LinkStatus> {
163        &self.status
164    }
165    /// <p>The timestamp of when the link was created.</p>
166    /// This field is required.
167    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    /// <p>The timestamp of when the link was created.</p>
172    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    /// <p>The timestamp of when the link was created.</p>
177    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
178        &self.created_at
179    }
180    /// <p>The timestamp of when the link was updated.</p>
181    /// This field is required.
182    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    /// <p>The timestamp of when the link was updated.</p>
187    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    /// <p>The timestamp of when the link was updated.</p>
192    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
193        &self.updated_at
194    }
195    /// <p>The direction of the link.</p>
196    pub fn direction(mut self, input: crate::types::LinkDirection) -> Self {
197        self.direction = ::std::option::Option::Some(input);
198        self
199    }
200    /// <p>The direction of the link.</p>
201    pub fn set_direction(mut self, input: ::std::option::Option<crate::types::LinkDirection>) -> Self {
202        self.direction = input;
203        self
204    }
205    /// <p>The direction of the link.</p>
206    pub fn get_direction(&self) -> &::std::option::Option<crate::types::LinkDirection> {
207        &self.direction
208    }
209    /// Appends an item to `flow_modules`.
210    ///
211    /// To override the contents of this collection use [`set_flow_modules`](Self::set_flow_modules).
212    ///
213    /// <p>The configuration of flow modules.</p>
214    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    /// <p>The configuration of flow modules.</p>
221    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    /// <p>The configuration of flow modules.</p>
226    pub fn get_flow_modules(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ModuleConfiguration>> {
227        &self.flow_modules
228    }
229    /// Appends an item to `pending_flow_modules`.
230    ///
231    /// To override the contents of this collection use [`set_pending_flow_modules`](Self::set_pending_flow_modules).
232    ///
233    /// <p>The configuration of pending flow modules.</p>
234    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    /// <p>The configuration of pending flow modules.</p>
241    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    /// <p>The configuration of pending flow modules.</p>
246    pub fn get_pending_flow_modules(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ModuleConfiguration>> {
247        &self.pending_flow_modules
248    }
249    /// <p>Attributes of the link.</p>
250    pub fn attributes(mut self, input: crate::types::LinkAttributes) -> Self {
251        self.attributes = ::std::option::Option::Some(input);
252        self
253    }
254    /// <p>Attributes of the link.</p>
255    pub fn set_attributes(mut self, input: ::std::option::Option<crate::types::LinkAttributes>) -> Self {
256        self.attributes = input;
257        self
258    }
259    /// <p>Attributes of the link.</p>
260    pub fn get_attributes(&self) -> &::std::option::Option<crate::types::LinkAttributes> {
261        &self.attributes
262    }
263    /// <p>The unique identifier of the link.</p>
264    /// This field is required.
265    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    /// <p>The unique identifier of the link.</p>
270    pub fn set_link_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
271        self.link_id = input;
272        self
273    }
274    /// <p>The unique identifier of the link.</p>
275    pub fn get_link_id(&self) -> &::std::option::Option<::std::string::String> {
276        &self.link_id
277    }
278    /// Adds a key-value pair to `tags`.
279    ///
280    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
281    ///
282    /// <p>A map of the key-value pairs for the tag or tags assigned to the specified resource.</p>
283    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    /// <p>A map of the key-value pairs for the tag or tags assigned to the specified resource.</p>
290    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    /// <p>A map of the key-value pairs for the tag or tags assigned to the specified resource.</p>
295    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
296        &self.tags
297    }
298    /// <p>Settings for the application logs.</p>
299    pub fn log_settings(mut self, input: crate::types::LinkLogSettings) -> Self {
300        self.log_settings = ::std::option::Option::Some(input);
301        self
302    }
303    /// <p>Settings for the application logs.</p>
304    pub fn set_log_settings(mut self, input: ::std::option::Option<crate::types::LinkLogSettings>) -> Self {
305        self.log_settings = input;
306        self
307    }
308    /// <p>Settings for the application logs.</p>
309    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    /// Consumes the builder and constructs a [`GetLinkOutput`](crate::operation::get_link::GetLinkOutput).
322    /// This method will fail if any of the following fields are not set:
323    /// - [`gateway_id`](crate::operation::get_link::builders::GetLinkOutputBuilder::gateway_id)
324    /// - [`peer_gateway_id`](crate::operation::get_link::builders::GetLinkOutputBuilder::peer_gateway_id)
325    /// - [`status`](crate::operation::get_link::builders::GetLinkOutputBuilder::status)
326    /// - [`created_at`](crate::operation::get_link::builders::GetLinkOutputBuilder::created_at)
327    /// - [`updated_at`](crate::operation::get_link::builders::GetLinkOutputBuilder::updated_at)
328    /// - [`link_id`](crate::operation::get_link::builders::GetLinkOutputBuilder::link_id)
329    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}