1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct DescribeGatewayOutput {
    /// <p>The ID of the gateway device.</p>
    pub gateway_id: ::std::string::String,
    /// <p>The name of the gateway.</p>
    pub gateway_name: ::std::string::String,
    /// <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>
    /// <p><code>arn:${Partition}:iotsitewise:${Region}:${Account}:gateway/${GatewayId}</code></p>
    pub gateway_arn: ::std::string::String,
    /// <p>The gateway's platform.</p>
    pub gateway_platform: ::std::option::Option<crate::types::GatewayPlatform>,
    /// <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>
    pub gateway_capability_summaries: ::std::vec::Vec<crate::types::GatewayCapabilitySummary>,
    /// <p>The date the gateway was created, in Unix epoch time.</p>
    pub creation_date: ::aws_smithy_types::DateTime,
    /// <p>The date the gateway was last updated, in Unix epoch time.</p>
    pub last_update_date: ::aws_smithy_types::DateTime,
    _request_id: Option<String>,
}
impl DescribeGatewayOutput {
    /// <p>The ID of the gateway device.</p>
    pub fn gateway_id(&self) -> &str {
        use std::ops::Deref;
        self.gateway_id.deref()
    }
    /// <p>The name of the gateway.</p>
    pub fn gateway_name(&self) -> &str {
        use std::ops::Deref;
        self.gateway_name.deref()
    }
    /// <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>
    /// <p><code>arn:${Partition}:iotsitewise:${Region}:${Account}:gateway/${GatewayId}</code></p>
    pub fn gateway_arn(&self) -> &str {
        use std::ops::Deref;
        self.gateway_arn.deref()
    }
    /// <p>The gateway's platform.</p>
    pub fn gateway_platform(&self) -> ::std::option::Option<&crate::types::GatewayPlatform> {
        self.gateway_platform.as_ref()
    }
    /// <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>
    pub fn gateway_capability_summaries(&self) -> &[crate::types::GatewayCapabilitySummary] {
        use std::ops::Deref;
        self.gateway_capability_summaries.deref()
    }
    /// <p>The date the gateway was created, in Unix epoch time.</p>
    pub fn creation_date(&self) -> &::aws_smithy_types::DateTime {
        &self.creation_date
    }
    /// <p>The date the gateway was last updated, in Unix epoch time.</p>
    pub fn last_update_date(&self) -> &::aws_smithy_types::DateTime {
        &self.last_update_date
    }
}
impl ::aws_types::request_id::RequestId for DescribeGatewayOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl DescribeGatewayOutput {
    /// Creates a new builder-style object to manufacture [`DescribeGatewayOutput`](crate::operation::describe_gateway::DescribeGatewayOutput).
    pub fn builder() -> crate::operation::describe_gateway::builders::DescribeGatewayOutputBuilder {
        crate::operation::describe_gateway::builders::DescribeGatewayOutputBuilder::default()
    }
}

/// A builder for [`DescribeGatewayOutput`](crate::operation::describe_gateway::DescribeGatewayOutput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct DescribeGatewayOutputBuilder {
    pub(crate) gateway_id: ::std::option::Option<::std::string::String>,
    pub(crate) gateway_name: ::std::option::Option<::std::string::String>,
    pub(crate) gateway_arn: ::std::option::Option<::std::string::String>,
    pub(crate) gateway_platform: ::std::option::Option<crate::types::GatewayPlatform>,
    pub(crate) gateway_capability_summaries: ::std::option::Option<::std::vec::Vec<crate::types::GatewayCapabilitySummary>>,
    pub(crate) creation_date: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) last_update_date: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl DescribeGatewayOutputBuilder {
    /// <p>The ID of the gateway device.</p>
    /// This field is required.
    pub fn gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.gateway_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the gateway device.</p>
    pub fn set_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.gateway_id = input;
        self
    }
    /// <p>The ID of the gateway device.</p>
    pub fn get_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.gateway_id
    }
    /// <p>The name of the gateway.</p>
    /// This field is required.
    pub fn gateway_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.gateway_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the gateway.</p>
    pub fn set_gateway_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.gateway_name = input;
        self
    }
    /// <p>The name of the gateway.</p>
    pub fn get_gateway_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.gateway_name
    }
    /// <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>
    /// <p><code>arn:${Partition}:iotsitewise:${Region}:${Account}:gateway/${GatewayId}</code></p>
    /// This field is required.
    pub fn gateway_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.gateway_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <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>
    /// <p><code>arn:${Partition}:iotsitewise:${Region}:${Account}:gateway/${GatewayId}</code></p>
    pub fn set_gateway_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.gateway_arn = input;
        self
    }
    /// <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>
    /// <p><code>arn:${Partition}:iotsitewise:${Region}:${Account}:gateway/${GatewayId}</code></p>
    pub fn get_gateway_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.gateway_arn
    }
    /// <p>The gateway's platform.</p>
    pub fn gateway_platform(mut self, input: crate::types::GatewayPlatform) -> Self {
        self.gateway_platform = ::std::option::Option::Some(input);
        self
    }
    /// <p>The gateway's platform.</p>
    pub fn set_gateway_platform(mut self, input: ::std::option::Option<crate::types::GatewayPlatform>) -> Self {
        self.gateway_platform = input;
        self
    }
    /// <p>The gateway's platform.</p>
    pub fn get_gateway_platform(&self) -> &::std::option::Option<crate::types::GatewayPlatform> {
        &self.gateway_platform
    }
    /// Appends an item to `gateway_capability_summaries`.
    ///
    /// To override the contents of this collection use [`set_gateway_capability_summaries`](Self::set_gateway_capability_summaries).
    ///
    /// <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>
    pub fn gateway_capability_summaries(mut self, input: crate::types::GatewayCapabilitySummary) -> Self {
        let mut v = self.gateway_capability_summaries.unwrap_or_default();
        v.push(input);
        self.gateway_capability_summaries = ::std::option::Option::Some(v);
        self
    }
    /// <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>
    pub fn set_gateway_capability_summaries(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GatewayCapabilitySummary>>) -> Self {
        self.gateway_capability_summaries = input;
        self
    }
    /// <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>
    pub fn get_gateway_capability_summaries(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GatewayCapabilitySummary>> {
        &self.gateway_capability_summaries
    }
    /// <p>The date the gateway was created, in Unix epoch time.</p>
    /// This field is required.
    pub fn creation_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.creation_date = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date the gateway was created, in Unix epoch time.</p>
    pub fn set_creation_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.creation_date = input;
        self
    }
    /// <p>The date the gateway was created, in Unix epoch time.</p>
    pub fn get_creation_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.creation_date
    }
    /// <p>The date the gateway was last updated, in Unix epoch time.</p>
    /// This field is required.
    pub fn last_update_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.last_update_date = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date the gateway was last updated, in Unix epoch time.</p>
    pub fn set_last_update_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.last_update_date = input;
        self
    }
    /// <p>The date the gateway was last updated, in Unix epoch time.</p>
    pub fn get_last_update_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.last_update_date
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`DescribeGatewayOutput`](crate::operation::describe_gateway::DescribeGatewayOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`gateway_id`](crate::operation::describe_gateway::builders::DescribeGatewayOutputBuilder::gateway_id)
    /// - [`gateway_name`](crate::operation::describe_gateway::builders::DescribeGatewayOutputBuilder::gateway_name)
    /// - [`gateway_arn`](crate::operation::describe_gateway::builders::DescribeGatewayOutputBuilder::gateway_arn)
    /// - [`gateway_capability_summaries`](crate::operation::describe_gateway::builders::DescribeGatewayOutputBuilder::gateway_capability_summaries)
    /// - [`creation_date`](crate::operation::describe_gateway::builders::DescribeGatewayOutputBuilder::creation_date)
    /// - [`last_update_date`](crate::operation::describe_gateway::builders::DescribeGatewayOutputBuilder::last_update_date)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::describe_gateway::DescribeGatewayOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::describe_gateway::DescribeGatewayOutput {
            gateway_id: self.gateway_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "gateway_id",
                    "gateway_id was not specified but it is required when building DescribeGatewayOutput",
                )
            })?,
            gateway_name: self.gateway_name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "gateway_name",
                    "gateway_name was not specified but it is required when building DescribeGatewayOutput",
                )
            })?,
            gateway_arn: self.gateway_arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "gateway_arn",
                    "gateway_arn was not specified but it is required when building DescribeGatewayOutput",
                )
            })?,
            gateway_platform: self.gateway_platform,
            gateway_capability_summaries: self.gateway_capability_summaries.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "gateway_capability_summaries",
                    "gateway_capability_summaries was not specified but it is required when building DescribeGatewayOutput",
                )
            })?,
            creation_date: self.creation_date.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "creation_date",
                    "creation_date was not specified but it is required when building DescribeGatewayOutput",
                )
            })?,
            last_update_date: self.last_update_date.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "last_update_date",
                    "last_update_date was not specified but it is required when building DescribeGatewayOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}