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