aws_sdk_iotsitewise/operation/describe_gateway/
_describe_gateway_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct DescribeGatewayOutput {
6 pub gateway_id: ::std::string::String,
8 pub gateway_name: ::std::string::String,
10 pub gateway_arn: ::std::string::String,
13 pub gateway_platform: ::std::option::Option<crate::types::GatewayPlatform>,
15 pub gateway_version: ::std::option::Option<::std::string::String>,
17 pub gateway_capability_summaries: ::std::vec::Vec<crate::types::GatewayCapabilitySummary>,
19 pub creation_date: ::aws_smithy_types::DateTime,
21 pub last_update_date: ::aws_smithy_types::DateTime,
23 _request_id: Option<String>,
24}
25impl DescribeGatewayOutput {
26 pub fn gateway_id(&self) -> &str {
28 use std::ops::Deref;
29 self.gateway_id.deref()
30 }
31 pub fn gateway_name(&self) -> &str {
33 use std::ops::Deref;
34 self.gateway_name.deref()
35 }
36 pub fn gateway_arn(&self) -> &str {
39 use std::ops::Deref;
40 self.gateway_arn.deref()
41 }
42 pub fn gateway_platform(&self) -> ::std::option::Option<&crate::types::GatewayPlatform> {
44 self.gateway_platform.as_ref()
45 }
46 pub fn gateway_version(&self) -> ::std::option::Option<&str> {
48 self.gateway_version.as_deref()
49 }
50 pub fn gateway_capability_summaries(&self) -> &[crate::types::GatewayCapabilitySummary] {
52 use std::ops::Deref;
53 self.gateway_capability_summaries.deref()
54 }
55 pub fn creation_date(&self) -> &::aws_smithy_types::DateTime {
57 &self.creation_date
58 }
59 pub fn last_update_date(&self) -> &::aws_smithy_types::DateTime {
61 &self.last_update_date
62 }
63}
64impl ::aws_types::request_id::RequestId for DescribeGatewayOutput {
65 fn request_id(&self) -> Option<&str> {
66 self._request_id.as_deref()
67 }
68}
69impl DescribeGatewayOutput {
70 pub fn builder() -> crate::operation::describe_gateway::builders::DescribeGatewayOutputBuilder {
72 crate::operation::describe_gateway::builders::DescribeGatewayOutputBuilder::default()
73 }
74}
75
76#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
78#[non_exhaustive]
79pub struct DescribeGatewayOutputBuilder {
80 pub(crate) gateway_id: ::std::option::Option<::std::string::String>,
81 pub(crate) gateway_name: ::std::option::Option<::std::string::String>,
82 pub(crate) gateway_arn: ::std::option::Option<::std::string::String>,
83 pub(crate) gateway_platform: ::std::option::Option<crate::types::GatewayPlatform>,
84 pub(crate) gateway_version: ::std::option::Option<::std::string::String>,
85 pub(crate) gateway_capability_summaries: ::std::option::Option<::std::vec::Vec<crate::types::GatewayCapabilitySummary>>,
86 pub(crate) creation_date: ::std::option::Option<::aws_smithy_types::DateTime>,
87 pub(crate) last_update_date: ::std::option::Option<::aws_smithy_types::DateTime>,
88 _request_id: Option<String>,
89}
90impl DescribeGatewayOutputBuilder {
91 pub fn gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
94 self.gateway_id = ::std::option::Option::Some(input.into());
95 self
96 }
97 pub fn set_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
99 self.gateway_id = input;
100 self
101 }
102 pub fn get_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
104 &self.gateway_id
105 }
106 pub fn gateway_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
109 self.gateway_name = ::std::option::Option::Some(input.into());
110 self
111 }
112 pub fn set_gateway_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
114 self.gateway_name = input;
115 self
116 }
117 pub fn get_gateway_name(&self) -> &::std::option::Option<::std::string::String> {
119 &self.gateway_name
120 }
121 pub fn gateway_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
125 self.gateway_arn = ::std::option::Option::Some(input.into());
126 self
127 }
128 pub fn set_gateway_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
131 self.gateway_arn = input;
132 self
133 }
134 pub fn get_gateway_arn(&self) -> &::std::option::Option<::std::string::String> {
137 &self.gateway_arn
138 }
139 pub fn gateway_platform(mut self, input: crate::types::GatewayPlatform) -> Self {
141 self.gateway_platform = ::std::option::Option::Some(input);
142 self
143 }
144 pub fn set_gateway_platform(mut self, input: ::std::option::Option<crate::types::GatewayPlatform>) -> Self {
146 self.gateway_platform = input;
147 self
148 }
149 pub fn get_gateway_platform(&self) -> &::std::option::Option<crate::types::GatewayPlatform> {
151 &self.gateway_platform
152 }
153 pub fn gateway_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155 self.gateway_version = ::std::option::Option::Some(input.into());
156 self
157 }
158 pub fn set_gateway_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160 self.gateway_version = input;
161 self
162 }
163 pub fn get_gateway_version(&self) -> &::std::option::Option<::std::string::String> {
165 &self.gateway_version
166 }
167 pub fn gateway_capability_summaries(mut self, input: crate::types::GatewayCapabilitySummary) -> Self {
173 let mut v = self.gateway_capability_summaries.unwrap_or_default();
174 v.push(input);
175 self.gateway_capability_summaries = ::std::option::Option::Some(v);
176 self
177 }
178 pub fn set_gateway_capability_summaries(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GatewayCapabilitySummary>>) -> Self {
180 self.gateway_capability_summaries = input;
181 self
182 }
183 pub fn get_gateway_capability_summaries(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GatewayCapabilitySummary>> {
185 &self.gateway_capability_summaries
186 }
187 pub fn creation_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
190 self.creation_date = ::std::option::Option::Some(input);
191 self
192 }
193 pub fn set_creation_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
195 self.creation_date = input;
196 self
197 }
198 pub fn get_creation_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
200 &self.creation_date
201 }
202 pub fn last_update_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
205 self.last_update_date = ::std::option::Option::Some(input);
206 self
207 }
208 pub fn set_last_update_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
210 self.last_update_date = input;
211 self
212 }
213 pub fn get_last_update_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
215 &self.last_update_date
216 }
217 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
218 self._request_id = Some(request_id.into());
219 self
220 }
221
222 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
223 self._request_id = request_id;
224 self
225 }
226 pub fn build(
235 self,
236 ) -> ::std::result::Result<crate::operation::describe_gateway::DescribeGatewayOutput, ::aws_smithy_types::error::operation::BuildError> {
237 ::std::result::Result::Ok(crate::operation::describe_gateway::DescribeGatewayOutput {
238 gateway_id: self.gateway_id.ok_or_else(|| {
239 ::aws_smithy_types::error::operation::BuildError::missing_field(
240 "gateway_id",
241 "gateway_id was not specified but it is required when building DescribeGatewayOutput",
242 )
243 })?,
244 gateway_name: self.gateway_name.ok_or_else(|| {
245 ::aws_smithy_types::error::operation::BuildError::missing_field(
246 "gateway_name",
247 "gateway_name was not specified but it is required when building DescribeGatewayOutput",
248 )
249 })?,
250 gateway_arn: self.gateway_arn.ok_or_else(|| {
251 ::aws_smithy_types::error::operation::BuildError::missing_field(
252 "gateway_arn",
253 "gateway_arn was not specified but it is required when building DescribeGatewayOutput",
254 )
255 })?,
256 gateway_platform: self.gateway_platform,
257 gateway_version: self.gateway_version,
258 gateway_capability_summaries: self.gateway_capability_summaries.ok_or_else(|| {
259 ::aws_smithy_types::error::operation::BuildError::missing_field(
260 "gateway_capability_summaries",
261 "gateway_capability_summaries was not specified but it is required when building DescribeGatewayOutput",
262 )
263 })?,
264 creation_date: self.creation_date.ok_or_else(|| {
265 ::aws_smithy_types::error::operation::BuildError::missing_field(
266 "creation_date",
267 "creation_date was not specified but it is required when building DescribeGatewayOutput",
268 )
269 })?,
270 last_update_date: self.last_update_date.ok_or_else(|| {
271 ::aws_smithy_types::error::operation::BuildError::missing_field(
272 "last_update_date",
273 "last_update_date was not specified but it is required when building DescribeGatewayOutput",
274 )
275 })?,
276 _request_id: self._request_id,
277 })
278 }
279}