aws_sdk_rtbfabric/operation/create_link/
_create_link_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateLinkOutput {
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 customer_provided_id: ::std::option::Option<::std::string::String>,
28 _request_id: Option<String>,
29}
30impl CreateLinkOutput {
31 pub fn gateway_id(&self) -> &str {
33 use std::ops::Deref;
34 self.gateway_id.deref()
35 }
36 pub fn peer_gateway_id(&self) -> &str {
38 use std::ops::Deref;
39 self.peer_gateway_id.deref()
40 }
41 pub fn status(&self) -> &crate::types::LinkStatus {
43 &self.status
44 }
45 pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
47 &self.created_at
48 }
49 pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
51 &self.updated_at
52 }
53 pub fn direction(&self) -> ::std::option::Option<&crate::types::LinkDirection> {
55 self.direction.as_ref()
56 }
57 pub fn flow_modules(&self) -> &[crate::types::ModuleConfiguration] {
61 self.flow_modules.as_deref().unwrap_or_default()
62 }
63 pub fn pending_flow_modules(&self) -> &[crate::types::ModuleConfiguration] {
67 self.pending_flow_modules.as_deref().unwrap_or_default()
68 }
69 pub fn attributes(&self) -> ::std::option::Option<&crate::types::LinkAttributes> {
71 self.attributes.as_ref()
72 }
73 pub fn link_id(&self) -> &str {
75 use std::ops::Deref;
76 self.link_id.deref()
77 }
78 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 pub fn builder() -> crate::operation::create_link::builders::CreateLinkOutputBuilder {
91 crate::operation::create_link::builders::CreateLinkOutputBuilder::default()
92 }
93}
94
95#[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 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 pub fn set_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121 self.gateway_id = input;
122 self
123 }
124 pub fn get_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
126 &self.gateway_id
127 }
128 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 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 pub fn get_peer_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
141 &self.peer_gateway_id
142 }
143 pub fn status(mut self, input: crate::types::LinkStatus) -> Self {
146 self.status = ::std::option::Option::Some(input);
147 self
148 }
149 pub fn set_status(mut self, input: ::std::option::Option<crate::types::LinkStatus>) -> Self {
151 self.status = input;
152 self
153 }
154 pub fn get_status(&self) -> &::std::option::Option<crate::types::LinkStatus> {
156 &self.status
157 }
158 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 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 pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
171 &self.created_at
172 }
173 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 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 pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
186 &self.updated_at
187 }
188 pub fn direction(mut self, input: crate::types::LinkDirection) -> Self {
190 self.direction = ::std::option::Option::Some(input);
191 self
192 }
193 pub fn set_direction(mut self, input: ::std::option::Option<crate::types::LinkDirection>) -> Self {
195 self.direction = input;
196 self
197 }
198 pub fn get_direction(&self) -> &::std::option::Option<crate::types::LinkDirection> {
200 &self.direction
201 }
202 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 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 pub fn get_flow_modules(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ModuleConfiguration>> {
220 &self.flow_modules
221 }
222 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 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 pub fn get_pending_flow_modules(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ModuleConfiguration>> {
240 &self.pending_flow_modules
241 }
242 pub fn attributes(mut self, input: crate::types::LinkAttributes) -> Self {
244 self.attributes = ::std::option::Option::Some(input);
245 self
246 }
247 pub fn set_attributes(mut self, input: ::std::option::Option<crate::types::LinkAttributes>) -> Self {
249 self.attributes = input;
250 self
251 }
252 pub fn get_attributes(&self) -> &::std::option::Option<crate::types::LinkAttributes> {
254 &self.attributes
255 }
256 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 pub fn set_link_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
264 self.link_id = input;
265 self
266 }
267 pub fn get_link_id(&self) -> &::std::option::Option<::std::string::String> {
269 &self.link_id
270 }
271 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 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 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 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}