@aws-sdk/client-signer 3.310.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.
@@ -15,13 +15,13 @@ const se_AddProfilePermissionCommand = async (input, context) => {
15
15
  "/signing-profiles/{profileName}/permissions";
16
16
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "profileName", () => input.profileName, "{profileName}", false);
17
17
  let body;
18
- body = JSON.stringify({
19
- ...(input.action != null && { action: input.action }),
20
- ...(input.principal != null && { principal: input.principal }),
21
- ...(input.profileVersion != null && { profileVersion: input.profileVersion }),
22
- ...(input.revisionId != null && { revisionId: input.revisionId }),
23
- ...(input.statementId != null && { statementId: input.statementId }),
24
- });
18
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
19
+ action: [],
20
+ principal: [],
21
+ profileVersion: [],
22
+ revisionId: [],
23
+ statementId: [],
24
+ }));
25
25
  return new protocol_http_1.HttpRequest({
26
26
  protocol,
27
27
  hostname,
@@ -89,7 +89,7 @@ const se_GetSigningProfileCommand = async (input, context) => {
89
89
  const headers = {};
90
90
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/signing-profiles/{profileName}";
91
91
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "profileName", () => input.profileName, "{profileName}", false);
92
- const query = map({
92
+ const query = (0, smithy_client_1.map)({
93
93
  profileOwner: [, input.profileOwner],
94
94
  });
95
95
  let body;
@@ -111,7 +111,7 @@ const se_ListProfilePermissionsCommand = async (input, context) => {
111
111
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
112
112
  "/signing-profiles/{profileName}/permissions";
113
113
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "profileName", () => input.profileName, "{profileName}", false);
114
- const query = map({
114
+ const query = (0, smithy_client_1.map)({
115
115
  nextToken: [, input.nextToken],
116
116
  });
117
117
  let body;
@@ -131,7 +131,7 @@ const se_ListSigningJobsCommand = async (input, context) => {
131
131
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
132
132
  const headers = {};
133
133
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/signing-jobs";
134
- const query = map({
134
+ const query = (0, smithy_client_1.map)({
135
135
  status: [, input.status],
136
136
  platformId: [, input.platformId],
137
137
  requestedBy: [, input.requestedBy],
@@ -165,7 +165,7 @@ const se_ListSigningPlatformsCommand = async (input, context) => {
165
165
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
166
166
  const headers = {};
167
167
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/signing-platforms";
168
- const query = map({
168
+ const query = (0, smithy_client_1.map)({
169
169
  category: [, input.category],
170
170
  partner: [, input.partner],
171
171
  target: [, input.target],
@@ -189,7 +189,7 @@ const se_ListSigningProfilesCommand = async (input, context) => {
189
189
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
190
190
  const headers = {};
191
191
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/signing-profiles";
192
- const query = map({
192
+ const query = (0, smithy_client_1.map)({
193
193
  includeCanceled: [() => input.includeCanceled !== void 0, () => input.includeCanceled.toString()],
194
194
  maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
195
195
  nextToken: [, input.nextToken],
@@ -234,18 +234,14 @@ const se_PutSigningProfileCommand = async (input, context) => {
234
234
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/signing-profiles/{profileName}";
235
235
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "profileName", () => input.profileName, "{profileName}", false);
236
236
  let body;
237
- body = JSON.stringify({
238
- ...(input.overrides != null && { overrides: se_SigningPlatformOverrides(input.overrides, context) }),
239
- ...(input.platformId != null && { platformId: input.platformId }),
240
- ...(input.signatureValidityPeriod != null && {
241
- signatureValidityPeriod: se_SignatureValidityPeriod(input.signatureValidityPeriod, context),
242
- }),
243
- ...(input.signingMaterial != null && { signingMaterial: se_SigningMaterial(input.signingMaterial, context) }),
244
- ...(input.signingParameters != null && {
245
- signingParameters: se_SigningParameters(input.signingParameters, context),
246
- }),
247
- ...(input.tags != null && { tags: se_TagMap(input.tags, context) }),
248
- });
237
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
238
+ overrides: (_) => (0, smithy_client_1._json)(_),
239
+ platformId: [],
240
+ signatureValidityPeriod: (_) => (0, smithy_client_1._json)(_),
241
+ signingMaterial: (_) => (0, smithy_client_1._json)(_),
242
+ signingParameters: (_) => (0, smithy_client_1._json)(_),
243
+ tags: (_) => (0, smithy_client_1._json)(_),
244
+ }));
249
245
  return new protocol_http_1.HttpRequest({
250
246
  protocol,
251
247
  hostname,
@@ -264,7 +260,7 @@ const se_RemoveProfilePermissionCommand = async (input, context) => {
264
260
  "/signing-profiles/{profileName}/permissions/{statementId}";
265
261
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "profileName", () => input.profileName, "{profileName}", false);
266
262
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "statementId", () => input.statementId, "{statementId}", false);
267
- const query = map({
263
+ const query = (0, smithy_client_1.map)({
268
264
  revisionId: [, (0, smithy_client_1.expectNonNull)(input.revisionId, `revisionId`)],
269
265
  });
270
266
  let body;
@@ -288,10 +284,10 @@ const se_RevokeSignatureCommand = async (input, context) => {
288
284
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/signing-jobs/{jobId}/revoke";
289
285
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "jobId", () => input.jobId, "{jobId}", false);
290
286
  let body;
291
- body = JSON.stringify({
292
- ...(input.jobOwner != null && { jobOwner: input.jobOwner }),
293
- ...(input.reason != null && { reason: input.reason }),
294
- });
287
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
288
+ jobOwner: [],
289
+ reason: [],
290
+ }));
295
291
  return new protocol_http_1.HttpRequest({
296
292
  protocol,
297
293
  hostname,
@@ -311,11 +307,11 @@ const se_RevokeSigningProfileCommand = async (input, context) => {
311
307
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/signing-profiles/{profileName}/revoke";
312
308
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "profileName", () => input.profileName, "{profileName}", false);
313
309
  let body;
314
- body = JSON.stringify({
315
- ...(input.effectiveTime != null && { effectiveTime: Math.round(input.effectiveTime.getTime() / 1000) }),
316
- ...(input.profileVersion != null && { profileVersion: input.profileVersion }),
317
- ...(input.reason != null && { reason: input.reason }),
318
- });
310
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
311
+ effectiveTime: (_) => Math.round(_.getTime() / 1000),
312
+ profileVersion: [],
313
+ reason: [],
314
+ }));
319
315
  return new protocol_http_1.HttpRequest({
320
316
  protocol,
321
317
  hostname,
@@ -334,13 +330,13 @@ const se_StartSigningJobCommand = async (input, context) => {
334
330
  };
335
331
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/signing-jobs";
336
332
  let body;
337
- body = JSON.stringify({
338
- clientRequestToken: input.clientRequestToken ?? (0, uuid_1.v4)(),
339
- ...(input.destination != null && { destination: se_Destination(input.destination, context) }),
340
- ...(input.profileName != null && { profileName: input.profileName }),
341
- ...(input.profileOwner != null && { profileOwner: input.profileOwner }),
342
- ...(input.source != null && { source: se_Source(input.source, context) }),
343
- });
333
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
334
+ clientRequestToken: (_) => _ ?? (0, uuid_1.v4)(),
335
+ destination: (_) => (0, smithy_client_1._json)(_),
336
+ profileName: [],
337
+ profileOwner: [],
338
+ source: (_) => (0, smithy_client_1._json)(_),
339
+ }));
344
340
  return new protocol_http_1.HttpRequest({
345
341
  protocol,
346
342
  hostname,
@@ -360,9 +356,9 @@ const se_TagResourceCommand = async (input, context) => {
360
356
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
361
357
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
362
358
  let body;
363
- body = JSON.stringify({
364
- ...(input.tags != null && { tags: se_TagMap(input.tags, context) }),
365
- });
359
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
360
+ tags: (_) => (0, smithy_client_1._json)(_),
361
+ }));
366
362
  return new protocol_http_1.HttpRequest({
367
363
  protocol,
368
364
  hostname,
@@ -379,7 +375,7 @@ const se_UntagResourceCommand = async (input, context) => {
379
375
  const headers = {};
380
376
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
381
377
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
382
- const query = map({
378
+ const query = (0, smithy_client_1.map)({
383
379
  tagKeys: [
384
380
  (0, smithy_client_1.expectNonNull)(input.tagKeys, `tagKeys`) != null,
385
381
  () => (input.tagKeys || []).map((_entry) => _entry),
@@ -402,13 +398,14 @@ const de_AddProfilePermissionCommand = async (output, context) => {
402
398
  if (output.statusCode !== 200 && output.statusCode >= 300) {
403
399
  return de_AddProfilePermissionCommandError(output, context);
404
400
  }
405
- const contents = map({
401
+ const contents = (0, smithy_client_1.map)({
406
402
  $metadata: deserializeMetadata(output),
407
403
  });
408
404
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
409
- if (data.revisionId != null) {
410
- contents.revisionId = (0, smithy_client_1.expectString)(data.revisionId);
411
- }
405
+ const doc = (0, smithy_client_1.take)(data, {
406
+ revisionId: smithy_client_1.expectString,
407
+ });
408
+ Object.assign(contents, doc);
412
409
  return contents;
413
410
  };
414
411
  exports.de_AddProfilePermissionCommand = de_AddProfilePermissionCommand;
@@ -442,10 +439,9 @@ const de_AddProfilePermissionCommandError = async (output, context) => {
442
439
  throw await de_ValidationExceptionRes(parsedOutput, context);
443
440
  default:
444
441
  const parsedBody = parsedOutput.body;
445
- (0, smithy_client_1.throwDefaultError)({
442
+ return throwDefaultError({
446
443
  output,
447
444
  parsedBody,
448
- exceptionCtor: SignerServiceException_1.SignerServiceException,
449
445
  errorCode,
450
446
  });
451
447
  }
@@ -454,7 +450,7 @@ const de_CancelSigningProfileCommand = async (output, context) => {
454
450
  if (output.statusCode !== 200 && output.statusCode >= 300) {
455
451
  return de_CancelSigningProfileCommandError(output, context);
456
452
  }
457
- const contents = map({
453
+ const contents = (0, smithy_client_1.map)({
458
454
  $metadata: deserializeMetadata(output),
459
455
  });
460
456
  await collectBody(output.body, context);
@@ -482,10 +478,9 @@ const de_CancelSigningProfileCommandError = async (output, context) => {
482
478
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
483
479
  default:
484
480
  const parsedBody = parsedOutput.body;
485
- (0, smithy_client_1.throwDefaultError)({
481
+ return throwDefaultError({
486
482
  output,
487
483
  parsedBody,
488
- exceptionCtor: SignerServiceException_1.SignerServiceException,
489
484
  errorCode,
490
485
  });
491
486
  }
@@ -494,67 +489,32 @@ const de_DescribeSigningJobCommand = async (output, context) => {
494
489
  if (output.statusCode !== 200 && output.statusCode >= 300) {
495
490
  return de_DescribeSigningJobCommandError(output, context);
496
491
  }
497
- const contents = map({
492
+ const contents = (0, smithy_client_1.map)({
498
493
  $metadata: deserializeMetadata(output),
499
494
  });
500
495
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
501
- if (data.completedAt != null) {
502
- contents.completedAt = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.completedAt)));
503
- }
504
- if (data.createdAt != null) {
505
- contents.createdAt = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.createdAt)));
506
- }
507
- if (data.jobId != null) {
508
- contents.jobId = (0, smithy_client_1.expectString)(data.jobId);
509
- }
510
- if (data.jobInvoker != null) {
511
- contents.jobInvoker = (0, smithy_client_1.expectString)(data.jobInvoker);
512
- }
513
- if (data.jobOwner != null) {
514
- contents.jobOwner = (0, smithy_client_1.expectString)(data.jobOwner);
515
- }
516
- if (data.overrides != null) {
517
- contents.overrides = de_SigningPlatformOverrides(data.overrides, context);
518
- }
519
- if (data.platformDisplayName != null) {
520
- contents.platformDisplayName = (0, smithy_client_1.expectString)(data.platformDisplayName);
521
- }
522
- if (data.platformId != null) {
523
- contents.platformId = (0, smithy_client_1.expectString)(data.platformId);
524
- }
525
- if (data.profileName != null) {
526
- contents.profileName = (0, smithy_client_1.expectString)(data.profileName);
527
- }
528
- if (data.profileVersion != null) {
529
- contents.profileVersion = (0, smithy_client_1.expectString)(data.profileVersion);
530
- }
531
- if (data.requestedBy != null) {
532
- contents.requestedBy = (0, smithy_client_1.expectString)(data.requestedBy);
533
- }
534
- if (data.revocationRecord != null) {
535
- contents.revocationRecord = de_SigningJobRevocationRecord(data.revocationRecord, context);
536
- }
537
- if (data.signatureExpiresAt != null) {
538
- contents.signatureExpiresAt = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.signatureExpiresAt)));
539
- }
540
- if (data.signedObject != null) {
541
- contents.signedObject = de_SignedObject(data.signedObject, context);
542
- }
543
- if (data.signingMaterial != null) {
544
- contents.signingMaterial = de_SigningMaterial(data.signingMaterial, context);
545
- }
546
- if (data.signingParameters != null) {
547
- contents.signingParameters = de_SigningParameters(data.signingParameters, context);
548
- }
549
- if (data.source != null) {
550
- contents.source = de_Source(data.source, context);
551
- }
552
- if (data.status != null) {
553
- contents.status = (0, smithy_client_1.expectString)(data.status);
554
- }
555
- if (data.statusReason != null) {
556
- contents.statusReason = (0, smithy_client_1.expectString)(data.statusReason);
557
- }
496
+ const doc = (0, smithy_client_1.take)(data, {
497
+ completedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
498
+ createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
499
+ jobId: smithy_client_1.expectString,
500
+ jobInvoker: smithy_client_1.expectString,
501
+ jobOwner: smithy_client_1.expectString,
502
+ overrides: smithy_client_1._json,
503
+ platformDisplayName: smithy_client_1.expectString,
504
+ platformId: smithy_client_1.expectString,
505
+ profileName: smithy_client_1.expectString,
506
+ profileVersion: smithy_client_1.expectString,
507
+ requestedBy: smithy_client_1.expectString,
508
+ revocationRecord: (_) => de_SigningJobRevocationRecord(_, context),
509
+ signatureExpiresAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
510
+ signedObject: smithy_client_1._json,
511
+ signingMaterial: smithy_client_1._json,
512
+ signingParameters: smithy_client_1._json,
513
+ source: smithy_client_1._json,
514
+ status: smithy_client_1.expectString,
515
+ statusReason: smithy_client_1.expectString,
516
+ });
517
+ Object.assign(contents, doc);
558
518
  return contents;
559
519
  };
560
520
  exports.de_DescribeSigningJobCommand = de_DescribeSigningJobCommand;
@@ -579,10 +539,9 @@ const de_DescribeSigningJobCommandError = async (output, context) => {
579
539
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
580
540
  default:
581
541
  const parsedBody = parsedOutput.body;
582
- (0, smithy_client_1.throwDefaultError)({
542
+ return throwDefaultError({
583
543
  output,
584
544
  parsedBody,
585
- exceptionCtor: SignerServiceException_1.SignerServiceException,
586
545
  errorCode,
587
546
  });
588
547
  }
@@ -591,37 +550,22 @@ const de_GetSigningPlatformCommand = async (output, context) => {
591
550
  if (output.statusCode !== 200 && output.statusCode >= 300) {
592
551
  return de_GetSigningPlatformCommandError(output, context);
593
552
  }
594
- const contents = map({
553
+ const contents = (0, smithy_client_1.map)({
595
554
  $metadata: deserializeMetadata(output),
596
555
  });
597
556
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
598
- if (data.category != null) {
599
- contents.category = (0, smithy_client_1.expectString)(data.category);
600
- }
601
- if (data.displayName != null) {
602
- contents.displayName = (0, smithy_client_1.expectString)(data.displayName);
603
- }
604
- if (data.maxSizeInMB != null) {
605
- contents.maxSizeInMB = (0, smithy_client_1.expectInt32)(data.maxSizeInMB);
606
- }
607
- if (data.partner != null) {
608
- contents.partner = (0, smithy_client_1.expectString)(data.partner);
609
- }
610
- if (data.platformId != null) {
611
- contents.platformId = (0, smithy_client_1.expectString)(data.platformId);
612
- }
613
- if (data.revocationSupported != null) {
614
- contents.revocationSupported = (0, smithy_client_1.expectBoolean)(data.revocationSupported);
615
- }
616
- if (data.signingConfiguration != null) {
617
- contents.signingConfiguration = de_SigningConfiguration(data.signingConfiguration, context);
618
- }
619
- if (data.signingImageFormat != null) {
620
- contents.signingImageFormat = de_SigningImageFormat(data.signingImageFormat, context);
621
- }
622
- if (data.target != null) {
623
- contents.target = (0, smithy_client_1.expectString)(data.target);
624
- }
557
+ const doc = (0, smithy_client_1.take)(data, {
558
+ category: smithy_client_1.expectString,
559
+ displayName: smithy_client_1.expectString,
560
+ maxSizeInMB: smithy_client_1.expectInt32,
561
+ partner: smithy_client_1.expectString,
562
+ platformId: smithy_client_1.expectString,
563
+ revocationSupported: smithy_client_1.expectBoolean,
564
+ signingConfiguration: smithy_client_1._json,
565
+ signingImageFormat: smithy_client_1._json,
566
+ target: smithy_client_1.expectString,
567
+ });
568
+ Object.assign(contents, doc);
625
569
  return contents;
626
570
  };
627
571
  exports.de_GetSigningPlatformCommand = de_GetSigningPlatformCommand;
@@ -646,10 +590,9 @@ const de_GetSigningPlatformCommandError = async (output, context) => {
646
590
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
647
591
  default:
648
592
  const parsedBody = parsedOutput.body;
649
- (0, smithy_client_1.throwDefaultError)({
593
+ return throwDefaultError({
650
594
  output,
651
595
  parsedBody,
652
- exceptionCtor: SignerServiceException_1.SignerServiceException,
653
596
  errorCode,
654
597
  });
655
598
  }
@@ -658,52 +601,27 @@ const de_GetSigningProfileCommand = async (output, context) => {
658
601
  if (output.statusCode !== 200 && output.statusCode >= 300) {
659
602
  return de_GetSigningProfileCommandError(output, context);
660
603
  }
661
- const contents = map({
604
+ const contents = (0, smithy_client_1.map)({
662
605
  $metadata: deserializeMetadata(output),
663
606
  });
664
607
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
665
- if (data.arn != null) {
666
- contents.arn = (0, smithy_client_1.expectString)(data.arn);
667
- }
668
- if (data.overrides != null) {
669
- contents.overrides = de_SigningPlatformOverrides(data.overrides, context);
670
- }
671
- if (data.platformDisplayName != null) {
672
- contents.platformDisplayName = (0, smithy_client_1.expectString)(data.platformDisplayName);
673
- }
674
- if (data.platformId != null) {
675
- contents.platformId = (0, smithy_client_1.expectString)(data.platformId);
676
- }
677
- if (data.profileName != null) {
678
- contents.profileName = (0, smithy_client_1.expectString)(data.profileName);
679
- }
680
- if (data.profileVersion != null) {
681
- contents.profileVersion = (0, smithy_client_1.expectString)(data.profileVersion);
682
- }
683
- if (data.profileVersionArn != null) {
684
- contents.profileVersionArn = (0, smithy_client_1.expectString)(data.profileVersionArn);
685
- }
686
- if (data.revocationRecord != null) {
687
- contents.revocationRecord = de_SigningProfileRevocationRecord(data.revocationRecord, context);
688
- }
689
- if (data.signatureValidityPeriod != null) {
690
- contents.signatureValidityPeriod = de_SignatureValidityPeriod(data.signatureValidityPeriod, context);
691
- }
692
- if (data.signingMaterial != null) {
693
- contents.signingMaterial = de_SigningMaterial(data.signingMaterial, context);
694
- }
695
- if (data.signingParameters != null) {
696
- contents.signingParameters = de_SigningParameters(data.signingParameters, context);
697
- }
698
- if (data.status != null) {
699
- contents.status = (0, smithy_client_1.expectString)(data.status);
700
- }
701
- if (data.statusReason != null) {
702
- contents.statusReason = (0, smithy_client_1.expectString)(data.statusReason);
703
- }
704
- if (data.tags != null) {
705
- contents.tags = de_TagMap(data.tags, context);
706
- }
608
+ const doc = (0, smithy_client_1.take)(data, {
609
+ arn: smithy_client_1.expectString,
610
+ overrides: smithy_client_1._json,
611
+ platformDisplayName: smithy_client_1.expectString,
612
+ platformId: smithy_client_1.expectString,
613
+ profileName: smithy_client_1.expectString,
614
+ profileVersion: smithy_client_1.expectString,
615
+ profileVersionArn: smithy_client_1.expectString,
616
+ revocationRecord: (_) => de_SigningProfileRevocationRecord(_, context),
617
+ signatureValidityPeriod: smithy_client_1._json,
618
+ signingMaterial: smithy_client_1._json,
619
+ signingParameters: smithy_client_1._json,
620
+ status: smithy_client_1.expectString,
621
+ statusReason: smithy_client_1.expectString,
622
+ tags: smithy_client_1._json,
623
+ });
624
+ Object.assign(contents, doc);
707
625
  return contents;
708
626
  };
709
627
  exports.de_GetSigningProfileCommand = de_GetSigningProfileCommand;
@@ -728,10 +646,9 @@ const de_GetSigningProfileCommandError = async (output, context) => {
728
646
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
729
647
  default:
730
648
  const parsedBody = parsedOutput.body;
731
- (0, smithy_client_1.throwDefaultError)({
649
+ return throwDefaultError({
732
650
  output,
733
651
  parsedBody,
734
- exceptionCtor: SignerServiceException_1.SignerServiceException,
735
652
  errorCode,
736
653
  });
737
654
  }
@@ -740,22 +657,17 @@ const de_ListProfilePermissionsCommand = async (output, context) => {
740
657
  if (output.statusCode !== 200 && output.statusCode >= 300) {
741
658
  return de_ListProfilePermissionsCommandError(output, context);
742
659
  }
743
- const contents = map({
660
+ const contents = (0, smithy_client_1.map)({
744
661
  $metadata: deserializeMetadata(output),
745
662
  });
746
663
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
747
- if (data.nextToken != null) {
748
- contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
749
- }
750
- if (data.permissions != null) {
751
- contents.permissions = de_Permissions(data.permissions, context);
752
- }
753
- if (data.policySizeBytes != null) {
754
- contents.policySizeBytes = (0, smithy_client_1.expectInt32)(data.policySizeBytes);
755
- }
756
- if (data.revisionId != null) {
757
- contents.revisionId = (0, smithy_client_1.expectString)(data.revisionId);
758
- }
664
+ const doc = (0, smithy_client_1.take)(data, {
665
+ nextToken: smithy_client_1.expectString,
666
+ permissions: smithy_client_1._json,
667
+ policySizeBytes: smithy_client_1.expectInt32,
668
+ revisionId: smithy_client_1.expectString,
669
+ });
670
+ Object.assign(contents, doc);
759
671
  return contents;
760
672
  };
761
673
  exports.de_ListProfilePermissionsCommand = de_ListProfilePermissionsCommand;
@@ -783,10 +695,9 @@ const de_ListProfilePermissionsCommandError = async (output, context) => {
783
695
  throw await de_ValidationExceptionRes(parsedOutput, context);
784
696
  default:
785
697
  const parsedBody = parsedOutput.body;
786
- (0, smithy_client_1.throwDefaultError)({
698
+ return throwDefaultError({
787
699
  output,
788
700
  parsedBody,
789
- exceptionCtor: SignerServiceException_1.SignerServiceException,
790
701
  errorCode,
791
702
  });
792
703
  }
@@ -795,16 +706,15 @@ const de_ListSigningJobsCommand = async (output, context) => {
795
706
  if (output.statusCode !== 200 && output.statusCode >= 300) {
796
707
  return de_ListSigningJobsCommandError(output, context);
797
708
  }
798
- const contents = map({
709
+ const contents = (0, smithy_client_1.map)({
799
710
  $metadata: deserializeMetadata(output),
800
711
  });
801
712
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
802
- if (data.jobs != null) {
803
- contents.jobs = de_SigningJobs(data.jobs, context);
804
- }
805
- if (data.nextToken != null) {
806
- contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
807
- }
713
+ const doc = (0, smithy_client_1.take)(data, {
714
+ jobs: (_) => de_SigningJobs(_, context),
715
+ nextToken: smithy_client_1.expectString,
716
+ });
717
+ Object.assign(contents, doc);
808
718
  return contents;
809
719
  };
810
720
  exports.de_ListSigningJobsCommand = de_ListSigningJobsCommand;
@@ -829,10 +739,9 @@ const de_ListSigningJobsCommandError = async (output, context) => {
829
739
  throw await de_ValidationExceptionRes(parsedOutput, context);
830
740
  default:
831
741
  const parsedBody = parsedOutput.body;
832
- (0, smithy_client_1.throwDefaultError)({
742
+ return throwDefaultError({
833
743
  output,
834
744
  parsedBody,
835
- exceptionCtor: SignerServiceException_1.SignerServiceException,
836
745
  errorCode,
837
746
  });
838
747
  }
@@ -841,16 +750,15 @@ const de_ListSigningPlatformsCommand = async (output, context) => {
841
750
  if (output.statusCode !== 200 && output.statusCode >= 300) {
842
751
  return de_ListSigningPlatformsCommandError(output, context);
843
752
  }
844
- const contents = map({
753
+ const contents = (0, smithy_client_1.map)({
845
754
  $metadata: deserializeMetadata(output),
846
755
  });
847
756
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
848
- if (data.nextToken != null) {
849
- contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
850
- }
851
- if (data.platforms != null) {
852
- contents.platforms = de_SigningPlatforms(data.platforms, context);
853
- }
757
+ const doc = (0, smithy_client_1.take)(data, {
758
+ nextToken: smithy_client_1.expectString,
759
+ platforms: smithy_client_1._json,
760
+ });
761
+ Object.assign(contents, doc);
854
762
  return contents;
855
763
  };
856
764
  exports.de_ListSigningPlatformsCommand = de_ListSigningPlatformsCommand;
@@ -875,10 +783,9 @@ const de_ListSigningPlatformsCommandError = async (output, context) => {
875
783
  throw await de_ValidationExceptionRes(parsedOutput, context);
876
784
  default:
877
785
  const parsedBody = parsedOutput.body;
878
- (0, smithy_client_1.throwDefaultError)({
786
+ return throwDefaultError({
879
787
  output,
880
788
  parsedBody,
881
- exceptionCtor: SignerServiceException_1.SignerServiceException,
882
789
  errorCode,
883
790
  });
884
791
  }
@@ -887,16 +794,15 @@ const de_ListSigningProfilesCommand = async (output, context) => {
887
794
  if (output.statusCode !== 200 && output.statusCode >= 300) {
888
795
  return de_ListSigningProfilesCommandError(output, context);
889
796
  }
890
- const contents = map({
797
+ const contents = (0, smithy_client_1.map)({
891
798
  $metadata: deserializeMetadata(output),
892
799
  });
893
800
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
894
- if (data.nextToken != null) {
895
- contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
896
- }
897
- if (data.profiles != null) {
898
- contents.profiles = de_SigningProfiles(data.profiles, context);
899
- }
801
+ const doc = (0, smithy_client_1.take)(data, {
802
+ nextToken: smithy_client_1.expectString,
803
+ profiles: smithy_client_1._json,
804
+ });
805
+ Object.assign(contents, doc);
900
806
  return contents;
901
807
  };
902
808
  exports.de_ListSigningProfilesCommand = de_ListSigningProfilesCommand;
@@ -918,10 +824,9 @@ const de_ListSigningProfilesCommandError = async (output, context) => {
918
824
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
919
825
  default:
920
826
  const parsedBody = parsedOutput.body;
921
- (0, smithy_client_1.throwDefaultError)({
827
+ return throwDefaultError({
922
828
  output,
923
829
  parsedBody,
924
- exceptionCtor: SignerServiceException_1.SignerServiceException,
925
830
  errorCode,
926
831
  });
927
832
  }
@@ -930,13 +835,14 @@ const de_ListTagsForResourceCommand = async (output, context) => {
930
835
  if (output.statusCode !== 200 && output.statusCode >= 300) {
931
836
  return de_ListTagsForResourceCommandError(output, context);
932
837
  }
933
- const contents = map({
838
+ const contents = (0, smithy_client_1.map)({
934
839
  $metadata: deserializeMetadata(output),
935
840
  });
936
841
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
937
- if (data.tags != null) {
938
- contents.tags = de_TagMap(data.tags, context);
939
- }
842
+ const doc = (0, smithy_client_1.take)(data, {
843
+ tags: smithy_client_1._json,
844
+ });
845
+ Object.assign(contents, doc);
940
846
  return contents;
941
847
  };
942
848
  exports.de_ListTagsForResourceCommand = de_ListTagsForResourceCommand;
@@ -961,10 +867,9 @@ const de_ListTagsForResourceCommandError = async (output, context) => {
961
867
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
962
868
  default:
963
869
  const parsedBody = parsedOutput.body;
964
- (0, smithy_client_1.throwDefaultError)({
870
+ return throwDefaultError({
965
871
  output,
966
872
  parsedBody,
967
- exceptionCtor: SignerServiceException_1.SignerServiceException,
968
873
  errorCode,
969
874
  });
970
875
  }
@@ -973,19 +878,16 @@ const de_PutSigningProfileCommand = async (output, context) => {
973
878
  if (output.statusCode !== 200 && output.statusCode >= 300) {
974
879
  return de_PutSigningProfileCommandError(output, context);
975
880
  }
976
- const contents = map({
881
+ const contents = (0, smithy_client_1.map)({
977
882
  $metadata: deserializeMetadata(output),
978
883
  });
979
884
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
980
- if (data.arn != null) {
981
- contents.arn = (0, smithy_client_1.expectString)(data.arn);
982
- }
983
- if (data.profileVersion != null) {
984
- contents.profileVersion = (0, smithy_client_1.expectString)(data.profileVersion);
985
- }
986
- if (data.profileVersionArn != null) {
987
- contents.profileVersionArn = (0, smithy_client_1.expectString)(data.profileVersionArn);
988
- }
885
+ const doc = (0, smithy_client_1.take)(data, {
886
+ arn: smithy_client_1.expectString,
887
+ profileVersion: smithy_client_1.expectString,
888
+ profileVersionArn: smithy_client_1.expectString,
889
+ });
890
+ Object.assign(contents, doc);
989
891
  return contents;
990
892
  };
991
893
  exports.de_PutSigningProfileCommand = de_PutSigningProfileCommand;
@@ -1013,10 +915,9 @@ const de_PutSigningProfileCommandError = async (output, context) => {
1013
915
  throw await de_ValidationExceptionRes(parsedOutput, context);
1014
916
  default:
1015
917
  const parsedBody = parsedOutput.body;
1016
- (0, smithy_client_1.throwDefaultError)({
918
+ return throwDefaultError({
1017
919
  output,
1018
920
  parsedBody,
1019
- exceptionCtor: SignerServiceException_1.SignerServiceException,
1020
921
  errorCode,
1021
922
  });
1022
923
  }
@@ -1025,13 +926,14 @@ const de_RemoveProfilePermissionCommand = async (output, context) => {
1025
926
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1026
927
  return de_RemoveProfilePermissionCommandError(output, context);
1027
928
  }
1028
- const contents = map({
929
+ const contents = (0, smithy_client_1.map)({
1029
930
  $metadata: deserializeMetadata(output),
1030
931
  });
1031
932
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1032
- if (data.revisionId != null) {
1033
- contents.revisionId = (0, smithy_client_1.expectString)(data.revisionId);
1034
- }
933
+ const doc = (0, smithy_client_1.take)(data, {
934
+ revisionId: smithy_client_1.expectString,
935
+ });
936
+ Object.assign(contents, doc);
1035
937
  return contents;
1036
938
  };
1037
939
  exports.de_RemoveProfilePermissionCommand = de_RemoveProfilePermissionCommand;
@@ -1062,10 +964,9 @@ const de_RemoveProfilePermissionCommandError = async (output, context) => {
1062
964
  throw await de_ValidationExceptionRes(parsedOutput, context);
1063
965
  default:
1064
966
  const parsedBody = parsedOutput.body;
1065
- (0, smithy_client_1.throwDefaultError)({
967
+ return throwDefaultError({
1066
968
  output,
1067
969
  parsedBody,
1068
- exceptionCtor: SignerServiceException_1.SignerServiceException,
1069
970
  errorCode,
1070
971
  });
1071
972
  }
@@ -1074,7 +975,7 @@ const de_RevokeSignatureCommand = async (output, context) => {
1074
975
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1075
976
  return de_RevokeSignatureCommandError(output, context);
1076
977
  }
1077
- const contents = map({
978
+ const contents = (0, smithy_client_1.map)({
1078
979
  $metadata: deserializeMetadata(output),
1079
980
  });
1080
981
  await collectBody(output.body, context);
@@ -1105,10 +1006,9 @@ const de_RevokeSignatureCommandError = async (output, context) => {
1105
1006
  throw await de_ValidationExceptionRes(parsedOutput, context);
1106
1007
  default:
1107
1008
  const parsedBody = parsedOutput.body;
1108
- (0, smithy_client_1.throwDefaultError)({
1009
+ return throwDefaultError({
1109
1010
  output,
1110
1011
  parsedBody,
1111
- exceptionCtor: SignerServiceException_1.SignerServiceException,
1112
1012
  errorCode,
1113
1013
  });
1114
1014
  }
@@ -1117,7 +1017,7 @@ const de_RevokeSigningProfileCommand = async (output, context) => {
1117
1017
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1118
1018
  return de_RevokeSigningProfileCommandError(output, context);
1119
1019
  }
1120
- const contents = map({
1020
+ const contents = (0, smithy_client_1.map)({
1121
1021
  $metadata: deserializeMetadata(output),
1122
1022
  });
1123
1023
  await collectBody(output.body, context);
@@ -1148,10 +1048,9 @@ const de_RevokeSigningProfileCommandError = async (output, context) => {
1148
1048
  throw await de_ValidationExceptionRes(parsedOutput, context);
1149
1049
  default:
1150
1050
  const parsedBody = parsedOutput.body;
1151
- (0, smithy_client_1.throwDefaultError)({
1051
+ return throwDefaultError({
1152
1052
  output,
1153
1053
  parsedBody,
1154
- exceptionCtor: SignerServiceException_1.SignerServiceException,
1155
1054
  errorCode,
1156
1055
  });
1157
1056
  }
@@ -1160,16 +1059,15 @@ const de_StartSigningJobCommand = async (output, context) => {
1160
1059
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1161
1060
  return de_StartSigningJobCommandError(output, context);
1162
1061
  }
1163
- const contents = map({
1062
+ const contents = (0, smithy_client_1.map)({
1164
1063
  $metadata: deserializeMetadata(output),
1165
1064
  });
1166
1065
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1167
- if (data.jobId != null) {
1168
- contents.jobId = (0, smithy_client_1.expectString)(data.jobId);
1169
- }
1170
- if (data.jobOwner != null) {
1171
- contents.jobOwner = (0, smithy_client_1.expectString)(data.jobOwner);
1172
- }
1066
+ const doc = (0, smithy_client_1.take)(data, {
1067
+ jobId: smithy_client_1.expectString,
1068
+ jobOwner: smithy_client_1.expectString,
1069
+ });
1070
+ Object.assign(contents, doc);
1173
1071
  return contents;
1174
1072
  };
1175
1073
  exports.de_StartSigningJobCommand = de_StartSigningJobCommand;
@@ -1200,10 +1098,9 @@ const de_StartSigningJobCommandError = async (output, context) => {
1200
1098
  throw await de_ValidationExceptionRes(parsedOutput, context);
1201
1099
  default:
1202
1100
  const parsedBody = parsedOutput.body;
1203
- (0, smithy_client_1.throwDefaultError)({
1101
+ return throwDefaultError({
1204
1102
  output,
1205
1103
  parsedBody,
1206
- exceptionCtor: SignerServiceException_1.SignerServiceException,
1207
1104
  errorCode,
1208
1105
  });
1209
1106
  }
@@ -1212,7 +1109,7 @@ const de_TagResourceCommand = async (output, context) => {
1212
1109
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1213
1110
  return de_TagResourceCommandError(output, context);
1214
1111
  }
1215
- const contents = map({
1112
+ const contents = (0, smithy_client_1.map)({
1216
1113
  $metadata: deserializeMetadata(output),
1217
1114
  });
1218
1115
  await collectBody(output.body, context);
@@ -1240,10 +1137,9 @@ const de_TagResourceCommandError = async (output, context) => {
1240
1137
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
1241
1138
  default:
1242
1139
  const parsedBody = parsedOutput.body;
1243
- (0, smithy_client_1.throwDefaultError)({
1140
+ return throwDefaultError({
1244
1141
  output,
1245
1142
  parsedBody,
1246
- exceptionCtor: SignerServiceException_1.SignerServiceException,
1247
1143
  errorCode,
1248
1144
  });
1249
1145
  }
@@ -1252,7 +1148,7 @@ const de_UntagResourceCommand = async (output, context) => {
1252
1148
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1253
1149
  return de_UntagResourceCommandError(output, context);
1254
1150
  }
1255
- const contents = map({
1151
+ const contents = (0, smithy_client_1.map)({
1256
1152
  $metadata: deserializeMetadata(output),
1257
1153
  });
1258
1154
  await collectBody(output.body, context);
@@ -1280,24 +1176,22 @@ const de_UntagResourceCommandError = async (output, context) => {
1280
1176
  throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
1281
1177
  default:
1282
1178
  const parsedBody = parsedOutput.body;
1283
- (0, smithy_client_1.throwDefaultError)({
1179
+ return throwDefaultError({
1284
1180
  output,
1285
1181
  parsedBody,
1286
- exceptionCtor: SignerServiceException_1.SignerServiceException,
1287
1182
  errorCode,
1288
1183
  });
1289
1184
  }
1290
1185
  };
1291
- const map = smithy_client_1.map;
1186
+ const throwDefaultError = (0, smithy_client_1.withBaseException)(SignerServiceException_1.SignerServiceException);
1292
1187
  const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
1293
- const contents = map({});
1188
+ const contents = (0, smithy_client_1.map)({});
1294
1189
  const data = parsedOutput.body;
1295
- if (data.code != null) {
1296
- contents.code = (0, smithy_client_1.expectString)(data.code);
1297
- }
1298
- if (data.message != null) {
1299
- contents.message = (0, smithy_client_1.expectString)(data.message);
1300
- }
1190
+ const doc = (0, smithy_client_1.take)(data, {
1191
+ code: smithy_client_1.expectString,
1192
+ message: smithy_client_1.expectString,
1193
+ });
1194
+ Object.assign(contents, doc);
1301
1195
  const exception = new models_0_1.AccessDeniedException({
1302
1196
  $metadata: deserializeMetadata(parsedOutput),
1303
1197
  ...contents,
@@ -1305,14 +1199,13 @@ const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
1305
1199
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1306
1200
  };
1307
1201
  const de_BadRequestExceptionRes = async (parsedOutput, context) => {
1308
- const contents = map({});
1202
+ const contents = (0, smithy_client_1.map)({});
1309
1203
  const data = parsedOutput.body;
1310
- if (data.code != null) {
1311
- contents.code = (0, smithy_client_1.expectString)(data.code);
1312
- }
1313
- if (data.message != null) {
1314
- contents.message = (0, smithy_client_1.expectString)(data.message);
1315
- }
1204
+ const doc = (0, smithy_client_1.take)(data, {
1205
+ code: smithy_client_1.expectString,
1206
+ message: smithy_client_1.expectString,
1207
+ });
1208
+ Object.assign(contents, doc);
1316
1209
  const exception = new models_0_1.BadRequestException({
1317
1210
  $metadata: deserializeMetadata(parsedOutput),
1318
1211
  ...contents,
@@ -1320,14 +1213,13 @@ const de_BadRequestExceptionRes = async (parsedOutput, context) => {
1320
1213
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1321
1214
  };
1322
1215
  const de_ConflictExceptionRes = async (parsedOutput, context) => {
1323
- const contents = map({});
1216
+ const contents = (0, smithy_client_1.map)({});
1324
1217
  const data = parsedOutput.body;
1325
- if (data.code != null) {
1326
- contents.code = (0, smithy_client_1.expectString)(data.code);
1327
- }
1328
- if (data.message != null) {
1329
- contents.message = (0, smithy_client_1.expectString)(data.message);
1330
- }
1218
+ const doc = (0, smithy_client_1.take)(data, {
1219
+ code: smithy_client_1.expectString,
1220
+ message: smithy_client_1.expectString,
1221
+ });
1222
+ Object.assign(contents, doc);
1331
1223
  const exception = new models_0_1.ConflictException({
1332
1224
  $metadata: deserializeMetadata(parsedOutput),
1333
1225
  ...contents,
@@ -1335,14 +1227,13 @@ const de_ConflictExceptionRes = async (parsedOutput, context) => {
1335
1227
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1336
1228
  };
1337
1229
  const de_InternalServiceErrorExceptionRes = async (parsedOutput, context) => {
1338
- const contents = map({});
1230
+ const contents = (0, smithy_client_1.map)({});
1339
1231
  const data = parsedOutput.body;
1340
- if (data.code != null) {
1341
- contents.code = (0, smithy_client_1.expectString)(data.code);
1342
- }
1343
- if (data.message != null) {
1344
- contents.message = (0, smithy_client_1.expectString)(data.message);
1345
- }
1232
+ const doc = (0, smithy_client_1.take)(data, {
1233
+ code: smithy_client_1.expectString,
1234
+ message: smithy_client_1.expectString,
1235
+ });
1236
+ Object.assign(contents, doc);
1346
1237
  const exception = new models_0_1.InternalServiceErrorException({
1347
1238
  $metadata: deserializeMetadata(parsedOutput),
1348
1239
  ...contents,
@@ -1350,14 +1241,13 @@ const de_InternalServiceErrorExceptionRes = async (parsedOutput, context) => {
1350
1241
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1351
1242
  };
1352
1243
  const de_NotFoundExceptionRes = async (parsedOutput, context) => {
1353
- const contents = map({});
1244
+ const contents = (0, smithy_client_1.map)({});
1354
1245
  const data = parsedOutput.body;
1355
- if (data.code != null) {
1356
- contents.code = (0, smithy_client_1.expectString)(data.code);
1357
- }
1358
- if (data.message != null) {
1359
- contents.message = (0, smithy_client_1.expectString)(data.message);
1360
- }
1246
+ const doc = (0, smithy_client_1.take)(data, {
1247
+ code: smithy_client_1.expectString,
1248
+ message: smithy_client_1.expectString,
1249
+ });
1250
+ Object.assign(contents, doc);
1361
1251
  const exception = new models_0_1.NotFoundException({
1362
1252
  $metadata: deserializeMetadata(parsedOutput),
1363
1253
  ...contents,
@@ -1365,14 +1255,13 @@ const de_NotFoundExceptionRes = async (parsedOutput, context) => {
1365
1255
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1366
1256
  };
1367
1257
  const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
1368
- const contents = map({});
1258
+ const contents = (0, smithy_client_1.map)({});
1369
1259
  const data = parsedOutput.body;
1370
- if (data.code != null) {
1371
- contents.code = (0, smithy_client_1.expectString)(data.code);
1372
- }
1373
- if (data.message != null) {
1374
- contents.message = (0, smithy_client_1.expectString)(data.message);
1375
- }
1260
+ const doc = (0, smithy_client_1.take)(data, {
1261
+ code: smithy_client_1.expectString,
1262
+ message: smithy_client_1.expectString,
1263
+ });
1264
+ Object.assign(contents, doc);
1376
1265
  const exception = new models_0_1.ResourceNotFoundException({
1377
1266
  $metadata: deserializeMetadata(parsedOutput),
1378
1267
  ...contents,
@@ -1380,14 +1269,13 @@ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
1380
1269
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1381
1270
  };
1382
1271
  const de_ServiceLimitExceededExceptionRes = async (parsedOutput, context) => {
1383
- const contents = map({});
1272
+ const contents = (0, smithy_client_1.map)({});
1384
1273
  const data = parsedOutput.body;
1385
- if (data.code != null) {
1386
- contents.code = (0, smithy_client_1.expectString)(data.code);
1387
- }
1388
- if (data.message != null) {
1389
- contents.message = (0, smithy_client_1.expectString)(data.message);
1390
- }
1274
+ const doc = (0, smithy_client_1.take)(data, {
1275
+ code: smithy_client_1.expectString,
1276
+ message: smithy_client_1.expectString,
1277
+ });
1278
+ Object.assign(contents, doc);
1391
1279
  const exception = new models_0_1.ServiceLimitExceededException({
1392
1280
  $metadata: deserializeMetadata(parsedOutput),
1393
1281
  ...contents,
@@ -1395,14 +1283,13 @@ const de_ServiceLimitExceededExceptionRes = async (parsedOutput, context) => {
1395
1283
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1396
1284
  };
1397
1285
  const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
1398
- const contents = map({});
1286
+ const contents = (0, smithy_client_1.map)({});
1399
1287
  const data = parsedOutput.body;
1400
- if (data.code != null) {
1401
- contents.code = (0, smithy_client_1.expectString)(data.code);
1402
- }
1403
- if (data.message != null) {
1404
- contents.message = (0, smithy_client_1.expectString)(data.message);
1405
- }
1288
+ const doc = (0, smithy_client_1.take)(data, {
1289
+ code: smithy_client_1.expectString,
1290
+ message: smithy_client_1.expectString,
1291
+ });
1292
+ Object.assign(contents, doc);
1406
1293
  const exception = new models_0_1.ThrottlingException({
1407
1294
  $metadata: deserializeMetadata(parsedOutput),
1408
1295
  ...contents,
@@ -1410,14 +1297,13 @@ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
1410
1297
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1411
1298
  };
1412
1299
  const de_TooManyRequestsExceptionRes = async (parsedOutput, context) => {
1413
- const contents = map({});
1300
+ const contents = (0, smithy_client_1.map)({});
1414
1301
  const data = parsedOutput.body;
1415
- if (data.code != null) {
1416
- contents.code = (0, smithy_client_1.expectString)(data.code);
1417
- }
1418
- if (data.message != null) {
1419
- contents.message = (0, smithy_client_1.expectString)(data.message);
1420
- }
1302
+ const doc = (0, smithy_client_1.take)(data, {
1303
+ code: smithy_client_1.expectString,
1304
+ message: smithy_client_1.expectString,
1305
+ });
1306
+ Object.assign(contents, doc);
1421
1307
  const exception = new models_0_1.TooManyRequestsException({
1422
1308
  $metadata: deserializeMetadata(parsedOutput),
1423
1309
  ...contents,
@@ -1425,328 +1311,58 @@ const de_TooManyRequestsExceptionRes = async (parsedOutput, context) => {
1425
1311
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1426
1312
  };
1427
1313
  const de_ValidationExceptionRes = async (parsedOutput, context) => {
1428
- const contents = map({});
1314
+ const contents = (0, smithy_client_1.map)({});
1429
1315
  const data = parsedOutput.body;
1430
- if (data.code != null) {
1431
- contents.code = (0, smithy_client_1.expectString)(data.code);
1432
- }
1433
- if (data.message != null) {
1434
- contents.message = (0, smithy_client_1.expectString)(data.message);
1435
- }
1316
+ const doc = (0, smithy_client_1.take)(data, {
1317
+ code: smithy_client_1.expectString,
1318
+ message: smithy_client_1.expectString,
1319
+ });
1320
+ Object.assign(contents, doc);
1436
1321
  const exception = new models_0_1.ValidationException({
1437
1322
  $metadata: deserializeMetadata(parsedOutput),
1438
1323
  ...contents,
1439
1324
  });
1440
1325
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1441
1326
  };
1442
- const se_Destination = (input, context) => {
1443
- return {
1444
- ...(input.s3 != null && { s3: se_S3Destination(input.s3, context) }),
1445
- };
1446
- };
1447
- const se_S3Destination = (input, context) => {
1448
- return {
1449
- ...(input.bucketName != null && { bucketName: input.bucketName }),
1450
- ...(input.prefix != null && { prefix: input.prefix }),
1451
- };
1452
- };
1453
- const se_S3Source = (input, context) => {
1454
- return {
1455
- ...(input.bucketName != null && { bucketName: input.bucketName }),
1456
- ...(input.key != null && { key: input.key }),
1457
- ...(input.version != null && { version: input.version }),
1458
- };
1459
- };
1460
- const se_SignatureValidityPeriod = (input, context) => {
1461
- return {
1462
- ...(input.type != null && { type: input.type }),
1463
- ...(input.value != null && { value: input.value }),
1464
- };
1465
- };
1466
- const se_SigningConfigurationOverrides = (input, context) => {
1467
- return {
1468
- ...(input.encryptionAlgorithm != null && { encryptionAlgorithm: input.encryptionAlgorithm }),
1469
- ...(input.hashAlgorithm != null && { hashAlgorithm: input.hashAlgorithm }),
1470
- };
1471
- };
1472
- const se_SigningMaterial = (input, context) => {
1473
- return {
1474
- ...(input.certificateArn != null && { certificateArn: input.certificateArn }),
1475
- };
1476
- };
1477
- const se_SigningParameters = (input, context) => {
1478
- return Object.entries(input).reduce((acc, [key, value]) => {
1479
- if (value === null) {
1480
- return acc;
1481
- }
1482
- acc[key] = value;
1483
- return acc;
1484
- }, {});
1485
- };
1486
- const se_SigningPlatformOverrides = (input, context) => {
1487
- return {
1488
- ...(input.signingConfiguration != null && {
1489
- signingConfiguration: se_SigningConfigurationOverrides(input.signingConfiguration, context),
1490
- }),
1491
- ...(input.signingImageFormat != null && { signingImageFormat: input.signingImageFormat }),
1492
- };
1493
- };
1494
- const se_Source = (input, context) => {
1495
- return {
1496
- ...(input.s3 != null && { s3: se_S3Source(input.s3, context) }),
1497
- };
1498
- };
1499
- const se_TagMap = (input, context) => {
1500
- return Object.entries(input).reduce((acc, [key, value]) => {
1501
- if (value === null) {
1502
- return acc;
1503
- }
1504
- acc[key] = value;
1505
- return acc;
1506
- }, {});
1507
- };
1508
- const de_EncryptionAlgorithmOptions = (output, context) => {
1509
- return {
1510
- allowedValues: output.allowedValues != null ? de_EncryptionAlgorithms(output.allowedValues, context) : undefined,
1511
- defaultValue: (0, smithy_client_1.expectString)(output.defaultValue),
1512
- };
1513
- };
1514
- const de_EncryptionAlgorithms = (output, context) => {
1515
- const retVal = (output || [])
1516
- .filter((e) => e != null)
1517
- .map((entry) => {
1518
- if (entry === null) {
1519
- return null;
1520
- }
1521
- return (0, smithy_client_1.expectString)(entry);
1522
- });
1523
- return retVal;
1524
- };
1525
- const de_HashAlgorithmOptions = (output, context) => {
1526
- return {
1527
- allowedValues: output.allowedValues != null ? de_HashAlgorithms(output.allowedValues, context) : undefined,
1528
- defaultValue: (0, smithy_client_1.expectString)(output.defaultValue),
1529
- };
1530
- };
1531
- const de_HashAlgorithms = (output, context) => {
1532
- const retVal = (output || [])
1533
- .filter((e) => e != null)
1534
- .map((entry) => {
1535
- if (entry === null) {
1536
- return null;
1537
- }
1538
- return (0, smithy_client_1.expectString)(entry);
1539
- });
1540
- return retVal;
1541
- };
1542
- const de_ImageFormats = (output, context) => {
1543
- const retVal = (output || [])
1544
- .filter((e) => e != null)
1545
- .map((entry) => {
1546
- if (entry === null) {
1547
- return null;
1548
- }
1549
- return (0, smithy_client_1.expectString)(entry);
1550
- });
1551
- return retVal;
1552
- };
1553
- const de_Permission = (output, context) => {
1554
- return {
1555
- action: (0, smithy_client_1.expectString)(output.action),
1556
- principal: (0, smithy_client_1.expectString)(output.principal),
1557
- profileVersion: (0, smithy_client_1.expectString)(output.profileVersion),
1558
- statementId: (0, smithy_client_1.expectString)(output.statementId),
1559
- };
1560
- };
1561
- const de_Permissions = (output, context) => {
1562
- const retVal = (output || [])
1563
- .filter((e) => e != null)
1564
- .map((entry) => {
1565
- if (entry === null) {
1566
- return null;
1567
- }
1568
- return de_Permission(entry, context);
1569
- });
1570
- return retVal;
1571
- };
1572
- const de_S3SignedObject = (output, context) => {
1573
- return {
1574
- bucketName: (0, smithy_client_1.expectString)(output.bucketName),
1575
- key: (0, smithy_client_1.expectString)(output.key),
1576
- };
1577
- };
1578
- const de_S3Source = (output, context) => {
1579
- return {
1580
- bucketName: (0, smithy_client_1.expectString)(output.bucketName),
1581
- key: (0, smithy_client_1.expectString)(output.key),
1582
- version: (0, smithy_client_1.expectString)(output.version),
1583
- };
1584
- };
1585
- const de_SignatureValidityPeriod = (output, context) => {
1586
- return {
1587
- type: (0, smithy_client_1.expectString)(output.type),
1588
- value: (0, smithy_client_1.expectInt32)(output.value),
1589
- };
1590
- };
1591
- const de_SignedObject = (output, context) => {
1592
- return {
1593
- s3: output.s3 != null ? de_S3SignedObject(output.s3, context) : undefined,
1594
- };
1595
- };
1596
- const de_SigningConfiguration = (output, context) => {
1597
- return {
1598
- encryptionAlgorithmOptions: output.encryptionAlgorithmOptions != null
1599
- ? de_EncryptionAlgorithmOptions(output.encryptionAlgorithmOptions, context)
1600
- : undefined,
1601
- hashAlgorithmOptions: output.hashAlgorithmOptions != null ? de_HashAlgorithmOptions(output.hashAlgorithmOptions, context) : undefined,
1602
- };
1603
- };
1604
- const de_SigningConfigurationOverrides = (output, context) => {
1605
- return {
1606
- encryptionAlgorithm: (0, smithy_client_1.expectString)(output.encryptionAlgorithm),
1607
- hashAlgorithm: (0, smithy_client_1.expectString)(output.hashAlgorithm),
1608
- };
1609
- };
1610
- const de_SigningImageFormat = (output, context) => {
1611
- return {
1612
- defaultFormat: (0, smithy_client_1.expectString)(output.defaultFormat),
1613
- supportedFormats: output.supportedFormats != null ? de_ImageFormats(output.supportedFormats, context) : undefined,
1614
- };
1615
- };
1616
1327
  const de_SigningJob = (output, context) => {
1617
- return {
1618
- createdAt: output.createdAt != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.createdAt))) : undefined,
1619
- isRevoked: (0, smithy_client_1.expectBoolean)(output.isRevoked),
1620
- jobId: (0, smithy_client_1.expectString)(output.jobId),
1621
- jobInvoker: (0, smithy_client_1.expectString)(output.jobInvoker),
1622
- jobOwner: (0, smithy_client_1.expectString)(output.jobOwner),
1623
- platformDisplayName: (0, smithy_client_1.expectString)(output.platformDisplayName),
1624
- platformId: (0, smithy_client_1.expectString)(output.platformId),
1625
- profileName: (0, smithy_client_1.expectString)(output.profileName),
1626
- profileVersion: (0, smithy_client_1.expectString)(output.profileVersion),
1627
- signatureExpiresAt: output.signatureExpiresAt != null
1628
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.signatureExpiresAt)))
1629
- : undefined,
1630
- signedObject: output.signedObject != null ? de_SignedObject(output.signedObject, context) : undefined,
1631
- signingMaterial: output.signingMaterial != null ? de_SigningMaterial(output.signingMaterial, context) : undefined,
1632
- source: output.source != null ? de_Source(output.source, context) : undefined,
1633
- status: (0, smithy_client_1.expectString)(output.status),
1634
- };
1328
+ return (0, smithy_client_1.take)(output, {
1329
+ createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1330
+ isRevoked: smithy_client_1.expectBoolean,
1331
+ jobId: smithy_client_1.expectString,
1332
+ jobInvoker: smithy_client_1.expectString,
1333
+ jobOwner: smithy_client_1.expectString,
1334
+ platformDisplayName: smithy_client_1.expectString,
1335
+ platformId: smithy_client_1.expectString,
1336
+ profileName: smithy_client_1.expectString,
1337
+ profileVersion: smithy_client_1.expectString,
1338
+ signatureExpiresAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1339
+ signedObject: smithy_client_1._json,
1340
+ signingMaterial: smithy_client_1._json,
1341
+ source: smithy_client_1._json,
1342
+ status: smithy_client_1.expectString,
1343
+ });
1635
1344
  };
1636
1345
  const de_SigningJobRevocationRecord = (output, context) => {
1637
- return {
1638
- reason: (0, smithy_client_1.expectString)(output.reason),
1639
- revokedAt: output.revokedAt != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.revokedAt))) : undefined,
1640
- revokedBy: (0, smithy_client_1.expectString)(output.revokedBy),
1641
- };
1346
+ return (0, smithy_client_1.take)(output, {
1347
+ reason: smithy_client_1.expectString,
1348
+ revokedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1349
+ revokedBy: smithy_client_1.expectString,
1350
+ });
1642
1351
  };
1643
1352
  const de_SigningJobs = (output, context) => {
1644
1353
  const retVal = (output || [])
1645
1354
  .filter((e) => e != null)
1646
1355
  .map((entry) => {
1647
- if (entry === null) {
1648
- return null;
1649
- }
1650
1356
  return de_SigningJob(entry, context);
1651
1357
  });
1652
1358
  return retVal;
1653
1359
  };
1654
- const de_SigningMaterial = (output, context) => {
1655
- return {
1656
- certificateArn: (0, smithy_client_1.expectString)(output.certificateArn),
1657
- };
1658
- };
1659
- const de_SigningParameters = (output, context) => {
1660
- return Object.entries(output).reduce((acc, [key, value]) => {
1661
- if (value === null) {
1662
- return acc;
1663
- }
1664
- acc[key] = (0, smithy_client_1.expectString)(value);
1665
- return acc;
1666
- }, {});
1667
- };
1668
- const de_SigningPlatform = (output, context) => {
1669
- return {
1670
- category: (0, smithy_client_1.expectString)(output.category),
1671
- displayName: (0, smithy_client_1.expectString)(output.displayName),
1672
- maxSizeInMB: (0, smithy_client_1.expectInt32)(output.maxSizeInMB),
1673
- partner: (0, smithy_client_1.expectString)(output.partner),
1674
- platformId: (0, smithy_client_1.expectString)(output.platformId),
1675
- revocationSupported: (0, smithy_client_1.expectBoolean)(output.revocationSupported),
1676
- signingConfiguration: output.signingConfiguration != null ? de_SigningConfiguration(output.signingConfiguration, context) : undefined,
1677
- signingImageFormat: output.signingImageFormat != null ? de_SigningImageFormat(output.signingImageFormat, context) : undefined,
1678
- target: (0, smithy_client_1.expectString)(output.target),
1679
- };
1680
- };
1681
- const de_SigningPlatformOverrides = (output, context) => {
1682
- return {
1683
- signingConfiguration: output.signingConfiguration != null
1684
- ? de_SigningConfigurationOverrides(output.signingConfiguration, context)
1685
- : undefined,
1686
- signingImageFormat: (0, smithy_client_1.expectString)(output.signingImageFormat),
1687
- };
1688
- };
1689
- const de_SigningPlatforms = (output, context) => {
1690
- const retVal = (output || [])
1691
- .filter((e) => e != null)
1692
- .map((entry) => {
1693
- if (entry === null) {
1694
- return null;
1695
- }
1696
- return de_SigningPlatform(entry, context);
1697
- });
1698
- return retVal;
1699
- };
1700
- const de_SigningProfile = (output, context) => {
1701
- return {
1702
- arn: (0, smithy_client_1.expectString)(output.arn),
1703
- platformDisplayName: (0, smithy_client_1.expectString)(output.platformDisplayName),
1704
- platformId: (0, smithy_client_1.expectString)(output.platformId),
1705
- profileName: (0, smithy_client_1.expectString)(output.profileName),
1706
- profileVersion: (0, smithy_client_1.expectString)(output.profileVersion),
1707
- profileVersionArn: (0, smithy_client_1.expectString)(output.profileVersionArn),
1708
- signatureValidityPeriod: output.signatureValidityPeriod != null
1709
- ? de_SignatureValidityPeriod(output.signatureValidityPeriod, context)
1710
- : undefined,
1711
- signingMaterial: output.signingMaterial != null ? de_SigningMaterial(output.signingMaterial, context) : undefined,
1712
- signingParameters: output.signingParameters != null ? de_SigningParameters(output.signingParameters, context) : undefined,
1713
- status: (0, smithy_client_1.expectString)(output.status),
1714
- tags: output.tags != null ? de_TagMap(output.tags, context) : undefined,
1715
- };
1716
- };
1717
1360
  const de_SigningProfileRevocationRecord = (output, context) => {
1718
- return {
1719
- revocationEffectiveFrom: output.revocationEffectiveFrom != null
1720
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.revocationEffectiveFrom)))
1721
- : undefined,
1722
- revokedAt: output.revokedAt != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.revokedAt))) : undefined,
1723
- revokedBy: (0, smithy_client_1.expectString)(output.revokedBy),
1724
- };
1725
- };
1726
- const de_SigningProfiles = (output, context) => {
1727
- const retVal = (output || [])
1728
- .filter((e) => e != null)
1729
- .map((entry) => {
1730
- if (entry === null) {
1731
- return null;
1732
- }
1733
- return de_SigningProfile(entry, context);
1361
+ return (0, smithy_client_1.take)(output, {
1362
+ revocationEffectiveFrom: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1363
+ revokedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1364
+ revokedBy: smithy_client_1.expectString,
1734
1365
  });
1735
- return retVal;
1736
- };
1737
- const de_Source = (output, context) => {
1738
- return {
1739
- s3: output.s3 != null ? de_S3Source(output.s3, context) : undefined,
1740
- };
1741
- };
1742
- const de_TagMap = (output, context) => {
1743
- return Object.entries(output).reduce((acc, [key, value]) => {
1744
- if (value === null) {
1745
- return acc;
1746
- }
1747
- acc[key] = (0, smithy_client_1.expectString)(value);
1748
- return acc;
1749
- }, {});
1750
1366
  };
1751
1367
  const deserializeMetadata = (output) => ({
1752
1368
  httpStatusCode: output.statusCode,