@aws-sdk/client-pinpoint-sms-voice 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,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PinpointSMSVoice = void 0;
4
+ const smithy_client_1 = require("@aws-sdk/smithy-client");
4
5
  const CreateConfigurationSetCommand_1 = require("./commands/CreateConfigurationSetCommand");
5
6
  const CreateConfigurationSetEventDestinationCommand_1 = require("./commands/CreateConfigurationSetEventDestinationCommand");
6
7
  const DeleteConfigurationSetCommand_1 = require("./commands/DeleteConfigurationSetCommand");
@@ -10,118 +11,17 @@ const ListConfigurationSetsCommand_1 = require("./commands/ListConfigurationSets
10
11
  const SendVoiceMessageCommand_1 = require("./commands/SendVoiceMessageCommand");
11
12
  const UpdateConfigurationSetEventDestinationCommand_1 = require("./commands/UpdateConfigurationSetEventDestinationCommand");
12
13
  const PinpointSMSVoiceClient_1 = require("./PinpointSMSVoiceClient");
14
+ const commands = {
15
+ CreateConfigurationSetCommand: CreateConfigurationSetCommand_1.CreateConfigurationSetCommand,
16
+ CreateConfigurationSetEventDestinationCommand: CreateConfigurationSetEventDestinationCommand_1.CreateConfigurationSetEventDestinationCommand,
17
+ DeleteConfigurationSetCommand: DeleteConfigurationSetCommand_1.DeleteConfigurationSetCommand,
18
+ DeleteConfigurationSetEventDestinationCommand: DeleteConfigurationSetEventDestinationCommand_1.DeleteConfigurationSetEventDestinationCommand,
19
+ GetConfigurationSetEventDestinationsCommand: GetConfigurationSetEventDestinationsCommand_1.GetConfigurationSetEventDestinationsCommand,
20
+ ListConfigurationSetsCommand: ListConfigurationSetsCommand_1.ListConfigurationSetsCommand,
21
+ SendVoiceMessageCommand: SendVoiceMessageCommand_1.SendVoiceMessageCommand,
22
+ UpdateConfigurationSetEventDestinationCommand: UpdateConfigurationSetEventDestinationCommand_1.UpdateConfigurationSetEventDestinationCommand,
23
+ };
13
24
  class PinpointSMSVoice extends PinpointSMSVoiceClient_1.PinpointSMSVoiceClient {
14
- createConfigurationSet(args, optionsOrCb, cb) {
15
- const command = new CreateConfigurationSetCommand_1.CreateConfigurationSetCommand(args);
16
- if (typeof optionsOrCb === "function") {
17
- this.send(command, optionsOrCb);
18
- }
19
- else if (typeof cb === "function") {
20
- if (typeof optionsOrCb !== "object")
21
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
22
- this.send(command, optionsOrCb || {}, cb);
23
- }
24
- else {
25
- return this.send(command, optionsOrCb);
26
- }
27
- }
28
- createConfigurationSetEventDestination(args, optionsOrCb, cb) {
29
- const command = new CreateConfigurationSetEventDestinationCommand_1.CreateConfigurationSetEventDestinationCommand(args);
30
- if (typeof optionsOrCb === "function") {
31
- this.send(command, optionsOrCb);
32
- }
33
- else if (typeof cb === "function") {
34
- if (typeof optionsOrCb !== "object")
35
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
36
- this.send(command, optionsOrCb || {}, cb);
37
- }
38
- else {
39
- return this.send(command, optionsOrCb);
40
- }
41
- }
42
- deleteConfigurationSet(args, optionsOrCb, cb) {
43
- const command = new DeleteConfigurationSetCommand_1.DeleteConfigurationSetCommand(args);
44
- if (typeof optionsOrCb === "function") {
45
- this.send(command, optionsOrCb);
46
- }
47
- else if (typeof cb === "function") {
48
- if (typeof optionsOrCb !== "object")
49
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
50
- this.send(command, optionsOrCb || {}, cb);
51
- }
52
- else {
53
- return this.send(command, optionsOrCb);
54
- }
55
- }
56
- deleteConfigurationSetEventDestination(args, optionsOrCb, cb) {
57
- const command = new DeleteConfigurationSetEventDestinationCommand_1.DeleteConfigurationSetEventDestinationCommand(args);
58
- if (typeof optionsOrCb === "function") {
59
- this.send(command, optionsOrCb);
60
- }
61
- else if (typeof cb === "function") {
62
- if (typeof optionsOrCb !== "object")
63
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
64
- this.send(command, optionsOrCb || {}, cb);
65
- }
66
- else {
67
- return this.send(command, optionsOrCb);
68
- }
69
- }
70
- getConfigurationSetEventDestinations(args, optionsOrCb, cb) {
71
- const command = new GetConfigurationSetEventDestinationsCommand_1.GetConfigurationSetEventDestinationsCommand(args);
72
- if (typeof optionsOrCb === "function") {
73
- this.send(command, optionsOrCb);
74
- }
75
- else if (typeof cb === "function") {
76
- if (typeof optionsOrCb !== "object")
77
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
78
- this.send(command, optionsOrCb || {}, cb);
79
- }
80
- else {
81
- return this.send(command, optionsOrCb);
82
- }
83
- }
84
- listConfigurationSets(args, optionsOrCb, cb) {
85
- const command = new ListConfigurationSetsCommand_1.ListConfigurationSetsCommand(args);
86
- if (typeof optionsOrCb === "function") {
87
- this.send(command, optionsOrCb);
88
- }
89
- else if (typeof cb === "function") {
90
- if (typeof optionsOrCb !== "object")
91
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
92
- this.send(command, optionsOrCb || {}, cb);
93
- }
94
- else {
95
- return this.send(command, optionsOrCb);
96
- }
97
- }
98
- sendVoiceMessage(args, optionsOrCb, cb) {
99
- const command = new SendVoiceMessageCommand_1.SendVoiceMessageCommand(args);
100
- if (typeof optionsOrCb === "function") {
101
- this.send(command, optionsOrCb);
102
- }
103
- else if (typeof cb === "function") {
104
- if (typeof optionsOrCb !== "object")
105
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
106
- this.send(command, optionsOrCb || {}, cb);
107
- }
108
- else {
109
- return this.send(command, optionsOrCb);
110
- }
111
- }
112
- updateConfigurationSetEventDestination(args, optionsOrCb, cb) {
113
- const command = new UpdateConfigurationSetEventDestinationCommand_1.UpdateConfigurationSetEventDestinationCommand(args);
114
- if (typeof optionsOrCb === "function") {
115
- this.send(command, optionsOrCb);
116
- }
117
- else if (typeof cb === "function") {
118
- if (typeof optionsOrCb !== "object")
119
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
120
- this.send(command, optionsOrCb || {}, cb);
121
- }
122
- else {
123
- return this.send(command, optionsOrCb);
124
- }
125
- }
126
25
  }
127
26
  exports.PinpointSMSVoice = PinpointSMSVoice;
27
+ (0, smithy_client_1.createAggregatedClient)(commands, PinpointSMSVoice);
@@ -12,9 +12,9 @@ const se_CreateConfigurationSetCommand = async (input, context) => {
12
12
  };
13
13
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/sms-voice/configuration-sets";
14
14
  let body;
15
- body = JSON.stringify({
16
- ...(input.ConfigurationSetName != null && { ConfigurationSetName: input.ConfigurationSetName }),
17
- });
15
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
16
+ ConfigurationSetName: [],
17
+ }));
18
18
  return new protocol_http_1.HttpRequest({
19
19
  protocol,
20
20
  hostname,
@@ -35,12 +35,10 @@ const se_CreateConfigurationSetEventDestinationCommand = async (input, context)
35
35
  "/v1/sms-voice/configuration-sets/{ConfigurationSetName}/event-destinations";
36
36
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ConfigurationSetName", () => input.ConfigurationSetName, "{ConfigurationSetName}", false);
37
37
  let body;
38
- body = JSON.stringify({
39
- ...(input.EventDestination != null && {
40
- EventDestination: se_EventDestinationDefinition(input.EventDestination, context),
41
- }),
42
- ...(input.EventDestinationName != null && { EventDestinationName: input.EventDestinationName }),
43
- });
38
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
39
+ EventDestination: (_) => (0, smithy_client_1._json)(_),
40
+ EventDestinationName: [],
41
+ }));
44
42
  return new protocol_http_1.HttpRequest({
45
43
  protocol,
46
44
  hostname,
@@ -111,7 +109,7 @@ const se_ListConfigurationSetsCommand = async (input, context) => {
111
109
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
112
110
  const headers = {};
113
111
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/sms-voice/configuration-sets";
114
- const query = map({
112
+ const query = (0, smithy_client_1.map)({
115
113
  NextToken: [, input.NextToken],
116
114
  PageSize: [, input.PageSize],
117
115
  });
@@ -135,13 +133,13 @@ const se_SendVoiceMessageCommand = async (input, context) => {
135
133
  };
136
134
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/sms-voice/voice/message";
137
135
  let body;
138
- body = JSON.stringify({
139
- ...(input.CallerId != null && { CallerId: input.CallerId }),
140
- ...(input.ConfigurationSetName != null && { ConfigurationSetName: input.ConfigurationSetName }),
141
- ...(input.Content != null && { Content: se_VoiceMessageContent(input.Content, context) }),
142
- ...(input.DestinationPhoneNumber != null && { DestinationPhoneNumber: input.DestinationPhoneNumber }),
143
- ...(input.OriginationPhoneNumber != null && { OriginationPhoneNumber: input.OriginationPhoneNumber }),
144
- });
136
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
137
+ CallerId: [],
138
+ ConfigurationSetName: [],
139
+ Content: (_) => (0, smithy_client_1._json)(_),
140
+ DestinationPhoneNumber: [],
141
+ OriginationPhoneNumber: [],
142
+ }));
145
143
  return new protocol_http_1.HttpRequest({
146
144
  protocol,
147
145
  hostname,
@@ -163,11 +161,9 @@ const se_UpdateConfigurationSetEventDestinationCommand = async (input, context)
163
161
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ConfigurationSetName", () => input.ConfigurationSetName, "{ConfigurationSetName}", false);
164
162
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "EventDestinationName", () => input.EventDestinationName, "{EventDestinationName}", false);
165
163
  let body;
166
- body = JSON.stringify({
167
- ...(input.EventDestination != null && {
168
- EventDestination: se_EventDestinationDefinition(input.EventDestination, context),
169
- }),
170
- });
164
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
165
+ EventDestination: (_) => (0, smithy_client_1._json)(_),
166
+ }));
171
167
  return new protocol_http_1.HttpRequest({
172
168
  protocol,
173
169
  hostname,
@@ -183,7 +179,7 @@ const de_CreateConfigurationSetCommand = async (output, context) => {
183
179
  if (output.statusCode !== 200 && output.statusCode >= 300) {
184
180
  return de_CreateConfigurationSetCommandError(output, context);
185
181
  }
186
- const contents = map({
182
+ const contents = (0, smithy_client_1.map)({
187
183
  $metadata: deserializeMetadata(output),
188
184
  });
189
185
  await collectBody(output.body, context);
@@ -214,10 +210,9 @@ const de_CreateConfigurationSetCommandError = async (output, context) => {
214
210
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
215
211
  default:
216
212
  const parsedBody = parsedOutput.body;
217
- (0, smithy_client_1.throwDefaultError)({
213
+ return throwDefaultError({
218
214
  output,
219
215
  parsedBody,
220
- exceptionCtor: PinpointSMSVoiceServiceException_1.PinpointSMSVoiceServiceException,
221
216
  errorCode,
222
217
  });
223
218
  }
@@ -226,7 +221,7 @@ const de_CreateConfigurationSetEventDestinationCommand = async (output, context)
226
221
  if (output.statusCode !== 200 && output.statusCode >= 300) {
227
222
  return de_CreateConfigurationSetEventDestinationCommandError(output, context);
228
223
  }
229
- const contents = map({
224
+ const contents = (0, smithy_client_1.map)({
230
225
  $metadata: deserializeMetadata(output),
231
226
  });
232
227
  await collectBody(output.body, context);
@@ -260,10 +255,9 @@ const de_CreateConfigurationSetEventDestinationCommandError = async (output, con
260
255
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
261
256
  default:
262
257
  const parsedBody = parsedOutput.body;
263
- (0, smithy_client_1.throwDefaultError)({
258
+ return throwDefaultError({
264
259
  output,
265
260
  parsedBody,
266
- exceptionCtor: PinpointSMSVoiceServiceException_1.PinpointSMSVoiceServiceException,
267
261
  errorCode,
268
262
  });
269
263
  }
@@ -272,7 +266,7 @@ const de_DeleteConfigurationSetCommand = async (output, context) => {
272
266
  if (output.statusCode !== 200 && output.statusCode >= 300) {
273
267
  return de_DeleteConfigurationSetCommandError(output, context);
274
268
  }
275
- const contents = map({
269
+ const contents = (0, smithy_client_1.map)({
276
270
  $metadata: deserializeMetadata(output),
277
271
  });
278
272
  await collectBody(output.body, context);
@@ -300,10 +294,9 @@ const de_DeleteConfigurationSetCommandError = async (output, context) => {
300
294
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
301
295
  default:
302
296
  const parsedBody = parsedOutput.body;
303
- (0, smithy_client_1.throwDefaultError)({
297
+ return throwDefaultError({
304
298
  output,
305
299
  parsedBody,
306
- exceptionCtor: PinpointSMSVoiceServiceException_1.PinpointSMSVoiceServiceException,
307
300
  errorCode,
308
301
  });
309
302
  }
@@ -312,7 +305,7 @@ const de_DeleteConfigurationSetEventDestinationCommand = async (output, context)
312
305
  if (output.statusCode !== 200 && output.statusCode >= 300) {
313
306
  return de_DeleteConfigurationSetEventDestinationCommandError(output, context);
314
307
  }
315
- const contents = map({
308
+ const contents = (0, smithy_client_1.map)({
316
309
  $metadata: deserializeMetadata(output),
317
310
  });
318
311
  await collectBody(output.body, context);
@@ -340,10 +333,9 @@ const de_DeleteConfigurationSetEventDestinationCommandError = async (output, con
340
333
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
341
334
  default:
342
335
  const parsedBody = parsedOutput.body;
343
- (0, smithy_client_1.throwDefaultError)({
336
+ return throwDefaultError({
344
337
  output,
345
338
  parsedBody,
346
- exceptionCtor: PinpointSMSVoiceServiceException_1.PinpointSMSVoiceServiceException,
347
339
  errorCode,
348
340
  });
349
341
  }
@@ -352,13 +344,14 @@ const de_GetConfigurationSetEventDestinationsCommand = async (output, context) =
352
344
  if (output.statusCode !== 200 && output.statusCode >= 300) {
353
345
  return de_GetConfigurationSetEventDestinationsCommandError(output, context);
354
346
  }
355
- const contents = map({
347
+ const contents = (0, smithy_client_1.map)({
356
348
  $metadata: deserializeMetadata(output),
357
349
  });
358
350
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
359
- if (data.EventDestinations != null) {
360
- contents.EventDestinations = de_EventDestinations(data.EventDestinations, context);
361
- }
351
+ const doc = (0, smithy_client_1.take)(data, {
352
+ EventDestinations: smithy_client_1._json,
353
+ });
354
+ Object.assign(contents, doc);
362
355
  return contents;
363
356
  };
364
357
  exports.de_GetConfigurationSetEventDestinationsCommand = de_GetConfigurationSetEventDestinationsCommand;
@@ -383,10 +376,9 @@ const de_GetConfigurationSetEventDestinationsCommandError = async (output, conte
383
376
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
384
377
  default:
385
378
  const parsedBody = parsedOutput.body;
386
- (0, smithy_client_1.throwDefaultError)({
379
+ return throwDefaultError({
387
380
  output,
388
381
  parsedBody,
389
- exceptionCtor: PinpointSMSVoiceServiceException_1.PinpointSMSVoiceServiceException,
390
382
  errorCode,
391
383
  });
392
384
  }
@@ -395,16 +387,15 @@ const de_ListConfigurationSetsCommand = async (output, context) => {
395
387
  if (output.statusCode !== 200 && output.statusCode >= 300) {
396
388
  return de_ListConfigurationSetsCommandError(output, context);
397
389
  }
398
- const contents = map({
390
+ const contents = (0, smithy_client_1.map)({
399
391
  $metadata: deserializeMetadata(output),
400
392
  });
401
393
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
402
- if (data.ConfigurationSets != null) {
403
- contents.ConfigurationSets = de_ConfigurationSets(data.ConfigurationSets, context);
404
- }
405
- if (data.NextToken != null) {
406
- contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
407
- }
394
+ const doc = (0, smithy_client_1.take)(data, {
395
+ ConfigurationSets: smithy_client_1._json,
396
+ NextToken: smithy_client_1.expectString,
397
+ });
398
+ Object.assign(contents, doc);
408
399
  return contents;
409
400
  };
410
401
  exports.de_ListConfigurationSetsCommand = de_ListConfigurationSetsCommand;
@@ -426,10 +417,9 @@ const de_ListConfigurationSetsCommandError = async (output, context) => {
426
417
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
427
418
  default:
428
419
  const parsedBody = parsedOutput.body;
429
- (0, smithy_client_1.throwDefaultError)({
420
+ return throwDefaultError({
430
421
  output,
431
422
  parsedBody,
432
- exceptionCtor: PinpointSMSVoiceServiceException_1.PinpointSMSVoiceServiceException,
433
423
  errorCode,
434
424
  });
435
425
  }
@@ -438,13 +428,14 @@ const de_SendVoiceMessageCommand = async (output, context) => {
438
428
  if (output.statusCode !== 200 && output.statusCode >= 300) {
439
429
  return de_SendVoiceMessageCommandError(output, context);
440
430
  }
441
- const contents = map({
431
+ const contents = (0, smithy_client_1.map)({
442
432
  $metadata: deserializeMetadata(output),
443
433
  });
444
434
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
445
- if (data.MessageId != null) {
446
- contents.MessageId = (0, smithy_client_1.expectString)(data.MessageId);
447
- }
435
+ const doc = (0, smithy_client_1.take)(data, {
436
+ MessageId: smithy_client_1.expectString,
437
+ });
438
+ Object.assign(contents, doc);
448
439
  return contents;
449
440
  };
450
441
  exports.de_SendVoiceMessageCommand = de_SendVoiceMessageCommand;
@@ -466,10 +457,9 @@ const de_SendVoiceMessageCommandError = async (output, context) => {
466
457
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
467
458
  default:
468
459
  const parsedBody = parsedOutput.body;
469
- (0, smithy_client_1.throwDefaultError)({
460
+ return throwDefaultError({
470
461
  output,
471
462
  parsedBody,
472
- exceptionCtor: PinpointSMSVoiceServiceException_1.PinpointSMSVoiceServiceException,
473
463
  errorCode,
474
464
  });
475
465
  }
@@ -478,7 +468,7 @@ const de_UpdateConfigurationSetEventDestinationCommand = async (output, context)
478
468
  if (output.statusCode !== 200 && output.statusCode >= 300) {
479
469
  return de_UpdateConfigurationSetEventDestinationCommandError(output, context);
480
470
  }
481
- const contents = map({
471
+ const contents = (0, smithy_client_1.map)({
482
472
  $metadata: deserializeMetadata(output),
483
473
  });
484
474
  await collectBody(output.body, context);
@@ -506,21 +496,21 @@ const de_UpdateConfigurationSetEventDestinationCommandError = async (output, con
506
496
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
507
497
  default:
508
498
  const parsedBody = parsedOutput.body;
509
- (0, smithy_client_1.throwDefaultError)({
499
+ return throwDefaultError({
510
500
  output,
511
501
  parsedBody,
512
- exceptionCtor: PinpointSMSVoiceServiceException_1.PinpointSMSVoiceServiceException,
513
502
  errorCode,
514
503
  });
515
504
  }
516
505
  };
517
- const map = smithy_client_1.map;
506
+ const throwDefaultError = (0, smithy_client_1.withBaseException)(PinpointSMSVoiceServiceException_1.PinpointSMSVoiceServiceException);
518
507
  const de_AlreadyExistsExceptionRes = async (parsedOutput, context) => {
519
- const contents = map({});
508
+ const contents = (0, smithy_client_1.map)({});
520
509
  const data = parsedOutput.body;
521
- if (data.Message != null) {
522
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
523
- }
510
+ const doc = (0, smithy_client_1.take)(data, {
511
+ Message: smithy_client_1.expectString,
512
+ });
513
+ Object.assign(contents, doc);
524
514
  const exception = new models_0_1.AlreadyExistsException({
525
515
  $metadata: deserializeMetadata(parsedOutput),
526
516
  ...contents,
@@ -528,11 +518,12 @@ const de_AlreadyExistsExceptionRes = async (parsedOutput, context) => {
528
518
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
529
519
  };
530
520
  const de_BadRequestExceptionRes = async (parsedOutput, context) => {
531
- const contents = map({});
521
+ const contents = (0, smithy_client_1.map)({});
532
522
  const data = parsedOutput.body;
533
- if (data.Message != null) {
534
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
535
- }
523
+ const doc = (0, smithy_client_1.take)(data, {
524
+ Message: smithy_client_1.expectString,
525
+ });
526
+ Object.assign(contents, doc);
536
527
  const exception = new models_0_1.BadRequestException({
537
528
  $metadata: deserializeMetadata(parsedOutput),
538
529
  ...contents,
@@ -540,11 +531,12 @@ const de_BadRequestExceptionRes = async (parsedOutput, context) => {
540
531
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
541
532
  };
542
533
  const de_InternalServiceErrorExceptionRes = async (parsedOutput, context) => {
543
- const contents = map({});
534
+ const contents = (0, smithy_client_1.map)({});
544
535
  const data = parsedOutput.body;
545
- if (data.Message != null) {
546
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
547
- }
536
+ const doc = (0, smithy_client_1.take)(data, {
537
+ Message: smithy_client_1.expectString,
538
+ });
539
+ Object.assign(contents, doc);
548
540
  const exception = new models_0_1.InternalServiceErrorException({
549
541
  $metadata: deserializeMetadata(parsedOutput),
550
542
  ...contents,
@@ -552,11 +544,12 @@ const de_InternalServiceErrorExceptionRes = async (parsedOutput, context) => {
552
544
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
553
545
  };
554
546
  const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
555
- const contents = map({});
547
+ const contents = (0, smithy_client_1.map)({});
556
548
  const data = parsedOutput.body;
557
- if (data.Message != null) {
558
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
559
- }
549
+ const doc = (0, smithy_client_1.take)(data, {
550
+ Message: smithy_client_1.expectString,
551
+ });
552
+ Object.assign(contents, doc);
560
553
  const exception = new models_0_1.LimitExceededException({
561
554
  $metadata: deserializeMetadata(parsedOutput),
562
555
  ...contents,
@@ -564,11 +557,12 @@ const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
564
557
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
565
558
  };
566
559
  const de_NotFoundExceptionRes = async (parsedOutput, context) => {
567
- const contents = map({});
560
+ const contents = (0, smithy_client_1.map)({});
568
561
  const data = parsedOutput.body;
569
- if (data.Message != null) {
570
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
571
- }
562
+ const doc = (0, smithy_client_1.take)(data, {
563
+ Message: smithy_client_1.expectString,
564
+ });
565
+ Object.assign(contents, doc);
572
566
  const exception = new models_0_1.NotFoundException({
573
567
  $metadata: deserializeMetadata(parsedOutput),
574
568
  ...contents,
@@ -576,148 +570,18 @@ const de_NotFoundExceptionRes = async (parsedOutput, context) => {
576
570
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
577
571
  };
578
572
  const de_TooManyRequestsExceptionRes = async (parsedOutput, context) => {
579
- const contents = map({});
573
+ const contents = (0, smithy_client_1.map)({});
580
574
  const data = parsedOutput.body;
581
- if (data.Message != null) {
582
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
583
- }
575
+ const doc = (0, smithy_client_1.take)(data, {
576
+ Message: smithy_client_1.expectString,
577
+ });
578
+ Object.assign(contents, doc);
584
579
  const exception = new models_0_1.TooManyRequestsException({
585
580
  $metadata: deserializeMetadata(parsedOutput),
586
581
  ...contents,
587
582
  });
588
583
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
589
584
  };
590
- const se_CallInstructionsMessageType = (input, context) => {
591
- return {
592
- ...(input.Text != null && { Text: input.Text }),
593
- };
594
- };
595
- const se_CloudWatchLogsDestination = (input, context) => {
596
- return {
597
- ...(input.IamRoleArn != null && { IamRoleArn: input.IamRoleArn }),
598
- ...(input.LogGroupArn != null && { LogGroupArn: input.LogGroupArn }),
599
- };
600
- };
601
- const se_EventDestinationDefinition = (input, context) => {
602
- return {
603
- ...(input.CloudWatchLogsDestination != null && {
604
- CloudWatchLogsDestination: se_CloudWatchLogsDestination(input.CloudWatchLogsDestination, context),
605
- }),
606
- ...(input.Enabled != null && { Enabled: input.Enabled }),
607
- ...(input.KinesisFirehoseDestination != null && {
608
- KinesisFirehoseDestination: se_KinesisFirehoseDestination(input.KinesisFirehoseDestination, context),
609
- }),
610
- ...(input.MatchingEventTypes != null && { MatchingEventTypes: se_EventTypes(input.MatchingEventTypes, context) }),
611
- ...(input.SnsDestination != null && { SnsDestination: se_SnsDestination(input.SnsDestination, context) }),
612
- };
613
- };
614
- const se_EventTypes = (input, context) => {
615
- return input
616
- .filter((e) => e != null)
617
- .map((entry) => {
618
- return entry;
619
- });
620
- };
621
- const se_KinesisFirehoseDestination = (input, context) => {
622
- return {
623
- ...(input.DeliveryStreamArn != null && { DeliveryStreamArn: input.DeliveryStreamArn }),
624
- ...(input.IamRoleArn != null && { IamRoleArn: input.IamRoleArn }),
625
- };
626
- };
627
- const se_PlainTextMessageType = (input, context) => {
628
- return {
629
- ...(input.LanguageCode != null && { LanguageCode: input.LanguageCode }),
630
- ...(input.Text != null && { Text: input.Text }),
631
- ...(input.VoiceId != null && { VoiceId: input.VoiceId }),
632
- };
633
- };
634
- const se_SnsDestination = (input, context) => {
635
- return {
636
- ...(input.TopicArn != null && { TopicArn: input.TopicArn }),
637
- };
638
- };
639
- const se_SSMLMessageType = (input, context) => {
640
- return {
641
- ...(input.LanguageCode != null && { LanguageCode: input.LanguageCode }),
642
- ...(input.Text != null && { Text: input.Text }),
643
- ...(input.VoiceId != null && { VoiceId: input.VoiceId }),
644
- };
645
- };
646
- const se_VoiceMessageContent = (input, context) => {
647
- return {
648
- ...(input.CallInstructionsMessage != null && {
649
- CallInstructionsMessage: se_CallInstructionsMessageType(input.CallInstructionsMessage, context),
650
- }),
651
- ...(input.PlainTextMessage != null && {
652
- PlainTextMessage: se_PlainTextMessageType(input.PlainTextMessage, context),
653
- }),
654
- ...(input.SSMLMessage != null && { SSMLMessage: se_SSMLMessageType(input.SSMLMessage, context) }),
655
- };
656
- };
657
- const de_CloudWatchLogsDestination = (output, context) => {
658
- return {
659
- IamRoleArn: (0, smithy_client_1.expectString)(output.IamRoleArn),
660
- LogGroupArn: (0, smithy_client_1.expectString)(output.LogGroupArn),
661
- };
662
- };
663
- const de_ConfigurationSets = (output, context) => {
664
- const retVal = (output || [])
665
- .filter((e) => e != null)
666
- .map((entry) => {
667
- if (entry === null) {
668
- return null;
669
- }
670
- return (0, smithy_client_1.expectString)(entry);
671
- });
672
- return retVal;
673
- };
674
- const de_EventDestination = (output, context) => {
675
- return {
676
- CloudWatchLogsDestination: output.CloudWatchLogsDestination != null
677
- ? de_CloudWatchLogsDestination(output.CloudWatchLogsDestination, context)
678
- : undefined,
679
- Enabled: (0, smithy_client_1.expectBoolean)(output.Enabled),
680
- KinesisFirehoseDestination: output.KinesisFirehoseDestination != null
681
- ? de_KinesisFirehoseDestination(output.KinesisFirehoseDestination, context)
682
- : undefined,
683
- MatchingEventTypes: output.MatchingEventTypes != null ? de_EventTypes(output.MatchingEventTypes, context) : undefined,
684
- Name: (0, smithy_client_1.expectString)(output.Name),
685
- SnsDestination: output.SnsDestination != null ? de_SnsDestination(output.SnsDestination, context) : undefined,
686
- };
687
- };
688
- const de_EventDestinations = (output, context) => {
689
- const retVal = (output || [])
690
- .filter((e) => e != null)
691
- .map((entry) => {
692
- if (entry === null) {
693
- return null;
694
- }
695
- return de_EventDestination(entry, context);
696
- });
697
- return retVal;
698
- };
699
- const de_EventTypes = (output, context) => {
700
- const retVal = (output || [])
701
- .filter((e) => e != null)
702
- .map((entry) => {
703
- if (entry === null) {
704
- return null;
705
- }
706
- return (0, smithy_client_1.expectString)(entry);
707
- });
708
- return retVal;
709
- };
710
- const de_KinesisFirehoseDestination = (output, context) => {
711
- return {
712
- DeliveryStreamArn: (0, smithy_client_1.expectString)(output.DeliveryStreamArn),
713
- IamRoleArn: (0, smithy_client_1.expectString)(output.IamRoleArn),
714
- };
715
- };
716
- const de_SnsDestination = (output, context) => {
717
- return {
718
- TopicArn: (0, smithy_client_1.expectString)(output.TopicArn),
719
- };
720
- };
721
585
  const deserializeMetadata = (output) => ({
722
586
  httpStatusCode: output.statusCode,
723
587
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],