@aws-sdk/client-ivschat 3.312.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.
@@ -12,13 +12,13 @@ const se_CreateChatTokenCommand = async (input, context) => {
12
12
  };
13
13
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/CreateChatToken";
14
14
  let body;
15
- body = JSON.stringify({
16
- ...(input.attributes != null && { attributes: se_ChatTokenAttributes(input.attributes, context) }),
17
- ...(input.capabilities != null && { capabilities: se_ChatTokenCapabilities(input.capabilities, context) }),
18
- ...(input.roomIdentifier != null && { roomIdentifier: input.roomIdentifier }),
19
- ...(input.sessionDurationInMinutes != null && { sessionDurationInMinutes: input.sessionDurationInMinutes }),
20
- ...(input.userId != null && { userId: input.userId }),
21
- });
15
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
16
+ attributes: (_) => (0, smithy_client_1._json)(_),
17
+ capabilities: (_) => (0, smithy_client_1._json)(_),
18
+ roomIdentifier: [],
19
+ sessionDurationInMinutes: [],
20
+ userId: [],
21
+ }));
22
22
  return new protocol_http_1.HttpRequest({
23
23
  protocol,
24
24
  hostname,
@@ -37,13 +37,11 @@ const se_CreateLoggingConfigurationCommand = async (input, context) => {
37
37
  };
38
38
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/CreateLoggingConfiguration";
39
39
  let body;
40
- body = JSON.stringify({
41
- ...(input.destinationConfiguration != null && {
42
- destinationConfiguration: se_DestinationConfiguration(input.destinationConfiguration, context),
43
- }),
44
- ...(input.name != null && { name: input.name }),
45
- ...(input.tags != null && { tags: se_Tags(input.tags, context) }),
46
- });
40
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
41
+ destinationConfiguration: (_) => (0, smithy_client_1._json)(_),
42
+ name: [],
43
+ tags: (_) => (0, smithy_client_1._json)(_),
44
+ }));
47
45
  return new protocol_http_1.HttpRequest({
48
46
  protocol,
49
47
  hostname,
@@ -62,20 +60,14 @@ const se_CreateRoomCommand = async (input, context) => {
62
60
  };
63
61
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/CreateRoom";
64
62
  let body;
65
- body = JSON.stringify({
66
- ...(input.loggingConfigurationIdentifiers != null && {
67
- loggingConfigurationIdentifiers: se_LoggingConfigurationIdentifierList(input.loggingConfigurationIdentifiers, context),
68
- }),
69
- ...(input.maximumMessageLength != null && { maximumMessageLength: input.maximumMessageLength }),
70
- ...(input.maximumMessageRatePerSecond != null && {
71
- maximumMessageRatePerSecond: input.maximumMessageRatePerSecond,
72
- }),
73
- ...(input.messageReviewHandler != null && {
74
- messageReviewHandler: se_MessageReviewHandler(input.messageReviewHandler, context),
75
- }),
76
- ...(input.name != null && { name: input.name }),
77
- ...(input.tags != null && { tags: se_Tags(input.tags, context) }),
78
- });
63
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
64
+ loggingConfigurationIdentifiers: (_) => (0, smithy_client_1._json)(_),
65
+ maximumMessageLength: [],
66
+ maximumMessageRatePerSecond: [],
67
+ messageReviewHandler: (_) => (0, smithy_client_1._json)(_),
68
+ name: [],
69
+ tags: (_) => (0, smithy_client_1._json)(_),
70
+ }));
79
71
  return new protocol_http_1.HttpRequest({
80
72
  protocol,
81
73
  hostname,
@@ -94,9 +86,9 @@ const se_DeleteLoggingConfigurationCommand = async (input, context) => {
94
86
  };
95
87
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/DeleteLoggingConfiguration";
96
88
  let body;
97
- body = JSON.stringify({
98
- ...(input.identifier != null && { identifier: input.identifier }),
99
- });
89
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
90
+ identifier: [],
91
+ }));
100
92
  return new protocol_http_1.HttpRequest({
101
93
  protocol,
102
94
  hostname,
@@ -115,11 +107,11 @@ const se_DeleteMessageCommand = async (input, context) => {
115
107
  };
116
108
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/DeleteMessage";
117
109
  let body;
118
- body = JSON.stringify({
119
- ...(input.id != null && { id: input.id }),
120
- ...(input.reason != null && { reason: input.reason }),
121
- ...(input.roomIdentifier != null && { roomIdentifier: input.roomIdentifier }),
122
- });
110
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
111
+ id: [],
112
+ reason: [],
113
+ roomIdentifier: [],
114
+ }));
123
115
  return new protocol_http_1.HttpRequest({
124
116
  protocol,
125
117
  hostname,
@@ -138,9 +130,9 @@ const se_DeleteRoomCommand = async (input, context) => {
138
130
  };
139
131
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/DeleteRoom";
140
132
  let body;
141
- body = JSON.stringify({
142
- ...(input.identifier != null && { identifier: input.identifier }),
143
- });
133
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
134
+ identifier: [],
135
+ }));
144
136
  return new protocol_http_1.HttpRequest({
145
137
  protocol,
146
138
  hostname,
@@ -159,11 +151,11 @@ const se_DisconnectUserCommand = async (input, context) => {
159
151
  };
160
152
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/DisconnectUser";
161
153
  let body;
162
- body = JSON.stringify({
163
- ...(input.reason != null && { reason: input.reason }),
164
- ...(input.roomIdentifier != null && { roomIdentifier: input.roomIdentifier }),
165
- ...(input.userId != null && { userId: input.userId }),
166
- });
154
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
155
+ reason: [],
156
+ roomIdentifier: [],
157
+ userId: [],
158
+ }));
167
159
  return new protocol_http_1.HttpRequest({
168
160
  protocol,
169
161
  hostname,
@@ -182,9 +174,9 @@ const se_GetLoggingConfigurationCommand = async (input, context) => {
182
174
  };
183
175
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/GetLoggingConfiguration";
184
176
  let body;
185
- body = JSON.stringify({
186
- ...(input.identifier != null && { identifier: input.identifier }),
187
- });
177
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
178
+ identifier: [],
179
+ }));
188
180
  return new protocol_http_1.HttpRequest({
189
181
  protocol,
190
182
  hostname,
@@ -203,9 +195,9 @@ const se_GetRoomCommand = async (input, context) => {
203
195
  };
204
196
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/GetRoom";
205
197
  let body;
206
- body = JSON.stringify({
207
- ...(input.identifier != null && { identifier: input.identifier }),
208
- });
198
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
199
+ identifier: [],
200
+ }));
209
201
  return new protocol_http_1.HttpRequest({
210
202
  protocol,
211
203
  hostname,
@@ -224,10 +216,10 @@ const se_ListLoggingConfigurationsCommand = async (input, context) => {
224
216
  };
225
217
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/ListLoggingConfigurations";
226
218
  let body;
227
- body = JSON.stringify({
228
- ...(input.maxResults != null && { maxResults: input.maxResults }),
229
- ...(input.nextToken != null && { nextToken: input.nextToken }),
230
- });
219
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
220
+ maxResults: [],
221
+ nextToken: [],
222
+ }));
231
223
  return new protocol_http_1.HttpRequest({
232
224
  protocol,
233
225
  hostname,
@@ -246,15 +238,13 @@ const se_ListRoomsCommand = async (input, context) => {
246
238
  };
247
239
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/ListRooms";
248
240
  let body;
249
- body = JSON.stringify({
250
- ...(input.loggingConfigurationIdentifier != null && {
251
- loggingConfigurationIdentifier: input.loggingConfigurationIdentifier,
252
- }),
253
- ...(input.maxResults != null && { maxResults: input.maxResults }),
254
- ...(input.messageReviewHandlerUri != null && { messageReviewHandlerUri: input.messageReviewHandlerUri }),
255
- ...(input.name != null && { name: input.name }),
256
- ...(input.nextToken != null && { nextToken: input.nextToken }),
257
- });
241
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
242
+ loggingConfigurationIdentifier: [],
243
+ maxResults: [],
244
+ messageReviewHandlerUri: [],
245
+ name: [],
246
+ nextToken: [],
247
+ }));
258
248
  return new protocol_http_1.HttpRequest({
259
249
  protocol,
260
250
  hostname,
@@ -290,11 +280,11 @@ const se_SendEventCommand = async (input, context) => {
290
280
  };
291
281
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/SendEvent";
292
282
  let body;
293
- body = JSON.stringify({
294
- ...(input.attributes != null && { attributes: se_EventAttributes(input.attributes, context) }),
295
- ...(input.eventName != null && { eventName: input.eventName }),
296
- ...(input.roomIdentifier != null && { roomIdentifier: input.roomIdentifier }),
297
- });
283
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
284
+ attributes: (_) => (0, smithy_client_1._json)(_),
285
+ eventName: [],
286
+ roomIdentifier: [],
287
+ }));
298
288
  return new protocol_http_1.HttpRequest({
299
289
  protocol,
300
290
  hostname,
@@ -314,9 +304,9 @@ const se_TagResourceCommand = async (input, context) => {
314
304
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
315
305
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
316
306
  let body;
317
- body = JSON.stringify({
318
- ...(input.tags != null && { tags: se_Tags(input.tags, context) }),
319
- });
307
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
308
+ tags: (_) => (0, smithy_client_1._json)(_),
309
+ }));
320
310
  return new protocol_http_1.HttpRequest({
321
311
  protocol,
322
312
  hostname,
@@ -333,7 +323,7 @@ const se_UntagResourceCommand = async (input, context) => {
333
323
  const headers = {};
334
324
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
335
325
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
336
- const query = map({
326
+ const query = (0, smithy_client_1.map)({
337
327
  tagKeys: [
338
328
  (0, smithy_client_1.expectNonNull)(input.tagKeys, `tagKeys`) != null,
339
329
  () => (input.tagKeys || []).map((_entry) => _entry),
@@ -359,13 +349,11 @@ const se_UpdateLoggingConfigurationCommand = async (input, context) => {
359
349
  };
360
350
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/UpdateLoggingConfiguration";
361
351
  let body;
362
- body = JSON.stringify({
363
- ...(input.destinationConfiguration != null && {
364
- destinationConfiguration: se_DestinationConfiguration(input.destinationConfiguration, context),
365
- }),
366
- ...(input.identifier != null && { identifier: input.identifier }),
367
- ...(input.name != null && { name: input.name }),
368
- });
352
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
353
+ destinationConfiguration: (_) => (0, smithy_client_1._json)(_),
354
+ identifier: [],
355
+ name: [],
356
+ }));
369
357
  return new protocol_http_1.HttpRequest({
370
358
  protocol,
371
359
  hostname,
@@ -384,20 +372,14 @@ const se_UpdateRoomCommand = async (input, context) => {
384
372
  };
385
373
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/UpdateRoom";
386
374
  let body;
387
- body = JSON.stringify({
388
- ...(input.identifier != null && { identifier: input.identifier }),
389
- ...(input.loggingConfigurationIdentifiers != null && {
390
- loggingConfigurationIdentifiers: se_LoggingConfigurationIdentifierList(input.loggingConfigurationIdentifiers, context),
391
- }),
392
- ...(input.maximumMessageLength != null && { maximumMessageLength: input.maximumMessageLength }),
393
- ...(input.maximumMessageRatePerSecond != null && {
394
- maximumMessageRatePerSecond: input.maximumMessageRatePerSecond,
395
- }),
396
- ...(input.messageReviewHandler != null && {
397
- messageReviewHandler: se_MessageReviewHandler(input.messageReviewHandler, context),
398
- }),
399
- ...(input.name != null && { name: input.name }),
400
- });
375
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
376
+ identifier: [],
377
+ loggingConfigurationIdentifiers: (_) => (0, smithy_client_1._json)(_),
378
+ maximumMessageLength: [],
379
+ maximumMessageRatePerSecond: [],
380
+ messageReviewHandler: (_) => (0, smithy_client_1._json)(_),
381
+ name: [],
382
+ }));
401
383
  return new protocol_http_1.HttpRequest({
402
384
  protocol,
403
385
  hostname,
@@ -413,19 +395,16 @@ const de_CreateChatTokenCommand = async (output, context) => {
413
395
  if (output.statusCode !== 200 && output.statusCode >= 300) {
414
396
  return de_CreateChatTokenCommandError(output, context);
415
397
  }
416
- const contents = map({
398
+ const contents = (0, smithy_client_1.map)({
417
399
  $metadata: deserializeMetadata(output),
418
400
  });
419
401
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
420
- if (data.sessionExpirationTime != null) {
421
- contents.sessionExpirationTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(data.sessionExpirationTime));
422
- }
423
- if (data.token != null) {
424
- contents.token = (0, smithy_client_1.expectString)(data.token);
425
- }
426
- if (data.tokenExpirationTime != null) {
427
- contents.tokenExpirationTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(data.tokenExpirationTime));
428
- }
402
+ const doc = (0, smithy_client_1.take)(data, {
403
+ sessionExpirationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
404
+ token: smithy_client_1.expectString,
405
+ tokenExpirationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
406
+ });
407
+ Object.assign(contents, doc);
429
408
  return contents;
430
409
  };
431
410
  exports.de_CreateChatTokenCommand = de_CreateChatTokenCommand;
@@ -450,10 +429,9 @@ const de_CreateChatTokenCommandError = async (output, context) => {
450
429
  throw await de_ValidationExceptionRes(parsedOutput, context);
451
430
  default:
452
431
  const parsedBody = parsedOutput.body;
453
- (0, smithy_client_1.throwDefaultError)({
432
+ return throwDefaultError({
454
433
  output,
455
434
  parsedBody,
456
- exceptionCtor: IvschatServiceException_1.IvschatServiceException,
457
435
  errorCode,
458
436
  });
459
437
  }
@@ -462,34 +440,21 @@ const de_CreateLoggingConfigurationCommand = async (output, context) => {
462
440
  if (output.statusCode !== 200 && output.statusCode >= 300) {
463
441
  return de_CreateLoggingConfigurationCommandError(output, context);
464
442
  }
465
- const contents = map({
443
+ const contents = (0, smithy_client_1.map)({
466
444
  $metadata: deserializeMetadata(output),
467
445
  });
468
446
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
469
- if (data.arn != null) {
470
- contents.arn = (0, smithy_client_1.expectString)(data.arn);
471
- }
472
- if (data.createTime != null) {
473
- contents.createTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(data.createTime));
474
- }
475
- if (data.destinationConfiguration != null) {
476
- contents.destinationConfiguration = de_DestinationConfiguration((0, smithy_client_1.expectUnion)(data.destinationConfiguration), context);
477
- }
478
- if (data.id != null) {
479
- contents.id = (0, smithy_client_1.expectString)(data.id);
480
- }
481
- if (data.name != null) {
482
- contents.name = (0, smithy_client_1.expectString)(data.name);
483
- }
484
- if (data.state != null) {
485
- contents.state = (0, smithy_client_1.expectString)(data.state);
486
- }
487
- if (data.tags != null) {
488
- contents.tags = de_Tags(data.tags, context);
489
- }
490
- if (data.updateTime != null) {
491
- contents.updateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(data.updateTime));
492
- }
447
+ const doc = (0, smithy_client_1.take)(data, {
448
+ arn: smithy_client_1.expectString,
449
+ createTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
450
+ destinationConfiguration: (_) => (0, smithy_client_1._json)((0, smithy_client_1.expectUnion)(_)),
451
+ id: smithy_client_1.expectString,
452
+ name: smithy_client_1.expectString,
453
+ state: smithy_client_1.expectString,
454
+ tags: smithy_client_1._json,
455
+ updateTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
456
+ });
457
+ Object.assign(contents, doc);
493
458
  return contents;
494
459
  };
495
460
  exports.de_CreateLoggingConfigurationCommand = de_CreateLoggingConfigurationCommand;
@@ -520,10 +485,9 @@ const de_CreateLoggingConfigurationCommandError = async (output, context) => {
520
485
  throw await de_ValidationExceptionRes(parsedOutput, context);
521
486
  default:
522
487
  const parsedBody = parsedOutput.body;
523
- (0, smithy_client_1.throwDefaultError)({
488
+ return throwDefaultError({
524
489
  output,
525
490
  parsedBody,
526
- exceptionCtor: IvschatServiceException_1.IvschatServiceException,
527
491
  errorCode,
528
492
  });
529
493
  }
@@ -532,40 +496,23 @@ const de_CreateRoomCommand = async (output, context) => {
532
496
  if (output.statusCode !== 200 && output.statusCode >= 300) {
533
497
  return de_CreateRoomCommandError(output, context);
534
498
  }
535
- const contents = map({
499
+ const contents = (0, smithy_client_1.map)({
536
500
  $metadata: deserializeMetadata(output),
537
501
  });
538
502
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
539
- if (data.arn != null) {
540
- contents.arn = (0, smithy_client_1.expectString)(data.arn);
541
- }
542
- if (data.createTime != null) {
543
- contents.createTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(data.createTime));
544
- }
545
- if (data.id != null) {
546
- contents.id = (0, smithy_client_1.expectString)(data.id);
547
- }
548
- if (data.loggingConfigurationIdentifiers != null) {
549
- contents.loggingConfigurationIdentifiers = de_LoggingConfigurationIdentifierList(data.loggingConfigurationIdentifiers, context);
550
- }
551
- if (data.maximumMessageLength != null) {
552
- contents.maximumMessageLength = (0, smithy_client_1.expectInt32)(data.maximumMessageLength);
553
- }
554
- if (data.maximumMessageRatePerSecond != null) {
555
- contents.maximumMessageRatePerSecond = (0, smithy_client_1.expectInt32)(data.maximumMessageRatePerSecond);
556
- }
557
- if (data.messageReviewHandler != null) {
558
- contents.messageReviewHandler = de_MessageReviewHandler(data.messageReviewHandler, context);
559
- }
560
- if (data.name != null) {
561
- contents.name = (0, smithy_client_1.expectString)(data.name);
562
- }
563
- if (data.tags != null) {
564
- contents.tags = de_Tags(data.tags, context);
565
- }
566
- if (data.updateTime != null) {
567
- contents.updateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(data.updateTime));
568
- }
503
+ const doc = (0, smithy_client_1.take)(data, {
504
+ arn: smithy_client_1.expectString,
505
+ createTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
506
+ id: smithy_client_1.expectString,
507
+ loggingConfigurationIdentifiers: smithy_client_1._json,
508
+ maximumMessageLength: smithy_client_1.expectInt32,
509
+ maximumMessageRatePerSecond: smithy_client_1.expectInt32,
510
+ messageReviewHandler: smithy_client_1._json,
511
+ name: smithy_client_1.expectString,
512
+ tags: smithy_client_1._json,
513
+ updateTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
514
+ });
515
+ Object.assign(contents, doc);
569
516
  return contents;
570
517
  };
571
518
  exports.de_CreateRoomCommand = de_CreateRoomCommand;
@@ -596,10 +543,9 @@ const de_CreateRoomCommandError = async (output, context) => {
596
543
  throw await de_ValidationExceptionRes(parsedOutput, context);
597
544
  default:
598
545
  const parsedBody = parsedOutput.body;
599
- (0, smithy_client_1.throwDefaultError)({
546
+ return throwDefaultError({
600
547
  output,
601
548
  parsedBody,
602
- exceptionCtor: IvschatServiceException_1.IvschatServiceException,
603
549
  errorCode,
604
550
  });
605
551
  }
@@ -608,7 +554,7 @@ const de_DeleteLoggingConfigurationCommand = async (output, context) => {
608
554
  if (output.statusCode !== 204 && output.statusCode >= 300) {
609
555
  return de_DeleteLoggingConfigurationCommandError(output, context);
610
556
  }
611
- const contents = map({
557
+ const contents = (0, smithy_client_1.map)({
612
558
  $metadata: deserializeMetadata(output),
613
559
  });
614
560
  await collectBody(output.body, context);
@@ -639,10 +585,9 @@ const de_DeleteLoggingConfigurationCommandError = async (output, context) => {
639
585
  throw await de_ValidationExceptionRes(parsedOutput, context);
640
586
  default:
641
587
  const parsedBody = parsedOutput.body;
642
- (0, smithy_client_1.throwDefaultError)({
588
+ return throwDefaultError({
643
589
  output,
644
590
  parsedBody,
645
- exceptionCtor: IvschatServiceException_1.IvschatServiceException,
646
591
  errorCode,
647
592
  });
648
593
  }
@@ -651,13 +596,14 @@ const de_DeleteMessageCommand = async (output, context) => {
651
596
  if (output.statusCode !== 200 && output.statusCode >= 300) {
652
597
  return de_DeleteMessageCommandError(output, context);
653
598
  }
654
- const contents = map({
599
+ const contents = (0, smithy_client_1.map)({
655
600
  $metadata: deserializeMetadata(output),
656
601
  });
657
602
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
658
- if (data.id != null) {
659
- contents.id = (0, smithy_client_1.expectString)(data.id);
660
- }
603
+ const doc = (0, smithy_client_1.take)(data, {
604
+ id: smithy_client_1.expectString,
605
+ });
606
+ Object.assign(contents, doc);
661
607
  return contents;
662
608
  };
663
609
  exports.de_DeleteMessageCommand = de_DeleteMessageCommand;
@@ -685,10 +631,9 @@ const de_DeleteMessageCommandError = async (output, context) => {
685
631
  throw await de_ValidationExceptionRes(parsedOutput, context);
686
632
  default:
687
633
  const parsedBody = parsedOutput.body;
688
- (0, smithy_client_1.throwDefaultError)({
634
+ return throwDefaultError({
689
635
  output,
690
636
  parsedBody,
691
- exceptionCtor: IvschatServiceException_1.IvschatServiceException,
692
637
  errorCode,
693
638
  });
694
639
  }
@@ -697,7 +642,7 @@ const de_DeleteRoomCommand = async (output, context) => {
697
642
  if (output.statusCode !== 204 && output.statusCode >= 300) {
698
643
  return de_DeleteRoomCommandError(output, context);
699
644
  }
700
- const contents = map({
645
+ const contents = (0, smithy_client_1.map)({
701
646
  $metadata: deserializeMetadata(output),
702
647
  });
703
648
  await collectBody(output.body, context);
@@ -725,10 +670,9 @@ const de_DeleteRoomCommandError = async (output, context) => {
725
670
  throw await de_ValidationExceptionRes(parsedOutput, context);
726
671
  default:
727
672
  const parsedBody = parsedOutput.body;
728
- (0, smithy_client_1.throwDefaultError)({
673
+ return throwDefaultError({
729
674
  output,
730
675
  parsedBody,
731
- exceptionCtor: IvschatServiceException_1.IvschatServiceException,
732
676
  errorCode,
733
677
  });
734
678
  }
@@ -737,7 +681,7 @@ const de_DisconnectUserCommand = async (output, context) => {
737
681
  if (output.statusCode !== 200 && output.statusCode >= 300) {
738
682
  return de_DisconnectUserCommandError(output, context);
739
683
  }
740
- const contents = map({
684
+ const contents = (0, smithy_client_1.map)({
741
685
  $metadata: deserializeMetadata(output),
742
686
  });
743
687
  await collectBody(output.body, context);
@@ -768,10 +712,9 @@ const de_DisconnectUserCommandError = async (output, context) => {
768
712
  throw await de_ValidationExceptionRes(parsedOutput, context);
769
713
  default:
770
714
  const parsedBody = parsedOutput.body;
771
- (0, smithy_client_1.throwDefaultError)({
715
+ return throwDefaultError({
772
716
  output,
773
717
  parsedBody,
774
- exceptionCtor: IvschatServiceException_1.IvschatServiceException,
775
718
  errorCode,
776
719
  });
777
720
  }
@@ -780,34 +723,21 @@ const de_GetLoggingConfigurationCommand = async (output, context) => {
780
723
  if (output.statusCode !== 200 && output.statusCode >= 300) {
781
724
  return de_GetLoggingConfigurationCommandError(output, context);
782
725
  }
783
- const contents = map({
726
+ const contents = (0, smithy_client_1.map)({
784
727
  $metadata: deserializeMetadata(output),
785
728
  });
786
729
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
787
- if (data.arn != null) {
788
- contents.arn = (0, smithy_client_1.expectString)(data.arn);
789
- }
790
- if (data.createTime != null) {
791
- contents.createTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(data.createTime));
792
- }
793
- if (data.destinationConfiguration != null) {
794
- contents.destinationConfiguration = de_DestinationConfiguration((0, smithy_client_1.expectUnion)(data.destinationConfiguration), context);
795
- }
796
- if (data.id != null) {
797
- contents.id = (0, smithy_client_1.expectString)(data.id);
798
- }
799
- if (data.name != null) {
800
- contents.name = (0, smithy_client_1.expectString)(data.name);
801
- }
802
- if (data.state != null) {
803
- contents.state = (0, smithy_client_1.expectString)(data.state);
804
- }
805
- if (data.tags != null) {
806
- contents.tags = de_Tags(data.tags, context);
807
- }
808
- if (data.updateTime != null) {
809
- contents.updateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(data.updateTime));
810
- }
730
+ const doc = (0, smithy_client_1.take)(data, {
731
+ arn: smithy_client_1.expectString,
732
+ createTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
733
+ destinationConfiguration: (_) => (0, smithy_client_1._json)((0, smithy_client_1.expectUnion)(_)),
734
+ id: smithy_client_1.expectString,
735
+ name: smithy_client_1.expectString,
736
+ state: smithy_client_1.expectString,
737
+ tags: smithy_client_1._json,
738
+ updateTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
739
+ });
740
+ Object.assign(contents, doc);
811
741
  return contents;
812
742
  };
813
743
  exports.de_GetLoggingConfigurationCommand = de_GetLoggingConfigurationCommand;
@@ -829,10 +759,9 @@ const de_GetLoggingConfigurationCommandError = async (output, context) => {
829
759
  throw await de_ValidationExceptionRes(parsedOutput, context);
830
760
  default:
831
761
  const parsedBody = parsedOutput.body;
832
- (0, smithy_client_1.throwDefaultError)({
762
+ return throwDefaultError({
833
763
  output,
834
764
  parsedBody,
835
- exceptionCtor: IvschatServiceException_1.IvschatServiceException,
836
765
  errorCode,
837
766
  });
838
767
  }
@@ -841,40 +770,23 @@ const de_GetRoomCommand = async (output, context) => {
841
770
  if (output.statusCode !== 200 && output.statusCode >= 300) {
842
771
  return de_GetRoomCommandError(output, context);
843
772
  }
844
- const contents = map({
773
+ const contents = (0, smithy_client_1.map)({
845
774
  $metadata: deserializeMetadata(output),
846
775
  });
847
776
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
848
- if (data.arn != null) {
849
- contents.arn = (0, smithy_client_1.expectString)(data.arn);
850
- }
851
- if (data.createTime != null) {
852
- contents.createTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(data.createTime));
853
- }
854
- if (data.id != null) {
855
- contents.id = (0, smithy_client_1.expectString)(data.id);
856
- }
857
- if (data.loggingConfigurationIdentifiers != null) {
858
- contents.loggingConfigurationIdentifiers = de_LoggingConfigurationIdentifierList(data.loggingConfigurationIdentifiers, context);
859
- }
860
- if (data.maximumMessageLength != null) {
861
- contents.maximumMessageLength = (0, smithy_client_1.expectInt32)(data.maximumMessageLength);
862
- }
863
- if (data.maximumMessageRatePerSecond != null) {
864
- contents.maximumMessageRatePerSecond = (0, smithy_client_1.expectInt32)(data.maximumMessageRatePerSecond);
865
- }
866
- if (data.messageReviewHandler != null) {
867
- contents.messageReviewHandler = de_MessageReviewHandler(data.messageReviewHandler, context);
868
- }
869
- if (data.name != null) {
870
- contents.name = (0, smithy_client_1.expectString)(data.name);
871
- }
872
- if (data.tags != null) {
873
- contents.tags = de_Tags(data.tags, context);
874
- }
875
- if (data.updateTime != null) {
876
- contents.updateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(data.updateTime));
877
- }
777
+ const doc = (0, smithy_client_1.take)(data, {
778
+ arn: smithy_client_1.expectString,
779
+ createTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
780
+ id: smithy_client_1.expectString,
781
+ loggingConfigurationIdentifiers: smithy_client_1._json,
782
+ maximumMessageLength: smithy_client_1.expectInt32,
783
+ maximumMessageRatePerSecond: smithy_client_1.expectInt32,
784
+ messageReviewHandler: smithy_client_1._json,
785
+ name: smithy_client_1.expectString,
786
+ tags: smithy_client_1._json,
787
+ updateTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
788
+ });
789
+ Object.assign(contents, doc);
878
790
  return contents;
879
791
  };
880
792
  exports.de_GetRoomCommand = de_GetRoomCommand;
@@ -896,10 +808,9 @@ const de_GetRoomCommandError = async (output, context) => {
896
808
  throw await de_ValidationExceptionRes(parsedOutput, context);
897
809
  default:
898
810
  const parsedBody = parsedOutput.body;
899
- (0, smithy_client_1.throwDefaultError)({
811
+ return throwDefaultError({
900
812
  output,
901
813
  parsedBody,
902
- exceptionCtor: IvschatServiceException_1.IvschatServiceException,
903
814
  errorCode,
904
815
  });
905
816
  }
@@ -908,16 +819,15 @@ const de_ListLoggingConfigurationsCommand = async (output, context) => {
908
819
  if (output.statusCode !== 200 && output.statusCode >= 300) {
909
820
  return de_ListLoggingConfigurationsCommandError(output, context);
910
821
  }
911
- const contents = map({
822
+ const contents = (0, smithy_client_1.map)({
912
823
  $metadata: deserializeMetadata(output),
913
824
  });
914
825
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
915
- if (data.loggingConfigurations != null) {
916
- contents.loggingConfigurations = de_LoggingConfigurationList(data.loggingConfigurations, context);
917
- }
918
- if (data.nextToken != null) {
919
- contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
920
- }
826
+ const doc = (0, smithy_client_1.take)(data, {
827
+ loggingConfigurations: (_) => de_LoggingConfigurationList(_, context),
828
+ nextToken: smithy_client_1.expectString,
829
+ });
830
+ Object.assign(contents, doc);
921
831
  return contents;
922
832
  };
923
833
  exports.de_ListLoggingConfigurationsCommand = de_ListLoggingConfigurationsCommand;
@@ -936,10 +846,9 @@ const de_ListLoggingConfigurationsCommandError = async (output, context) => {
936
846
  throw await de_ValidationExceptionRes(parsedOutput, context);
937
847
  default:
938
848
  const parsedBody = parsedOutput.body;
939
- (0, smithy_client_1.throwDefaultError)({
849
+ return throwDefaultError({
940
850
  output,
941
851
  parsedBody,
942
- exceptionCtor: IvschatServiceException_1.IvschatServiceException,
943
852
  errorCode,
944
853
  });
945
854
  }
@@ -948,16 +857,15 @@ const de_ListRoomsCommand = async (output, context) => {
948
857
  if (output.statusCode !== 200 && output.statusCode >= 300) {
949
858
  return de_ListRoomsCommandError(output, context);
950
859
  }
951
- const contents = map({
860
+ const contents = (0, smithy_client_1.map)({
952
861
  $metadata: deserializeMetadata(output),
953
862
  });
954
863
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
955
- if (data.nextToken != null) {
956
- contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
957
- }
958
- if (data.rooms != null) {
959
- contents.rooms = de_RoomList(data.rooms, context);
960
- }
864
+ const doc = (0, smithy_client_1.take)(data, {
865
+ nextToken: smithy_client_1.expectString,
866
+ rooms: (_) => de_RoomList(_, context),
867
+ });
868
+ Object.assign(contents, doc);
961
869
  return contents;
962
870
  };
963
871
  exports.de_ListRoomsCommand = de_ListRoomsCommand;
@@ -979,10 +887,9 @@ const de_ListRoomsCommandError = async (output, context) => {
979
887
  throw await de_ValidationExceptionRes(parsedOutput, context);
980
888
  default:
981
889
  const parsedBody = parsedOutput.body;
982
- (0, smithy_client_1.throwDefaultError)({
890
+ return throwDefaultError({
983
891
  output,
984
892
  parsedBody,
985
- exceptionCtor: IvschatServiceException_1.IvschatServiceException,
986
893
  errorCode,
987
894
  });
988
895
  }
@@ -991,13 +898,14 @@ const de_ListTagsForResourceCommand = async (output, context) => {
991
898
  if (output.statusCode !== 200 && output.statusCode >= 300) {
992
899
  return de_ListTagsForResourceCommandError(output, context);
993
900
  }
994
- const contents = map({
901
+ const contents = (0, smithy_client_1.map)({
995
902
  $metadata: deserializeMetadata(output),
996
903
  });
997
904
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
998
- if (data.tags != null) {
999
- contents.tags = de_Tags(data.tags, context);
1000
- }
905
+ const doc = (0, smithy_client_1.take)(data, {
906
+ tags: smithy_client_1._json,
907
+ });
908
+ Object.assign(contents, doc);
1001
909
  return contents;
1002
910
  };
1003
911
  exports.de_ListTagsForResourceCommand = de_ListTagsForResourceCommand;
@@ -1019,10 +927,9 @@ const de_ListTagsForResourceCommandError = async (output, context) => {
1019
927
  throw await de_ValidationExceptionRes(parsedOutput, context);
1020
928
  default:
1021
929
  const parsedBody = parsedOutput.body;
1022
- (0, smithy_client_1.throwDefaultError)({
930
+ return throwDefaultError({
1023
931
  output,
1024
932
  parsedBody,
1025
- exceptionCtor: IvschatServiceException_1.IvschatServiceException,
1026
933
  errorCode,
1027
934
  });
1028
935
  }
@@ -1031,13 +938,14 @@ const de_SendEventCommand = async (output, context) => {
1031
938
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1032
939
  return de_SendEventCommandError(output, context);
1033
940
  }
1034
- const contents = map({
941
+ const contents = (0, smithy_client_1.map)({
1035
942
  $metadata: deserializeMetadata(output),
1036
943
  });
1037
944
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1038
- if (data.id != null) {
1039
- contents.id = (0, smithy_client_1.expectString)(data.id);
1040
- }
945
+ const doc = (0, smithy_client_1.take)(data, {
946
+ id: smithy_client_1.expectString,
947
+ });
948
+ Object.assign(contents, doc);
1041
949
  return contents;
1042
950
  };
1043
951
  exports.de_SendEventCommand = de_SendEventCommand;
@@ -1065,10 +973,9 @@ const de_SendEventCommandError = async (output, context) => {
1065
973
  throw await de_ValidationExceptionRes(parsedOutput, context);
1066
974
  default:
1067
975
  const parsedBody = parsedOutput.body;
1068
- (0, smithy_client_1.throwDefaultError)({
976
+ return throwDefaultError({
1069
977
  output,
1070
978
  parsedBody,
1071
- exceptionCtor: IvschatServiceException_1.IvschatServiceException,
1072
979
  errorCode,
1073
980
  });
1074
981
  }
@@ -1077,7 +984,7 @@ const de_TagResourceCommand = async (output, context) => {
1077
984
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1078
985
  return de_TagResourceCommandError(output, context);
1079
986
  }
1080
- const contents = map({
987
+ const contents = (0, smithy_client_1.map)({
1081
988
  $metadata: deserializeMetadata(output),
1082
989
  });
1083
990
  await collectBody(output.body, context);
@@ -1102,10 +1009,9 @@ const de_TagResourceCommandError = async (output, context) => {
1102
1009
  throw await de_ValidationExceptionRes(parsedOutput, context);
1103
1010
  default:
1104
1011
  const parsedBody = parsedOutput.body;
1105
- (0, smithy_client_1.throwDefaultError)({
1012
+ return throwDefaultError({
1106
1013
  output,
1107
1014
  parsedBody,
1108
- exceptionCtor: IvschatServiceException_1.IvschatServiceException,
1109
1015
  errorCode,
1110
1016
  });
1111
1017
  }
@@ -1114,7 +1020,7 @@ const de_UntagResourceCommand = async (output, context) => {
1114
1020
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1115
1021
  return de_UntagResourceCommandError(output, context);
1116
1022
  }
1117
- const contents = map({
1023
+ const contents = (0, smithy_client_1.map)({
1118
1024
  $metadata: deserializeMetadata(output),
1119
1025
  });
1120
1026
  await collectBody(output.body, context);
@@ -1139,10 +1045,9 @@ const de_UntagResourceCommandError = async (output, context) => {
1139
1045
  throw await de_ValidationExceptionRes(parsedOutput, context);
1140
1046
  default:
1141
1047
  const parsedBody = parsedOutput.body;
1142
- (0, smithy_client_1.throwDefaultError)({
1048
+ return throwDefaultError({
1143
1049
  output,
1144
1050
  parsedBody,
1145
- exceptionCtor: IvschatServiceException_1.IvschatServiceException,
1146
1051
  errorCode,
1147
1052
  });
1148
1053
  }
@@ -1151,34 +1056,21 @@ const de_UpdateLoggingConfigurationCommand = async (output, context) => {
1151
1056
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1152
1057
  return de_UpdateLoggingConfigurationCommandError(output, context);
1153
1058
  }
1154
- const contents = map({
1059
+ const contents = (0, smithy_client_1.map)({
1155
1060
  $metadata: deserializeMetadata(output),
1156
1061
  });
1157
1062
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1158
- if (data.arn != null) {
1159
- contents.arn = (0, smithy_client_1.expectString)(data.arn);
1160
- }
1161
- if (data.createTime != null) {
1162
- contents.createTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(data.createTime));
1163
- }
1164
- if (data.destinationConfiguration != null) {
1165
- contents.destinationConfiguration = de_DestinationConfiguration((0, smithy_client_1.expectUnion)(data.destinationConfiguration), context);
1166
- }
1167
- if (data.id != null) {
1168
- contents.id = (0, smithy_client_1.expectString)(data.id);
1169
- }
1170
- if (data.name != null) {
1171
- contents.name = (0, smithy_client_1.expectString)(data.name);
1172
- }
1173
- if (data.state != null) {
1174
- contents.state = (0, smithy_client_1.expectString)(data.state);
1175
- }
1176
- if (data.tags != null) {
1177
- contents.tags = de_Tags(data.tags, context);
1178
- }
1179
- if (data.updateTime != null) {
1180
- contents.updateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(data.updateTime));
1181
- }
1063
+ const doc = (0, smithy_client_1.take)(data, {
1064
+ arn: smithy_client_1.expectString,
1065
+ createTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
1066
+ destinationConfiguration: (_) => (0, smithy_client_1._json)((0, smithy_client_1.expectUnion)(_)),
1067
+ id: smithy_client_1.expectString,
1068
+ name: smithy_client_1.expectString,
1069
+ state: smithy_client_1.expectString,
1070
+ tags: smithy_client_1._json,
1071
+ updateTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
1072
+ });
1073
+ Object.assign(contents, doc);
1182
1074
  return contents;
1183
1075
  };
1184
1076
  exports.de_UpdateLoggingConfigurationCommand = de_UpdateLoggingConfigurationCommand;
@@ -1206,10 +1098,9 @@ const de_UpdateLoggingConfigurationCommandError = async (output, context) => {
1206
1098
  throw await de_ValidationExceptionRes(parsedOutput, context);
1207
1099
  default:
1208
1100
  const parsedBody = parsedOutput.body;
1209
- (0, smithy_client_1.throwDefaultError)({
1101
+ return throwDefaultError({
1210
1102
  output,
1211
1103
  parsedBody,
1212
- exceptionCtor: IvschatServiceException_1.IvschatServiceException,
1213
1104
  errorCode,
1214
1105
  });
1215
1106
  }
@@ -1218,40 +1109,23 @@ const de_UpdateRoomCommand = async (output, context) => {
1218
1109
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1219
1110
  return de_UpdateRoomCommandError(output, context);
1220
1111
  }
1221
- const contents = map({
1112
+ const contents = (0, smithy_client_1.map)({
1222
1113
  $metadata: deserializeMetadata(output),
1223
1114
  });
1224
1115
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1225
- if (data.arn != null) {
1226
- contents.arn = (0, smithy_client_1.expectString)(data.arn);
1227
- }
1228
- if (data.createTime != null) {
1229
- contents.createTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(data.createTime));
1230
- }
1231
- if (data.id != null) {
1232
- contents.id = (0, smithy_client_1.expectString)(data.id);
1233
- }
1234
- if (data.loggingConfigurationIdentifiers != null) {
1235
- contents.loggingConfigurationIdentifiers = de_LoggingConfigurationIdentifierList(data.loggingConfigurationIdentifiers, context);
1236
- }
1237
- if (data.maximumMessageLength != null) {
1238
- contents.maximumMessageLength = (0, smithy_client_1.expectInt32)(data.maximumMessageLength);
1239
- }
1240
- if (data.maximumMessageRatePerSecond != null) {
1241
- contents.maximumMessageRatePerSecond = (0, smithy_client_1.expectInt32)(data.maximumMessageRatePerSecond);
1242
- }
1243
- if (data.messageReviewHandler != null) {
1244
- contents.messageReviewHandler = de_MessageReviewHandler(data.messageReviewHandler, context);
1245
- }
1246
- if (data.name != null) {
1247
- contents.name = (0, smithy_client_1.expectString)(data.name);
1248
- }
1249
- if (data.tags != null) {
1250
- contents.tags = de_Tags(data.tags, context);
1251
- }
1252
- if (data.updateTime != null) {
1253
- contents.updateTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(data.updateTime));
1254
- }
1116
+ const doc = (0, smithy_client_1.take)(data, {
1117
+ arn: smithy_client_1.expectString,
1118
+ createTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
1119
+ id: smithy_client_1.expectString,
1120
+ loggingConfigurationIdentifiers: smithy_client_1._json,
1121
+ maximumMessageLength: smithy_client_1.expectInt32,
1122
+ maximumMessageRatePerSecond: smithy_client_1.expectInt32,
1123
+ messageReviewHandler: smithy_client_1._json,
1124
+ name: smithy_client_1.expectString,
1125
+ tags: smithy_client_1._json,
1126
+ updateTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
1127
+ });
1128
+ Object.assign(contents, doc);
1255
1129
  return contents;
1256
1130
  };
1257
1131
  exports.de_UpdateRoomCommand = de_UpdateRoomCommand;
@@ -1276,21 +1150,21 @@ const de_UpdateRoomCommandError = async (output, context) => {
1276
1150
  throw await de_ValidationExceptionRes(parsedOutput, context);
1277
1151
  default:
1278
1152
  const parsedBody = parsedOutput.body;
1279
- (0, smithy_client_1.throwDefaultError)({
1153
+ return throwDefaultError({
1280
1154
  output,
1281
1155
  parsedBody,
1282
- exceptionCtor: IvschatServiceException_1.IvschatServiceException,
1283
1156
  errorCode,
1284
1157
  });
1285
1158
  }
1286
1159
  };
1287
- const map = smithy_client_1.map;
1160
+ const throwDefaultError = (0, smithy_client_1.withBaseException)(IvschatServiceException_1.IvschatServiceException);
1288
1161
  const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
1289
- const contents = map({});
1162
+ const contents = (0, smithy_client_1.map)({});
1290
1163
  const data = parsedOutput.body;
1291
- if (data.message != null) {
1292
- contents.message = (0, smithy_client_1.expectString)(data.message);
1293
- }
1164
+ const doc = (0, smithy_client_1.take)(data, {
1165
+ message: smithy_client_1.expectString,
1166
+ });
1167
+ Object.assign(contents, doc);
1294
1168
  const exception = new models_0_1.AccessDeniedException({
1295
1169
  $metadata: deserializeMetadata(parsedOutput),
1296
1170
  ...contents,
@@ -1298,17 +1172,14 @@ const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
1298
1172
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1299
1173
  };
1300
1174
  const de_ConflictExceptionRes = async (parsedOutput, context) => {
1301
- const contents = map({});
1175
+ const contents = (0, smithy_client_1.map)({});
1302
1176
  const data = parsedOutput.body;
1303
- if (data.message != null) {
1304
- contents.message = (0, smithy_client_1.expectString)(data.message);
1305
- }
1306
- if (data.resourceId != null) {
1307
- contents.resourceId = (0, smithy_client_1.expectString)(data.resourceId);
1308
- }
1309
- if (data.resourceType != null) {
1310
- contents.resourceType = (0, smithy_client_1.expectString)(data.resourceType);
1311
- }
1177
+ const doc = (0, smithy_client_1.take)(data, {
1178
+ message: smithy_client_1.expectString,
1179
+ resourceId: smithy_client_1.expectString,
1180
+ resourceType: smithy_client_1.expectString,
1181
+ });
1182
+ Object.assign(contents, doc);
1312
1183
  const exception = new models_0_1.ConflictException({
1313
1184
  $metadata: deserializeMetadata(parsedOutput),
1314
1185
  ...contents,
@@ -1316,11 +1187,12 @@ const de_ConflictExceptionRes = async (parsedOutput, context) => {
1316
1187
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1317
1188
  };
1318
1189
  const de_InternalServerExceptionRes = async (parsedOutput, context) => {
1319
- const contents = map({});
1190
+ const contents = (0, smithy_client_1.map)({});
1320
1191
  const data = parsedOutput.body;
1321
- if (data.message != null) {
1322
- contents.message = (0, smithy_client_1.expectString)(data.message);
1323
- }
1192
+ const doc = (0, smithy_client_1.take)(data, {
1193
+ message: smithy_client_1.expectString,
1194
+ });
1195
+ Object.assign(contents, doc);
1324
1196
  const exception = new models_0_1.InternalServerException({
1325
1197
  $metadata: deserializeMetadata(parsedOutput),
1326
1198
  ...contents,
@@ -1328,11 +1200,12 @@ const de_InternalServerExceptionRes = async (parsedOutput, context) => {
1328
1200
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1329
1201
  };
1330
1202
  const de_PendingVerificationRes = async (parsedOutput, context) => {
1331
- const contents = map({});
1203
+ const contents = (0, smithy_client_1.map)({});
1332
1204
  const data = parsedOutput.body;
1333
- if (data.message != null) {
1334
- contents.message = (0, smithy_client_1.expectString)(data.message);
1335
- }
1205
+ const doc = (0, smithy_client_1.take)(data, {
1206
+ message: smithy_client_1.expectString,
1207
+ });
1208
+ Object.assign(contents, doc);
1336
1209
  const exception = new models_0_1.PendingVerification({
1337
1210
  $metadata: deserializeMetadata(parsedOutput),
1338
1211
  ...contents,
@@ -1340,17 +1213,14 @@ const de_PendingVerificationRes = async (parsedOutput, context) => {
1340
1213
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1341
1214
  };
1342
1215
  const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
1343
- const contents = map({});
1216
+ const contents = (0, smithy_client_1.map)({});
1344
1217
  const data = parsedOutput.body;
1345
- if (data.message != null) {
1346
- contents.message = (0, smithy_client_1.expectString)(data.message);
1347
- }
1348
- if (data.resourceId != null) {
1349
- contents.resourceId = (0, smithy_client_1.expectString)(data.resourceId);
1350
- }
1351
- if (data.resourceType != null) {
1352
- contents.resourceType = (0, smithy_client_1.expectString)(data.resourceType);
1353
- }
1218
+ const doc = (0, smithy_client_1.take)(data, {
1219
+ message: smithy_client_1.expectString,
1220
+ resourceId: smithy_client_1.expectString,
1221
+ resourceType: smithy_client_1.expectString,
1222
+ });
1223
+ Object.assign(contents, doc);
1354
1224
  const exception = new models_0_1.ResourceNotFoundException({
1355
1225
  $metadata: deserializeMetadata(parsedOutput),
1356
1226
  ...contents,
@@ -1358,20 +1228,15 @@ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
1358
1228
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1359
1229
  };
1360
1230
  const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
1361
- const contents = map({});
1231
+ const contents = (0, smithy_client_1.map)({});
1362
1232
  const data = parsedOutput.body;
1363
- if (data.limit != null) {
1364
- contents.limit = (0, smithy_client_1.expectInt32)(data.limit);
1365
- }
1366
- if (data.message != null) {
1367
- contents.message = (0, smithy_client_1.expectString)(data.message);
1368
- }
1369
- if (data.resourceId != null) {
1370
- contents.resourceId = (0, smithy_client_1.expectString)(data.resourceId);
1371
- }
1372
- if (data.resourceType != null) {
1373
- contents.resourceType = (0, smithy_client_1.expectString)(data.resourceType);
1374
- }
1233
+ const doc = (0, smithy_client_1.take)(data, {
1234
+ limit: smithy_client_1.expectInt32,
1235
+ message: smithy_client_1.expectString,
1236
+ resourceId: smithy_client_1.expectString,
1237
+ resourceType: smithy_client_1.expectString,
1238
+ });
1239
+ Object.assign(contents, doc);
1375
1240
  const exception = new models_0_1.ServiceQuotaExceededException({
1376
1241
  $metadata: deserializeMetadata(parsedOutput),
1377
1242
  ...contents,
@@ -1379,20 +1244,15 @@ const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
1379
1244
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1380
1245
  };
1381
1246
  const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
1382
- const contents = map({});
1247
+ const contents = (0, smithy_client_1.map)({});
1383
1248
  const data = parsedOutput.body;
1384
- if (data.limit != null) {
1385
- contents.limit = (0, smithy_client_1.expectInt32)(data.limit);
1386
- }
1387
- if (data.message != null) {
1388
- contents.message = (0, smithy_client_1.expectString)(data.message);
1389
- }
1390
- if (data.resourceId != null) {
1391
- contents.resourceId = (0, smithy_client_1.expectString)(data.resourceId);
1392
- }
1393
- if (data.resourceType != null) {
1394
- contents.resourceType = (0, smithy_client_1.expectString)(data.resourceType);
1395
- }
1249
+ const doc = (0, smithy_client_1.take)(data, {
1250
+ limit: smithy_client_1.expectInt32,
1251
+ message: smithy_client_1.expectString,
1252
+ resourceId: smithy_client_1.expectString,
1253
+ resourceType: smithy_client_1.expectString,
1254
+ });
1255
+ Object.assign(contents, doc);
1396
1256
  const exception = new models_0_1.ThrottlingException({
1397
1257
  $metadata: deserializeMetadata(parsedOutput),
1398
1258
  ...contents,
@@ -1400,218 +1260,59 @@ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
1400
1260
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1401
1261
  };
1402
1262
  const de_ValidationExceptionRes = async (parsedOutput, context) => {
1403
- const contents = map({});
1263
+ const contents = (0, smithy_client_1.map)({});
1404
1264
  const data = parsedOutput.body;
1405
- if (data.fieldList != null) {
1406
- contents.fieldList = de_ValidationExceptionFieldList(data.fieldList, context);
1407
- }
1408
- if (data.message != null) {
1409
- contents.message = (0, smithy_client_1.expectString)(data.message);
1410
- }
1411
- if (data.reason != null) {
1412
- contents.reason = (0, smithy_client_1.expectString)(data.reason);
1413
- }
1265
+ const doc = (0, smithy_client_1.take)(data, {
1266
+ fieldList: smithy_client_1._json,
1267
+ message: smithy_client_1.expectString,
1268
+ reason: smithy_client_1.expectString,
1269
+ });
1270
+ Object.assign(contents, doc);
1414
1271
  const exception = new models_0_1.ValidationException({
1415
1272
  $metadata: deserializeMetadata(parsedOutput),
1416
1273
  ...contents,
1417
1274
  });
1418
1275
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1419
1276
  };
1420
- const se_ChatTokenAttributes = (input, context) => {
1421
- return Object.entries(input).reduce((acc, [key, value]) => {
1422
- if (value === null) {
1423
- return acc;
1424
- }
1425
- acc[key] = value;
1426
- return acc;
1427
- }, {});
1428
- };
1429
- const se_ChatTokenCapabilities = (input, context) => {
1430
- return input
1431
- .filter((e) => e != null)
1432
- .map((entry) => {
1433
- return entry;
1434
- });
1435
- };
1436
- const se_CloudWatchLogsDestinationConfiguration = (input, context) => {
1437
- return {
1438
- ...(input.logGroupName != null && { logGroupName: input.logGroupName }),
1439
- };
1440
- };
1441
- const se_DestinationConfiguration = (input, context) => {
1442
- return models_0_1.DestinationConfiguration.visit(input, {
1443
- cloudWatchLogs: (value) => ({ cloudWatchLogs: se_CloudWatchLogsDestinationConfiguration(value, context) }),
1444
- firehose: (value) => ({ firehose: se_FirehoseDestinationConfiguration(value, context) }),
1445
- s3: (value) => ({ s3: se_S3DestinationConfiguration(value, context) }),
1446
- _: (name, value) => ({ name: value }),
1447
- });
1448
- };
1449
- const se_EventAttributes = (input, context) => {
1450
- return Object.entries(input).reduce((acc, [key, value]) => {
1451
- if (value === null) {
1452
- return acc;
1453
- }
1454
- acc[key] = value;
1455
- return acc;
1456
- }, {});
1457
- };
1458
- const se_FirehoseDestinationConfiguration = (input, context) => {
1459
- return {
1460
- ...(input.deliveryStreamName != null && { deliveryStreamName: input.deliveryStreamName }),
1461
- };
1462
- };
1463
- const se_LoggingConfigurationIdentifierList = (input, context) => {
1464
- return input
1465
- .filter((e) => e != null)
1466
- .map((entry) => {
1467
- return entry;
1468
- });
1469
- };
1470
- const se_MessageReviewHandler = (input, context) => {
1471
- return {
1472
- ...(input.fallbackResult != null && { fallbackResult: input.fallbackResult }),
1473
- ...(input.uri != null && { uri: input.uri }),
1474
- };
1475
- };
1476
- const se_S3DestinationConfiguration = (input, context) => {
1477
- return {
1478
- ...(input.bucketName != null && { bucketName: input.bucketName }),
1479
- };
1480
- };
1481
- const se_Tags = (input, context) => {
1482
- return Object.entries(input).reduce((acc, [key, value]) => {
1483
- if (value === null) {
1484
- return acc;
1485
- }
1486
- acc[key] = value;
1487
- return acc;
1488
- }, {});
1489
- };
1490
- const de_CloudWatchLogsDestinationConfiguration = (output, context) => {
1491
- return {
1492
- logGroupName: (0, smithy_client_1.expectString)(output.logGroupName),
1493
- };
1494
- };
1495
- const de_DestinationConfiguration = (output, context) => {
1496
- if (output.cloudWatchLogs != null) {
1497
- return {
1498
- cloudWatchLogs: de_CloudWatchLogsDestinationConfiguration(output.cloudWatchLogs, context),
1499
- };
1500
- }
1501
- if (output.firehose != null) {
1502
- return {
1503
- firehose: de_FirehoseDestinationConfiguration(output.firehose, context),
1504
- };
1505
- }
1506
- if (output.s3 != null) {
1507
- return {
1508
- s3: de_S3DestinationConfiguration(output.s3, context),
1509
- };
1510
- }
1511
- return { $unknown: Object.entries(output)[0] };
1512
- };
1513
- const de_FirehoseDestinationConfiguration = (output, context) => {
1514
- return {
1515
- deliveryStreamName: (0, smithy_client_1.expectString)(output.deliveryStreamName),
1516
- };
1517
- };
1518
- const de_LoggingConfigurationIdentifierList = (output, context) => {
1519
- const retVal = (output || [])
1520
- .filter((e) => e != null)
1521
- .map((entry) => {
1522
- if (entry === null) {
1523
- return null;
1524
- }
1525
- return (0, smithy_client_1.expectString)(entry);
1526
- });
1527
- return retVal;
1528
- };
1529
1277
  const de_LoggingConfigurationList = (output, context) => {
1530
1278
  const retVal = (output || [])
1531
1279
  .filter((e) => e != null)
1532
1280
  .map((entry) => {
1533
- if (entry === null) {
1534
- return null;
1535
- }
1536
1281
  return de_LoggingConfigurationSummary(entry, context);
1537
1282
  });
1538
1283
  return retVal;
1539
1284
  };
1540
1285
  const de_LoggingConfigurationSummary = (output, context) => {
1541
- return {
1542
- arn: (0, smithy_client_1.expectString)(output.arn),
1543
- createTime: output.createTime != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(output.createTime)) : undefined,
1544
- destinationConfiguration: output.destinationConfiguration != null
1545
- ? de_DestinationConfiguration((0, smithy_client_1.expectUnion)(output.destinationConfiguration), context)
1546
- : undefined,
1547
- id: (0, smithy_client_1.expectString)(output.id),
1548
- name: (0, smithy_client_1.expectString)(output.name),
1549
- state: (0, smithy_client_1.expectString)(output.state),
1550
- tags: output.tags != null ? de_Tags(output.tags, context) : undefined,
1551
- updateTime: output.updateTime != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(output.updateTime)) : undefined,
1552
- };
1553
- };
1554
- const de_MessageReviewHandler = (output, context) => {
1555
- return {
1556
- fallbackResult: (0, smithy_client_1.expectString)(output.fallbackResult),
1557
- uri: (0, smithy_client_1.expectString)(output.uri),
1558
- };
1286
+ return (0, smithy_client_1.take)(output, {
1287
+ arn: smithy_client_1.expectString,
1288
+ createTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
1289
+ destinationConfiguration: (_) => (0, smithy_client_1._json)((0, smithy_client_1.expectUnion)(_)),
1290
+ id: smithy_client_1.expectString,
1291
+ name: smithy_client_1.expectString,
1292
+ state: smithy_client_1.expectString,
1293
+ tags: smithy_client_1._json,
1294
+ updateTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
1295
+ });
1559
1296
  };
1560
1297
  const de_RoomList = (output, context) => {
1561
1298
  const retVal = (output || [])
1562
1299
  .filter((e) => e != null)
1563
1300
  .map((entry) => {
1564
- if (entry === null) {
1565
- return null;
1566
- }
1567
1301
  return de_RoomSummary(entry, context);
1568
1302
  });
1569
1303
  return retVal;
1570
1304
  };
1571
1305
  const de_RoomSummary = (output, context) => {
1572
- return {
1573
- arn: (0, smithy_client_1.expectString)(output.arn),
1574
- createTime: output.createTime != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(output.createTime)) : undefined,
1575
- id: (0, smithy_client_1.expectString)(output.id),
1576
- loggingConfigurationIdentifiers: output.loggingConfigurationIdentifiers != null
1577
- ? de_LoggingConfigurationIdentifierList(output.loggingConfigurationIdentifiers, context)
1578
- : undefined,
1579
- messageReviewHandler: output.messageReviewHandler != null ? de_MessageReviewHandler(output.messageReviewHandler, context) : undefined,
1580
- name: (0, smithy_client_1.expectString)(output.name),
1581
- tags: output.tags != null ? de_Tags(output.tags, context) : undefined,
1582
- updateTime: output.updateTime != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(output.updateTime)) : undefined,
1583
- };
1584
- };
1585
- const de_S3DestinationConfiguration = (output, context) => {
1586
- return {
1587
- bucketName: (0, smithy_client_1.expectString)(output.bucketName),
1588
- };
1589
- };
1590
- const de_Tags = (output, context) => {
1591
- return Object.entries(output).reduce((acc, [key, value]) => {
1592
- if (value === null) {
1593
- return acc;
1594
- }
1595
- acc[key] = (0, smithy_client_1.expectString)(value);
1596
- return acc;
1597
- }, {});
1598
- };
1599
- const de_ValidationExceptionField = (output, context) => {
1600
- return {
1601
- message: (0, smithy_client_1.expectString)(output.message),
1602
- name: (0, smithy_client_1.expectString)(output.name),
1603
- };
1604
- };
1605
- const de_ValidationExceptionFieldList = (output, context) => {
1606
- const retVal = (output || [])
1607
- .filter((e) => e != null)
1608
- .map((entry) => {
1609
- if (entry === null) {
1610
- return null;
1611
- }
1612
- return de_ValidationExceptionField(entry, context);
1306
+ return (0, smithy_client_1.take)(output, {
1307
+ arn: smithy_client_1.expectString,
1308
+ createTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
1309
+ id: smithy_client_1.expectString,
1310
+ loggingConfigurationIdentifiers: smithy_client_1._json,
1311
+ messageReviewHandler: smithy_client_1._json,
1312
+ name: smithy_client_1.expectString,
1313
+ tags: smithy_client_1._json,
1314
+ updateTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
1613
1315
  });
1614
- return retVal;
1615
1316
  };
1616
1317
  const deserializeMetadata = (output) => ({
1617
1318
  httpStatusCode: output.statusCode,