@aws-sdk/client-iotsecuretunneling 3.312.0 → 3.316.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.
@@ -1,3 +1,4 @@
1
+ import { createAggregatedClient } from "@aws-sdk/smithy-client";
1
2
  import { CloseTunnelCommand } from "./commands/CloseTunnelCommand";
2
3
  import { DescribeTunnelCommand, } from "./commands/DescribeTunnelCommand";
3
4
  import { ListTagsForResourceCommand, } from "./commands/ListTagsForResourceCommand";
@@ -7,117 +8,16 @@ import { RotateTunnelAccessTokenCommand, } from "./commands/RotateTunnelAccessTo
7
8
  import { TagResourceCommand } from "./commands/TagResourceCommand";
8
9
  import { UntagResourceCommand, } from "./commands/UntagResourceCommand";
9
10
  import { IoTSecureTunnelingClient } from "./IoTSecureTunnelingClient";
11
+ const commands = {
12
+ CloseTunnelCommand,
13
+ DescribeTunnelCommand,
14
+ ListTagsForResourceCommand,
15
+ ListTunnelsCommand,
16
+ OpenTunnelCommand,
17
+ RotateTunnelAccessTokenCommand,
18
+ TagResourceCommand,
19
+ UntagResourceCommand,
20
+ };
10
21
  export class IoTSecureTunneling extends IoTSecureTunnelingClient {
11
- closeTunnel(args, optionsOrCb, cb) {
12
- const command = new CloseTunnelCommand(args);
13
- if (typeof optionsOrCb === "function") {
14
- this.send(command, optionsOrCb);
15
- }
16
- else if (typeof cb === "function") {
17
- if (typeof optionsOrCb !== "object")
18
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
19
- this.send(command, optionsOrCb || {}, cb);
20
- }
21
- else {
22
- return this.send(command, optionsOrCb);
23
- }
24
- }
25
- describeTunnel(args, optionsOrCb, cb) {
26
- const command = new DescribeTunnelCommand(args);
27
- if (typeof optionsOrCb === "function") {
28
- this.send(command, optionsOrCb);
29
- }
30
- else if (typeof cb === "function") {
31
- if (typeof optionsOrCb !== "object")
32
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
33
- this.send(command, optionsOrCb || {}, cb);
34
- }
35
- else {
36
- return this.send(command, optionsOrCb);
37
- }
38
- }
39
- listTagsForResource(args, optionsOrCb, cb) {
40
- const command = new ListTagsForResourceCommand(args);
41
- if (typeof optionsOrCb === "function") {
42
- this.send(command, optionsOrCb);
43
- }
44
- else if (typeof cb === "function") {
45
- if (typeof optionsOrCb !== "object")
46
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
47
- this.send(command, optionsOrCb || {}, cb);
48
- }
49
- else {
50
- return this.send(command, optionsOrCb);
51
- }
52
- }
53
- listTunnels(args, optionsOrCb, cb) {
54
- const command = new ListTunnelsCommand(args);
55
- if (typeof optionsOrCb === "function") {
56
- this.send(command, optionsOrCb);
57
- }
58
- else if (typeof cb === "function") {
59
- if (typeof optionsOrCb !== "object")
60
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
61
- this.send(command, optionsOrCb || {}, cb);
62
- }
63
- else {
64
- return this.send(command, optionsOrCb);
65
- }
66
- }
67
- openTunnel(args, optionsOrCb, cb) {
68
- const command = new OpenTunnelCommand(args);
69
- if (typeof optionsOrCb === "function") {
70
- this.send(command, optionsOrCb);
71
- }
72
- else if (typeof cb === "function") {
73
- if (typeof optionsOrCb !== "object")
74
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
75
- this.send(command, optionsOrCb || {}, cb);
76
- }
77
- else {
78
- return this.send(command, optionsOrCb);
79
- }
80
- }
81
- rotateTunnelAccessToken(args, optionsOrCb, cb) {
82
- const command = new RotateTunnelAccessTokenCommand(args);
83
- if (typeof optionsOrCb === "function") {
84
- this.send(command, optionsOrCb);
85
- }
86
- else if (typeof cb === "function") {
87
- if (typeof optionsOrCb !== "object")
88
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
89
- this.send(command, optionsOrCb || {}, cb);
90
- }
91
- else {
92
- return this.send(command, optionsOrCb);
93
- }
94
- }
95
- tagResource(args, optionsOrCb, cb) {
96
- const command = new TagResourceCommand(args);
97
- if (typeof optionsOrCb === "function") {
98
- this.send(command, optionsOrCb);
99
- }
100
- else if (typeof cb === "function") {
101
- if (typeof optionsOrCb !== "object")
102
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
103
- this.send(command, optionsOrCb || {}, cb);
104
- }
105
- else {
106
- return this.send(command, optionsOrCb);
107
- }
108
- }
109
- untagResource(args, optionsOrCb, cb) {
110
- const command = new UntagResourceCommand(args);
111
- if (typeof optionsOrCb === "function") {
112
- this.send(command, optionsOrCb);
113
- }
114
- else if (typeof cb === "function") {
115
- if (typeof optionsOrCb !== "object")
116
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
117
- this.send(command, optionsOrCb || {}, cb);
118
- }
119
- else {
120
- return this.send(command, optionsOrCb);
121
- }
122
- }
123
22
  }
23
+ createAggregatedClient(commands, IoTSecureTunneling);
@@ -1,53 +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
6
  const headers = sharedHeaders("CloseTunnel");
7
7
  let body;
8
- body = JSON.stringify(se_CloseTunnelRequest(input, context));
8
+ body = JSON.stringify(_json(input));
9
9
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
10
10
  };
11
11
  export const se_DescribeTunnelCommand = async (input, context) => {
12
12
  const headers = sharedHeaders("DescribeTunnel");
13
13
  let body;
14
- body = JSON.stringify(se_DescribeTunnelRequest(input, context));
14
+ body = JSON.stringify(_json(input));
15
15
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
16
16
  };
17
17
  export const se_ListTagsForResourceCommand = async (input, context) => {
18
18
  const headers = sharedHeaders("ListTagsForResource");
19
19
  let body;
20
- body = JSON.stringify(se_ListTagsForResourceRequest(input, context));
20
+ body = JSON.stringify(_json(input));
21
21
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
22
22
  };
23
23
  export const se_ListTunnelsCommand = async (input, context) => {
24
24
  const headers = sharedHeaders("ListTunnels");
25
25
  let body;
26
- body = JSON.stringify(se_ListTunnelsRequest(input, context));
26
+ body = JSON.stringify(_json(input));
27
27
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
28
28
  };
29
29
  export const se_OpenTunnelCommand = async (input, context) => {
30
30
  const headers = sharedHeaders("OpenTunnel");
31
31
  let body;
32
- body = JSON.stringify(se_OpenTunnelRequest(input, context));
32
+ body = JSON.stringify(_json(input));
33
33
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
34
34
  };
35
35
  export const se_RotateTunnelAccessTokenCommand = async (input, context) => {
36
36
  const headers = sharedHeaders("RotateTunnelAccessToken");
37
37
  let body;
38
- body = JSON.stringify(se_RotateTunnelAccessTokenRequest(input, context));
38
+ body = JSON.stringify(_json(input));
39
39
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
40
40
  };
41
41
  export const se_TagResourceCommand = async (input, context) => {
42
42
  const headers = sharedHeaders("TagResource");
43
43
  let body;
44
- body = JSON.stringify(se_TagResourceRequest(input, context));
44
+ body = JSON.stringify(_json(input));
45
45
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
46
46
  };
47
47
  export const se_UntagResourceCommand = async (input, context) => {
48
48
  const headers = sharedHeaders("UntagResource");
49
49
  let body;
50
- body = JSON.stringify(se_UntagResourceRequest(input, context));
50
+ body = JSON.stringify(_json(input));
51
51
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
52
52
  };
53
53
  export const de_CloseTunnelCommand = async (output, context) => {
@@ -56,12 +56,12 @@ export const de_CloseTunnelCommand = async (output, context) => {
56
56
  }
57
57
  const data = await parseBody(output.body, context);
58
58
  let contents = {};
59
- contents = de_CloseTunnelResponse(data, context);
59
+ contents = _json(data);
60
60
  const response = {
61
61
  $metadata: deserializeMetadata(output),
62
62
  ...contents,
63
63
  };
64
- return Promise.resolve(response);
64
+ return response;
65
65
  };
66
66
  const de_CloseTunnelCommandError = async (output, context) => {
67
67
  const parsedOutput = {
@@ -75,10 +75,9 @@ const de_CloseTunnelCommandError = async (output, context) => {
75
75
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
76
76
  default:
77
77
  const parsedBody = parsedOutput.body;
78
- throwDefaultError({
78
+ return throwDefaultError({
79
79
  output,
80
80
  parsedBody,
81
- exceptionCtor: __BaseException,
82
81
  errorCode,
83
82
  });
84
83
  }
@@ -94,7 +93,7 @@ export const de_DescribeTunnelCommand = async (output, context) => {
94
93
  $metadata: deserializeMetadata(output),
95
94
  ...contents,
96
95
  };
97
- return Promise.resolve(response);
96
+ return response;
98
97
  };
99
98
  const de_DescribeTunnelCommandError = async (output, context) => {
100
99
  const parsedOutput = {
@@ -108,10 +107,9 @@ const de_DescribeTunnelCommandError = async (output, context) => {
108
107
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
109
108
  default:
110
109
  const parsedBody = parsedOutput.body;
111
- throwDefaultError({
110
+ return throwDefaultError({
112
111
  output,
113
112
  parsedBody,
114
- exceptionCtor: __BaseException,
115
113
  errorCode,
116
114
  });
117
115
  }
@@ -122,12 +120,12 @@ export const de_ListTagsForResourceCommand = async (output, context) => {
122
120
  }
123
121
  const data = await parseBody(output.body, context);
124
122
  let contents = {};
125
- contents = de_ListTagsForResourceResponse(data, context);
123
+ contents = _json(data);
126
124
  const response = {
127
125
  $metadata: deserializeMetadata(output),
128
126
  ...contents,
129
127
  };
130
- return Promise.resolve(response);
128
+ return response;
131
129
  };
132
130
  const de_ListTagsForResourceCommandError = async (output, context) => {
133
131
  const parsedOutput = {
@@ -141,10 +139,9 @@ const de_ListTagsForResourceCommandError = async (output, context) => {
141
139
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
142
140
  default:
143
141
  const parsedBody = parsedOutput.body;
144
- throwDefaultError({
142
+ return throwDefaultError({
145
143
  output,
146
144
  parsedBody,
147
- exceptionCtor: __BaseException,
148
145
  errorCode,
149
146
  });
150
147
  }
@@ -160,7 +157,7 @@ export const de_ListTunnelsCommand = async (output, context) => {
160
157
  $metadata: deserializeMetadata(output),
161
158
  ...contents,
162
159
  };
163
- return Promise.resolve(response);
160
+ return response;
164
161
  };
165
162
  const de_ListTunnelsCommandError = async (output, context) => {
166
163
  const parsedOutput = {
@@ -169,10 +166,9 @@ const de_ListTunnelsCommandError = async (output, context) => {
169
166
  };
170
167
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
171
168
  const parsedBody = parsedOutput.body;
172
- throwDefaultError({
169
+ return throwDefaultError({
173
170
  output,
174
171
  parsedBody,
175
- exceptionCtor: __BaseException,
176
172
  errorCode,
177
173
  });
178
174
  };
@@ -182,12 +178,12 @@ export const de_OpenTunnelCommand = async (output, context) => {
182
178
  }
183
179
  const data = await parseBody(output.body, context);
184
180
  let contents = {};
185
- contents = de_OpenTunnelResponse(data, context);
181
+ contents = _json(data);
186
182
  const response = {
187
183
  $metadata: deserializeMetadata(output),
188
184
  ...contents,
189
185
  };
190
- return Promise.resolve(response);
186
+ return response;
191
187
  };
192
188
  const de_OpenTunnelCommandError = async (output, context) => {
193
189
  const parsedOutput = {
@@ -201,10 +197,9 @@ const de_OpenTunnelCommandError = async (output, context) => {
201
197
  throw await de_LimitExceededExceptionRes(parsedOutput, context);
202
198
  default:
203
199
  const parsedBody = parsedOutput.body;
204
- throwDefaultError({
200
+ return throwDefaultError({
205
201
  output,
206
202
  parsedBody,
207
- exceptionCtor: __BaseException,
208
203
  errorCode,
209
204
  });
210
205
  }
@@ -215,12 +210,12 @@ export const de_RotateTunnelAccessTokenCommand = async (output, context) => {
215
210
  }
216
211
  const data = await parseBody(output.body, context);
217
212
  let contents = {};
218
- contents = de_RotateTunnelAccessTokenResponse(data, context);
213
+ contents = _json(data);
219
214
  const response = {
220
215
  $metadata: deserializeMetadata(output),
221
216
  ...contents,
222
217
  };
223
- return Promise.resolve(response);
218
+ return response;
224
219
  };
225
220
  const de_RotateTunnelAccessTokenCommandError = async (output, context) => {
226
221
  const parsedOutput = {
@@ -234,10 +229,9 @@ const de_RotateTunnelAccessTokenCommandError = async (output, context) => {
234
229
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
235
230
  default:
236
231
  const parsedBody = parsedOutput.body;
237
- throwDefaultError({
232
+ return throwDefaultError({
238
233
  output,
239
234
  parsedBody,
240
- exceptionCtor: __BaseException,
241
235
  errorCode,
242
236
  });
243
237
  }
@@ -248,12 +242,12 @@ export const de_TagResourceCommand = async (output, context) => {
248
242
  }
249
243
  const data = await parseBody(output.body, context);
250
244
  let contents = {};
251
- contents = de_TagResourceResponse(data, context);
245
+ contents = _json(data);
252
246
  const response = {
253
247
  $metadata: deserializeMetadata(output),
254
248
  ...contents,
255
249
  };
256
- return Promise.resolve(response);
250
+ return response;
257
251
  };
258
252
  const de_TagResourceCommandError = async (output, context) => {
259
253
  const parsedOutput = {
@@ -267,10 +261,9 @@ const de_TagResourceCommandError = async (output, context) => {
267
261
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
268
262
  default:
269
263
  const parsedBody = parsedOutput.body;
270
- throwDefaultError({
264
+ return throwDefaultError({
271
265
  output,
272
266
  parsedBody,
273
- exceptionCtor: __BaseException,
274
267
  errorCode,
275
268
  });
276
269
  }
@@ -281,12 +274,12 @@ export const de_UntagResourceCommand = async (output, context) => {
281
274
  }
282
275
  const data = await parseBody(output.body, context);
283
276
  let contents = {};
284
- contents = de_UntagResourceResponse(data, context);
277
+ contents = _json(data);
285
278
  const response = {
286
279
  $metadata: deserializeMetadata(output),
287
280
  ...contents,
288
281
  };
289
- return Promise.resolve(response);
282
+ return response;
290
283
  };
291
284
  const de_UntagResourceCommandError = async (output, context) => {
292
285
  const parsedOutput = {
@@ -300,17 +293,16 @@ const de_UntagResourceCommandError = async (output, context) => {
300
293
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
301
294
  default:
302
295
  const parsedBody = parsedOutput.body;
303
- throwDefaultError({
296
+ return throwDefaultError({
304
297
  output,
305
298
  parsedBody,
306
- exceptionCtor: __BaseException,
307
299
  errorCode,
308
300
  });
309
301
  }
310
302
  };
311
303
  const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
312
304
  const body = parsedOutput.body;
313
- const deserialized = de_LimitExceededException(body, context);
305
+ const deserialized = _json(body);
314
306
  const exception = new LimitExceededException({
315
307
  $metadata: deserializeMetadata(parsedOutput),
316
308
  ...deserialized,
@@ -319,244 +311,63 @@ const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
319
311
  };
320
312
  const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
321
313
  const body = parsedOutput.body;
322
- const deserialized = de_ResourceNotFoundException(body, context);
314
+ const deserialized = _json(body);
323
315
  const exception = new ResourceNotFoundException({
324
316
  $metadata: deserializeMetadata(parsedOutput),
325
317
  ...deserialized,
326
318
  });
327
319
  return __decorateServiceException(exception, body);
328
320
  };
329
- const se_CloseTunnelRequest = (input, context) => {
330
- return {
331
- ...(input.delete != null && { delete: input.delete }),
332
- ...(input.tunnelId != null && { tunnelId: input.tunnelId }),
333
- };
334
- };
335
- const se_DescribeTunnelRequest = (input, context) => {
336
- return {
337
- ...(input.tunnelId != null && { tunnelId: input.tunnelId }),
338
- };
339
- };
340
- const se_DestinationConfig = (input, context) => {
341
- return {
342
- ...(input.services != null && { services: se_ServiceList(input.services, context) }),
343
- ...(input.thingName != null && { thingName: input.thingName }),
344
- };
345
- };
346
- const se_ListTagsForResourceRequest = (input, context) => {
347
- return {
348
- ...(input.resourceArn != null && { resourceArn: input.resourceArn }),
349
- };
350
- };
351
- const se_ListTunnelsRequest = (input, context) => {
352
- return {
353
- ...(input.maxResults != null && { maxResults: input.maxResults }),
354
- ...(input.nextToken != null && { nextToken: input.nextToken }),
355
- ...(input.thingName != null && { thingName: input.thingName }),
356
- };
357
- };
358
- const se_OpenTunnelRequest = (input, context) => {
359
- return {
360
- ...(input.description != null && { description: input.description }),
361
- ...(input.destinationConfig != null && {
362
- destinationConfig: se_DestinationConfig(input.destinationConfig, context),
363
- }),
364
- ...(input.tags != null && { tags: se_TagList(input.tags, context) }),
365
- ...(input.timeoutConfig != null && { timeoutConfig: se_TimeoutConfig(input.timeoutConfig, context) }),
366
- };
367
- };
368
- const se_RotateTunnelAccessTokenRequest = (input, context) => {
369
- return {
370
- ...(input.clientMode != null && { clientMode: input.clientMode }),
371
- ...(input.destinationConfig != null && {
372
- destinationConfig: se_DestinationConfig(input.destinationConfig, context),
373
- }),
374
- ...(input.tunnelId != null && { tunnelId: input.tunnelId }),
375
- };
376
- };
377
- const se_ServiceList = (input, context) => {
378
- return input
379
- .filter((e) => e != null)
380
- .map((entry) => {
381
- return entry;
382
- });
383
- };
384
- const se_Tag = (input, context) => {
385
- return {
386
- ...(input.key != null && { key: input.key }),
387
- ...(input.value != null && { value: input.value }),
388
- };
389
- };
390
- const se_TagKeyList = (input, context) => {
391
- return input
392
- .filter((e) => e != null)
393
- .map((entry) => {
394
- return entry;
395
- });
396
- };
397
- const se_TagList = (input, context) => {
398
- return input
399
- .filter((e) => e != null)
400
- .map((entry) => {
401
- return se_Tag(entry, context);
402
- });
403
- };
404
- const se_TagResourceRequest = (input, context) => {
405
- return {
406
- ...(input.resourceArn != null && { resourceArn: input.resourceArn }),
407
- ...(input.tags != null && { tags: se_TagList(input.tags, context) }),
408
- };
409
- };
410
- const se_TimeoutConfig = (input, context) => {
411
- return {
412
- ...(input.maxLifetimeTimeoutMinutes != null && { maxLifetimeTimeoutMinutes: input.maxLifetimeTimeoutMinutes }),
413
- };
414
- };
415
- const se_UntagResourceRequest = (input, context) => {
416
- return {
417
- ...(input.resourceArn != null && { resourceArn: input.resourceArn }),
418
- ...(input.tagKeys != null && { tagKeys: se_TagKeyList(input.tagKeys, context) }),
419
- };
420
- };
421
- const de_CloseTunnelResponse = (output, context) => {
422
- return {};
423
- };
424
321
  const de_ConnectionState = (output, context) => {
425
- return {
426
- lastUpdatedAt: output.lastUpdatedAt != null
427
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.lastUpdatedAt)))
428
- : undefined,
429
- status: __expectString(output.status),
430
- };
322
+ return take(output, {
323
+ lastUpdatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
324
+ status: __expectString,
325
+ });
431
326
  };
432
327
  const de_DescribeTunnelResponse = (output, context) => {
433
- return {
434
- tunnel: output.tunnel != null ? de_Tunnel(output.tunnel, context) : undefined,
435
- };
436
- };
437
- const de_DestinationConfig = (output, context) => {
438
- return {
439
- services: output.services != null ? de_ServiceList(output.services, context) : undefined,
440
- thingName: __expectString(output.thingName),
441
- };
442
- };
443
- const de_LimitExceededException = (output, context) => {
444
- return {
445
- message: __expectString(output.message),
446
- };
447
- };
448
- const de_ListTagsForResourceResponse = (output, context) => {
449
- return {
450
- tags: output.tags != null ? de_TagList(output.tags, context) : undefined,
451
- };
452
- };
453
- const de_ListTunnelsResponse = (output, context) => {
454
- return {
455
- nextToken: __expectString(output.nextToken),
456
- tunnelSummaries: output.tunnelSummaries != null ? de_TunnelSummaryList(output.tunnelSummaries, context) : undefined,
457
- };
458
- };
459
- const de_OpenTunnelResponse = (output, context) => {
460
- return {
461
- destinationAccessToken: __expectString(output.destinationAccessToken),
462
- sourceAccessToken: __expectString(output.sourceAccessToken),
463
- tunnelArn: __expectString(output.tunnelArn),
464
- tunnelId: __expectString(output.tunnelId),
465
- };
466
- };
467
- const de_ResourceNotFoundException = (output, context) => {
468
- return {
469
- message: __expectString(output.message),
470
- };
471
- };
472
- const de_RotateTunnelAccessTokenResponse = (output, context) => {
473
- return {
474
- destinationAccessToken: __expectString(output.destinationAccessToken),
475
- sourceAccessToken: __expectString(output.sourceAccessToken),
476
- tunnelArn: __expectString(output.tunnelArn),
477
- };
478
- };
479
- const de_ServiceList = (output, context) => {
480
- const retVal = (output || [])
481
- .filter((e) => e != null)
482
- .map((entry) => {
483
- if (entry === null) {
484
- return null;
485
- }
486
- return __expectString(entry);
328
+ return take(output, {
329
+ tunnel: (_) => de_Tunnel(_, context),
487
330
  });
488
- return retVal;
489
331
  };
490
- const de_Tag = (output, context) => {
491
- return {
492
- key: __expectString(output.key),
493
- value: __expectString(output.value),
494
- };
495
- };
496
- const de_TagList = (output, context) => {
497
- const retVal = (output || [])
498
- .filter((e) => e != null)
499
- .map((entry) => {
500
- if (entry === null) {
501
- return null;
502
- }
503
- return de_Tag(entry, context);
332
+ const de_ListTunnelsResponse = (output, context) => {
333
+ return take(output, {
334
+ nextToken: __expectString,
335
+ tunnelSummaries: (_) => de_TunnelSummaryList(_, context),
504
336
  });
505
- return retVal;
506
- };
507
- const de_TagResourceResponse = (output, context) => {
508
- return {};
509
- };
510
- const de_TimeoutConfig = (output, context) => {
511
- return {
512
- maxLifetimeTimeoutMinutes: __expectInt32(output.maxLifetimeTimeoutMinutes),
513
- };
514
337
  };
515
338
  const de_Tunnel = (output, context) => {
516
- return {
517
- createdAt: output.createdAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.createdAt))) : undefined,
518
- description: __expectString(output.description),
519
- destinationConfig: output.destinationConfig != null ? de_DestinationConfig(output.destinationConfig, context) : undefined,
520
- destinationConnectionState: output.destinationConnectionState != null
521
- ? de_ConnectionState(output.destinationConnectionState, context)
522
- : undefined,
523
- lastUpdatedAt: output.lastUpdatedAt != null
524
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.lastUpdatedAt)))
525
- : undefined,
526
- sourceConnectionState: output.sourceConnectionState != null ? de_ConnectionState(output.sourceConnectionState, context) : undefined,
527
- status: __expectString(output.status),
528
- tags: output.tags != null ? de_TagList(output.tags, context) : undefined,
529
- timeoutConfig: output.timeoutConfig != null ? de_TimeoutConfig(output.timeoutConfig, context) : undefined,
530
- tunnelArn: __expectString(output.tunnelArn),
531
- tunnelId: __expectString(output.tunnelId),
532
- };
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
+ });
533
352
  };
534
353
  const de_TunnelSummary = (output, context) => {
535
- return {
536
- createdAt: output.createdAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.createdAt))) : undefined,
537
- description: __expectString(output.description),
538
- lastUpdatedAt: output.lastUpdatedAt != null
539
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.lastUpdatedAt)))
540
- : undefined,
541
- status: __expectString(output.status),
542
- tunnelArn: __expectString(output.tunnelArn),
543
- tunnelId: __expectString(output.tunnelId),
544
- };
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
+ });
545
362
  };
546
363
  const de_TunnelSummaryList = (output, context) => {
547
364
  const retVal = (output || [])
548
365
  .filter((e) => e != null)
549
366
  .map((entry) => {
550
- if (entry === null) {
551
- return null;
552
- }
553
367
  return de_TunnelSummary(entry, context);
554
368
  });
555
369
  return retVal;
556
370
  };
557
- const de_UntagResourceResponse = (output, context) => {
558
- return {};
559
- };
560
371
  const deserializeMetadata = (output) => ({
561
372
  httpStatusCode: output.statusCode,
562
373
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
@@ -570,6 +381,7 @@ const collectBody = (streamBody = new Uint8Array(), context) => {
570
381
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
571
382
  };
572
383
  const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
384
+ const throwDefaultError = withBaseException(__BaseException);
573
385
  const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
574
386
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
575
387
  const contents = {