@aws-sdk/client-codestar-notifications 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.
@@ -13,16 +13,16 @@ const se_CreateNotificationRuleCommand = async (input, context) => {
13
13
  };
14
14
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/createNotificationRule";
15
15
  let body;
16
- body = JSON.stringify({
17
- ClientRequestToken: input.ClientRequestToken ?? (0, uuid_1.v4)(),
18
- ...(input.DetailType != null && { DetailType: input.DetailType }),
19
- ...(input.EventTypeIds != null && { EventTypeIds: se_EventTypeIds(input.EventTypeIds, context) }),
20
- ...(input.Name != null && { Name: input.Name }),
21
- ...(input.Resource != null && { Resource: input.Resource }),
22
- ...(input.Status != null && { Status: input.Status }),
23
- ...(input.Tags != null && { Tags: se_Tags(input.Tags, context) }),
24
- ...(input.Targets != null && { Targets: se_Targets(input.Targets, context) }),
25
- });
16
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
17
+ ClientRequestToken: (_) => _ ?? (0, uuid_1.v4)(),
18
+ DetailType: [],
19
+ EventTypeIds: (_) => (0, smithy_client_1._json)(_),
20
+ Name: [],
21
+ Resource: [],
22
+ Status: [],
23
+ Tags: (_) => (0, smithy_client_1._json)(_),
24
+ Targets: (_) => (0, smithy_client_1._json)(_),
25
+ }));
26
26
  return new protocol_http_1.HttpRequest({
27
27
  protocol,
28
28
  hostname,
@@ -41,9 +41,9 @@ const se_DeleteNotificationRuleCommand = async (input, context) => {
41
41
  };
42
42
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/deleteNotificationRule";
43
43
  let body;
44
- body = JSON.stringify({
45
- ...(input.Arn != null && { Arn: input.Arn }),
46
- });
44
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
45
+ Arn: [],
46
+ }));
47
47
  return new protocol_http_1.HttpRequest({
48
48
  protocol,
49
49
  hostname,
@@ -62,10 +62,10 @@ const se_DeleteTargetCommand = async (input, context) => {
62
62
  };
63
63
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/deleteTarget";
64
64
  let body;
65
- body = JSON.stringify({
66
- ...(input.ForceUnsubscribeAll != null && { ForceUnsubscribeAll: input.ForceUnsubscribeAll }),
67
- ...(input.TargetAddress != null && { TargetAddress: input.TargetAddress }),
68
- });
65
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
66
+ ForceUnsubscribeAll: [],
67
+ TargetAddress: [],
68
+ }));
69
69
  return new protocol_http_1.HttpRequest({
70
70
  protocol,
71
71
  hostname,
@@ -84,9 +84,9 @@ const se_DescribeNotificationRuleCommand = async (input, context) => {
84
84
  };
85
85
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/describeNotificationRule";
86
86
  let body;
87
- body = JSON.stringify({
88
- ...(input.Arn != null && { Arn: input.Arn }),
89
- });
87
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
88
+ Arn: [],
89
+ }));
90
90
  return new protocol_http_1.HttpRequest({
91
91
  protocol,
92
92
  hostname,
@@ -105,11 +105,11 @@ const se_ListEventTypesCommand = async (input, context) => {
105
105
  };
106
106
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/listEventTypes";
107
107
  let body;
108
- body = JSON.stringify({
109
- ...(input.Filters != null && { Filters: se_ListEventTypesFilters(input.Filters, context) }),
110
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
111
- ...(input.NextToken != null && { NextToken: input.NextToken }),
112
- });
108
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
109
+ Filters: (_) => (0, smithy_client_1._json)(_),
110
+ MaxResults: [],
111
+ NextToken: [],
112
+ }));
113
113
  return new protocol_http_1.HttpRequest({
114
114
  protocol,
115
115
  hostname,
@@ -128,11 +128,11 @@ const se_ListNotificationRulesCommand = async (input, context) => {
128
128
  };
129
129
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/listNotificationRules";
130
130
  let body;
131
- body = JSON.stringify({
132
- ...(input.Filters != null && { Filters: se_ListNotificationRulesFilters(input.Filters, context) }),
133
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
134
- ...(input.NextToken != null && { NextToken: input.NextToken }),
135
- });
131
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
132
+ Filters: (_) => (0, smithy_client_1._json)(_),
133
+ MaxResults: [],
134
+ NextToken: [],
135
+ }));
136
136
  return new protocol_http_1.HttpRequest({
137
137
  protocol,
138
138
  hostname,
@@ -151,9 +151,9 @@ const se_ListTagsForResourceCommand = async (input, context) => {
151
151
  };
152
152
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/listTagsForResource";
153
153
  let body;
154
- body = JSON.stringify({
155
- ...(input.Arn != null && { Arn: input.Arn }),
156
- });
154
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
155
+ Arn: [],
156
+ }));
157
157
  return new protocol_http_1.HttpRequest({
158
158
  protocol,
159
159
  hostname,
@@ -172,11 +172,11 @@ const se_ListTargetsCommand = async (input, context) => {
172
172
  };
173
173
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/listTargets";
174
174
  let body;
175
- body = JSON.stringify({
176
- ...(input.Filters != null && { Filters: se_ListTargetsFilters(input.Filters, context) }),
177
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
178
- ...(input.NextToken != null && { NextToken: input.NextToken }),
179
- });
175
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
176
+ Filters: (_) => (0, smithy_client_1._json)(_),
177
+ MaxResults: [],
178
+ NextToken: [],
179
+ }));
180
180
  return new protocol_http_1.HttpRequest({
181
181
  protocol,
182
182
  hostname,
@@ -195,11 +195,11 @@ const se_SubscribeCommand = async (input, context) => {
195
195
  };
196
196
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/subscribe";
197
197
  let body;
198
- body = JSON.stringify({
199
- ...(input.Arn != null && { Arn: input.Arn }),
200
- ...(input.ClientRequestToken != null && { ClientRequestToken: input.ClientRequestToken }),
201
- ...(input.Target != null && { Target: se_Target(input.Target, context) }),
202
- });
198
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
199
+ Arn: [],
200
+ ClientRequestToken: [],
201
+ Target: (_) => (0, smithy_client_1._json)(_),
202
+ }));
203
203
  return new protocol_http_1.HttpRequest({
204
204
  protocol,
205
205
  hostname,
@@ -218,10 +218,10 @@ const se_TagResourceCommand = async (input, context) => {
218
218
  };
219
219
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tagResource";
220
220
  let body;
221
- body = JSON.stringify({
222
- ...(input.Arn != null && { Arn: input.Arn }),
223
- ...(input.Tags != null && { Tags: se_Tags(input.Tags, context) }),
224
- });
221
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
222
+ Arn: [],
223
+ Tags: (_) => (0, smithy_client_1._json)(_),
224
+ }));
225
225
  return new protocol_http_1.HttpRequest({
226
226
  protocol,
227
227
  hostname,
@@ -240,10 +240,10 @@ const se_UnsubscribeCommand = async (input, context) => {
240
240
  };
241
241
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/unsubscribe";
242
242
  let body;
243
- body = JSON.stringify({
244
- ...(input.Arn != null && { Arn: input.Arn }),
245
- ...(input.TargetAddress != null && { TargetAddress: input.TargetAddress }),
246
- });
243
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
244
+ Arn: [],
245
+ TargetAddress: [],
246
+ }));
247
247
  return new protocol_http_1.HttpRequest({
248
248
  protocol,
249
249
  hostname,
@@ -260,7 +260,7 @@ const se_UntagResourceCommand = async (input, context) => {
260
260
  const headers = {};
261
261
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/untagResource/{Arn}";
262
262
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Arn", () => input.Arn, "{Arn}", false);
263
- const query = map({
263
+ const query = (0, smithy_client_1.map)({
264
264
  tagKeys: [
265
265
  (0, smithy_client_1.expectNonNull)(input.TagKeys, `TagKeys`) != null,
266
266
  () => (input.TagKeys || []).map((_entry) => _entry),
@@ -286,14 +286,14 @@ const se_UpdateNotificationRuleCommand = async (input, context) => {
286
286
  };
287
287
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/updateNotificationRule";
288
288
  let body;
289
- body = JSON.stringify({
290
- ...(input.Arn != null && { Arn: input.Arn }),
291
- ...(input.DetailType != null && { DetailType: input.DetailType }),
292
- ...(input.EventTypeIds != null && { EventTypeIds: se_EventTypeIds(input.EventTypeIds, context) }),
293
- ...(input.Name != null && { Name: input.Name }),
294
- ...(input.Status != null && { Status: input.Status }),
295
- ...(input.Targets != null && { Targets: se_Targets(input.Targets, context) }),
296
- });
289
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
290
+ Arn: [],
291
+ DetailType: [],
292
+ EventTypeIds: (_) => (0, smithy_client_1._json)(_),
293
+ Name: [],
294
+ Status: [],
295
+ Targets: (_) => (0, smithy_client_1._json)(_),
296
+ }));
297
297
  return new protocol_http_1.HttpRequest({
298
298
  protocol,
299
299
  hostname,
@@ -309,13 +309,14 @@ const de_CreateNotificationRuleCommand = async (output, context) => {
309
309
  if (output.statusCode !== 200 && output.statusCode >= 300) {
310
310
  return de_CreateNotificationRuleCommandError(output, context);
311
311
  }
312
- const contents = map({
312
+ const contents = (0, smithy_client_1.map)({
313
313
  $metadata: deserializeMetadata(output),
314
314
  });
315
315
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
316
- if (data.Arn != null) {
317
- contents.Arn = (0, smithy_client_1.expectString)(data.Arn);
318
- }
316
+ const doc = (0, smithy_client_1.take)(data, {
317
+ Arn: smithy_client_1.expectString,
318
+ });
319
+ Object.assign(contents, doc);
319
320
  return contents;
320
321
  };
321
322
  exports.de_CreateNotificationRuleCommand = de_CreateNotificationRuleCommand;
@@ -346,10 +347,9 @@ const de_CreateNotificationRuleCommandError = async (output, context) => {
346
347
  throw await de_ValidationExceptionRes(parsedOutput, context);
347
348
  default:
348
349
  const parsedBody = parsedOutput.body;
349
- (0, smithy_client_1.throwDefaultError)({
350
+ return throwDefaultError({
350
351
  output,
351
352
  parsedBody,
352
- exceptionCtor: CodestarNotificationsServiceException_1.CodestarNotificationsServiceException,
353
353
  errorCode,
354
354
  });
355
355
  }
@@ -358,13 +358,14 @@ const de_DeleteNotificationRuleCommand = async (output, context) => {
358
358
  if (output.statusCode !== 200 && output.statusCode >= 300) {
359
359
  return de_DeleteNotificationRuleCommandError(output, context);
360
360
  }
361
- const contents = map({
361
+ const contents = (0, smithy_client_1.map)({
362
362
  $metadata: deserializeMetadata(output),
363
363
  });
364
364
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
365
- if (data.Arn != null) {
366
- contents.Arn = (0, smithy_client_1.expectString)(data.Arn);
367
- }
365
+ const doc = (0, smithy_client_1.take)(data, {
366
+ Arn: smithy_client_1.expectString,
367
+ });
368
+ Object.assign(contents, doc);
368
369
  return contents;
369
370
  };
370
371
  exports.de_DeleteNotificationRuleCommand = de_DeleteNotificationRuleCommand;
@@ -386,10 +387,9 @@ const de_DeleteNotificationRuleCommandError = async (output, context) => {
386
387
  throw await de_ValidationExceptionRes(parsedOutput, context);
387
388
  default:
388
389
  const parsedBody = parsedOutput.body;
389
- (0, smithy_client_1.throwDefaultError)({
390
+ return throwDefaultError({
390
391
  output,
391
392
  parsedBody,
392
- exceptionCtor: CodestarNotificationsServiceException_1.CodestarNotificationsServiceException,
393
393
  errorCode,
394
394
  });
395
395
  }
@@ -398,7 +398,7 @@ const de_DeleteTargetCommand = async (output, context) => {
398
398
  if (output.statusCode !== 200 && output.statusCode >= 300) {
399
399
  return de_DeleteTargetCommandError(output, context);
400
400
  }
401
- const contents = map({
401
+ const contents = (0, smithy_client_1.map)({
402
402
  $metadata: deserializeMetadata(output),
403
403
  });
404
404
  await collectBody(output.body, context);
@@ -417,10 +417,9 @@ const de_DeleteTargetCommandError = async (output, context) => {
417
417
  throw await de_ValidationExceptionRes(parsedOutput, context);
418
418
  default:
419
419
  const parsedBody = parsedOutput.body;
420
- (0, smithy_client_1.throwDefaultError)({
420
+ return throwDefaultError({
421
421
  output,
422
422
  parsedBody,
423
- exceptionCtor: CodestarNotificationsServiceException_1.CodestarNotificationsServiceException,
424
423
  errorCode,
425
424
  });
426
425
  }
@@ -429,43 +428,24 @@ const de_DescribeNotificationRuleCommand = async (output, context) => {
429
428
  if (output.statusCode !== 200 && output.statusCode >= 300) {
430
429
  return de_DescribeNotificationRuleCommandError(output, context);
431
430
  }
432
- const contents = map({
431
+ const contents = (0, smithy_client_1.map)({
433
432
  $metadata: deserializeMetadata(output),
434
433
  });
435
434
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
436
- if (data.Arn != null) {
437
- contents.Arn = (0, smithy_client_1.expectString)(data.Arn);
438
- }
439
- if (data.CreatedBy != null) {
440
- contents.CreatedBy = (0, smithy_client_1.expectString)(data.CreatedBy);
441
- }
442
- if (data.CreatedTimestamp != null) {
443
- contents.CreatedTimestamp = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.CreatedTimestamp)));
444
- }
445
- if (data.DetailType != null) {
446
- contents.DetailType = (0, smithy_client_1.expectString)(data.DetailType);
447
- }
448
- if (data.EventTypes != null) {
449
- contents.EventTypes = de_EventTypeBatch(data.EventTypes, context);
450
- }
451
- if (data.LastModifiedTimestamp != null) {
452
- contents.LastModifiedTimestamp = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.LastModifiedTimestamp)));
453
- }
454
- if (data.Name != null) {
455
- contents.Name = (0, smithy_client_1.expectString)(data.Name);
456
- }
457
- if (data.Resource != null) {
458
- contents.Resource = (0, smithy_client_1.expectString)(data.Resource);
459
- }
460
- if (data.Status != null) {
461
- contents.Status = (0, smithy_client_1.expectString)(data.Status);
462
- }
463
- if (data.Tags != null) {
464
- contents.Tags = de_Tags(data.Tags, context);
465
- }
466
- if (data.Targets != null) {
467
- contents.Targets = de_TargetsBatch(data.Targets, context);
468
- }
435
+ const doc = (0, smithy_client_1.take)(data, {
436
+ Arn: smithy_client_1.expectString,
437
+ CreatedBy: smithy_client_1.expectString,
438
+ CreatedTimestamp: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
439
+ DetailType: smithy_client_1.expectString,
440
+ EventTypes: smithy_client_1._json,
441
+ LastModifiedTimestamp: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
442
+ Name: smithy_client_1.expectString,
443
+ Resource: smithy_client_1.expectString,
444
+ Status: smithy_client_1.expectString,
445
+ Tags: smithy_client_1._json,
446
+ Targets: smithy_client_1._json,
447
+ });
448
+ Object.assign(contents, doc);
469
449
  return contents;
470
450
  };
471
451
  exports.de_DescribeNotificationRuleCommand = de_DescribeNotificationRuleCommand;
@@ -484,10 +464,9 @@ const de_DescribeNotificationRuleCommandError = async (output, context) => {
484
464
  throw await de_ValidationExceptionRes(parsedOutput, context);
485
465
  default:
486
466
  const parsedBody = parsedOutput.body;
487
- (0, smithy_client_1.throwDefaultError)({
467
+ return throwDefaultError({
488
468
  output,
489
469
  parsedBody,
490
- exceptionCtor: CodestarNotificationsServiceException_1.CodestarNotificationsServiceException,
491
470
  errorCode,
492
471
  });
493
472
  }
@@ -496,16 +475,15 @@ const de_ListEventTypesCommand = async (output, context) => {
496
475
  if (output.statusCode !== 200 && output.statusCode >= 300) {
497
476
  return de_ListEventTypesCommandError(output, context);
498
477
  }
499
- const contents = map({
478
+ const contents = (0, smithy_client_1.map)({
500
479
  $metadata: deserializeMetadata(output),
501
480
  });
502
481
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
503
- if (data.EventTypes != null) {
504
- contents.EventTypes = de_EventTypeBatch(data.EventTypes, context);
505
- }
506
- if (data.NextToken != null) {
507
- contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
508
- }
482
+ const doc = (0, smithy_client_1.take)(data, {
483
+ EventTypes: smithy_client_1._json,
484
+ NextToken: smithy_client_1.expectString,
485
+ });
486
+ Object.assign(contents, doc);
509
487
  return contents;
510
488
  };
511
489
  exports.de_ListEventTypesCommand = de_ListEventTypesCommand;
@@ -524,10 +502,9 @@ const de_ListEventTypesCommandError = async (output, context) => {
524
502
  throw await de_ValidationExceptionRes(parsedOutput, context);
525
503
  default:
526
504
  const parsedBody = parsedOutput.body;
527
- (0, smithy_client_1.throwDefaultError)({
505
+ return throwDefaultError({
528
506
  output,
529
507
  parsedBody,
530
- exceptionCtor: CodestarNotificationsServiceException_1.CodestarNotificationsServiceException,
531
508
  errorCode,
532
509
  });
533
510
  }
@@ -536,16 +513,15 @@ const de_ListNotificationRulesCommand = async (output, context) => {
536
513
  if (output.statusCode !== 200 && output.statusCode >= 300) {
537
514
  return de_ListNotificationRulesCommandError(output, context);
538
515
  }
539
- const contents = map({
516
+ const contents = (0, smithy_client_1.map)({
540
517
  $metadata: deserializeMetadata(output),
541
518
  });
542
519
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
543
- if (data.NextToken != null) {
544
- contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
545
- }
546
- if (data.NotificationRules != null) {
547
- contents.NotificationRules = de_NotificationRuleBatch(data.NotificationRules, context);
548
- }
520
+ const doc = (0, smithy_client_1.take)(data, {
521
+ NextToken: smithy_client_1.expectString,
522
+ NotificationRules: smithy_client_1._json,
523
+ });
524
+ Object.assign(contents, doc);
549
525
  return contents;
550
526
  };
551
527
  exports.de_ListNotificationRulesCommand = de_ListNotificationRulesCommand;
@@ -564,10 +540,9 @@ const de_ListNotificationRulesCommandError = async (output, context) => {
564
540
  throw await de_ValidationExceptionRes(parsedOutput, context);
565
541
  default:
566
542
  const parsedBody = parsedOutput.body;
567
- (0, smithy_client_1.throwDefaultError)({
543
+ return throwDefaultError({
568
544
  output,
569
545
  parsedBody,
570
- exceptionCtor: CodestarNotificationsServiceException_1.CodestarNotificationsServiceException,
571
546
  errorCode,
572
547
  });
573
548
  }
@@ -576,13 +551,14 @@ const de_ListTagsForResourceCommand = async (output, context) => {
576
551
  if (output.statusCode !== 200 && output.statusCode >= 300) {
577
552
  return de_ListTagsForResourceCommandError(output, context);
578
553
  }
579
- const contents = map({
554
+ const contents = (0, smithy_client_1.map)({
580
555
  $metadata: deserializeMetadata(output),
581
556
  });
582
557
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
583
- if (data.Tags != null) {
584
- contents.Tags = de_Tags(data.Tags, context);
585
- }
558
+ const doc = (0, smithy_client_1.take)(data, {
559
+ Tags: smithy_client_1._json,
560
+ });
561
+ Object.assign(contents, doc);
586
562
  return contents;
587
563
  };
588
564
  exports.de_ListTagsForResourceCommand = de_ListTagsForResourceCommand;
@@ -601,10 +577,9 @@ const de_ListTagsForResourceCommandError = async (output, context) => {
601
577
  throw await de_ValidationExceptionRes(parsedOutput, context);
602
578
  default:
603
579
  const parsedBody = parsedOutput.body;
604
- (0, smithy_client_1.throwDefaultError)({
580
+ return throwDefaultError({
605
581
  output,
606
582
  parsedBody,
607
- exceptionCtor: CodestarNotificationsServiceException_1.CodestarNotificationsServiceException,
608
583
  errorCode,
609
584
  });
610
585
  }
@@ -613,16 +588,15 @@ const de_ListTargetsCommand = async (output, context) => {
613
588
  if (output.statusCode !== 200 && output.statusCode >= 300) {
614
589
  return de_ListTargetsCommandError(output, context);
615
590
  }
616
- const contents = map({
591
+ const contents = (0, smithy_client_1.map)({
617
592
  $metadata: deserializeMetadata(output),
618
593
  });
619
594
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
620
- if (data.NextToken != null) {
621
- contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
622
- }
623
- if (data.Targets != null) {
624
- contents.Targets = de_TargetsBatch(data.Targets, context);
625
- }
595
+ const doc = (0, smithy_client_1.take)(data, {
596
+ NextToken: smithy_client_1.expectString,
597
+ Targets: smithy_client_1._json,
598
+ });
599
+ Object.assign(contents, doc);
626
600
  return contents;
627
601
  };
628
602
  exports.de_ListTargetsCommand = de_ListTargetsCommand;
@@ -641,10 +615,9 @@ const de_ListTargetsCommandError = async (output, context) => {
641
615
  throw await de_ValidationExceptionRes(parsedOutput, context);
642
616
  default:
643
617
  const parsedBody = parsedOutput.body;
644
- (0, smithy_client_1.throwDefaultError)({
618
+ return throwDefaultError({
645
619
  output,
646
620
  parsedBody,
647
- exceptionCtor: CodestarNotificationsServiceException_1.CodestarNotificationsServiceException,
648
621
  errorCode,
649
622
  });
650
623
  }
@@ -653,13 +626,14 @@ const de_SubscribeCommand = async (output, context) => {
653
626
  if (output.statusCode !== 200 && output.statusCode >= 300) {
654
627
  return de_SubscribeCommandError(output, context);
655
628
  }
656
- const contents = map({
629
+ const contents = (0, smithy_client_1.map)({
657
630
  $metadata: deserializeMetadata(output),
658
631
  });
659
632
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
660
- if (data.Arn != null) {
661
- contents.Arn = (0, smithy_client_1.expectString)(data.Arn);
662
- }
633
+ const doc = (0, smithy_client_1.take)(data, {
634
+ Arn: smithy_client_1.expectString,
635
+ });
636
+ Object.assign(contents, doc);
663
637
  return contents;
664
638
  };
665
639
  exports.de_SubscribeCommand = de_SubscribeCommand;
@@ -681,10 +655,9 @@ const de_SubscribeCommandError = async (output, context) => {
681
655
  throw await de_ValidationExceptionRes(parsedOutput, context);
682
656
  default:
683
657
  const parsedBody = parsedOutput.body;
684
- (0, smithy_client_1.throwDefaultError)({
658
+ return throwDefaultError({
685
659
  output,
686
660
  parsedBody,
687
- exceptionCtor: CodestarNotificationsServiceException_1.CodestarNotificationsServiceException,
688
661
  errorCode,
689
662
  });
690
663
  }
@@ -693,13 +666,14 @@ const de_TagResourceCommand = async (output, context) => {
693
666
  if (output.statusCode !== 200 && output.statusCode >= 300) {
694
667
  return de_TagResourceCommandError(output, context);
695
668
  }
696
- const contents = map({
669
+ const contents = (0, smithy_client_1.map)({
697
670
  $metadata: deserializeMetadata(output),
698
671
  });
699
672
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
700
- if (data.Tags != null) {
701
- contents.Tags = de_Tags(data.Tags, context);
702
- }
673
+ const doc = (0, smithy_client_1.take)(data, {
674
+ Tags: smithy_client_1._json,
675
+ });
676
+ Object.assign(contents, doc);
703
677
  return contents;
704
678
  };
705
679
  exports.de_TagResourceCommand = de_TagResourceCommand;
@@ -724,10 +698,9 @@ const de_TagResourceCommandError = async (output, context) => {
724
698
  throw await de_ValidationExceptionRes(parsedOutput, context);
725
699
  default:
726
700
  const parsedBody = parsedOutput.body;
727
- (0, smithy_client_1.throwDefaultError)({
701
+ return throwDefaultError({
728
702
  output,
729
703
  parsedBody,
730
- exceptionCtor: CodestarNotificationsServiceException_1.CodestarNotificationsServiceException,
731
704
  errorCode,
732
705
  });
733
706
  }
@@ -736,13 +709,14 @@ const de_UnsubscribeCommand = async (output, context) => {
736
709
  if (output.statusCode !== 200 && output.statusCode >= 300) {
737
710
  return de_UnsubscribeCommandError(output, context);
738
711
  }
739
- const contents = map({
712
+ const contents = (0, smithy_client_1.map)({
740
713
  $metadata: deserializeMetadata(output),
741
714
  });
742
715
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
743
- if (data.Arn != null) {
744
- contents.Arn = (0, smithy_client_1.expectString)(data.Arn);
745
- }
716
+ const doc = (0, smithy_client_1.take)(data, {
717
+ Arn: smithy_client_1.expectString,
718
+ });
719
+ Object.assign(contents, doc);
746
720
  return contents;
747
721
  };
748
722
  exports.de_UnsubscribeCommand = de_UnsubscribeCommand;
@@ -758,10 +732,9 @@ const de_UnsubscribeCommandError = async (output, context) => {
758
732
  throw await de_ValidationExceptionRes(parsedOutput, context);
759
733
  default:
760
734
  const parsedBody = parsedOutput.body;
761
- (0, smithy_client_1.throwDefaultError)({
735
+ return throwDefaultError({
762
736
  output,
763
737
  parsedBody,
764
- exceptionCtor: CodestarNotificationsServiceException_1.CodestarNotificationsServiceException,
765
738
  errorCode,
766
739
  });
767
740
  }
@@ -770,7 +743,7 @@ const de_UntagResourceCommand = async (output, context) => {
770
743
  if (output.statusCode !== 200 && output.statusCode >= 300) {
771
744
  return de_UntagResourceCommandError(output, context);
772
745
  }
773
- const contents = map({
746
+ const contents = (0, smithy_client_1.map)({
774
747
  $metadata: deserializeMetadata(output),
775
748
  });
776
749
  await collectBody(output.body, context);
@@ -798,10 +771,9 @@ const de_UntagResourceCommandError = async (output, context) => {
798
771
  throw await de_ValidationExceptionRes(parsedOutput, context);
799
772
  default:
800
773
  const parsedBody = parsedOutput.body;
801
- (0, smithy_client_1.throwDefaultError)({
774
+ return throwDefaultError({
802
775
  output,
803
776
  parsedBody,
804
- exceptionCtor: CodestarNotificationsServiceException_1.CodestarNotificationsServiceException,
805
777
  errorCode,
806
778
  });
807
779
  }
@@ -810,7 +782,7 @@ const de_UpdateNotificationRuleCommand = async (output, context) => {
810
782
  if (output.statusCode !== 200 && output.statusCode >= 300) {
811
783
  return de_UpdateNotificationRuleCommandError(output, context);
812
784
  }
813
- const contents = map({
785
+ const contents = (0, smithy_client_1.map)({
814
786
  $metadata: deserializeMetadata(output),
815
787
  });
816
788
  await collectBody(output.body, context);
@@ -835,21 +807,21 @@ const de_UpdateNotificationRuleCommandError = async (output, context) => {
835
807
  throw await de_ValidationExceptionRes(parsedOutput, context);
836
808
  default:
837
809
  const parsedBody = parsedOutput.body;
838
- (0, smithy_client_1.throwDefaultError)({
810
+ return throwDefaultError({
839
811
  output,
840
812
  parsedBody,
841
- exceptionCtor: CodestarNotificationsServiceException_1.CodestarNotificationsServiceException,
842
813
  errorCode,
843
814
  });
844
815
  }
845
816
  };
846
- const map = smithy_client_1.map;
817
+ const throwDefaultError = (0, smithy_client_1.withBaseException)(CodestarNotificationsServiceException_1.CodestarNotificationsServiceException);
847
818
  const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
848
- const contents = map({});
819
+ const contents = (0, smithy_client_1.map)({});
849
820
  const data = parsedOutput.body;
850
- if (data.Message != null) {
851
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
852
- }
821
+ const doc = (0, smithy_client_1.take)(data, {
822
+ Message: smithy_client_1.expectString,
823
+ });
824
+ Object.assign(contents, doc);
853
825
  const exception = new models_0_1.AccessDeniedException({
854
826
  $metadata: deserializeMetadata(parsedOutput),
855
827
  ...contents,
@@ -857,11 +829,12 @@ const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
857
829
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
858
830
  };
859
831
  const de_ConcurrentModificationExceptionRes = async (parsedOutput, context) => {
860
- const contents = map({});
832
+ const contents = (0, smithy_client_1.map)({});
861
833
  const data = parsedOutput.body;
862
- if (data.Message != null) {
863
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
864
- }
834
+ const doc = (0, smithy_client_1.take)(data, {
835
+ Message: smithy_client_1.expectString,
836
+ });
837
+ Object.assign(contents, doc);
865
838
  const exception = new models_0_1.ConcurrentModificationException({
866
839
  $metadata: deserializeMetadata(parsedOutput),
867
840
  ...contents,
@@ -869,11 +842,12 @@ const de_ConcurrentModificationExceptionRes = async (parsedOutput, context) => {
869
842
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
870
843
  };
871
844
  const de_ConfigurationExceptionRes = async (parsedOutput, context) => {
872
- const contents = map({});
845
+ const contents = (0, smithy_client_1.map)({});
873
846
  const data = parsedOutput.body;
874
- if (data.Message != null) {
875
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
876
- }
847
+ const doc = (0, smithy_client_1.take)(data, {
848
+ Message: smithy_client_1.expectString,
849
+ });
850
+ Object.assign(contents, doc);
877
851
  const exception = new models_0_1.ConfigurationException({
878
852
  $metadata: deserializeMetadata(parsedOutput),
879
853
  ...contents,
@@ -881,11 +855,12 @@ const de_ConfigurationExceptionRes = async (parsedOutput, context) => {
881
855
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
882
856
  };
883
857
  const de_InvalidNextTokenExceptionRes = async (parsedOutput, context) => {
884
- const contents = map({});
858
+ const contents = (0, smithy_client_1.map)({});
885
859
  const data = parsedOutput.body;
886
- if (data.Message != null) {
887
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
888
- }
860
+ const doc = (0, smithy_client_1.take)(data, {
861
+ Message: smithy_client_1.expectString,
862
+ });
863
+ Object.assign(contents, doc);
889
864
  const exception = new models_0_1.InvalidNextTokenException({
890
865
  $metadata: deserializeMetadata(parsedOutput),
891
866
  ...contents,
@@ -893,11 +868,12 @@ const de_InvalidNextTokenExceptionRes = async (parsedOutput, context) => {
893
868
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
894
869
  };
895
870
  const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
896
- const contents = map({});
871
+ const contents = (0, smithy_client_1.map)({});
897
872
  const data = parsedOutput.body;
898
- if (data.Message != null) {
899
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
900
- }
873
+ const doc = (0, smithy_client_1.take)(data, {
874
+ Message: smithy_client_1.expectString,
875
+ });
876
+ Object.assign(contents, doc);
901
877
  const exception = new models_0_1.LimitExceededException({
902
878
  $metadata: deserializeMetadata(parsedOutput),
903
879
  ...contents,
@@ -905,11 +881,12 @@ const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
905
881
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
906
882
  };
907
883
  const de_ResourceAlreadyExistsExceptionRes = async (parsedOutput, context) => {
908
- const contents = map({});
884
+ const contents = (0, smithy_client_1.map)({});
909
885
  const data = parsedOutput.body;
910
- if (data.Message != null) {
911
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
912
- }
886
+ const doc = (0, smithy_client_1.take)(data, {
887
+ Message: smithy_client_1.expectString,
888
+ });
889
+ Object.assign(contents, doc);
913
890
  const exception = new models_0_1.ResourceAlreadyExistsException({
914
891
  $metadata: deserializeMetadata(parsedOutput),
915
892
  ...contents,
@@ -917,11 +894,12 @@ const de_ResourceAlreadyExistsExceptionRes = async (parsedOutput, context) => {
917
894
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
918
895
  };
919
896
  const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
920
- const contents = map({});
897
+ const contents = (0, smithy_client_1.map)({});
921
898
  const data = parsedOutput.body;
922
- if (data.Message != null) {
923
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
924
- }
899
+ const doc = (0, smithy_client_1.take)(data, {
900
+ Message: smithy_client_1.expectString,
901
+ });
902
+ Object.assign(contents, doc);
925
903
  const exception = new models_0_1.ResourceNotFoundException({
926
904
  $metadata: deserializeMetadata(parsedOutput),
927
905
  ...contents,
@@ -929,148 +907,18 @@ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
929
907
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
930
908
  };
931
909
  const de_ValidationExceptionRes = async (parsedOutput, context) => {
932
- const contents = map({});
910
+ const contents = (0, smithy_client_1.map)({});
933
911
  const data = parsedOutput.body;
934
- if (data.Message != null) {
935
- contents.Message = (0, smithy_client_1.expectString)(data.Message);
936
- }
912
+ const doc = (0, smithy_client_1.take)(data, {
913
+ Message: smithy_client_1.expectString,
914
+ });
915
+ Object.assign(contents, doc);
937
916
  const exception = new models_0_1.ValidationException({
938
917
  $metadata: deserializeMetadata(parsedOutput),
939
918
  ...contents,
940
919
  });
941
920
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
942
921
  };
943
- const se_EventTypeIds = (input, context) => {
944
- return input
945
- .filter((e) => e != null)
946
- .map((entry) => {
947
- return entry;
948
- });
949
- };
950
- const se_ListEventTypesFilter = (input, context) => {
951
- return {
952
- ...(input.Name != null && { Name: input.Name }),
953
- ...(input.Value != null && { Value: input.Value }),
954
- };
955
- };
956
- const se_ListEventTypesFilters = (input, context) => {
957
- return input
958
- .filter((e) => e != null)
959
- .map((entry) => {
960
- return se_ListEventTypesFilter(entry, context);
961
- });
962
- };
963
- const se_ListNotificationRulesFilter = (input, context) => {
964
- return {
965
- ...(input.Name != null && { Name: input.Name }),
966
- ...(input.Value != null && { Value: input.Value }),
967
- };
968
- };
969
- const se_ListNotificationRulesFilters = (input, context) => {
970
- return input
971
- .filter((e) => e != null)
972
- .map((entry) => {
973
- return se_ListNotificationRulesFilter(entry, context);
974
- });
975
- };
976
- const se_ListTargetsFilter = (input, context) => {
977
- return {
978
- ...(input.Name != null && { Name: input.Name }),
979
- ...(input.Value != null && { Value: input.Value }),
980
- };
981
- };
982
- const se_ListTargetsFilters = (input, context) => {
983
- return input
984
- .filter((e) => e != null)
985
- .map((entry) => {
986
- return se_ListTargetsFilter(entry, context);
987
- });
988
- };
989
- const se_Tags = (input, context) => {
990
- return Object.entries(input).reduce((acc, [key, value]) => {
991
- if (value === null) {
992
- return acc;
993
- }
994
- acc[key] = value;
995
- return acc;
996
- }, {});
997
- };
998
- const se_Target = (input, context) => {
999
- return {
1000
- ...(input.TargetAddress != null && { TargetAddress: input.TargetAddress }),
1001
- ...(input.TargetType != null && { TargetType: input.TargetType }),
1002
- };
1003
- };
1004
- const se_Targets = (input, context) => {
1005
- return input
1006
- .filter((e) => e != null)
1007
- .map((entry) => {
1008
- return se_Target(entry, context);
1009
- });
1010
- };
1011
- const de_EventTypeBatch = (output, context) => {
1012
- const retVal = (output || [])
1013
- .filter((e) => e != null)
1014
- .map((entry) => {
1015
- if (entry === null) {
1016
- return null;
1017
- }
1018
- return de_EventTypeSummary(entry, context);
1019
- });
1020
- return retVal;
1021
- };
1022
- const de_EventTypeSummary = (output, context) => {
1023
- return {
1024
- EventTypeId: (0, smithy_client_1.expectString)(output.EventTypeId),
1025
- EventTypeName: (0, smithy_client_1.expectString)(output.EventTypeName),
1026
- ResourceType: (0, smithy_client_1.expectString)(output.ResourceType),
1027
- ServiceName: (0, smithy_client_1.expectString)(output.ServiceName),
1028
- };
1029
- };
1030
- const de_NotificationRuleBatch = (output, context) => {
1031
- const retVal = (output || [])
1032
- .filter((e) => e != null)
1033
- .map((entry) => {
1034
- if (entry === null) {
1035
- return null;
1036
- }
1037
- return de_NotificationRuleSummary(entry, context);
1038
- });
1039
- return retVal;
1040
- };
1041
- const de_NotificationRuleSummary = (output, context) => {
1042
- return {
1043
- Arn: (0, smithy_client_1.expectString)(output.Arn),
1044
- Id: (0, smithy_client_1.expectString)(output.Id),
1045
- };
1046
- };
1047
- const de_Tags = (output, context) => {
1048
- return Object.entries(output).reduce((acc, [key, value]) => {
1049
- if (value === null) {
1050
- return acc;
1051
- }
1052
- acc[key] = (0, smithy_client_1.expectString)(value);
1053
- return acc;
1054
- }, {});
1055
- };
1056
- const de_TargetsBatch = (output, context) => {
1057
- const retVal = (output || [])
1058
- .filter((e) => e != null)
1059
- .map((entry) => {
1060
- if (entry === null) {
1061
- return null;
1062
- }
1063
- return de_TargetSummary(entry, context);
1064
- });
1065
- return retVal;
1066
- };
1067
- const de_TargetSummary = (output, context) => {
1068
- return {
1069
- TargetAddress: (0, smithy_client_1.expectString)(output.TargetAddress),
1070
- TargetStatus: (0, smithy_client_1.expectString)(output.TargetStatus),
1071
- TargetType: (0, smithy_client_1.expectString)(output.TargetType),
1072
- };
1073
- };
1074
922
  const deserializeMetadata = (output) => ({
1075
923
  httpStatusCode: output.statusCode,
1076
924
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],