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
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
// 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 GetConnectionOutput {
/// <p>The connection state of the client. Returns <code>true</code> if the client is currently connected, or <code>false</code> if the client is not connected.</p>
pub connected: bool,
/// <p>The name of the thing associated with the principal of the MQTT client, if applicable.</p>
pub thing_name: ::std::option::Option<::std::string::String>,
/// <p>Indicates whether the client is using a clean session. Returns <code>true</code> for clean sessions or <code>false</code> for persistent sessions.</p>
pub clean_session: bool,
/// <p>The IP address of the client that initiated the connection.</p>
pub source_ip: ::std::option::Option<::std::string::String>,
/// <p>The client's source port.</p>
pub source_port: i32,
/// <p>The IP address of the Amazon Web Services IoT Core endpoint that the client connected to. For clients connected to VPC endpoints, this is the private IP address of the network interface the client is connected to.</p>
pub target_ip: ::std::option::Option<::std::string::String>,
/// <p>The port number of the Amazon Web Services IoT Core endpoint that the client connected to.</p>
pub target_port: i32,
/// <p>The keep-alive interval in seconds that the client specified when establishing the connection.</p>
pub keep_alive_duration: i32,
/// <p>Unix timestamp (in milliseconds) indicating when the client connected. Present only when connected is true.</p>
pub connected_since: i64,
/// <p>Unix timestamp (in milliseconds) indicating when the client disconnected. Present only when connected is false. This information is available for 30 minutes after the client disconnects.</p>
pub disconnected_since: i64,
/// <p>The reason for the last disconnection, if the client is currently disconnected. See the <a href="https://docs.aws.amazon.com/iot/latest/developerguide/life-cycle-events.html#connect-disconnect">developer guide</a> for valid disconnect reasons.</p>
pub disconnect_reason: ::std::option::Option<::std::string::String>,
/// <p>The session expiry interval in seconds for the MQTT client connection. This is configured by the user. This value indicates how long the session will remain active after the client disconnects.</p>
pub session_expiry: i64,
/// <p>The unique identifier of the MQTT client. This is the same client ID that was used when the client established the connection.</p>
pub client_id: ::std::option::Option<::std::string::String>,
/// <p>The ID of the VPC endpoint. Present for clients connected to IoT Core via a <a href="https://docs.aws.amazon.com/iot/latest/developerguide/IoTCore-VPC.html">VPC endpoint</a>.</p>
pub vpc_endpoint_id: ::std::option::Option<::std::string::String>,
_request_id: Option<String>,
}
impl GetConnectionOutput {
/// <p>The connection state of the client. Returns <code>true</code> if the client is currently connected, or <code>false</code> if the client is not connected.</p>
pub fn connected(&self) -> bool {
self.connected
}
/// <p>The name of the thing associated with the principal of the MQTT client, if applicable.</p>
pub fn thing_name(&self) -> ::std::option::Option<&str> {
self.thing_name.as_deref()
}
/// <p>Indicates whether the client is using a clean session. Returns <code>true</code> for clean sessions or <code>false</code> for persistent sessions.</p>
pub fn clean_session(&self) -> bool {
self.clean_session
}
/// <p>The IP address of the client that initiated the connection.</p>
pub fn source_ip(&self) -> ::std::option::Option<&str> {
self.source_ip.as_deref()
}
/// <p>The client's source port.</p>
pub fn source_port(&self) -> i32 {
self.source_port
}
/// <p>The IP address of the Amazon Web Services IoT Core endpoint that the client connected to. For clients connected to VPC endpoints, this is the private IP address of the network interface the client is connected to.</p>
pub fn target_ip(&self) -> ::std::option::Option<&str> {
self.target_ip.as_deref()
}
/// <p>The port number of the Amazon Web Services IoT Core endpoint that the client connected to.</p>
pub fn target_port(&self) -> i32 {
self.target_port
}
/// <p>The keep-alive interval in seconds that the client specified when establishing the connection.</p>
pub fn keep_alive_duration(&self) -> i32 {
self.keep_alive_duration
}
/// <p>Unix timestamp (in milliseconds) indicating when the client connected. Present only when connected is true.</p>
pub fn connected_since(&self) -> i64 {
self.connected_since
}
/// <p>Unix timestamp (in milliseconds) indicating when the client disconnected. Present only when connected is false. This information is available for 30 minutes after the client disconnects.</p>
pub fn disconnected_since(&self) -> i64 {
self.disconnected_since
}
/// <p>The reason for the last disconnection, if the client is currently disconnected. See the <a href="https://docs.aws.amazon.com/iot/latest/developerguide/life-cycle-events.html#connect-disconnect">developer guide</a> for valid disconnect reasons.</p>
pub fn disconnect_reason(&self) -> ::std::option::Option<&str> {
self.disconnect_reason.as_deref()
}
/// <p>The session expiry interval in seconds for the MQTT client connection. This is configured by the user. This value indicates how long the session will remain active after the client disconnects.</p>
pub fn session_expiry(&self) -> i64 {
self.session_expiry
}
/// <p>The unique identifier of the MQTT client. This is the same client ID that was used when the client established the connection.</p>
pub fn client_id(&self) -> ::std::option::Option<&str> {
self.client_id.as_deref()
}
/// <p>The ID of the VPC endpoint. Present for clients connected to IoT Core via a <a href="https://docs.aws.amazon.com/iot/latest/developerguide/IoTCore-VPC.html">VPC endpoint</a>.</p>
pub fn vpc_endpoint_id(&self) -> ::std::option::Option<&str> {
self.vpc_endpoint_id.as_deref()
}
}
impl ::aws_types::request_id::RequestId for GetConnectionOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl GetConnectionOutput {
/// Creates a new builder-style object to manufacture [`GetConnectionOutput`](crate::operation::get_connection::GetConnectionOutput).
pub fn builder() -> crate::operation::get_connection::builders::GetConnectionOutputBuilder {
crate::operation::get_connection::builders::GetConnectionOutputBuilder::default()
}
}
/// A builder for [`GetConnectionOutput`](crate::operation::get_connection::GetConnectionOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetConnectionOutputBuilder {
pub(crate) connected: ::std::option::Option<bool>,
pub(crate) thing_name: ::std::option::Option<::std::string::String>,
pub(crate) clean_session: ::std::option::Option<bool>,
pub(crate) source_ip: ::std::option::Option<::std::string::String>,
pub(crate) source_port: ::std::option::Option<i32>,
pub(crate) target_ip: ::std::option::Option<::std::string::String>,
pub(crate) target_port: ::std::option::Option<i32>,
pub(crate) keep_alive_duration: ::std::option::Option<i32>,
pub(crate) connected_since: ::std::option::Option<i64>,
pub(crate) disconnected_since: ::std::option::Option<i64>,
pub(crate) disconnect_reason: ::std::option::Option<::std::string::String>,
pub(crate) session_expiry: ::std::option::Option<i64>,
pub(crate) client_id: ::std::option::Option<::std::string::String>,
pub(crate) vpc_endpoint_id: ::std::option::Option<::std::string::String>,
_request_id: Option<String>,
}
impl GetConnectionOutputBuilder {
/// <p>The connection state of the client. Returns <code>true</code> if the client is currently connected, or <code>false</code> if the client is not connected.</p>
pub fn connected(mut self, input: bool) -> Self {
self.connected = ::std::option::Option::Some(input);
self
}
/// <p>The connection state of the client. Returns <code>true</code> if the client is currently connected, or <code>false</code> if the client is not connected.</p>
pub fn set_connected(mut self, input: ::std::option::Option<bool>) -> Self {
self.connected = input;
self
}
/// <p>The connection state of the client. Returns <code>true</code> if the client is currently connected, or <code>false</code> if the client is not connected.</p>
pub fn get_connected(&self) -> &::std::option::Option<bool> {
&self.connected
}
/// <p>The name of the thing associated with the principal of the MQTT client, if applicable.</p>
pub fn thing_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.thing_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the thing associated with the principal of the MQTT client, if applicable.</p>
pub fn set_thing_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.thing_name = input;
self
}
/// <p>The name of the thing associated with the principal of the MQTT client, if applicable.</p>
pub fn get_thing_name(&self) -> &::std::option::Option<::std::string::String> {
&self.thing_name
}
/// <p>Indicates whether the client is using a clean session. Returns <code>true</code> for clean sessions or <code>false</code> for persistent sessions.</p>
pub fn clean_session(mut self, input: bool) -> Self {
self.clean_session = ::std::option::Option::Some(input);
self
}
/// <p>Indicates whether the client is using a clean session. Returns <code>true</code> for clean sessions or <code>false</code> for persistent sessions.</p>
pub fn set_clean_session(mut self, input: ::std::option::Option<bool>) -> Self {
self.clean_session = input;
self
}
/// <p>Indicates whether the client is using a clean session. Returns <code>true</code> for clean sessions or <code>false</code> for persistent sessions.</p>
pub fn get_clean_session(&self) -> &::std::option::Option<bool> {
&self.clean_session
}
/// <p>The IP address of the client that initiated the connection.</p>
pub fn source_ip(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.source_ip = ::std::option::Option::Some(input.into());
self
}
/// <p>The IP address of the client that initiated the connection.</p>
pub fn set_source_ip(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.source_ip = input;
self
}
/// <p>The IP address of the client that initiated the connection.</p>
pub fn get_source_ip(&self) -> &::std::option::Option<::std::string::String> {
&self.source_ip
}
/// <p>The client's source port.</p>
pub fn source_port(mut self, input: i32) -> Self {
self.source_port = ::std::option::Option::Some(input);
self
}
/// <p>The client's source port.</p>
pub fn set_source_port(mut self, input: ::std::option::Option<i32>) -> Self {
self.source_port = input;
self
}
/// <p>The client's source port.</p>
pub fn get_source_port(&self) -> &::std::option::Option<i32> {
&self.source_port
}
/// <p>The IP address of the Amazon Web Services IoT Core endpoint that the client connected to. For clients connected to VPC endpoints, this is the private IP address of the network interface the client is connected to.</p>
pub fn target_ip(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.target_ip = ::std::option::Option::Some(input.into());
self
}
/// <p>The IP address of the Amazon Web Services IoT Core endpoint that the client connected to. For clients connected to VPC endpoints, this is the private IP address of the network interface the client is connected to.</p>
pub fn set_target_ip(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.target_ip = input;
self
}
/// <p>The IP address of the Amazon Web Services IoT Core endpoint that the client connected to. For clients connected to VPC endpoints, this is the private IP address of the network interface the client is connected to.</p>
pub fn get_target_ip(&self) -> &::std::option::Option<::std::string::String> {
&self.target_ip
}
/// <p>The port number of the Amazon Web Services IoT Core endpoint that the client connected to.</p>
pub fn target_port(mut self, input: i32) -> Self {
self.target_port = ::std::option::Option::Some(input);
self
}
/// <p>The port number of the Amazon Web Services IoT Core endpoint that the client connected to.</p>
pub fn set_target_port(mut self, input: ::std::option::Option<i32>) -> Self {
self.target_port = input;
self
}
/// <p>The port number of the Amazon Web Services IoT Core endpoint that the client connected to.</p>
pub fn get_target_port(&self) -> &::std::option::Option<i32> {
&self.target_port
}
/// <p>The keep-alive interval in seconds that the client specified when establishing the connection.</p>
pub fn keep_alive_duration(mut self, input: i32) -> Self {
self.keep_alive_duration = ::std::option::Option::Some(input);
self
}
/// <p>The keep-alive interval in seconds that the client specified when establishing the connection.</p>
pub fn set_keep_alive_duration(mut self, input: ::std::option::Option<i32>) -> Self {
self.keep_alive_duration = input;
self
}
/// <p>The keep-alive interval in seconds that the client specified when establishing the connection.</p>
pub fn get_keep_alive_duration(&self) -> &::std::option::Option<i32> {
&self.keep_alive_duration
}
/// <p>Unix timestamp (in milliseconds) indicating when the client connected. Present only when connected is true.</p>
pub fn connected_since(mut self, input: i64) -> Self {
self.connected_since = ::std::option::Option::Some(input);
self
}
/// <p>Unix timestamp (in milliseconds) indicating when the client connected. Present only when connected is true.</p>
pub fn set_connected_since(mut self, input: ::std::option::Option<i64>) -> Self {
self.connected_since = input;
self
}
/// <p>Unix timestamp (in milliseconds) indicating when the client connected. Present only when connected is true.</p>
pub fn get_connected_since(&self) -> &::std::option::Option<i64> {
&self.connected_since
}
/// <p>Unix timestamp (in milliseconds) indicating when the client disconnected. Present only when connected is false. This information is available for 30 minutes after the client disconnects.</p>
pub fn disconnected_since(mut self, input: i64) -> Self {
self.disconnected_since = ::std::option::Option::Some(input);
self
}
/// <p>Unix timestamp (in milliseconds) indicating when the client disconnected. Present only when connected is false. This information is available for 30 minutes after the client disconnects.</p>
pub fn set_disconnected_since(mut self, input: ::std::option::Option<i64>) -> Self {
self.disconnected_since = input;
self
}
/// <p>Unix timestamp (in milliseconds) indicating when the client disconnected. Present only when connected is false. This information is available for 30 minutes after the client disconnects.</p>
pub fn get_disconnected_since(&self) -> &::std::option::Option<i64> {
&self.disconnected_since
}
/// <p>The reason for the last disconnection, if the client is currently disconnected. See the <a href="https://docs.aws.amazon.com/iot/latest/developerguide/life-cycle-events.html#connect-disconnect">developer guide</a> for valid disconnect reasons.</p>
pub fn disconnect_reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.disconnect_reason = ::std::option::Option::Some(input.into());
self
}
/// <p>The reason for the last disconnection, if the client is currently disconnected. See the <a href="https://docs.aws.amazon.com/iot/latest/developerguide/life-cycle-events.html#connect-disconnect">developer guide</a> for valid disconnect reasons.</p>
pub fn set_disconnect_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.disconnect_reason = input;
self
}
/// <p>The reason for the last disconnection, if the client is currently disconnected. See the <a href="https://docs.aws.amazon.com/iot/latest/developerguide/life-cycle-events.html#connect-disconnect">developer guide</a> for valid disconnect reasons.</p>
pub fn get_disconnect_reason(&self) -> &::std::option::Option<::std::string::String> {
&self.disconnect_reason
}
/// <p>The session expiry interval in seconds for the MQTT client connection. This is configured by the user. This value indicates how long the session will remain active after the client disconnects.</p>
pub fn session_expiry(mut self, input: i64) -> Self {
self.session_expiry = ::std::option::Option::Some(input);
self
}
/// <p>The session expiry interval in seconds for the MQTT client connection. This is configured by the user. This value indicates how long the session will remain active after the client disconnects.</p>
pub fn set_session_expiry(mut self, input: ::std::option::Option<i64>) -> Self {
self.session_expiry = input;
self
}
/// <p>The session expiry interval in seconds for the MQTT client connection. This is configured by the user. This value indicates how long the session will remain active after the client disconnects.</p>
pub fn get_session_expiry(&self) -> &::std::option::Option<i64> {
&self.session_expiry
}
/// <p>The unique identifier of the MQTT client. This is the same client ID that was used when the client established the connection.</p>
pub fn client_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.client_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The unique identifier of the MQTT client. This is the same client ID that was used when the client established the connection.</p>
pub fn set_client_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.client_id = input;
self
}
/// <p>The unique identifier of the MQTT client. This is the same client ID that was used when the client established the connection.</p>
pub fn get_client_id(&self) -> &::std::option::Option<::std::string::String> {
&self.client_id
}
/// <p>The ID of the VPC endpoint. Present for clients connected to IoT Core via a <a href="https://docs.aws.amazon.com/iot/latest/developerguide/IoTCore-VPC.html">VPC endpoint</a>.</p>
pub fn vpc_endpoint_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.vpc_endpoint_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The ID of the VPC endpoint. Present for clients connected to IoT Core via a <a href="https://docs.aws.amazon.com/iot/latest/developerguide/IoTCore-VPC.html">VPC endpoint</a>.</p>
pub fn set_vpc_endpoint_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.vpc_endpoint_id = input;
self
}
/// <p>The ID of the VPC endpoint. Present for clients connected to IoT Core via a <a href="https://docs.aws.amazon.com/iot/latest/developerguide/IoTCore-VPC.html">VPC endpoint</a>.</p>
pub fn get_vpc_endpoint_id(&self) -> &::std::option::Option<::std::string::String> {
&self.vpc_endpoint_id
}
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 [`GetConnectionOutput`](crate::operation::get_connection::GetConnectionOutput).
pub fn build(self) -> crate::operation::get_connection::GetConnectionOutput {
crate::operation::get_connection::GetConnectionOutput {
connected: self.connected.unwrap_or_default(),
thing_name: self.thing_name,
clean_session: self.clean_session.unwrap_or_default(),
source_ip: self.source_ip,
source_port: self.source_port.unwrap_or_default(),
target_ip: self.target_ip,
target_port: self.target_port.unwrap_or_default(),
keep_alive_duration: self.keep_alive_duration.unwrap_or_default(),
connected_since: self.connected_since.unwrap_or_default(),
disconnected_since: self.disconnected_since.unwrap_or_default(),
disconnect_reason: self.disconnect_reason,
session_expiry: self.session_expiry.unwrap_or_default(),
client_id: self.client_id,
vpc_endpoint_id: self.vpc_endpoint_id,
_request_id: self._request_id,
}
}
}