aws_sdk_rtbfabric/operation/accept_link/
_accept_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 AcceptLinkOutput {
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    _request_id: Option<String>,
27}
28impl AcceptLinkOutput {
29    /// <p>The unique identifier of the gateway.</p>
30    pub fn gateway_id(&self) -> &str {
31        use std::ops::Deref;
32        self.gateway_id.deref()
33    }
34    /// <p>The unique identifier of the peer gateway.</p>
35    pub fn peer_gateway_id(&self) -> &str {
36        use std::ops::Deref;
37        self.peer_gateway_id.deref()
38    }
39    /// <p>The status of the link.</p>
40    pub fn status(&self) -> &crate::types::LinkStatus {
41        &self.status
42    }
43    /// <p>The timestamp of when the link was created.</p>
44    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
45        &self.created_at
46    }
47    /// <p>The timestamp of when the link was updated.</p>
48    pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
49        &self.updated_at
50    }
51    /// <p>The direction of the link.</p>
52    pub fn direction(&self) -> ::std::option::Option<&crate::types::LinkDirection> {
53        self.direction.as_ref()
54    }
55    /// <p>The configuration of flow modules.</p>
56    ///
57    /// 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()`.
58    pub fn flow_modules(&self) -> &[crate::types::ModuleConfiguration] {
59        self.flow_modules.as_deref().unwrap_or_default()
60    }
61    /// <p>The configuration of pending flow modules.</p>
62    ///
63    /// 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()`.
64    pub fn pending_flow_modules(&self) -> &[crate::types::ModuleConfiguration] {
65        self.pending_flow_modules.as_deref().unwrap_or_default()
66    }
67    /// <p>Attributes of the link.</p>
68    pub fn attributes(&self) -> ::std::option::Option<&crate::types::LinkAttributes> {
69        self.attributes.as_ref()
70    }
71    /// <p>The unique identifier of the link.</p>
72    pub fn link_id(&self) -> &str {
73        use std::ops::Deref;
74        self.link_id.deref()
75    }
76}
77impl ::aws_types::request_id::RequestId for AcceptLinkOutput {
78    fn request_id(&self) -> Option<&str> {
79        self._request_id.as_deref()
80    }
81}
82impl AcceptLinkOutput {
83    /// Creates a new builder-style object to manufacture [`AcceptLinkOutput`](crate::operation::accept_link::AcceptLinkOutput).
84    pub fn builder() -> crate::operation::accept_link::builders::AcceptLinkOutputBuilder {
85        crate::operation::accept_link::builders::AcceptLinkOutputBuilder::default()
86    }
87}
88
89/// A builder for [`AcceptLinkOutput`](crate::operation::accept_link::AcceptLinkOutput).
90#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
91#[non_exhaustive]
92pub struct AcceptLinkOutputBuilder {
93    pub(crate) gateway_id: ::std::option::Option<::std::string::String>,
94    pub(crate) peer_gateway_id: ::std::option::Option<::std::string::String>,
95    pub(crate) status: ::std::option::Option<crate::types::LinkStatus>,
96    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
97    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
98    pub(crate) direction: ::std::option::Option<crate::types::LinkDirection>,
99    pub(crate) flow_modules: ::std::option::Option<::std::vec::Vec<crate::types::ModuleConfiguration>>,
100    pub(crate) pending_flow_modules: ::std::option::Option<::std::vec::Vec<crate::types::ModuleConfiguration>>,
101    pub(crate) attributes: ::std::option::Option<crate::types::LinkAttributes>,
102    pub(crate) link_id: ::std::option::Option<::std::string::String>,
103    _request_id: Option<String>,
104}
105impl AcceptLinkOutputBuilder {
106    /// <p>The unique identifier of the gateway.</p>
107    /// This field is required.
108    pub fn gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
109        self.gateway_id = ::std::option::Option::Some(input.into());
110        self
111    }
112    /// <p>The unique identifier of the gateway.</p>
113    pub fn set_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
114        self.gateway_id = input;
115        self
116    }
117    /// <p>The unique identifier of the gateway.</p>
118    pub fn get_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
119        &self.gateway_id
120    }
121    /// <p>The unique identifier of the peer gateway.</p>
122    /// This field is required.
123    pub fn peer_gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
124        self.peer_gateway_id = ::std::option::Option::Some(input.into());
125        self
126    }
127    /// <p>The unique identifier of the peer gateway.</p>
128    pub fn set_peer_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
129        self.peer_gateway_id = input;
130        self
131    }
132    /// <p>The unique identifier of the peer gateway.</p>
133    pub fn get_peer_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
134        &self.peer_gateway_id
135    }
136    /// <p>The status of the link.</p>
137    /// This field is required.
138    pub fn status(mut self, input: crate::types::LinkStatus) -> Self {
139        self.status = ::std::option::Option::Some(input);
140        self
141    }
142    /// <p>The status of the link.</p>
143    pub fn set_status(mut self, input: ::std::option::Option<crate::types::LinkStatus>) -> Self {
144        self.status = input;
145        self
146    }
147    /// <p>The status of the link.</p>
148    pub fn get_status(&self) -> &::std::option::Option<crate::types::LinkStatus> {
149        &self.status
150    }
151    /// <p>The timestamp of when the link was created.</p>
152    /// This field is required.
153    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
154        self.created_at = ::std::option::Option::Some(input);
155        self
156    }
157    /// <p>The timestamp of when the link was created.</p>
158    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
159        self.created_at = input;
160        self
161    }
162    /// <p>The timestamp of when the link was created.</p>
163    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
164        &self.created_at
165    }
166    /// <p>The timestamp of when the link was updated.</p>
167    /// This field is required.
168    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
169        self.updated_at = ::std::option::Option::Some(input);
170        self
171    }
172    /// <p>The timestamp of when the link was updated.</p>
173    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
174        self.updated_at = input;
175        self
176    }
177    /// <p>The timestamp of when the link was updated.</p>
178    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
179        &self.updated_at
180    }
181    /// <p>The direction of the link.</p>
182    pub fn direction(mut self, input: crate::types::LinkDirection) -> Self {
183        self.direction = ::std::option::Option::Some(input);
184        self
185    }
186    /// <p>The direction of the link.</p>
187    pub fn set_direction(mut self, input: ::std::option::Option<crate::types::LinkDirection>) -> Self {
188        self.direction = input;
189        self
190    }
191    /// <p>The direction of the link.</p>
192    pub fn get_direction(&self) -> &::std::option::Option<crate::types::LinkDirection> {
193        &self.direction
194    }
195    /// Appends an item to `flow_modules`.
196    ///
197    /// To override the contents of this collection use [`set_flow_modules`](Self::set_flow_modules).
198    ///
199    /// <p>The configuration of flow modules.</p>
200    pub fn flow_modules(mut self, input: crate::types::ModuleConfiguration) -> Self {
201        let mut v = self.flow_modules.unwrap_or_default();
202        v.push(input);
203        self.flow_modules = ::std::option::Option::Some(v);
204        self
205    }
206    /// <p>The configuration of flow modules.</p>
207    pub fn set_flow_modules(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ModuleConfiguration>>) -> Self {
208        self.flow_modules = input;
209        self
210    }
211    /// <p>The configuration of flow modules.</p>
212    pub fn get_flow_modules(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ModuleConfiguration>> {
213        &self.flow_modules
214    }
215    /// Appends an item to `pending_flow_modules`.
216    ///
217    /// To override the contents of this collection use [`set_pending_flow_modules`](Self::set_pending_flow_modules).
218    ///
219    /// <p>The configuration of pending flow modules.</p>
220    pub fn pending_flow_modules(mut self, input: crate::types::ModuleConfiguration) -> Self {
221        let mut v = self.pending_flow_modules.unwrap_or_default();
222        v.push(input);
223        self.pending_flow_modules = ::std::option::Option::Some(v);
224        self
225    }
226    /// <p>The configuration of pending flow modules.</p>
227    pub fn set_pending_flow_modules(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ModuleConfiguration>>) -> Self {
228        self.pending_flow_modules = input;
229        self
230    }
231    /// <p>The configuration of pending flow modules.</p>
232    pub fn get_pending_flow_modules(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ModuleConfiguration>> {
233        &self.pending_flow_modules
234    }
235    /// <p>Attributes of the link.</p>
236    pub fn attributes(mut self, input: crate::types::LinkAttributes) -> Self {
237        self.attributes = ::std::option::Option::Some(input);
238        self
239    }
240    /// <p>Attributes of the link.</p>
241    pub fn set_attributes(mut self, input: ::std::option::Option<crate::types::LinkAttributes>) -> Self {
242        self.attributes = input;
243        self
244    }
245    /// <p>Attributes of the link.</p>
246    pub fn get_attributes(&self) -> &::std::option::Option<crate::types::LinkAttributes> {
247        &self.attributes
248    }
249    /// <p>The unique identifier of the link.</p>
250    /// This field is required.
251    pub fn link_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
252        self.link_id = ::std::option::Option::Some(input.into());
253        self
254    }
255    /// <p>The unique identifier of the link.</p>
256    pub fn set_link_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
257        self.link_id = input;
258        self
259    }
260    /// <p>The unique identifier of the link.</p>
261    pub fn get_link_id(&self) -> &::std::option::Option<::std::string::String> {
262        &self.link_id
263    }
264    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
265        self._request_id = Some(request_id.into());
266        self
267    }
268
269    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
270        self._request_id = request_id;
271        self
272    }
273    /// Consumes the builder and constructs a [`AcceptLinkOutput`](crate::operation::accept_link::AcceptLinkOutput).
274    /// This method will fail if any of the following fields are not set:
275    /// - [`gateway_id`](crate::operation::accept_link::builders::AcceptLinkOutputBuilder::gateway_id)
276    /// - [`peer_gateway_id`](crate::operation::accept_link::builders::AcceptLinkOutputBuilder::peer_gateway_id)
277    /// - [`status`](crate::operation::accept_link::builders::AcceptLinkOutputBuilder::status)
278    /// - [`created_at`](crate::operation::accept_link::builders::AcceptLinkOutputBuilder::created_at)
279    /// - [`updated_at`](crate::operation::accept_link::builders::AcceptLinkOutputBuilder::updated_at)
280    /// - [`link_id`](crate::operation::accept_link::builders::AcceptLinkOutputBuilder::link_id)
281    pub fn build(self) -> ::std::result::Result<crate::operation::accept_link::AcceptLinkOutput, ::aws_smithy_types::error::operation::BuildError> {
282        ::std::result::Result::Ok(crate::operation::accept_link::AcceptLinkOutput {
283            gateway_id: self.gateway_id.ok_or_else(|| {
284                ::aws_smithy_types::error::operation::BuildError::missing_field(
285                    "gateway_id",
286                    "gateway_id was not specified but it is required when building AcceptLinkOutput",
287                )
288            })?,
289            peer_gateway_id: self.peer_gateway_id.ok_or_else(|| {
290                ::aws_smithy_types::error::operation::BuildError::missing_field(
291                    "peer_gateway_id",
292                    "peer_gateway_id was not specified but it is required when building AcceptLinkOutput",
293                )
294            })?,
295            status: self.status.ok_or_else(|| {
296                ::aws_smithy_types::error::operation::BuildError::missing_field(
297                    "status",
298                    "status was not specified but it is required when building AcceptLinkOutput",
299                )
300            })?,
301            created_at: self.created_at.ok_or_else(|| {
302                ::aws_smithy_types::error::operation::BuildError::missing_field(
303                    "created_at",
304                    "created_at was not specified but it is required when building AcceptLinkOutput",
305                )
306            })?,
307            updated_at: self.updated_at.ok_or_else(|| {
308                ::aws_smithy_types::error::operation::BuildError::missing_field(
309                    "updated_at",
310                    "updated_at was not specified but it is required when building AcceptLinkOutput",
311                )
312            })?,
313            direction: self.direction,
314            flow_modules: self.flow_modules,
315            pending_flow_modules: self.pending_flow_modules,
316            attributes: self.attributes,
317            link_id: self.link_id.ok_or_else(|| {
318                ::aws_smithy_types::error::operation::BuildError::missing_field(
319                    "link_id",
320                    "link_id was not specified but it is required when building AcceptLinkOutput",
321                )
322            })?,
323            _request_id: self._request_id,
324        })
325    }
326}