@aws-sdk/client-iotsecuretunneling 3.310.0 → 3.315.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,82 +6,58 @@ const smithy_client_1 = require("@aws-sdk/smithy-client");
6
6
  const IoTSecureTunnelingServiceException_1 = require("../models/IoTSecureTunnelingServiceException");
7
7
  const models_0_1 = require("../models/models_0");
8
8
  const se_CloseTunnelCommand = async (input, context) => {
9
- const headers = {
10
- "content-type": "application/x-amz-json-1.1",
11
- "x-amz-target": "IoTSecuredTunneling.CloseTunnel",
12
- };
9
+ const headers = sharedHeaders("CloseTunnel");
13
10
  let body;
14
- body = JSON.stringify(se_CloseTunnelRequest(input, context));
11
+ body = JSON.stringify((0, smithy_client_1._json)(input));
15
12
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
16
13
  };
17
14
  exports.se_CloseTunnelCommand = se_CloseTunnelCommand;
18
15
  const se_DescribeTunnelCommand = async (input, context) => {
19
- const headers = {
20
- "content-type": "application/x-amz-json-1.1",
21
- "x-amz-target": "IoTSecuredTunneling.DescribeTunnel",
22
- };
16
+ const headers = sharedHeaders("DescribeTunnel");
23
17
  let body;
24
- body = JSON.stringify(se_DescribeTunnelRequest(input, context));
18
+ body = JSON.stringify((0, smithy_client_1._json)(input));
25
19
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
26
20
  };
27
21
  exports.se_DescribeTunnelCommand = se_DescribeTunnelCommand;
28
22
  const se_ListTagsForResourceCommand = async (input, context) => {
29
- const headers = {
30
- "content-type": "application/x-amz-json-1.1",
31
- "x-amz-target": "IoTSecuredTunneling.ListTagsForResource",
32
- };
23
+ const headers = sharedHeaders("ListTagsForResource");
33
24
  let body;
34
- body = JSON.stringify(se_ListTagsForResourceRequest(input, context));
25
+ body = JSON.stringify((0, smithy_client_1._json)(input));
35
26
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
36
27
  };
37
28
  exports.se_ListTagsForResourceCommand = se_ListTagsForResourceCommand;
38
29
  const se_ListTunnelsCommand = async (input, context) => {
39
- const headers = {
40
- "content-type": "application/x-amz-json-1.1",
41
- "x-amz-target": "IoTSecuredTunneling.ListTunnels",
42
- };
30
+ const headers = sharedHeaders("ListTunnels");
43
31
  let body;
44
- body = JSON.stringify(se_ListTunnelsRequest(input, context));
32
+ body = JSON.stringify((0, smithy_client_1._json)(input));
45
33
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
46
34
  };
47
35
  exports.se_ListTunnelsCommand = se_ListTunnelsCommand;
48
36
  const se_OpenTunnelCommand = async (input, context) => {
49
- const headers = {
50
- "content-type": "application/x-amz-json-1.1",
51
- "x-amz-target": "IoTSecuredTunneling.OpenTunnel",
52
- };
37
+ const headers = sharedHeaders("OpenTunnel");
53
38
  let body;
54
- body = JSON.stringify(se_OpenTunnelRequest(input, context));
39
+ body = JSON.stringify((0, smithy_client_1._json)(input));
55
40
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
56
41
  };
57
42
  exports.se_OpenTunnelCommand = se_OpenTunnelCommand;
58
43
  const se_RotateTunnelAccessTokenCommand = async (input, context) => {
59
- const headers = {
60
- "content-type": "application/x-amz-json-1.1",
61
- "x-amz-target": "IoTSecuredTunneling.RotateTunnelAccessToken",
62
- };
44
+ const headers = sharedHeaders("RotateTunnelAccessToken");
63
45
  let body;
64
- body = JSON.stringify(se_RotateTunnelAccessTokenRequest(input, context));
46
+ body = JSON.stringify((0, smithy_client_1._json)(input));
65
47
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
66
48
  };
67
49
  exports.se_RotateTunnelAccessTokenCommand = se_RotateTunnelAccessTokenCommand;
68
50
  const se_TagResourceCommand = async (input, context) => {
69
- const headers = {
70
- "content-type": "application/x-amz-json-1.1",
71
- "x-amz-target": "IoTSecuredTunneling.TagResource",
72
- };
51
+ const headers = sharedHeaders("TagResource");
73
52
  let body;
74
- body = JSON.stringify(se_TagResourceRequest(input, context));
53
+ body = JSON.stringify((0, smithy_client_1._json)(input));
75
54
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
76
55
  };
77
56
  exports.se_TagResourceCommand = se_TagResourceCommand;
78
57
  const se_UntagResourceCommand = async (input, context) => {
79
- const headers = {
80
- "content-type": "application/x-amz-json-1.1",
81
- "x-amz-target": "IoTSecuredTunneling.UntagResource",
82
- };
58
+ const headers = sharedHeaders("UntagResource");
83
59
  let body;
84
- body = JSON.stringify(se_UntagResourceRequest(input, context));
60
+ body = JSON.stringify((0, smithy_client_1._json)(input));
85
61
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
86
62
  };
87
63
  exports.se_UntagResourceCommand = se_UntagResourceCommand;
@@ -91,12 +67,12 @@ const de_CloseTunnelCommand = async (output, context) => {
91
67
  }
92
68
  const data = await parseBody(output.body, context);
93
69
  let contents = {};
94
- contents = de_CloseTunnelResponse(data, context);
70
+ contents = (0, smithy_client_1._json)(data);
95
71
  const response = {
96
72
  $metadata: deserializeMetadata(output),
97
73
  ...contents,
98
74
  };
99
- return Promise.resolve(response);
75
+ return response;
100
76
  };
101
77
  exports.de_CloseTunnelCommand = de_CloseTunnelCommand;
102
78
  const de_CloseTunnelCommandError = async (output, context) => {
@@ -111,10 +87,9 @@ const de_CloseTunnelCommandError = async (output, context) => {
111
87
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
112
88
  default:
113
89
  const parsedBody = parsedOutput.body;
114
- (0, smithy_client_1.throwDefaultError)({
90
+ return throwDefaultError({
115
91
  output,
116
92
  parsedBody,
117
- exceptionCtor: IoTSecureTunnelingServiceException_1.IoTSecureTunnelingServiceException,
118
93
  errorCode,
119
94
  });
120
95
  }
@@ -130,7 +105,7 @@ const de_DescribeTunnelCommand = async (output, context) => {
130
105
  $metadata: deserializeMetadata(output),
131
106
  ...contents,
132
107
  };
133
- return Promise.resolve(response);
108
+ return response;
134
109
  };
135
110
  exports.de_DescribeTunnelCommand = de_DescribeTunnelCommand;
136
111
  const de_DescribeTunnelCommandError = async (output, context) => {
@@ -145,10 +120,9 @@ const de_DescribeTunnelCommandError = async (output, context) => {
145
120
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
146
121
  default:
147
122
  const parsedBody = parsedOutput.body;
148
- (0, smithy_client_1.throwDefaultError)({
123
+ return throwDefaultError({
149
124
  output,
150
125
  parsedBody,
151
- exceptionCtor: IoTSecureTunnelingServiceException_1.IoTSecureTunnelingServiceException,
152
126
  errorCode,
153
127
  });
154
128
  }
@@ -159,12 +133,12 @@ const de_ListTagsForResourceCommand = async (output, context) => {
159
133
  }
160
134
  const data = await parseBody(output.body, context);
161
135
  let contents = {};
162
- contents = de_ListTagsForResourceResponse(data, context);
136
+ contents = (0, smithy_client_1._json)(data);
163
137
  const response = {
164
138
  $metadata: deserializeMetadata(output),
165
139
  ...contents,
166
140
  };
167
- return Promise.resolve(response);
141
+ return response;
168
142
  };
169
143
  exports.de_ListTagsForResourceCommand = de_ListTagsForResourceCommand;
170
144
  const de_ListTagsForResourceCommandError = async (output, context) => {
@@ -179,10 +153,9 @@ const de_ListTagsForResourceCommandError = async (output, context) => {
179
153
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
180
154
  default:
181
155
  const parsedBody = parsedOutput.body;
182
- (0, smithy_client_1.throwDefaultError)({
156
+ return throwDefaultError({
183
157
  output,
184
158
  parsedBody,
185
- exceptionCtor: IoTSecureTunnelingServiceException_1.IoTSecureTunnelingServiceException,
186
159
  errorCode,
187
160
  });
188
161
  }
@@ -198,7 +171,7 @@ const de_ListTunnelsCommand = async (output, context) => {
198
171
  $metadata: deserializeMetadata(output),
199
172
  ...contents,
200
173
  };
201
- return Promise.resolve(response);
174
+ return response;
202
175
  };
203
176
  exports.de_ListTunnelsCommand = de_ListTunnelsCommand;
204
177
  const de_ListTunnelsCommandError = async (output, context) => {
@@ -208,10 +181,9 @@ const de_ListTunnelsCommandError = async (output, context) => {
208
181
  };
209
182
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
210
183
  const parsedBody = parsedOutput.body;
211
- (0, smithy_client_1.throwDefaultError)({
184
+ return throwDefaultError({
212
185
  output,
213
186
  parsedBody,
214
- exceptionCtor: IoTSecureTunnelingServiceException_1.IoTSecureTunnelingServiceException,
215
187
  errorCode,
216
188
  });
217
189
  };
@@ -221,12 +193,12 @@ const de_OpenTunnelCommand = async (output, context) => {
221
193
  }
222
194
  const data = await parseBody(output.body, context);
223
195
  let contents = {};
224
- contents = de_OpenTunnelResponse(data, context);
196
+ contents = (0, smithy_client_1._json)(data);
225
197
  const response = {
226
198
  $metadata: deserializeMetadata(output),
227
199
  ...contents,
228
200
  };
229
- return Promise.resolve(response);
201
+ return response;
230
202
  };
231
203
  exports.de_OpenTunnelCommand = de_OpenTunnelCommand;
232
204
  const de_OpenTunnelCommandError = async (output, context) => {
@@ -241,10 +213,9 @@ const de_OpenTunnelCommandError = async (output, context) => {
241
213
  throw await de_LimitExceededExceptionRes(parsedOutput, context);
242
214
  default:
243
215
  const parsedBody = parsedOutput.body;
244
- (0, smithy_client_1.throwDefaultError)({
216
+ return throwDefaultError({
245
217
  output,
246
218
  parsedBody,
247
- exceptionCtor: IoTSecureTunnelingServiceException_1.IoTSecureTunnelingServiceException,
248
219
  errorCode,
249
220
  });
250
221
  }
@@ -255,12 +226,12 @@ const de_RotateTunnelAccessTokenCommand = async (output, context) => {
255
226
  }
256
227
  const data = await parseBody(output.body, context);
257
228
  let contents = {};
258
- contents = de_RotateTunnelAccessTokenResponse(data, context);
229
+ contents = (0, smithy_client_1._json)(data);
259
230
  const response = {
260
231
  $metadata: deserializeMetadata(output),
261
232
  ...contents,
262
233
  };
263
- return Promise.resolve(response);
234
+ return response;
264
235
  };
265
236
  exports.de_RotateTunnelAccessTokenCommand = de_RotateTunnelAccessTokenCommand;
266
237
  const de_RotateTunnelAccessTokenCommandError = async (output, context) => {
@@ -275,10 +246,9 @@ const de_RotateTunnelAccessTokenCommandError = async (output, context) => {
275
246
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
276
247
  default:
277
248
  const parsedBody = parsedOutput.body;
278
- (0, smithy_client_1.throwDefaultError)({
249
+ return throwDefaultError({
279
250
  output,
280
251
  parsedBody,
281
- exceptionCtor: IoTSecureTunnelingServiceException_1.IoTSecureTunnelingServiceException,
282
252
  errorCode,
283
253
  });
284
254
  }
@@ -289,12 +259,12 @@ const de_TagResourceCommand = async (output, context) => {
289
259
  }
290
260
  const data = await parseBody(output.body, context);
291
261
  let contents = {};
292
- contents = de_TagResourceResponse(data, context);
262
+ contents = (0, smithy_client_1._json)(data);
293
263
  const response = {
294
264
  $metadata: deserializeMetadata(output),
295
265
  ...contents,
296
266
  };
297
- return Promise.resolve(response);
267
+ return response;
298
268
  };
299
269
  exports.de_TagResourceCommand = de_TagResourceCommand;
300
270
  const de_TagResourceCommandError = async (output, context) => {
@@ -309,10 +279,9 @@ const de_TagResourceCommandError = async (output, context) => {
309
279
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
310
280
  default:
311
281
  const parsedBody = parsedOutput.body;
312
- (0, smithy_client_1.throwDefaultError)({
282
+ return throwDefaultError({
313
283
  output,
314
284
  parsedBody,
315
- exceptionCtor: IoTSecureTunnelingServiceException_1.IoTSecureTunnelingServiceException,
316
285
  errorCode,
317
286
  });
318
287
  }
@@ -323,12 +292,12 @@ const de_UntagResourceCommand = async (output, context) => {
323
292
  }
324
293
  const data = await parseBody(output.body, context);
325
294
  let contents = {};
326
- contents = de_UntagResourceResponse(data, context);
295
+ contents = (0, smithy_client_1._json)(data);
327
296
  const response = {
328
297
  $metadata: deserializeMetadata(output),
329
298
  ...contents,
330
299
  };
331
- return Promise.resolve(response);
300
+ return response;
332
301
  };
333
302
  exports.de_UntagResourceCommand = de_UntagResourceCommand;
334
303
  const de_UntagResourceCommandError = async (output, context) => {
@@ -343,17 +312,16 @@ const de_UntagResourceCommandError = async (output, context) => {
343
312
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
344
313
  default:
345
314
  const parsedBody = parsedOutput.body;
346
- (0, smithy_client_1.throwDefaultError)({
315
+ return throwDefaultError({
347
316
  output,
348
317
  parsedBody,
349
- exceptionCtor: IoTSecureTunnelingServiceException_1.IoTSecureTunnelingServiceException,
350
318
  errorCode,
351
319
  });
352
320
  }
353
321
  };
354
322
  const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
355
323
  const body = parsedOutput.body;
356
- const deserialized = de_LimitExceededException(body, context);
324
+ const deserialized = (0, smithy_client_1._json)(body);
357
325
  const exception = new models_0_1.LimitExceededException({
358
326
  $metadata: deserializeMetadata(parsedOutput),
359
327
  ...deserialized,
@@ -362,244 +330,63 @@ const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
362
330
  };
363
331
  const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
364
332
  const body = parsedOutput.body;
365
- const deserialized = de_ResourceNotFoundException(body, context);
333
+ const deserialized = (0, smithy_client_1._json)(body);
366
334
  const exception = new models_0_1.ResourceNotFoundException({
367
335
  $metadata: deserializeMetadata(parsedOutput),
368
336
  ...deserialized,
369
337
  });
370
338
  return (0, smithy_client_1.decorateServiceException)(exception, body);
371
339
  };
372
- const se_CloseTunnelRequest = (input, context) => {
373
- return {
374
- ...(input.delete != null && { delete: input.delete }),
375
- ...(input.tunnelId != null && { tunnelId: input.tunnelId }),
376
- };
377
- };
378
- const se_DescribeTunnelRequest = (input, context) => {
379
- return {
380
- ...(input.tunnelId != null && { tunnelId: input.tunnelId }),
381
- };
382
- };
383
- const se_DestinationConfig = (input, context) => {
384
- return {
385
- ...(input.services != null && { services: se_ServiceList(input.services, context) }),
386
- ...(input.thingName != null && { thingName: input.thingName }),
387
- };
388
- };
389
- const se_ListTagsForResourceRequest = (input, context) => {
390
- return {
391
- ...(input.resourceArn != null && { resourceArn: input.resourceArn }),
392
- };
393
- };
394
- const se_ListTunnelsRequest = (input, context) => {
395
- return {
396
- ...(input.maxResults != null && { maxResults: input.maxResults }),
397
- ...(input.nextToken != null && { nextToken: input.nextToken }),
398
- ...(input.thingName != null && { thingName: input.thingName }),
399
- };
400
- };
401
- const se_OpenTunnelRequest = (input, context) => {
402
- return {
403
- ...(input.description != null && { description: input.description }),
404
- ...(input.destinationConfig != null && {
405
- destinationConfig: se_DestinationConfig(input.destinationConfig, context),
406
- }),
407
- ...(input.tags != null && { tags: se_TagList(input.tags, context) }),
408
- ...(input.timeoutConfig != null && { timeoutConfig: se_TimeoutConfig(input.timeoutConfig, context) }),
409
- };
410
- };
411
- const se_RotateTunnelAccessTokenRequest = (input, context) => {
412
- return {
413
- ...(input.clientMode != null && { clientMode: input.clientMode }),
414
- ...(input.destinationConfig != null && {
415
- destinationConfig: se_DestinationConfig(input.destinationConfig, context),
416
- }),
417
- ...(input.tunnelId != null && { tunnelId: input.tunnelId }),
418
- };
419
- };
420
- const se_ServiceList = (input, context) => {
421
- return input
422
- .filter((e) => e != null)
423
- .map((entry) => {
424
- return entry;
425
- });
426
- };
427
- const se_Tag = (input, context) => {
428
- return {
429
- ...(input.key != null && { key: input.key }),
430
- ...(input.value != null && { value: input.value }),
431
- };
432
- };
433
- const se_TagKeyList = (input, context) => {
434
- return input
435
- .filter((e) => e != null)
436
- .map((entry) => {
437
- return entry;
438
- });
439
- };
440
- const se_TagList = (input, context) => {
441
- return input
442
- .filter((e) => e != null)
443
- .map((entry) => {
444
- return se_Tag(entry, context);
445
- });
446
- };
447
- const se_TagResourceRequest = (input, context) => {
448
- return {
449
- ...(input.resourceArn != null && { resourceArn: input.resourceArn }),
450
- ...(input.tags != null && { tags: se_TagList(input.tags, context) }),
451
- };
452
- };
453
- const se_TimeoutConfig = (input, context) => {
454
- return {
455
- ...(input.maxLifetimeTimeoutMinutes != null && { maxLifetimeTimeoutMinutes: input.maxLifetimeTimeoutMinutes }),
456
- };
457
- };
458
- const se_UntagResourceRequest = (input, context) => {
459
- return {
460
- ...(input.resourceArn != null && { resourceArn: input.resourceArn }),
461
- ...(input.tagKeys != null && { tagKeys: se_TagKeyList(input.tagKeys, context) }),
462
- };
463
- };
464
- const de_CloseTunnelResponse = (output, context) => {
465
- return {};
466
- };
467
340
  const de_ConnectionState = (output, context) => {
468
- return {
469
- lastUpdatedAt: output.lastUpdatedAt != null
470
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.lastUpdatedAt)))
471
- : undefined,
472
- status: (0, smithy_client_1.expectString)(output.status),
473
- };
341
+ return (0, smithy_client_1.take)(output, {
342
+ lastUpdatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
343
+ status: smithy_client_1.expectString,
344
+ });
474
345
  };
475
346
  const de_DescribeTunnelResponse = (output, context) => {
476
- return {
477
- tunnel: output.tunnel != null ? de_Tunnel(output.tunnel, context) : undefined,
478
- };
479
- };
480
- const de_DestinationConfig = (output, context) => {
481
- return {
482
- services: output.services != null ? de_ServiceList(output.services, context) : undefined,
483
- thingName: (0, smithy_client_1.expectString)(output.thingName),
484
- };
485
- };
486
- const de_LimitExceededException = (output, context) => {
487
- return {
488
- message: (0, smithy_client_1.expectString)(output.message),
489
- };
490
- };
491
- const de_ListTagsForResourceResponse = (output, context) => {
492
- return {
493
- tags: output.tags != null ? de_TagList(output.tags, context) : undefined,
494
- };
495
- };
496
- const de_ListTunnelsResponse = (output, context) => {
497
- return {
498
- nextToken: (0, smithy_client_1.expectString)(output.nextToken),
499
- tunnelSummaries: output.tunnelSummaries != null ? de_TunnelSummaryList(output.tunnelSummaries, context) : undefined,
500
- };
501
- };
502
- const de_OpenTunnelResponse = (output, context) => {
503
- return {
504
- destinationAccessToken: (0, smithy_client_1.expectString)(output.destinationAccessToken),
505
- sourceAccessToken: (0, smithy_client_1.expectString)(output.sourceAccessToken),
506
- tunnelArn: (0, smithy_client_1.expectString)(output.tunnelArn),
507
- tunnelId: (0, smithy_client_1.expectString)(output.tunnelId),
508
- };
509
- };
510
- const de_ResourceNotFoundException = (output, context) => {
511
- return {
512
- message: (0, smithy_client_1.expectString)(output.message),
513
- };
514
- };
515
- const de_RotateTunnelAccessTokenResponse = (output, context) => {
516
- return {
517
- destinationAccessToken: (0, smithy_client_1.expectString)(output.destinationAccessToken),
518
- sourceAccessToken: (0, smithy_client_1.expectString)(output.sourceAccessToken),
519
- tunnelArn: (0, smithy_client_1.expectString)(output.tunnelArn),
520
- };
521
- };
522
- const de_ServiceList = (output, context) => {
523
- const retVal = (output || [])
524
- .filter((e) => e != null)
525
- .map((entry) => {
526
- if (entry === null) {
527
- return null;
528
- }
529
- return (0, smithy_client_1.expectString)(entry);
347
+ return (0, smithy_client_1.take)(output, {
348
+ tunnel: (_) => de_Tunnel(_, context),
530
349
  });
531
- return retVal;
532
350
  };
533
- const de_Tag = (output, context) => {
534
- return {
535
- key: (0, smithy_client_1.expectString)(output.key),
536
- value: (0, smithy_client_1.expectString)(output.value),
537
- };
538
- };
539
- const de_TagList = (output, context) => {
540
- const retVal = (output || [])
541
- .filter((e) => e != null)
542
- .map((entry) => {
543
- if (entry === null) {
544
- return null;
545
- }
546
- return de_Tag(entry, context);
351
+ const de_ListTunnelsResponse = (output, context) => {
352
+ return (0, smithy_client_1.take)(output, {
353
+ nextToken: smithy_client_1.expectString,
354
+ tunnelSummaries: (_) => de_TunnelSummaryList(_, context),
547
355
  });
548
- return retVal;
549
- };
550
- const de_TagResourceResponse = (output, context) => {
551
- return {};
552
- };
553
- const de_TimeoutConfig = (output, context) => {
554
- return {
555
- maxLifetimeTimeoutMinutes: (0, smithy_client_1.expectInt32)(output.maxLifetimeTimeoutMinutes),
556
- };
557
356
  };
558
357
  const de_Tunnel = (output, context) => {
559
- return {
560
- createdAt: output.createdAt != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.createdAt))) : undefined,
561
- description: (0, smithy_client_1.expectString)(output.description),
562
- destinationConfig: output.destinationConfig != null ? de_DestinationConfig(output.destinationConfig, context) : undefined,
563
- destinationConnectionState: output.destinationConnectionState != null
564
- ? de_ConnectionState(output.destinationConnectionState, context)
565
- : undefined,
566
- lastUpdatedAt: output.lastUpdatedAt != null
567
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.lastUpdatedAt)))
568
- : undefined,
569
- sourceConnectionState: output.sourceConnectionState != null ? de_ConnectionState(output.sourceConnectionState, context) : undefined,
570
- status: (0, smithy_client_1.expectString)(output.status),
571
- tags: output.tags != null ? de_TagList(output.tags, context) : undefined,
572
- timeoutConfig: output.timeoutConfig != null ? de_TimeoutConfig(output.timeoutConfig, context) : undefined,
573
- tunnelArn: (0, smithy_client_1.expectString)(output.tunnelArn),
574
- tunnelId: (0, smithy_client_1.expectString)(output.tunnelId),
575
- };
358
+ return (0, smithy_client_1.take)(output, {
359
+ createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
360
+ description: smithy_client_1.expectString,
361
+ destinationConfig: smithy_client_1._json,
362
+ destinationConnectionState: (_) => de_ConnectionState(_, context),
363
+ lastUpdatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
364
+ sourceConnectionState: (_) => de_ConnectionState(_, context),
365
+ status: smithy_client_1.expectString,
366
+ tags: smithy_client_1._json,
367
+ timeoutConfig: smithy_client_1._json,
368
+ tunnelArn: smithy_client_1.expectString,
369
+ tunnelId: smithy_client_1.expectString,
370
+ });
576
371
  };
577
372
  const de_TunnelSummary = (output, context) => {
578
- return {
579
- createdAt: output.createdAt != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.createdAt))) : undefined,
580
- description: (0, smithy_client_1.expectString)(output.description),
581
- lastUpdatedAt: output.lastUpdatedAt != null
582
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.lastUpdatedAt)))
583
- : undefined,
584
- status: (0, smithy_client_1.expectString)(output.status),
585
- tunnelArn: (0, smithy_client_1.expectString)(output.tunnelArn),
586
- tunnelId: (0, smithy_client_1.expectString)(output.tunnelId),
587
- };
373
+ return (0, smithy_client_1.take)(output, {
374
+ createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
375
+ description: smithy_client_1.expectString,
376
+ lastUpdatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
377
+ status: smithy_client_1.expectString,
378
+ tunnelArn: smithy_client_1.expectString,
379
+ tunnelId: smithy_client_1.expectString,
380
+ });
588
381
  };
589
382
  const de_TunnelSummaryList = (output, context) => {
590
383
  const retVal = (output || [])
591
384
  .filter((e) => e != null)
592
385
  .map((entry) => {
593
- if (entry === null) {
594
- return null;
595
- }
596
386
  return de_TunnelSummary(entry, context);
597
387
  });
598
388
  return retVal;
599
389
  };
600
- const de_UntagResourceResponse = (output, context) => {
601
- return {};
602
- };
603
390
  const deserializeMetadata = (output) => ({
604
391
  httpStatusCode: output.statusCode,
605
392
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
@@ -613,6 +400,7 @@ const collectBody = (streamBody = new Uint8Array(), context) => {
613
400
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
614
401
  };
615
402
  const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
403
+ const throwDefaultError = (0, smithy_client_1.withBaseException)(IoTSecureTunnelingServiceException_1.IoTSecureTunnelingServiceException);
616
404
  const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
617
405
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
618
406
  const contents = {
@@ -631,6 +419,12 @@ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, bod
631
419
  }
632
420
  return new protocol_http_1.HttpRequest(contents);
633
421
  };
422
+ function sharedHeaders(operation) {
423
+ return {
424
+ "content-type": "application/x-amz-json-1.1",
425
+ "x-amz-target": `IoTSecuredTunneling.${operation}`,
426
+ };
427
+ }
634
428
  const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
635
429
  if (encoded.length) {
636
430
  return JSON.parse(encoded);
@@ -1,77 +1,53 @@
1
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
- import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, parseEpochTimestamp as __parseEpochTimestamp, throwDefaultError, } from "@aws-sdk/smithy-client";
2
+ import { _json, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@aws-sdk/smithy-client";
3
3
  import { IoTSecureTunnelingServiceException as __BaseException } from "../models/IoTSecureTunnelingServiceException";
4
4
  import { LimitExceededException, ResourceNotFoundException, } from "../models/models_0";
5
5
  export const se_CloseTunnelCommand = async (input, context) => {
6
- const headers = {
7
- "content-type": "application/x-amz-json-1.1",
8
- "x-amz-target": "IoTSecuredTunneling.CloseTunnel",
9
- };
6
+ const headers = sharedHeaders("CloseTunnel");
10
7
  let body;
11
- body = JSON.stringify(se_CloseTunnelRequest(input, context));
8
+ body = JSON.stringify(_json(input));
12
9
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
13
10
  };
14
11
  export const se_DescribeTunnelCommand = async (input, context) => {
15
- const headers = {
16
- "content-type": "application/x-amz-json-1.1",
17
- "x-amz-target": "IoTSecuredTunneling.DescribeTunnel",
18
- };
12
+ const headers = sharedHeaders("DescribeTunnel");
19
13
  let body;
20
- body = JSON.stringify(se_DescribeTunnelRequest(input, context));
14
+ body = JSON.stringify(_json(input));
21
15
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
22
16
  };
23
17
  export const se_ListTagsForResourceCommand = async (input, context) => {
24
- const headers = {
25
- "content-type": "application/x-amz-json-1.1",
26
- "x-amz-target": "IoTSecuredTunneling.ListTagsForResource",
27
- };
18
+ const headers = sharedHeaders("ListTagsForResource");
28
19
  let body;
29
- body = JSON.stringify(se_ListTagsForResourceRequest(input, context));
20
+ body = JSON.stringify(_json(input));
30
21
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
31
22
  };
32
23
  export const se_ListTunnelsCommand = async (input, context) => {
33
- const headers = {
34
- "content-type": "application/x-amz-json-1.1",
35
- "x-amz-target": "IoTSecuredTunneling.ListTunnels",
36
- };
24
+ const headers = sharedHeaders("ListTunnels");
37
25
  let body;
38
- body = JSON.stringify(se_ListTunnelsRequest(input, context));
26
+ body = JSON.stringify(_json(input));
39
27
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
40
28
  };
41
29
  export const se_OpenTunnelCommand = async (input, context) => {
42
- const headers = {
43
- "content-type": "application/x-amz-json-1.1",
44
- "x-amz-target": "IoTSecuredTunneling.OpenTunnel",
45
- };
30
+ const headers = sharedHeaders("OpenTunnel");
46
31
  let body;
47
- body = JSON.stringify(se_OpenTunnelRequest(input, context));
32
+ body = JSON.stringify(_json(input));
48
33
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
49
34
  };
50
35
  export const se_RotateTunnelAccessTokenCommand = async (input, context) => {
51
- const headers = {
52
- "content-type": "application/x-amz-json-1.1",
53
- "x-amz-target": "IoTSecuredTunneling.RotateTunnelAccessToken",
54
- };
36
+ const headers = sharedHeaders("RotateTunnelAccessToken");
55
37
  let body;
56
- body = JSON.stringify(se_RotateTunnelAccessTokenRequest(input, context));
38
+ body = JSON.stringify(_json(input));
57
39
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
58
40
  };
59
41
  export const se_TagResourceCommand = async (input, context) => {
60
- const headers = {
61
- "content-type": "application/x-amz-json-1.1",
62
- "x-amz-target": "IoTSecuredTunneling.TagResource",
63
- };
42
+ const headers = sharedHeaders("TagResource");
64
43
  let body;
65
- body = JSON.stringify(se_TagResourceRequest(input, context));
44
+ body = JSON.stringify(_json(input));
66
45
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
67
46
  };
68
47
  export const se_UntagResourceCommand = async (input, context) => {
69
- const headers = {
70
- "content-type": "application/x-amz-json-1.1",
71
- "x-amz-target": "IoTSecuredTunneling.UntagResource",
72
- };
48
+ const headers = sharedHeaders("UntagResource");
73
49
  let body;
74
- body = JSON.stringify(se_UntagResourceRequest(input, context));
50
+ body = JSON.stringify(_json(input));
75
51
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
76
52
  };
77
53
  export const de_CloseTunnelCommand = async (output, context) => {
@@ -80,12 +56,12 @@ export const de_CloseTunnelCommand = async (output, context) => {
80
56
  }
81
57
  const data = await parseBody(output.body, context);
82
58
  let contents = {};
83
- contents = de_CloseTunnelResponse(data, context);
59
+ contents = _json(data);
84
60
  const response = {
85
61
  $metadata: deserializeMetadata(output),
86
62
  ...contents,
87
63
  };
88
- return Promise.resolve(response);
64
+ return response;
89
65
  };
90
66
  const de_CloseTunnelCommandError = async (output, context) => {
91
67
  const parsedOutput = {
@@ -99,10 +75,9 @@ const de_CloseTunnelCommandError = async (output, context) => {
99
75
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
100
76
  default:
101
77
  const parsedBody = parsedOutput.body;
102
- throwDefaultError({
78
+ return throwDefaultError({
103
79
  output,
104
80
  parsedBody,
105
- exceptionCtor: __BaseException,
106
81
  errorCode,
107
82
  });
108
83
  }
@@ -118,7 +93,7 @@ export const de_DescribeTunnelCommand = async (output, context) => {
118
93
  $metadata: deserializeMetadata(output),
119
94
  ...contents,
120
95
  };
121
- return Promise.resolve(response);
96
+ return response;
122
97
  };
123
98
  const de_DescribeTunnelCommandError = async (output, context) => {
124
99
  const parsedOutput = {
@@ -132,10 +107,9 @@ const de_DescribeTunnelCommandError = async (output, context) => {
132
107
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
133
108
  default:
134
109
  const parsedBody = parsedOutput.body;
135
- throwDefaultError({
110
+ return throwDefaultError({
136
111
  output,
137
112
  parsedBody,
138
- exceptionCtor: __BaseException,
139
113
  errorCode,
140
114
  });
141
115
  }
@@ -146,12 +120,12 @@ export const de_ListTagsForResourceCommand = async (output, context) => {
146
120
  }
147
121
  const data = await parseBody(output.body, context);
148
122
  let contents = {};
149
- contents = de_ListTagsForResourceResponse(data, context);
123
+ contents = _json(data);
150
124
  const response = {
151
125
  $metadata: deserializeMetadata(output),
152
126
  ...contents,
153
127
  };
154
- return Promise.resolve(response);
128
+ return response;
155
129
  };
156
130
  const de_ListTagsForResourceCommandError = async (output, context) => {
157
131
  const parsedOutput = {
@@ -165,10 +139,9 @@ const de_ListTagsForResourceCommandError = async (output, context) => {
165
139
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
166
140
  default:
167
141
  const parsedBody = parsedOutput.body;
168
- throwDefaultError({
142
+ return throwDefaultError({
169
143
  output,
170
144
  parsedBody,
171
- exceptionCtor: __BaseException,
172
145
  errorCode,
173
146
  });
174
147
  }
@@ -184,7 +157,7 @@ export const de_ListTunnelsCommand = async (output, context) => {
184
157
  $metadata: deserializeMetadata(output),
185
158
  ...contents,
186
159
  };
187
- return Promise.resolve(response);
160
+ return response;
188
161
  };
189
162
  const de_ListTunnelsCommandError = async (output, context) => {
190
163
  const parsedOutput = {
@@ -193,10 +166,9 @@ const de_ListTunnelsCommandError = async (output, context) => {
193
166
  };
194
167
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
195
168
  const parsedBody = parsedOutput.body;
196
- throwDefaultError({
169
+ return throwDefaultError({
197
170
  output,
198
171
  parsedBody,
199
- exceptionCtor: __BaseException,
200
172
  errorCode,
201
173
  });
202
174
  };
@@ -206,12 +178,12 @@ export const de_OpenTunnelCommand = async (output, context) => {
206
178
  }
207
179
  const data = await parseBody(output.body, context);
208
180
  let contents = {};
209
- contents = de_OpenTunnelResponse(data, context);
181
+ contents = _json(data);
210
182
  const response = {
211
183
  $metadata: deserializeMetadata(output),
212
184
  ...contents,
213
185
  };
214
- return Promise.resolve(response);
186
+ return response;
215
187
  };
216
188
  const de_OpenTunnelCommandError = async (output, context) => {
217
189
  const parsedOutput = {
@@ -225,10 +197,9 @@ const de_OpenTunnelCommandError = async (output, context) => {
225
197
  throw await de_LimitExceededExceptionRes(parsedOutput, context);
226
198
  default:
227
199
  const parsedBody = parsedOutput.body;
228
- throwDefaultError({
200
+ return throwDefaultError({
229
201
  output,
230
202
  parsedBody,
231
- exceptionCtor: __BaseException,
232
203
  errorCode,
233
204
  });
234
205
  }
@@ -239,12 +210,12 @@ export const de_RotateTunnelAccessTokenCommand = async (output, context) => {
239
210
  }
240
211
  const data = await parseBody(output.body, context);
241
212
  let contents = {};
242
- contents = de_RotateTunnelAccessTokenResponse(data, context);
213
+ contents = _json(data);
243
214
  const response = {
244
215
  $metadata: deserializeMetadata(output),
245
216
  ...contents,
246
217
  };
247
- return Promise.resolve(response);
218
+ return response;
248
219
  };
249
220
  const de_RotateTunnelAccessTokenCommandError = async (output, context) => {
250
221
  const parsedOutput = {
@@ -258,10 +229,9 @@ const de_RotateTunnelAccessTokenCommandError = async (output, context) => {
258
229
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
259
230
  default:
260
231
  const parsedBody = parsedOutput.body;
261
- throwDefaultError({
232
+ return throwDefaultError({
262
233
  output,
263
234
  parsedBody,
264
- exceptionCtor: __BaseException,
265
235
  errorCode,
266
236
  });
267
237
  }
@@ -272,12 +242,12 @@ export const de_TagResourceCommand = async (output, context) => {
272
242
  }
273
243
  const data = await parseBody(output.body, context);
274
244
  let contents = {};
275
- contents = de_TagResourceResponse(data, context);
245
+ contents = _json(data);
276
246
  const response = {
277
247
  $metadata: deserializeMetadata(output),
278
248
  ...contents,
279
249
  };
280
- return Promise.resolve(response);
250
+ return response;
281
251
  };
282
252
  const de_TagResourceCommandError = async (output, context) => {
283
253
  const parsedOutput = {
@@ -291,10 +261,9 @@ const de_TagResourceCommandError = async (output, context) => {
291
261
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
292
262
  default:
293
263
  const parsedBody = parsedOutput.body;
294
- throwDefaultError({
264
+ return throwDefaultError({
295
265
  output,
296
266
  parsedBody,
297
- exceptionCtor: __BaseException,
298
267
  errorCode,
299
268
  });
300
269
  }
@@ -305,12 +274,12 @@ export const de_UntagResourceCommand = async (output, context) => {
305
274
  }
306
275
  const data = await parseBody(output.body, context);
307
276
  let contents = {};
308
- contents = de_UntagResourceResponse(data, context);
277
+ contents = _json(data);
309
278
  const response = {
310
279
  $metadata: deserializeMetadata(output),
311
280
  ...contents,
312
281
  };
313
- return Promise.resolve(response);
282
+ return response;
314
283
  };
315
284
  const de_UntagResourceCommandError = async (output, context) => {
316
285
  const parsedOutput = {
@@ -324,17 +293,16 @@ const de_UntagResourceCommandError = async (output, context) => {
324
293
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
325
294
  default:
326
295
  const parsedBody = parsedOutput.body;
327
- throwDefaultError({
296
+ return throwDefaultError({
328
297
  output,
329
298
  parsedBody,
330
- exceptionCtor: __BaseException,
331
299
  errorCode,
332
300
  });
333
301
  }
334
302
  };
335
303
  const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
336
304
  const body = parsedOutput.body;
337
- const deserialized = de_LimitExceededException(body, context);
305
+ const deserialized = _json(body);
338
306
  const exception = new LimitExceededException({
339
307
  $metadata: deserializeMetadata(parsedOutput),
340
308
  ...deserialized,
@@ -343,244 +311,63 @@ const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
343
311
  };
344
312
  const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
345
313
  const body = parsedOutput.body;
346
- const deserialized = de_ResourceNotFoundException(body, context);
314
+ const deserialized = _json(body);
347
315
  const exception = new ResourceNotFoundException({
348
316
  $metadata: deserializeMetadata(parsedOutput),
349
317
  ...deserialized,
350
318
  });
351
319
  return __decorateServiceException(exception, body);
352
320
  };
353
- const se_CloseTunnelRequest = (input, context) => {
354
- return {
355
- ...(input.delete != null && { delete: input.delete }),
356
- ...(input.tunnelId != null && { tunnelId: input.tunnelId }),
357
- };
358
- };
359
- const se_DescribeTunnelRequest = (input, context) => {
360
- return {
361
- ...(input.tunnelId != null && { tunnelId: input.tunnelId }),
362
- };
363
- };
364
- const se_DestinationConfig = (input, context) => {
365
- return {
366
- ...(input.services != null && { services: se_ServiceList(input.services, context) }),
367
- ...(input.thingName != null && { thingName: input.thingName }),
368
- };
369
- };
370
- const se_ListTagsForResourceRequest = (input, context) => {
371
- return {
372
- ...(input.resourceArn != null && { resourceArn: input.resourceArn }),
373
- };
374
- };
375
- const se_ListTunnelsRequest = (input, context) => {
376
- return {
377
- ...(input.maxResults != null && { maxResults: input.maxResults }),
378
- ...(input.nextToken != null && { nextToken: input.nextToken }),
379
- ...(input.thingName != null && { thingName: input.thingName }),
380
- };
381
- };
382
- const se_OpenTunnelRequest = (input, context) => {
383
- return {
384
- ...(input.description != null && { description: input.description }),
385
- ...(input.destinationConfig != null && {
386
- destinationConfig: se_DestinationConfig(input.destinationConfig, context),
387
- }),
388
- ...(input.tags != null && { tags: se_TagList(input.tags, context) }),
389
- ...(input.timeoutConfig != null && { timeoutConfig: se_TimeoutConfig(input.timeoutConfig, context) }),
390
- };
391
- };
392
- const se_RotateTunnelAccessTokenRequest = (input, context) => {
393
- return {
394
- ...(input.clientMode != null && { clientMode: input.clientMode }),
395
- ...(input.destinationConfig != null && {
396
- destinationConfig: se_DestinationConfig(input.destinationConfig, context),
397
- }),
398
- ...(input.tunnelId != null && { tunnelId: input.tunnelId }),
399
- };
400
- };
401
- const se_ServiceList = (input, context) => {
402
- return input
403
- .filter((e) => e != null)
404
- .map((entry) => {
405
- return entry;
406
- });
407
- };
408
- const se_Tag = (input, context) => {
409
- return {
410
- ...(input.key != null && { key: input.key }),
411
- ...(input.value != null && { value: input.value }),
412
- };
413
- };
414
- const se_TagKeyList = (input, context) => {
415
- return input
416
- .filter((e) => e != null)
417
- .map((entry) => {
418
- return entry;
419
- });
420
- };
421
- const se_TagList = (input, context) => {
422
- return input
423
- .filter((e) => e != null)
424
- .map((entry) => {
425
- return se_Tag(entry, context);
426
- });
427
- };
428
- const se_TagResourceRequest = (input, context) => {
429
- return {
430
- ...(input.resourceArn != null && { resourceArn: input.resourceArn }),
431
- ...(input.tags != null && { tags: se_TagList(input.tags, context) }),
432
- };
433
- };
434
- const se_TimeoutConfig = (input, context) => {
435
- return {
436
- ...(input.maxLifetimeTimeoutMinutes != null && { maxLifetimeTimeoutMinutes: input.maxLifetimeTimeoutMinutes }),
437
- };
438
- };
439
- const se_UntagResourceRequest = (input, context) => {
440
- return {
441
- ...(input.resourceArn != null && { resourceArn: input.resourceArn }),
442
- ...(input.tagKeys != null && { tagKeys: se_TagKeyList(input.tagKeys, context) }),
443
- };
444
- };
445
- const de_CloseTunnelResponse = (output, context) => {
446
- return {};
447
- };
448
321
  const de_ConnectionState = (output, context) => {
449
- return {
450
- lastUpdatedAt: output.lastUpdatedAt != null
451
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.lastUpdatedAt)))
452
- : undefined,
453
- status: __expectString(output.status),
454
- };
322
+ return take(output, {
323
+ lastUpdatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
324
+ status: __expectString,
325
+ });
455
326
  };
456
327
  const de_DescribeTunnelResponse = (output, context) => {
457
- return {
458
- tunnel: output.tunnel != null ? de_Tunnel(output.tunnel, context) : undefined,
459
- };
460
- };
461
- const de_DestinationConfig = (output, context) => {
462
- return {
463
- services: output.services != null ? de_ServiceList(output.services, context) : undefined,
464
- thingName: __expectString(output.thingName),
465
- };
466
- };
467
- const de_LimitExceededException = (output, context) => {
468
- return {
469
- message: __expectString(output.message),
470
- };
471
- };
472
- const de_ListTagsForResourceResponse = (output, context) => {
473
- return {
474
- tags: output.tags != null ? de_TagList(output.tags, context) : undefined,
475
- };
476
- };
477
- const de_ListTunnelsResponse = (output, context) => {
478
- return {
479
- nextToken: __expectString(output.nextToken),
480
- tunnelSummaries: output.tunnelSummaries != null ? de_TunnelSummaryList(output.tunnelSummaries, context) : undefined,
481
- };
482
- };
483
- const de_OpenTunnelResponse = (output, context) => {
484
- return {
485
- destinationAccessToken: __expectString(output.destinationAccessToken),
486
- sourceAccessToken: __expectString(output.sourceAccessToken),
487
- tunnelArn: __expectString(output.tunnelArn),
488
- tunnelId: __expectString(output.tunnelId),
489
- };
490
- };
491
- const de_ResourceNotFoundException = (output, context) => {
492
- return {
493
- message: __expectString(output.message),
494
- };
495
- };
496
- const de_RotateTunnelAccessTokenResponse = (output, context) => {
497
- return {
498
- destinationAccessToken: __expectString(output.destinationAccessToken),
499
- sourceAccessToken: __expectString(output.sourceAccessToken),
500
- tunnelArn: __expectString(output.tunnelArn),
501
- };
502
- };
503
- const de_ServiceList = (output, context) => {
504
- const retVal = (output || [])
505
- .filter((e) => e != null)
506
- .map((entry) => {
507
- if (entry === null) {
508
- return null;
509
- }
510
- return __expectString(entry);
328
+ return take(output, {
329
+ tunnel: (_) => de_Tunnel(_, context),
511
330
  });
512
- return retVal;
513
331
  };
514
- const de_Tag = (output, context) => {
515
- return {
516
- key: __expectString(output.key),
517
- value: __expectString(output.value),
518
- };
519
- };
520
- const de_TagList = (output, context) => {
521
- const retVal = (output || [])
522
- .filter((e) => e != null)
523
- .map((entry) => {
524
- if (entry === null) {
525
- return null;
526
- }
527
- return de_Tag(entry, context);
332
+ const de_ListTunnelsResponse = (output, context) => {
333
+ return take(output, {
334
+ nextToken: __expectString,
335
+ tunnelSummaries: (_) => de_TunnelSummaryList(_, context),
528
336
  });
529
- return retVal;
530
- };
531
- const de_TagResourceResponse = (output, context) => {
532
- return {};
533
- };
534
- const de_TimeoutConfig = (output, context) => {
535
- return {
536
- maxLifetimeTimeoutMinutes: __expectInt32(output.maxLifetimeTimeoutMinutes),
537
- };
538
337
  };
539
338
  const de_Tunnel = (output, context) => {
540
- return {
541
- createdAt: output.createdAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.createdAt))) : undefined,
542
- description: __expectString(output.description),
543
- destinationConfig: output.destinationConfig != null ? de_DestinationConfig(output.destinationConfig, context) : undefined,
544
- destinationConnectionState: output.destinationConnectionState != null
545
- ? de_ConnectionState(output.destinationConnectionState, context)
546
- : undefined,
547
- lastUpdatedAt: output.lastUpdatedAt != null
548
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.lastUpdatedAt)))
549
- : undefined,
550
- sourceConnectionState: output.sourceConnectionState != null ? de_ConnectionState(output.sourceConnectionState, context) : undefined,
551
- status: __expectString(output.status),
552
- tags: output.tags != null ? de_TagList(output.tags, context) : undefined,
553
- timeoutConfig: output.timeoutConfig != null ? de_TimeoutConfig(output.timeoutConfig, context) : undefined,
554
- tunnelArn: __expectString(output.tunnelArn),
555
- tunnelId: __expectString(output.tunnelId),
556
- };
339
+ return take(output, {
340
+ createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
341
+ description: __expectString,
342
+ destinationConfig: _json,
343
+ destinationConnectionState: (_) => de_ConnectionState(_, context),
344
+ lastUpdatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
345
+ sourceConnectionState: (_) => de_ConnectionState(_, context),
346
+ status: __expectString,
347
+ tags: _json,
348
+ timeoutConfig: _json,
349
+ tunnelArn: __expectString,
350
+ tunnelId: __expectString,
351
+ });
557
352
  };
558
353
  const de_TunnelSummary = (output, context) => {
559
- return {
560
- createdAt: output.createdAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.createdAt))) : undefined,
561
- description: __expectString(output.description),
562
- lastUpdatedAt: output.lastUpdatedAt != null
563
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.lastUpdatedAt)))
564
- : undefined,
565
- status: __expectString(output.status),
566
- tunnelArn: __expectString(output.tunnelArn),
567
- tunnelId: __expectString(output.tunnelId),
568
- };
354
+ return take(output, {
355
+ createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
356
+ description: __expectString,
357
+ lastUpdatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
358
+ status: __expectString,
359
+ tunnelArn: __expectString,
360
+ tunnelId: __expectString,
361
+ });
569
362
  };
570
363
  const de_TunnelSummaryList = (output, context) => {
571
364
  const retVal = (output || [])
572
365
  .filter((e) => e != null)
573
366
  .map((entry) => {
574
- if (entry === null) {
575
- return null;
576
- }
577
367
  return de_TunnelSummary(entry, context);
578
368
  });
579
369
  return retVal;
580
370
  };
581
- const de_UntagResourceResponse = (output, context) => {
582
- return {};
583
- };
584
371
  const deserializeMetadata = (output) => ({
585
372
  httpStatusCode: output.statusCode,
586
373
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
@@ -594,6 +381,7 @@ const collectBody = (streamBody = new Uint8Array(), context) => {
594
381
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
595
382
  };
596
383
  const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
384
+ const throwDefaultError = withBaseException(__BaseException);
597
385
  const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
598
386
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
599
387
  const contents = {
@@ -612,6 +400,12 @@ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, bod
612
400
  }
613
401
  return new __HttpRequest(contents);
614
402
  };
403
+ function sharedHeaders(operation) {
404
+ return {
405
+ "content-type": "application/x-amz-json-1.1",
406
+ "x-amz-target": `IoTSecuredTunneling.${operation}`,
407
+ };
408
+ }
615
409
  const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
616
410
  if (encoded.length) {
617
411
  return JSON.parse(encoded);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-iotsecuretunneling",
3
3
  "description": "AWS SDK for JavaScript Iotsecuretunneling Client for Node.js, Browser and React Native",
4
- "version": "3.310.0",
4
+ "version": "3.315.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",
@@ -21,9 +21,9 @@
21
21
  "dependencies": {
22
22
  "@aws-crypto/sha256-browser": "3.0.0",
23
23
  "@aws-crypto/sha256-js": "3.0.0",
24
- "@aws-sdk/client-sts": "3.310.0",
24
+ "@aws-sdk/client-sts": "3.315.0",
25
25
  "@aws-sdk/config-resolver": "3.310.0",
26
- "@aws-sdk/credential-provider-node": "3.310.0",
26
+ "@aws-sdk/credential-provider-node": "3.315.0",
27
27
  "@aws-sdk/fetch-http-handler": "3.310.0",
28
28
  "@aws-sdk/hash-node": "3.310.0",
29
29
  "@aws-sdk/invalid-dependency": "3.310.0",
@@ -40,14 +40,14 @@
40
40
  "@aws-sdk/node-config-provider": "3.310.0",
41
41
  "@aws-sdk/node-http-handler": "3.310.0",
42
42
  "@aws-sdk/protocol-http": "3.310.0",
43
- "@aws-sdk/smithy-client": "3.310.0",
43
+ "@aws-sdk/smithy-client": "3.315.0",
44
44
  "@aws-sdk/types": "3.310.0",
45
45
  "@aws-sdk/url-parser": "3.310.0",
46
46
  "@aws-sdk/util-base64": "3.310.0",
47
47
  "@aws-sdk/util-body-length-browser": "3.310.0",
48
48
  "@aws-sdk/util-body-length-node": "3.310.0",
49
- "@aws-sdk/util-defaults-mode-browser": "3.310.0",
50
- "@aws-sdk/util-defaults-mode-node": "3.310.0",
49
+ "@aws-sdk/util-defaults-mode-browser": "3.315.0",
50
+ "@aws-sdk/util-defaults-mode-node": "3.315.0",
51
51
  "@aws-sdk/util-endpoints": "3.310.0",
52
52
  "@aws-sdk/util-retry": "3.310.0",
53
53
  "@aws-sdk/util-user-agent-browser": "3.310.0",