aws_sdk_rtbfabric/operation/reject_link/
_reject_link_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct RejectLinkOutput {
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 _request_id: Option<String>,
27}
28impl RejectLinkOutput {
29 pub fn gateway_id(&self) -> &str {
31 use std::ops::Deref;
32 self.gateway_id.deref()
33 }
34 pub fn peer_gateway_id(&self) -> &str {
36 use std::ops::Deref;
37 self.peer_gateway_id.deref()
38 }
39 pub fn status(&self) -> &crate::types::LinkStatus {
41 &self.status
42 }
43 pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
45 &self.created_at
46 }
47 pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
49 &self.updated_at
50 }
51 pub fn direction(&self) -> ::std::option::Option<&crate::types::LinkDirection> {
53 self.direction.as_ref()
54 }
55 pub fn flow_modules(&self) -> &[crate::types::ModuleConfiguration] {
59 self.flow_modules.as_deref().unwrap_or_default()
60 }
61 pub fn pending_flow_modules(&self) -> &[crate::types::ModuleConfiguration] {
65 self.pending_flow_modules.as_deref().unwrap_or_default()
66 }
67 pub fn attributes(&self) -> ::std::option::Option<&crate::types::LinkAttributes> {
69 self.attributes.as_ref()
70 }
71 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 RejectLinkOutput {
78 fn request_id(&self) -> Option<&str> {
79 self._request_id.as_deref()
80 }
81}
82impl RejectLinkOutput {
83 pub fn builder() -> crate::operation::reject_link::builders::RejectLinkOutputBuilder {
85 crate::operation::reject_link::builders::RejectLinkOutputBuilder::default()
86 }
87}
88
89#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
91#[non_exhaustive]
92pub struct RejectLinkOutputBuilder {
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 RejectLinkOutputBuilder {
106 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 pub fn set_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
114 self.gateway_id = input;
115 self
116 }
117 pub fn get_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
119 &self.gateway_id
120 }
121 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 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 pub fn get_peer_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
134 &self.peer_gateway_id
135 }
136 pub fn status(mut self, input: crate::types::LinkStatus) -> Self {
139 self.status = ::std::option::Option::Some(input);
140 self
141 }
142 pub fn set_status(mut self, input: ::std::option::Option<crate::types::LinkStatus>) -> Self {
144 self.status = input;
145 self
146 }
147 pub fn get_status(&self) -> &::std::option::Option<crate::types::LinkStatus> {
149 &self.status
150 }
151 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 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 pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
164 &self.created_at
165 }
166 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 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 pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
179 &self.updated_at
180 }
181 pub fn direction(mut self, input: crate::types::LinkDirection) -> Self {
183 self.direction = ::std::option::Option::Some(input);
184 self
185 }
186 pub fn set_direction(mut self, input: ::std::option::Option<crate::types::LinkDirection>) -> Self {
188 self.direction = input;
189 self
190 }
191 pub fn get_direction(&self) -> &::std::option::Option<crate::types::LinkDirection> {
193 &self.direction
194 }
195 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 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 pub fn get_flow_modules(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ModuleConfiguration>> {
213 &self.flow_modules
214 }
215 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 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 pub fn get_pending_flow_modules(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ModuleConfiguration>> {
233 &self.pending_flow_modules
234 }
235 pub fn attributes(mut self, input: crate::types::LinkAttributes) -> Self {
237 self.attributes = ::std::option::Option::Some(input);
238 self
239 }
240 pub fn set_attributes(mut self, input: ::std::option::Option<crate::types::LinkAttributes>) -> Self {
242 self.attributes = input;
243 self
244 }
245 pub fn get_attributes(&self) -> &::std::option::Option<crate::types::LinkAttributes> {
247 &self.attributes
248 }
249 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 pub fn set_link_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
257 self.link_id = input;
258 self
259 }
260 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 pub fn build(self) -> ::std::result::Result<crate::operation::reject_link::RejectLinkOutput, ::aws_smithy_types::error::operation::BuildError> {
282 ::std::result::Result::Ok(crate::operation::reject_link::RejectLinkOutput {
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 RejectLinkOutput",
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 RejectLinkOutput",
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 RejectLinkOutput",
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 RejectLinkOutput",
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 RejectLinkOutput",
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 RejectLinkOutput",
321 )
322 })?,
323 _request_id: self._request_id,
324 })
325 }
326}