@aws-sdk/client-connectparticipant 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 { CompleteAttachmentUploadCommand, } from "./commands/CompleteAttachmentUploadCommand";
2
3
  import { CreateParticipantConnectionCommand, } from "./commands/CreateParticipantConnectionCommand";
3
4
  import { DisconnectParticipantCommand, } from "./commands/DisconnectParticipantCommand";
@@ -7,117 +8,16 @@ import { SendEventCommand } from "./commands/SendEventCommand";
7
8
  import { SendMessageCommand } from "./commands/SendMessageCommand";
8
9
  import { StartAttachmentUploadCommand, } from "./commands/StartAttachmentUploadCommand";
9
10
  import { ConnectParticipantClient } from "./ConnectParticipantClient";
11
+ const commands = {
12
+ CompleteAttachmentUploadCommand,
13
+ CreateParticipantConnectionCommand,
14
+ DisconnectParticipantCommand,
15
+ GetAttachmentCommand,
16
+ GetTranscriptCommand,
17
+ SendEventCommand,
18
+ SendMessageCommand,
19
+ StartAttachmentUploadCommand,
20
+ };
10
21
  export class ConnectParticipant extends ConnectParticipantClient {
11
- completeAttachmentUpload(args, optionsOrCb, cb) {
12
- const command = new CompleteAttachmentUploadCommand(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
- createParticipantConnection(args, optionsOrCb, cb) {
26
- const command = new CreateParticipantConnectionCommand(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
- disconnectParticipant(args, optionsOrCb, cb) {
40
- const command = new DisconnectParticipantCommand(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
- getAttachment(args, optionsOrCb, cb) {
54
- const command = new GetAttachmentCommand(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
- getTranscript(args, optionsOrCb, cb) {
68
- const command = new GetTranscriptCommand(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
- sendEvent(args, optionsOrCb, cb) {
82
- const command = new SendEventCommand(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
- sendMessage(args, optionsOrCb, cb) {
96
- const command = new SendMessageCommand(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
- startAttachmentUpload(args, optionsOrCb, cb) {
110
- const command = new StartAttachmentUploadCommand(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, ConnectParticipant);
@@ -1,5 +1,5 @@
1
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
- import { decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map as __map, throwDefaultError, } from "@aws-sdk/smithy-client";
2
+ import { _json, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map, take, withBaseException, } from "@aws-sdk/smithy-client";
3
3
  import { v4 as generateIdempotencyToken } from "uuid";
4
4
  import { ConnectParticipantServiceException as __BaseException } from "../models/ConnectParticipantServiceException";
5
5
  import { AccessDeniedException, ConflictException, InternalServerException, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
@@ -11,10 +11,10 @@ export const se_CompleteAttachmentUploadCommand = async (input, context) => {
11
11
  });
12
12
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/participant/complete-attachment-upload";
13
13
  let body;
14
- body = JSON.stringify({
15
- ...(input.AttachmentIds != null && { AttachmentIds: se_AttachmentIdList(input.AttachmentIds, context) }),
16
- ClientToken: input.ClientToken ?? generateIdempotencyToken(),
17
- });
14
+ body = JSON.stringify(take(input, {
15
+ AttachmentIds: (_) => _json(_),
16
+ ClientToken: [true, (_) => _ ?? generateIdempotencyToken()],
17
+ }));
18
18
  return new __HttpRequest({
19
19
  protocol,
20
20
  hostname,
@@ -33,10 +33,10 @@ export const se_CreateParticipantConnectionCommand = async (input, context) => {
33
33
  });
34
34
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/participant/connection";
35
35
  let body;
36
- body = JSON.stringify({
37
- ...(input.ConnectParticipant != null && { ConnectParticipant: input.ConnectParticipant }),
38
- ...(input.Type != null && { Type: se_ConnectionTypeList(input.Type, context) }),
39
- });
36
+ body = JSON.stringify(take(input, {
37
+ ConnectParticipant: [],
38
+ Type: (_) => _json(_),
39
+ }));
40
40
  return new __HttpRequest({
41
41
  protocol,
42
42
  hostname,
@@ -55,9 +55,9 @@ export const se_DisconnectParticipantCommand = async (input, context) => {
55
55
  });
56
56
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/participant/disconnect";
57
57
  let body;
58
- body = JSON.stringify({
59
- ClientToken: input.ClientToken ?? generateIdempotencyToken(),
60
- });
58
+ body = JSON.stringify(take(input, {
59
+ ClientToken: [true, (_) => _ ?? generateIdempotencyToken()],
60
+ }));
61
61
  return new __HttpRequest({
62
62
  protocol,
63
63
  hostname,
@@ -76,9 +76,9 @@ export const se_GetAttachmentCommand = async (input, context) => {
76
76
  });
77
77
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/participant/attachment";
78
78
  let body;
79
- body = JSON.stringify({
80
- ...(input.AttachmentId != null && { AttachmentId: input.AttachmentId }),
81
- });
79
+ body = JSON.stringify(take(input, {
80
+ AttachmentId: [],
81
+ }));
82
82
  return new __HttpRequest({
83
83
  protocol,
84
84
  hostname,
@@ -97,14 +97,14 @@ export const se_GetTranscriptCommand = async (input, context) => {
97
97
  });
98
98
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/participant/transcript";
99
99
  let body;
100
- body = JSON.stringify({
101
- ...(input.ContactId != null && { ContactId: input.ContactId }),
102
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
103
- ...(input.NextToken != null && { NextToken: input.NextToken }),
104
- ...(input.ScanDirection != null && { ScanDirection: input.ScanDirection }),
105
- ...(input.SortOrder != null && { SortOrder: input.SortOrder }),
106
- ...(input.StartPosition != null && { StartPosition: se_StartPosition(input.StartPosition, context) }),
107
- });
100
+ body = JSON.stringify(take(input, {
101
+ ContactId: [],
102
+ MaxResults: [],
103
+ NextToken: [],
104
+ ScanDirection: [],
105
+ SortOrder: [],
106
+ StartPosition: (_) => _json(_),
107
+ }));
108
108
  return new __HttpRequest({
109
109
  protocol,
110
110
  hostname,
@@ -123,11 +123,11 @@ export const se_SendEventCommand = async (input, context) => {
123
123
  });
124
124
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/participant/event";
125
125
  let body;
126
- body = JSON.stringify({
127
- ClientToken: input.ClientToken ?? generateIdempotencyToken(),
128
- ...(input.Content != null && { Content: input.Content }),
129
- ...(input.ContentType != null && { ContentType: input.ContentType }),
130
- });
126
+ body = JSON.stringify(take(input, {
127
+ ClientToken: [true, (_) => _ ?? generateIdempotencyToken()],
128
+ Content: [],
129
+ ContentType: [],
130
+ }));
131
131
  return new __HttpRequest({
132
132
  protocol,
133
133
  hostname,
@@ -146,11 +146,11 @@ export const se_SendMessageCommand = async (input, context) => {
146
146
  });
147
147
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/participant/message";
148
148
  let body;
149
- body = JSON.stringify({
150
- ClientToken: input.ClientToken ?? generateIdempotencyToken(),
151
- ...(input.Content != null && { Content: input.Content }),
152
- ...(input.ContentType != null && { ContentType: input.ContentType }),
153
- });
149
+ body = JSON.stringify(take(input, {
150
+ ClientToken: [true, (_) => _ ?? generateIdempotencyToken()],
151
+ Content: [],
152
+ ContentType: [],
153
+ }));
154
154
  return new __HttpRequest({
155
155
  protocol,
156
156
  hostname,
@@ -169,12 +169,12 @@ export const se_StartAttachmentUploadCommand = async (input, context) => {
169
169
  });
170
170
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/participant/start-attachment-upload";
171
171
  let body;
172
- body = JSON.stringify({
173
- ...(input.AttachmentName != null && { AttachmentName: input.AttachmentName }),
174
- ...(input.AttachmentSizeInBytes != null && { AttachmentSizeInBytes: input.AttachmentSizeInBytes }),
175
- ClientToken: input.ClientToken ?? generateIdempotencyToken(),
176
- ...(input.ContentType != null && { ContentType: input.ContentType }),
177
- });
172
+ body = JSON.stringify(take(input, {
173
+ AttachmentName: [],
174
+ AttachmentSizeInBytes: [],
175
+ ClientToken: [true, (_) => _ ?? generateIdempotencyToken()],
176
+ ContentType: [],
177
+ }));
178
178
  return new __HttpRequest({
179
179
  protocol,
180
180
  hostname,
@@ -222,10 +222,9 @@ const de_CompleteAttachmentUploadCommandError = async (output, context) => {
222
222
  throw await de_ValidationExceptionRes(parsedOutput, context);
223
223
  default:
224
224
  const parsedBody = parsedOutput.body;
225
- throwDefaultError({
225
+ return throwDefaultError({
226
226
  output,
227
227
  parsedBody,
228
- exceptionCtor: __BaseException,
229
228
  errorCode,
230
229
  });
231
230
  }
@@ -238,12 +237,11 @@ export const de_CreateParticipantConnectionCommand = async (output, context) =>
238
237
  $metadata: deserializeMetadata(output),
239
238
  });
240
239
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
241
- if (data.ConnectionCredentials != null) {
242
- contents.ConnectionCredentials = de_ConnectionCredentials(data.ConnectionCredentials, context);
243
- }
244
- if (data.Websocket != null) {
245
- contents.Websocket = de_Websocket(data.Websocket, context);
246
- }
240
+ const doc = take(data, {
241
+ ConnectionCredentials: _json,
242
+ Websocket: _json,
243
+ });
244
+ Object.assign(contents, doc);
247
245
  return contents;
248
246
  };
249
247
  const de_CreateParticipantConnectionCommandError = async (output, context) => {
@@ -267,10 +265,9 @@ const de_CreateParticipantConnectionCommandError = async (output, context) => {
267
265
  throw await de_ValidationExceptionRes(parsedOutput, context);
268
266
  default:
269
267
  const parsedBody = parsedOutput.body;
270
- throwDefaultError({
268
+ return throwDefaultError({
271
269
  output,
272
270
  parsedBody,
273
- exceptionCtor: __BaseException,
274
271
  errorCode,
275
272
  });
276
273
  }
@@ -306,10 +303,9 @@ const de_DisconnectParticipantCommandError = async (output, context) => {
306
303
  throw await de_ValidationExceptionRes(parsedOutput, context);
307
304
  default:
308
305
  const parsedBody = parsedOutput.body;
309
- throwDefaultError({
306
+ return throwDefaultError({
310
307
  output,
311
308
  parsedBody,
312
- exceptionCtor: __BaseException,
313
309
  errorCode,
314
310
  });
315
311
  }
@@ -322,12 +318,11 @@ export const de_GetAttachmentCommand = async (output, context) => {
322
318
  $metadata: deserializeMetadata(output),
323
319
  });
324
320
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
325
- if (data.Url != null) {
326
- contents.Url = __expectString(data.Url);
327
- }
328
- if (data.UrlExpiry != null) {
329
- contents.UrlExpiry = __expectString(data.UrlExpiry);
330
- }
321
+ const doc = take(data, {
322
+ Url: __expectString,
323
+ UrlExpiry: __expectString,
324
+ });
325
+ Object.assign(contents, doc);
331
326
  return contents;
332
327
  };
333
328
  const de_GetAttachmentCommandError = async (output, context) => {
@@ -351,10 +346,9 @@ const de_GetAttachmentCommandError = async (output, context) => {
351
346
  throw await de_ValidationExceptionRes(parsedOutput, context);
352
347
  default:
353
348
  const parsedBody = parsedOutput.body;
354
- throwDefaultError({
349
+ return throwDefaultError({
355
350
  output,
356
351
  parsedBody,
357
- exceptionCtor: __BaseException,
358
352
  errorCode,
359
353
  });
360
354
  }
@@ -367,15 +361,12 @@ export const de_GetTranscriptCommand = async (output, context) => {
367
361
  $metadata: deserializeMetadata(output),
368
362
  });
369
363
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
370
- if (data.InitialContactId != null) {
371
- contents.InitialContactId = __expectString(data.InitialContactId);
372
- }
373
- if (data.NextToken != null) {
374
- contents.NextToken = __expectString(data.NextToken);
375
- }
376
- if (data.Transcript != null) {
377
- contents.Transcript = de_Transcript(data.Transcript, context);
378
- }
364
+ const doc = take(data, {
365
+ InitialContactId: __expectString,
366
+ NextToken: __expectString,
367
+ Transcript: _json,
368
+ });
369
+ Object.assign(contents, doc);
379
370
  return contents;
380
371
  };
381
372
  const de_GetTranscriptCommandError = async (output, context) => {
@@ -399,10 +390,9 @@ const de_GetTranscriptCommandError = async (output, context) => {
399
390
  throw await de_ValidationExceptionRes(parsedOutput, context);
400
391
  default:
401
392
  const parsedBody = parsedOutput.body;
402
- throwDefaultError({
393
+ return throwDefaultError({
403
394
  output,
404
395
  parsedBody,
405
- exceptionCtor: __BaseException,
406
396
  errorCode,
407
397
  });
408
398
  }
@@ -415,12 +405,11 @@ export const de_SendEventCommand = async (output, context) => {
415
405
  $metadata: deserializeMetadata(output),
416
406
  });
417
407
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
418
- if (data.AbsoluteTime != null) {
419
- contents.AbsoluteTime = __expectString(data.AbsoluteTime);
420
- }
421
- if (data.Id != null) {
422
- contents.Id = __expectString(data.Id);
423
- }
408
+ const doc = take(data, {
409
+ AbsoluteTime: __expectString,
410
+ Id: __expectString,
411
+ });
412
+ Object.assign(contents, doc);
424
413
  return contents;
425
414
  };
426
415
  const de_SendEventCommandError = async (output, context) => {
@@ -444,10 +433,9 @@ const de_SendEventCommandError = async (output, context) => {
444
433
  throw await de_ValidationExceptionRes(parsedOutput, context);
445
434
  default:
446
435
  const parsedBody = parsedOutput.body;
447
- throwDefaultError({
436
+ return throwDefaultError({
448
437
  output,
449
438
  parsedBody,
450
- exceptionCtor: __BaseException,
451
439
  errorCode,
452
440
  });
453
441
  }
@@ -460,12 +448,11 @@ export const de_SendMessageCommand = async (output, context) => {
460
448
  $metadata: deserializeMetadata(output),
461
449
  });
462
450
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
463
- if (data.AbsoluteTime != null) {
464
- contents.AbsoluteTime = __expectString(data.AbsoluteTime);
465
- }
466
- if (data.Id != null) {
467
- contents.Id = __expectString(data.Id);
468
- }
451
+ const doc = take(data, {
452
+ AbsoluteTime: __expectString,
453
+ Id: __expectString,
454
+ });
455
+ Object.assign(contents, doc);
469
456
  return contents;
470
457
  };
471
458
  const de_SendMessageCommandError = async (output, context) => {
@@ -489,10 +476,9 @@ const de_SendMessageCommandError = async (output, context) => {
489
476
  throw await de_ValidationExceptionRes(parsedOutput, context);
490
477
  default:
491
478
  const parsedBody = parsedOutput.body;
492
- throwDefaultError({
479
+ return throwDefaultError({
493
480
  output,
494
481
  parsedBody,
495
- exceptionCtor: __BaseException,
496
482
  errorCode,
497
483
  });
498
484
  }
@@ -505,12 +491,11 @@ export const de_StartAttachmentUploadCommand = async (output, context) => {
505
491
  $metadata: deserializeMetadata(output),
506
492
  });
507
493
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
508
- if (data.AttachmentId != null) {
509
- contents.AttachmentId = __expectString(data.AttachmentId);
510
- }
511
- if (data.UploadMetadata != null) {
512
- contents.UploadMetadata = de_UploadMetadata(data.UploadMetadata, context);
513
- }
494
+ const doc = take(data, {
495
+ AttachmentId: __expectString,
496
+ UploadMetadata: _json,
497
+ });
498
+ Object.assign(contents, doc);
514
499
  return contents;
515
500
  };
516
501
  const de_StartAttachmentUploadCommandError = async (output, context) => {
@@ -537,21 +522,21 @@ const de_StartAttachmentUploadCommandError = async (output, context) => {
537
522
  throw await de_ValidationExceptionRes(parsedOutput, context);
538
523
  default:
539
524
  const parsedBody = parsedOutput.body;
540
- throwDefaultError({
525
+ return throwDefaultError({
541
526
  output,
542
527
  parsedBody,
543
- exceptionCtor: __BaseException,
544
528
  errorCode,
545
529
  });
546
530
  }
547
531
  };
548
- const map = __map;
532
+ const throwDefaultError = withBaseException(__BaseException);
549
533
  const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
550
534
  const contents = map({});
551
535
  const data = parsedOutput.body;
552
- if (data.Message != null) {
553
- contents.Message = __expectString(data.Message);
554
- }
536
+ const doc = take(data, {
537
+ Message: __expectString,
538
+ });
539
+ Object.assign(contents, doc);
555
540
  const exception = new AccessDeniedException({
556
541
  $metadata: deserializeMetadata(parsedOutput),
557
542
  ...contents,
@@ -561,9 +546,10 @@ const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
561
546
  const de_ConflictExceptionRes = async (parsedOutput, context) => {
562
547
  const contents = map({});
563
548
  const data = parsedOutput.body;
564
- if (data.Message != null) {
565
- contents.Message = __expectString(data.Message);
566
- }
549
+ const doc = take(data, {
550
+ Message: __expectString,
551
+ });
552
+ Object.assign(contents, doc);
567
553
  const exception = new ConflictException({
568
554
  $metadata: deserializeMetadata(parsedOutput),
569
555
  ...contents,
@@ -573,9 +559,10 @@ const de_ConflictExceptionRes = async (parsedOutput, context) => {
573
559
  const de_InternalServerExceptionRes = async (parsedOutput, context) => {
574
560
  const contents = map({});
575
561
  const data = parsedOutput.body;
576
- if (data.Message != null) {
577
- contents.Message = __expectString(data.Message);
578
- }
562
+ const doc = take(data, {
563
+ Message: __expectString,
564
+ });
565
+ Object.assign(contents, doc);
579
566
  const exception = new InternalServerException({
580
567
  $metadata: deserializeMetadata(parsedOutput),
581
568
  ...contents,
@@ -585,9 +572,10 @@ const de_InternalServerExceptionRes = async (parsedOutput, context) => {
585
572
  const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
586
573
  const contents = map({});
587
574
  const data = parsedOutput.body;
588
- if (data.Message != null) {
589
- contents.Message = __expectString(data.Message);
590
- }
575
+ const doc = take(data, {
576
+ Message: __expectString,
577
+ });
578
+ Object.assign(contents, doc);
591
579
  const exception = new ServiceQuotaExceededException({
592
580
  $metadata: deserializeMetadata(parsedOutput),
593
581
  ...contents,
@@ -597,9 +585,10 @@ const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
597
585
  const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
598
586
  const contents = map({});
599
587
  const data = parsedOutput.body;
600
- if (data.Message != null) {
601
- contents.Message = __expectString(data.Message);
602
- }
588
+ const doc = take(data, {
589
+ Message: __expectString,
590
+ });
591
+ Object.assign(contents, doc);
603
592
  const exception = new ThrottlingException({
604
593
  $metadata: deserializeMetadata(parsedOutput),
605
594
  ...contents,
@@ -609,134 +598,16 @@ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
609
598
  const de_ValidationExceptionRes = async (parsedOutput, context) => {
610
599
  const contents = map({});
611
600
  const data = parsedOutput.body;
612
- if (data.Message != null) {
613
- contents.Message = __expectString(data.Message);
614
- }
601
+ const doc = take(data, {
602
+ Message: __expectString,
603
+ });
604
+ Object.assign(contents, doc);
615
605
  const exception = new ValidationException({
616
606
  $metadata: deserializeMetadata(parsedOutput),
617
607
  ...contents,
618
608
  });
619
609
  return __decorateServiceException(exception, parsedOutput.body);
620
610
  };
621
- const se_AttachmentIdList = (input, context) => {
622
- return input
623
- .filter((e) => e != null)
624
- .map((entry) => {
625
- return entry;
626
- });
627
- };
628
- const se_ConnectionTypeList = (input, context) => {
629
- return input
630
- .filter((e) => e != null)
631
- .map((entry) => {
632
- return entry;
633
- });
634
- };
635
- const se_StartPosition = (input, context) => {
636
- return {
637
- ...(input.AbsoluteTime != null && { AbsoluteTime: input.AbsoluteTime }),
638
- ...(input.Id != null && { Id: input.Id }),
639
- ...(input.MostRecent != null && { MostRecent: input.MostRecent }),
640
- };
641
- };
642
- const de_AttachmentItem = (output, context) => {
643
- return {
644
- AttachmentId: __expectString(output.AttachmentId),
645
- AttachmentName: __expectString(output.AttachmentName),
646
- ContentType: __expectString(output.ContentType),
647
- Status: __expectString(output.Status),
648
- };
649
- };
650
- const de_Attachments = (output, context) => {
651
- const retVal = (output || [])
652
- .filter((e) => e != null)
653
- .map((entry) => {
654
- if (entry === null) {
655
- return null;
656
- }
657
- return de_AttachmentItem(entry, context);
658
- });
659
- return retVal;
660
- };
661
- const de_ConnectionCredentials = (output, context) => {
662
- return {
663
- ConnectionToken: __expectString(output.ConnectionToken),
664
- Expiry: __expectString(output.Expiry),
665
- };
666
- };
667
- const de_Item = (output, context) => {
668
- return {
669
- AbsoluteTime: __expectString(output.AbsoluteTime),
670
- Attachments: output.Attachments != null ? de_Attachments(output.Attachments, context) : undefined,
671
- ContactId: __expectString(output.ContactId),
672
- Content: __expectString(output.Content),
673
- ContentType: __expectString(output.ContentType),
674
- DisplayName: __expectString(output.DisplayName),
675
- Id: __expectString(output.Id),
676
- MessageMetadata: output.MessageMetadata != null ? de_MessageMetadata(output.MessageMetadata, context) : undefined,
677
- ParticipantId: __expectString(output.ParticipantId),
678
- ParticipantRole: __expectString(output.ParticipantRole),
679
- RelatedContactId: __expectString(output.RelatedContactId),
680
- Type: __expectString(output.Type),
681
- };
682
- };
683
- const de_MessageMetadata = (output, context) => {
684
- return {
685
- MessageId: __expectString(output.MessageId),
686
- Receipts: output.Receipts != null ? de_Receipts(output.Receipts, context) : undefined,
687
- };
688
- };
689
- const de_Receipt = (output, context) => {
690
- return {
691
- DeliveredTimestamp: __expectString(output.DeliveredTimestamp),
692
- ReadTimestamp: __expectString(output.ReadTimestamp),
693
- RecipientParticipantId: __expectString(output.RecipientParticipantId),
694
- };
695
- };
696
- const de_Receipts = (output, context) => {
697
- const retVal = (output || [])
698
- .filter((e) => e != null)
699
- .map((entry) => {
700
- if (entry === null) {
701
- return null;
702
- }
703
- return de_Receipt(entry, context);
704
- });
705
- return retVal;
706
- };
707
- const de_Transcript = (output, context) => {
708
- const retVal = (output || [])
709
- .filter((e) => e != null)
710
- .map((entry) => {
711
- if (entry === null) {
712
- return null;
713
- }
714
- return de_Item(entry, context);
715
- });
716
- return retVal;
717
- };
718
- const de_UploadMetadata = (output, context) => {
719
- return {
720
- HeadersToInclude: output.HeadersToInclude != null ? de_UploadMetadataSignedHeaders(output.HeadersToInclude, context) : undefined,
721
- Url: __expectString(output.Url),
722
- UrlExpiry: __expectString(output.UrlExpiry),
723
- };
724
- };
725
- const de_UploadMetadataSignedHeaders = (output, context) => {
726
- return Object.entries(output).reduce((acc, [key, value]) => {
727
- if (value === null) {
728
- return acc;
729
- }
730
- acc[key] = __expectString(value);
731
- return acc;
732
- }, {});
733
- };
734
- const de_Websocket = (output, context) => {
735
- return {
736
- ConnectionExpiry: __expectString(output.ConnectionExpiry),
737
- Url: __expectString(output.Url),
738
- };
739
- };
740
611
  const deserializeMetadata = (output) => ({
741
612
  httpStatusCode: output.statusCode,
742
613
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],