aws_sdk_iotsitewise/operation/describe_gateway/
_describe_gateway_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 DescribeGatewayOutput {
6    /// <p>The ID of the gateway device.</p>
7    pub gateway_id: ::std::string::String,
8    /// <p>The name of the gateway.</p>
9    pub gateway_name: ::std::string::String,
10    /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">ARN</a> of the gateway, which has the following format.</p>
11    /// <p><code>arn:${Partition}:iotsitewise:${Region}:${Account}:gateway/${GatewayId}</code></p>
12    pub gateway_arn: ::std::string::String,
13    /// <p>The gateway's platform.</p>
14    pub gateway_platform: ::std::option::Option<crate::types::GatewayPlatform>,
15    /// <p>The version of the gateway. A value of <code>3</code> indicates an MQTT-enabled, V3 gateway, while <code>2</code> indicates a Classic streams, V2 gateway.</p>
16    pub gateway_version: ::std::option::Option<::std::string::String>,
17    /// <p>A list of gateway capability summaries that each contain a namespace and status. Each gateway capability defines data sources for the gateway. To retrieve a capability configuration's definition, use <a href="https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_DescribeGatewayCapabilityConfiguration.html">DescribeGatewayCapabilityConfiguration</a>.</p>
18    pub gateway_capability_summaries: ::std::vec::Vec<crate::types::GatewayCapabilitySummary>,
19    /// <p>The date the gateway was created, in Unix epoch time.</p>
20    pub creation_date: ::aws_smithy_types::DateTime,
21    /// <p>The date the gateway was last updated, in Unix epoch time.</p>
22    pub last_update_date: ::aws_smithy_types::DateTime,
23    _request_id: Option<String>,
24}
25impl DescribeGatewayOutput {
26    /// <p>The ID of the gateway device.</p>
27    pub fn gateway_id(&self) -> &str {
28        use std::ops::Deref;
29        self.gateway_id.deref()
30    }
31    /// <p>The name of the gateway.</p>
32    pub fn gateway_name(&self) -> &str {
33        use std::ops::Deref;
34        self.gateway_name.deref()
35    }
36    /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">ARN</a> of the gateway, which has the following format.</p>
37    /// <p><code>arn:${Partition}:iotsitewise:${Region}:${Account}:gateway/${GatewayId}</code></p>
38    pub fn gateway_arn(&self) -> &str {
39        use std::ops::Deref;
40        self.gateway_arn.deref()
41    }
42    /// <p>The gateway's platform.</p>
43    pub fn gateway_platform(&self) -> ::std::option::Option<&crate::types::GatewayPlatform> {
44        self.gateway_platform.as_ref()
45    }
46    /// <p>The version of the gateway. A value of <code>3</code> indicates an MQTT-enabled, V3 gateway, while <code>2</code> indicates a Classic streams, V2 gateway.</p>
47    pub fn gateway_version(&self) -> ::std::option::Option<&str> {
48        self.gateway_version.as_deref()
49    }
50    /// <p>A list of gateway capability summaries that each contain a namespace and status. Each gateway capability defines data sources for the gateway. To retrieve a capability configuration's definition, use <a href="https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_DescribeGatewayCapabilityConfiguration.html">DescribeGatewayCapabilityConfiguration</a>.</p>
51    pub fn gateway_capability_summaries(&self) -> &[crate::types::GatewayCapabilitySummary] {
52        use std::ops::Deref;
53        self.gateway_capability_summaries.deref()
54    }
55    /// <p>The date the gateway was created, in Unix epoch time.</p>
56    pub fn creation_date(&self) -> &::aws_smithy_types::DateTime {
57        &self.creation_date
58    }
59    /// <p>The date the gateway was last updated, in Unix epoch time.</p>
60    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    /// Creates a new builder-style object to manufacture [`DescribeGatewayOutput`](crate::operation::describe_gateway::DescribeGatewayOutput).
71    pub fn builder() -> crate::operation::describe_gateway::builders::DescribeGatewayOutputBuilder {
72        crate::operation::describe_gateway::builders::DescribeGatewayOutputBuilder::default()
73    }
74}
75
76/// A builder for [`DescribeGatewayOutput`](crate::operation::describe_gateway::DescribeGatewayOutput).
77#[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    /// <p>The ID of the gateway device.</p>
92    /// This field is required.
93    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    /// <p>The ID of the gateway device.</p>
98    pub fn set_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
99        self.gateway_id = input;
100        self
101    }
102    /// <p>The ID of the gateway device.</p>
103    pub fn get_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
104        &self.gateway_id
105    }
106    /// <p>The name of the gateway.</p>
107    /// This field is required.
108    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    /// <p>The name of the gateway.</p>
113    pub fn set_gateway_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
114        self.gateway_name = input;
115        self
116    }
117    /// <p>The name of the gateway.</p>
118    pub fn get_gateway_name(&self) -> &::std::option::Option<::std::string::String> {
119        &self.gateway_name
120    }
121    /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">ARN</a> of the gateway, which has the following format.</p>
122    /// <p><code>arn:${Partition}:iotsitewise:${Region}:${Account}:gateway/${GatewayId}</code></p>
123    /// This field is required.
124    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    /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">ARN</a> of the gateway, which has the following format.</p>
129    /// <p><code>arn:${Partition}:iotsitewise:${Region}:${Account}:gateway/${GatewayId}</code></p>
130    pub fn set_gateway_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
131        self.gateway_arn = input;
132        self
133    }
134    /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">ARN</a> of the gateway, which has the following format.</p>
135    /// <p><code>arn:${Partition}:iotsitewise:${Region}:${Account}:gateway/${GatewayId}</code></p>
136    pub fn get_gateway_arn(&self) -> &::std::option::Option<::std::string::String> {
137        &self.gateway_arn
138    }
139    /// <p>The gateway's platform.</p>
140    pub fn gateway_platform(mut self, input: crate::types::GatewayPlatform) -> Self {
141        self.gateway_platform = ::std::option::Option::Some(input);
142        self
143    }
144    /// <p>The gateway's platform.</p>
145    pub fn set_gateway_platform(mut self, input: ::std::option::Option<crate::types::GatewayPlatform>) -> Self {
146        self.gateway_platform = input;
147        self
148    }
149    /// <p>The gateway's platform.</p>
150    pub fn get_gateway_platform(&self) -> &::std::option::Option<crate::types::GatewayPlatform> {
151        &self.gateway_platform
152    }
153    /// <p>The version of the gateway. A value of <code>3</code> indicates an MQTT-enabled, V3 gateway, while <code>2</code> indicates a Classic streams, V2 gateway.</p>
154    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    /// <p>The version of the gateway. A value of <code>3</code> indicates an MQTT-enabled, V3 gateway, while <code>2</code> indicates a Classic streams, V2 gateway.</p>
159    pub fn set_gateway_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160        self.gateway_version = input;
161        self
162    }
163    /// <p>The version of the gateway. A value of <code>3</code> indicates an MQTT-enabled, V3 gateway, while <code>2</code> indicates a Classic streams, V2 gateway.</p>
164    pub fn get_gateway_version(&self) -> &::std::option::Option<::std::string::String> {
165        &self.gateway_version
166    }
167    /// Appends an item to `gateway_capability_summaries`.
168    ///
169    /// To override the contents of this collection use [`set_gateway_capability_summaries`](Self::set_gateway_capability_summaries).
170    ///
171    /// <p>A list of gateway capability summaries that each contain a namespace and status. Each gateway capability defines data sources for the gateway. To retrieve a capability configuration's definition, use <a href="https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_DescribeGatewayCapabilityConfiguration.html">DescribeGatewayCapabilityConfiguration</a>.</p>
172    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    /// <p>A list of gateway capability summaries that each contain a namespace and status. Each gateway capability defines data sources for the gateway. To retrieve a capability configuration's definition, use <a href="https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_DescribeGatewayCapabilityConfiguration.html">DescribeGatewayCapabilityConfiguration</a>.</p>
179    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    /// <p>A list of gateway capability summaries that each contain a namespace and status. Each gateway capability defines data sources for the gateway. To retrieve a capability configuration's definition, use <a href="https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_DescribeGatewayCapabilityConfiguration.html">DescribeGatewayCapabilityConfiguration</a>.</p>
184    pub fn get_gateway_capability_summaries(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GatewayCapabilitySummary>> {
185        &self.gateway_capability_summaries
186    }
187    /// <p>The date the gateway was created, in Unix epoch time.</p>
188    /// This field is required.
189    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    /// <p>The date the gateway was created, in Unix epoch time.</p>
194    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    /// <p>The date the gateway was created, in Unix epoch time.</p>
199    pub fn get_creation_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
200        &self.creation_date
201    }
202    /// <p>The date the gateway was last updated, in Unix epoch time.</p>
203    /// This field is required.
204    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    /// <p>The date the gateway was last updated, in Unix epoch time.</p>
209    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    /// <p>The date the gateway was last updated, in Unix epoch time.</p>
214    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    /// Consumes the builder and constructs a [`DescribeGatewayOutput`](crate::operation::describe_gateway::DescribeGatewayOutput).
227    /// This method will fail if any of the following fields are not set:
228    /// - [`gateway_id`](crate::operation::describe_gateway::builders::DescribeGatewayOutputBuilder::gateway_id)
229    /// - [`gateway_name`](crate::operation::describe_gateway::builders::DescribeGatewayOutputBuilder::gateway_name)
230    /// - [`gateway_arn`](crate::operation::describe_gateway::builders::DescribeGatewayOutputBuilder::gateway_arn)
231    /// - [`gateway_capability_summaries`](crate::operation::describe_gateway::builders::DescribeGatewayOutputBuilder::gateway_capability_summaries)
232    /// - [`creation_date`](crate::operation::describe_gateway::builders::DescribeGatewayOutputBuilder::creation_date)
233    /// - [`last_update_date`](crate::operation::describe_gateway::builders::DescribeGatewayOutputBuilder::last_update_date)
234    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}