@aws-sdk/client-mgn 3.131.0 → 3.142.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.
Files changed (75) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +1 -1
  3. package/dist-cjs/commands/ChangeServerLifeCycleStateCommand.js +2 -2
  4. package/dist-cjs/commands/CreateLaunchConfigurationTemplateCommand.js +2 -2
  5. package/dist-cjs/commands/CreateReplicationConfigurationTemplateCommand.js +2 -2
  6. package/dist-cjs/commands/DeleteJobCommand.js +2 -2
  7. package/dist-cjs/commands/DeleteLaunchConfigurationTemplateCommand.js +2 -2
  8. package/dist-cjs/commands/DeleteReplicationConfigurationTemplateCommand.js +2 -2
  9. package/dist-cjs/commands/DeleteSourceServerCommand.js +2 -2
  10. package/dist-cjs/commands/DeleteVcenterClientCommand.js +1 -1
  11. package/dist-cjs/commands/DescribeJobLogItemsCommand.js +2 -2
  12. package/dist-cjs/commands/DescribeJobsCommand.js +2 -2
  13. package/dist-cjs/commands/DescribeLaunchConfigurationTemplatesCommand.js +2 -2
  14. package/dist-cjs/commands/DescribeReplicationConfigurationTemplatesCommand.js +2 -2
  15. package/dist-cjs/commands/DescribeSourceServersCommand.js +2 -2
  16. package/dist-cjs/commands/DescribeVcenterClientsCommand.js +2 -2
  17. package/dist-cjs/commands/DisconnectFromServiceCommand.js +2 -2
  18. package/dist-cjs/commands/FinalizeCutoverCommand.js +2 -2
  19. package/dist-cjs/commands/GetLaunchConfigurationCommand.js +2 -2
  20. package/dist-cjs/commands/GetReplicationConfigurationCommand.js +2 -2
  21. package/dist-cjs/commands/InitializeServiceCommand.js +2 -2
  22. package/dist-cjs/commands/ListTagsForResourceCommand.js +2 -2
  23. package/dist-cjs/commands/MarkAsArchivedCommand.js +2 -2
  24. package/dist-cjs/commands/RetryDataReplicationCommand.js +2 -2
  25. package/dist-cjs/commands/StartCutoverCommand.js +2 -2
  26. package/dist-cjs/commands/StartReplicationCommand.js +2 -2
  27. package/dist-cjs/commands/StartTestCommand.js +2 -2
  28. package/dist-cjs/commands/TagResourceCommand.js +1 -1
  29. package/dist-cjs/commands/TerminateTargetInstancesCommand.js +2 -2
  30. package/dist-cjs/commands/UntagResourceCommand.js +1 -1
  31. package/dist-cjs/commands/UpdateLaunchConfigurationCommand.js +2 -2
  32. package/dist-cjs/commands/UpdateLaunchConfigurationTemplateCommand.js +2 -2
  33. package/dist-cjs/commands/UpdateReplicationConfigurationCommand.js +2 -2
  34. package/dist-cjs/commands/UpdateReplicationConfigurationTemplateCommand.js +2 -2
  35. package/dist-cjs/commands/UpdateSourceServerReplicationTypeCommand.js +2 -2
  36. package/dist-cjs/models/models_0.js +394 -576
  37. package/dist-cjs/protocols/Aws_restJson1.js +492 -829
  38. package/dist-es/commands/ChangeServerLifeCycleStateCommand.js +3 -3
  39. package/dist-es/commands/CreateLaunchConfigurationTemplateCommand.js +3 -3
  40. package/dist-es/commands/CreateReplicationConfigurationTemplateCommand.js +3 -3
  41. package/dist-es/commands/DeleteJobCommand.js +3 -3
  42. package/dist-es/commands/DeleteLaunchConfigurationTemplateCommand.js +3 -3
  43. package/dist-es/commands/DeleteReplicationConfigurationTemplateCommand.js +3 -3
  44. package/dist-es/commands/DeleteSourceServerCommand.js +3 -3
  45. package/dist-es/commands/DeleteVcenterClientCommand.js +2 -2
  46. package/dist-es/commands/DescribeJobLogItemsCommand.js +3 -3
  47. package/dist-es/commands/DescribeJobsCommand.js +3 -3
  48. package/dist-es/commands/DescribeLaunchConfigurationTemplatesCommand.js +3 -3
  49. package/dist-es/commands/DescribeReplicationConfigurationTemplatesCommand.js +3 -3
  50. package/dist-es/commands/DescribeSourceServersCommand.js +3 -3
  51. package/dist-es/commands/DescribeVcenterClientsCommand.js +3 -3
  52. package/dist-es/commands/DisconnectFromServiceCommand.js +3 -3
  53. package/dist-es/commands/FinalizeCutoverCommand.js +3 -3
  54. package/dist-es/commands/GetLaunchConfigurationCommand.js +3 -3
  55. package/dist-es/commands/GetReplicationConfigurationCommand.js +3 -3
  56. package/dist-es/commands/InitializeServiceCommand.js +3 -3
  57. package/dist-es/commands/ListTagsForResourceCommand.js +3 -3
  58. package/dist-es/commands/MarkAsArchivedCommand.js +3 -3
  59. package/dist-es/commands/RetryDataReplicationCommand.js +3 -3
  60. package/dist-es/commands/StartCutoverCommand.js +3 -3
  61. package/dist-es/commands/StartReplicationCommand.js +3 -3
  62. package/dist-es/commands/StartTestCommand.js +3 -3
  63. package/dist-es/commands/TagResourceCommand.js +2 -2
  64. package/dist-es/commands/TerminateTargetInstancesCommand.js +3 -3
  65. package/dist-es/commands/UntagResourceCommand.js +2 -2
  66. package/dist-es/commands/UpdateLaunchConfigurationCommand.js +3 -3
  67. package/dist-es/commands/UpdateLaunchConfigurationTemplateCommand.js +3 -3
  68. package/dist-es/commands/UpdateReplicationConfigurationCommand.js +3 -3
  69. package/dist-es/commands/UpdateReplicationConfigurationTemplateCommand.js +3 -3
  70. package/dist-es/commands/UpdateSourceServerReplicationTypeCommand.js +3 -3
  71. package/dist-es/models/models_0.js +91 -364
  72. package/dist-es/protocols/Aws_restJson1.js +595 -828
  73. package/dist-types/models/models_0.d.ts +364 -546
  74. package/dist-types/ts3.4/models/models_0.d.ts +182 -364
  75. package/package.json +6 -6
@@ -334,10 +334,10 @@ const serializeAws_restJson1DescribeVcenterClientsCommand = async (input, contex
334
334
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
335
335
  const headers = {};
336
336
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/DescribeVcenterClients";
337
- const query = {
338
- ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
339
- ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
340
- };
337
+ const query = map({
338
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
339
+ nextToken: [, input.nextToken],
340
+ });
341
341
  let body;
342
342
  return new protocol_http_1.HttpRequest({
343
343
  protocol,
@@ -458,16 +458,7 @@ const serializeAws_restJson1ListTagsForResourceCommand = async (input, context)
458
458
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
459
459
  const headers = {};
460
460
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
461
- if (input.resourceArn !== undefined) {
462
- const labelValue = input.resourceArn;
463
- if (labelValue.length <= 0) {
464
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
465
- }
466
- resolvedPath = resolvedPath.replace("{resourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
467
- }
468
- else {
469
- throw new Error("No value provided for input HTTP label: resourceArn.");
470
- }
461
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
471
462
  let body;
472
463
  return new protocol_http_1.HttpRequest({
473
464
  protocol,
@@ -597,16 +588,7 @@ const serializeAws_restJson1TagResourceCommand = async (input, context) => {
597
588
  "content-type": "application/json",
598
589
  };
599
590
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
600
- if (input.resourceArn !== undefined) {
601
- const labelValue = input.resourceArn;
602
- if (labelValue.length <= 0) {
603
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
604
- }
605
- resolvedPath = resolvedPath.replace("{resourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
606
- }
607
- else {
608
- throw new Error("No value provided for input HTTP label: resourceArn.");
609
- }
591
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
610
592
  let body;
611
593
  body = JSON.stringify({
612
594
  ...(input.tags != null && { tags: serializeAws_restJson1TagsMap(input.tags, context) }),
@@ -650,19 +632,10 @@ const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
650
632
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
651
633
  const headers = {};
652
634
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
653
- if (input.resourceArn !== undefined) {
654
- const labelValue = input.resourceArn;
655
- if (labelValue.length <= 0) {
656
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
657
- }
658
- resolvedPath = resolvedPath.replace("{resourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
659
- }
660
- else {
661
- throw new Error("No value provided for input HTTP label: resourceArn.");
662
- }
663
- const query = {
664
- ...(input.tagKeys !== undefined && { tagKeys: (input.tagKeys || []).map((_entry) => _entry) }),
665
- };
635
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
636
+ const query = map({
637
+ tagKeys: [() => input.tagKeys !== void 0, () => (input.tagKeys || []).map((_entry) => _entry)],
638
+ });
666
639
  let body;
667
640
  return new protocol_http_1.HttpRequest({
668
641
  protocol,
@@ -858,51 +831,41 @@ const deserializeAws_restJson1ChangeServerLifeCycleStateCommand = async (output,
858
831
  if (output.statusCode !== 200 && output.statusCode >= 300) {
859
832
  return deserializeAws_restJson1ChangeServerLifeCycleStateCommandError(output, context);
860
833
  }
861
- const contents = {
834
+ const contents = map({
862
835
  $metadata: deserializeMetadata(output),
863
- arn: undefined,
864
- dataReplicationInfo: undefined,
865
- isArchived: undefined,
866
- launchedInstance: undefined,
867
- lifeCycle: undefined,
868
- replicationType: undefined,
869
- sourceProperties: undefined,
870
- sourceServerID: undefined,
871
- tags: undefined,
872
- vcenterClientID: undefined,
873
- };
836
+ });
874
837
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
875
- if (data.arn !== undefined && data.arn !== null) {
838
+ if (data.arn != null) {
876
839
  contents.arn = (0, smithy_client_1.expectString)(data.arn);
877
840
  }
878
- if (data.dataReplicationInfo !== undefined && data.dataReplicationInfo !== null) {
841
+ if (data.dataReplicationInfo != null) {
879
842
  contents.dataReplicationInfo = deserializeAws_restJson1DataReplicationInfo(data.dataReplicationInfo, context);
880
843
  }
881
- if (data.isArchived !== undefined && data.isArchived !== null) {
844
+ if (data.isArchived != null) {
882
845
  contents.isArchived = (0, smithy_client_1.expectBoolean)(data.isArchived);
883
846
  }
884
- if (data.launchedInstance !== undefined && data.launchedInstance !== null) {
847
+ if (data.launchedInstance != null) {
885
848
  contents.launchedInstance = deserializeAws_restJson1LaunchedInstance(data.launchedInstance, context);
886
849
  }
887
- if (data.lifeCycle !== undefined && data.lifeCycle !== null) {
850
+ if (data.lifeCycle != null) {
888
851
  contents.lifeCycle = deserializeAws_restJson1LifeCycle(data.lifeCycle, context);
889
852
  }
890
- if (data.replicationType !== undefined && data.replicationType !== null) {
853
+ if (data.replicationType != null) {
891
854
  contents.replicationType = (0, smithy_client_1.expectString)(data.replicationType);
892
855
  }
893
- if (data.sourceProperties !== undefined && data.sourceProperties !== null) {
856
+ if (data.sourceProperties != null) {
894
857
  contents.sourceProperties = deserializeAws_restJson1SourceProperties(data.sourceProperties, context);
895
858
  }
896
- if (data.sourceServerID !== undefined && data.sourceServerID !== null) {
859
+ if (data.sourceServerID != null) {
897
860
  contents.sourceServerID = (0, smithy_client_1.expectString)(data.sourceServerID);
898
861
  }
899
- if (data.tags !== undefined && data.tags !== null) {
862
+ if (data.tags != null) {
900
863
  contents.tags = deserializeAws_restJson1TagsMap(data.tags, context);
901
864
  }
902
- if (data.vcenterClientID !== undefined && data.vcenterClientID !== null) {
865
+ if (data.vcenterClientID != null) {
903
866
  contents.vcenterClientID = (0, smithy_client_1.expectString)(data.vcenterClientID);
904
867
  }
905
- return Promise.resolve(contents);
868
+ return contents;
906
869
  };
907
870
  exports.deserializeAws_restJson1ChangeServerLifeCycleStateCommand = deserializeAws_restJson1ChangeServerLifeCycleStateCommand;
908
871
  const deserializeAws_restJson1ChangeServerLifeCycleStateCommandError = async (output, context) => {
@@ -910,7 +873,6 @@ const deserializeAws_restJson1ChangeServerLifeCycleStateCommandError = async (ou
910
873
  ...output,
911
874
  body: await parseBody(output.body, context),
912
875
  };
913
- let response;
914
876
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
915
877
  switch (errorCode) {
916
878
  case "ConflictException":
@@ -927,41 +889,35 @@ const deserializeAws_restJson1ChangeServerLifeCycleStateCommandError = async (ou
927
889
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
928
890
  default:
929
891
  const parsedBody = parsedOutput.body;
930
- const $metadata = deserializeMetadata(output);
931
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
932
- response = new MgnServiceException_1.MgnServiceException({
933
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
934
- $fault: "client",
935
- $metadata,
892
+ (0, smithy_client_1.throwDefaultError)({
893
+ output,
894
+ parsedBody,
895
+ exceptionCtor: MgnServiceException_1.MgnServiceException,
896
+ errorCode,
936
897
  });
937
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
938
898
  }
939
899
  };
940
900
  const deserializeAws_restJson1CreateLaunchConfigurationTemplateCommand = async (output, context) => {
941
901
  if (output.statusCode !== 201 && output.statusCode >= 300) {
942
902
  return deserializeAws_restJson1CreateLaunchConfigurationTemplateCommandError(output, context);
943
903
  }
944
- const contents = {
904
+ const contents = map({
945
905
  $metadata: deserializeMetadata(output),
946
- arn: undefined,
947
- launchConfigurationTemplateID: undefined,
948
- postLaunchActions: undefined,
949
- tags: undefined,
950
- };
906
+ });
951
907
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
952
- if (data.arn !== undefined && data.arn !== null) {
908
+ if (data.arn != null) {
953
909
  contents.arn = (0, smithy_client_1.expectString)(data.arn);
954
910
  }
955
- if (data.launchConfigurationTemplateID !== undefined && data.launchConfigurationTemplateID !== null) {
911
+ if (data.launchConfigurationTemplateID != null) {
956
912
  contents.launchConfigurationTemplateID = (0, smithy_client_1.expectString)(data.launchConfigurationTemplateID);
957
913
  }
958
- if (data.postLaunchActions !== undefined && data.postLaunchActions !== null) {
914
+ if (data.postLaunchActions != null) {
959
915
  contents.postLaunchActions = deserializeAws_restJson1PostLaunchActions(data.postLaunchActions, context);
960
916
  }
961
- if (data.tags !== undefined && data.tags !== null) {
917
+ if (data.tags != null) {
962
918
  contents.tags = deserializeAws_restJson1TagsMap(data.tags, context);
963
919
  }
964
- return Promise.resolve(contents);
920
+ return contents;
965
921
  };
966
922
  exports.deserializeAws_restJson1CreateLaunchConfigurationTemplateCommand = deserializeAws_restJson1CreateLaunchConfigurationTemplateCommand;
967
923
  const deserializeAws_restJson1CreateLaunchConfigurationTemplateCommandError = async (output, context) => {
@@ -969,7 +925,6 @@ const deserializeAws_restJson1CreateLaunchConfigurationTemplateCommandError = as
969
925
  ...output,
970
926
  body: await parseBody(output.body, context),
971
927
  };
972
- let response;
973
928
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
974
929
  switch (errorCode) {
975
930
  case "AccessDeniedException":
@@ -983,85 +938,68 @@ const deserializeAws_restJson1CreateLaunchConfigurationTemplateCommandError = as
983
938
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
984
939
  default:
985
940
  const parsedBody = parsedOutput.body;
986
- const $metadata = deserializeMetadata(output);
987
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
988
- response = new MgnServiceException_1.MgnServiceException({
989
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
990
- $fault: "client",
991
- $metadata,
941
+ (0, smithy_client_1.throwDefaultError)({
942
+ output,
943
+ parsedBody,
944
+ exceptionCtor: MgnServiceException_1.MgnServiceException,
945
+ errorCode,
992
946
  });
993
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
994
947
  }
995
948
  };
996
949
  const deserializeAws_restJson1CreateReplicationConfigurationTemplateCommand = async (output, context) => {
997
950
  if (output.statusCode !== 201 && output.statusCode >= 300) {
998
951
  return deserializeAws_restJson1CreateReplicationConfigurationTemplateCommandError(output, context);
999
952
  }
1000
- const contents = {
953
+ const contents = map({
1001
954
  $metadata: deserializeMetadata(output),
1002
- arn: undefined,
1003
- associateDefaultSecurityGroup: undefined,
1004
- bandwidthThrottling: undefined,
1005
- createPublicIP: undefined,
1006
- dataPlaneRouting: undefined,
1007
- defaultLargeStagingDiskType: undefined,
1008
- ebsEncryption: undefined,
1009
- ebsEncryptionKeyArn: undefined,
1010
- replicationConfigurationTemplateID: undefined,
1011
- replicationServerInstanceType: undefined,
1012
- replicationServersSecurityGroupsIDs: undefined,
1013
- stagingAreaSubnetId: undefined,
1014
- stagingAreaTags: undefined,
1015
- tags: undefined,
1016
- useDedicatedReplicationServer: undefined,
1017
- };
955
+ });
1018
956
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1019
- if (data.arn !== undefined && data.arn !== null) {
957
+ if (data.arn != null) {
1020
958
  contents.arn = (0, smithy_client_1.expectString)(data.arn);
1021
959
  }
1022
- if (data.associateDefaultSecurityGroup !== undefined && data.associateDefaultSecurityGroup !== null) {
960
+ if (data.associateDefaultSecurityGroup != null) {
1023
961
  contents.associateDefaultSecurityGroup = (0, smithy_client_1.expectBoolean)(data.associateDefaultSecurityGroup);
1024
962
  }
1025
- if (data.bandwidthThrottling !== undefined && data.bandwidthThrottling !== null) {
963
+ if (data.bandwidthThrottling != null) {
1026
964
  contents.bandwidthThrottling = (0, smithy_client_1.expectLong)(data.bandwidthThrottling);
1027
965
  }
1028
- if (data.createPublicIP !== undefined && data.createPublicIP !== null) {
966
+ if (data.createPublicIP != null) {
1029
967
  contents.createPublicIP = (0, smithy_client_1.expectBoolean)(data.createPublicIP);
1030
968
  }
1031
- if (data.dataPlaneRouting !== undefined && data.dataPlaneRouting !== null) {
969
+ if (data.dataPlaneRouting != null) {
1032
970
  contents.dataPlaneRouting = (0, smithy_client_1.expectString)(data.dataPlaneRouting);
1033
971
  }
1034
- if (data.defaultLargeStagingDiskType !== undefined && data.defaultLargeStagingDiskType !== null) {
972
+ if (data.defaultLargeStagingDiskType != null) {
1035
973
  contents.defaultLargeStagingDiskType = (0, smithy_client_1.expectString)(data.defaultLargeStagingDiskType);
1036
974
  }
1037
- if (data.ebsEncryption !== undefined && data.ebsEncryption !== null) {
975
+ if (data.ebsEncryption != null) {
1038
976
  contents.ebsEncryption = (0, smithy_client_1.expectString)(data.ebsEncryption);
1039
977
  }
1040
- if (data.ebsEncryptionKeyArn !== undefined && data.ebsEncryptionKeyArn !== null) {
978
+ if (data.ebsEncryptionKeyArn != null) {
1041
979
  contents.ebsEncryptionKeyArn = (0, smithy_client_1.expectString)(data.ebsEncryptionKeyArn);
1042
980
  }
1043
- if (data.replicationConfigurationTemplateID !== undefined && data.replicationConfigurationTemplateID !== null) {
981
+ if (data.replicationConfigurationTemplateID != null) {
1044
982
  contents.replicationConfigurationTemplateID = (0, smithy_client_1.expectString)(data.replicationConfigurationTemplateID);
1045
983
  }
1046
- if (data.replicationServerInstanceType !== undefined && data.replicationServerInstanceType !== null) {
984
+ if (data.replicationServerInstanceType != null) {
1047
985
  contents.replicationServerInstanceType = (0, smithy_client_1.expectString)(data.replicationServerInstanceType);
1048
986
  }
1049
- if (data.replicationServersSecurityGroupsIDs !== undefined && data.replicationServersSecurityGroupsIDs !== null) {
987
+ if (data.replicationServersSecurityGroupsIDs != null) {
1050
988
  contents.replicationServersSecurityGroupsIDs = deserializeAws_restJson1ReplicationServersSecurityGroupsIDs(data.replicationServersSecurityGroupsIDs, context);
1051
989
  }
1052
- if (data.stagingAreaSubnetId !== undefined && data.stagingAreaSubnetId !== null) {
990
+ if (data.stagingAreaSubnetId != null) {
1053
991
  contents.stagingAreaSubnetId = (0, smithy_client_1.expectString)(data.stagingAreaSubnetId);
1054
992
  }
1055
- if (data.stagingAreaTags !== undefined && data.stagingAreaTags !== null) {
993
+ if (data.stagingAreaTags != null) {
1056
994
  contents.stagingAreaTags = deserializeAws_restJson1TagsMap(data.stagingAreaTags, context);
1057
995
  }
1058
- if (data.tags !== undefined && data.tags !== null) {
996
+ if (data.tags != null) {
1059
997
  contents.tags = deserializeAws_restJson1TagsMap(data.tags, context);
1060
998
  }
1061
- if (data.useDedicatedReplicationServer !== undefined && data.useDedicatedReplicationServer !== null) {
999
+ if (data.useDedicatedReplicationServer != null) {
1062
1000
  contents.useDedicatedReplicationServer = (0, smithy_client_1.expectBoolean)(data.useDedicatedReplicationServer);
1063
1001
  }
1064
- return Promise.resolve(contents);
1002
+ return contents;
1065
1003
  };
1066
1004
  exports.deserializeAws_restJson1CreateReplicationConfigurationTemplateCommand = deserializeAws_restJson1CreateReplicationConfigurationTemplateCommand;
1067
1005
  const deserializeAws_restJson1CreateReplicationConfigurationTemplateCommandError = async (output, context) => {
@@ -1069,7 +1007,6 @@ const deserializeAws_restJson1CreateReplicationConfigurationTemplateCommandError
1069
1007
  ...output,
1070
1008
  body: await parseBody(output.body, context),
1071
1009
  };
1072
- let response;
1073
1010
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1074
1011
  switch (errorCode) {
1075
1012
  case "AccessDeniedException":
@@ -1083,25 +1020,23 @@ const deserializeAws_restJson1CreateReplicationConfigurationTemplateCommandError
1083
1020
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1084
1021
  default:
1085
1022
  const parsedBody = parsedOutput.body;
1086
- const $metadata = deserializeMetadata(output);
1087
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1088
- response = new MgnServiceException_1.MgnServiceException({
1089
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1090
- $fault: "client",
1091
- $metadata,
1023
+ (0, smithy_client_1.throwDefaultError)({
1024
+ output,
1025
+ parsedBody,
1026
+ exceptionCtor: MgnServiceException_1.MgnServiceException,
1027
+ errorCode,
1092
1028
  });
1093
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1094
1029
  }
1095
1030
  };
1096
1031
  const deserializeAws_restJson1DeleteJobCommand = async (output, context) => {
1097
1032
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1098
1033
  return deserializeAws_restJson1DeleteJobCommandError(output, context);
1099
1034
  }
1100
- const contents = {
1035
+ const contents = map({
1101
1036
  $metadata: deserializeMetadata(output),
1102
- };
1037
+ });
1103
1038
  await collectBody(output.body, context);
1104
- return Promise.resolve(contents);
1039
+ return contents;
1105
1040
  };
1106
1041
  exports.deserializeAws_restJson1DeleteJobCommand = deserializeAws_restJson1DeleteJobCommand;
1107
1042
  const deserializeAws_restJson1DeleteJobCommandError = async (output, context) => {
@@ -1109,7 +1044,6 @@ const deserializeAws_restJson1DeleteJobCommandError = async (output, context) =>
1109
1044
  ...output,
1110
1045
  body: await parseBody(output.body, context),
1111
1046
  };
1112
- let response;
1113
1047
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1114
1048
  switch (errorCode) {
1115
1049
  case "ConflictException":
@@ -1123,25 +1057,23 @@ const deserializeAws_restJson1DeleteJobCommandError = async (output, context) =>
1123
1057
  throw await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context);
1124
1058
  default:
1125
1059
  const parsedBody = parsedOutput.body;
1126
- const $metadata = deserializeMetadata(output);
1127
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1128
- response = new MgnServiceException_1.MgnServiceException({
1129
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1130
- $fault: "client",
1131
- $metadata,
1060
+ (0, smithy_client_1.throwDefaultError)({
1061
+ output,
1062
+ parsedBody,
1063
+ exceptionCtor: MgnServiceException_1.MgnServiceException,
1064
+ errorCode,
1132
1065
  });
1133
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1134
1066
  }
1135
1067
  };
1136
1068
  const deserializeAws_restJson1DeleteLaunchConfigurationTemplateCommand = async (output, context) => {
1137
1069
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1138
1070
  return deserializeAws_restJson1DeleteLaunchConfigurationTemplateCommandError(output, context);
1139
1071
  }
1140
- const contents = {
1072
+ const contents = map({
1141
1073
  $metadata: deserializeMetadata(output),
1142
- };
1074
+ });
1143
1075
  await collectBody(output.body, context);
1144
- return Promise.resolve(contents);
1076
+ return contents;
1145
1077
  };
1146
1078
  exports.deserializeAws_restJson1DeleteLaunchConfigurationTemplateCommand = deserializeAws_restJson1DeleteLaunchConfigurationTemplateCommand;
1147
1079
  const deserializeAws_restJson1DeleteLaunchConfigurationTemplateCommandError = async (output, context) => {
@@ -1149,7 +1081,6 @@ const deserializeAws_restJson1DeleteLaunchConfigurationTemplateCommandError = as
1149
1081
  ...output,
1150
1082
  body: await parseBody(output.body, context),
1151
1083
  };
1152
- let response;
1153
1084
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1154
1085
  switch (errorCode) {
1155
1086
  case "ConflictException":
@@ -1163,25 +1094,23 @@ const deserializeAws_restJson1DeleteLaunchConfigurationTemplateCommandError = as
1163
1094
  throw await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context);
1164
1095
  default:
1165
1096
  const parsedBody = parsedOutput.body;
1166
- const $metadata = deserializeMetadata(output);
1167
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1168
- response = new MgnServiceException_1.MgnServiceException({
1169
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1170
- $fault: "client",
1171
- $metadata,
1097
+ (0, smithy_client_1.throwDefaultError)({
1098
+ output,
1099
+ parsedBody,
1100
+ exceptionCtor: MgnServiceException_1.MgnServiceException,
1101
+ errorCode,
1172
1102
  });
1173
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1174
1103
  }
1175
1104
  };
1176
1105
  const deserializeAws_restJson1DeleteReplicationConfigurationTemplateCommand = async (output, context) => {
1177
1106
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1178
1107
  return deserializeAws_restJson1DeleteReplicationConfigurationTemplateCommandError(output, context);
1179
1108
  }
1180
- const contents = {
1109
+ const contents = map({
1181
1110
  $metadata: deserializeMetadata(output),
1182
- };
1111
+ });
1183
1112
  await collectBody(output.body, context);
1184
- return Promise.resolve(contents);
1113
+ return contents;
1185
1114
  };
1186
1115
  exports.deserializeAws_restJson1DeleteReplicationConfigurationTemplateCommand = deserializeAws_restJson1DeleteReplicationConfigurationTemplateCommand;
1187
1116
  const deserializeAws_restJson1DeleteReplicationConfigurationTemplateCommandError = async (output, context) => {
@@ -1189,7 +1118,6 @@ const deserializeAws_restJson1DeleteReplicationConfigurationTemplateCommandError
1189
1118
  ...output,
1190
1119
  body: await parseBody(output.body, context),
1191
1120
  };
1192
- let response;
1193
1121
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1194
1122
  switch (errorCode) {
1195
1123
  case "ConflictException":
@@ -1203,25 +1131,23 @@ const deserializeAws_restJson1DeleteReplicationConfigurationTemplateCommandError
1203
1131
  throw await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context);
1204
1132
  default:
1205
1133
  const parsedBody = parsedOutput.body;
1206
- const $metadata = deserializeMetadata(output);
1207
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1208
- response = new MgnServiceException_1.MgnServiceException({
1209
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1210
- $fault: "client",
1211
- $metadata,
1134
+ (0, smithy_client_1.throwDefaultError)({
1135
+ output,
1136
+ parsedBody,
1137
+ exceptionCtor: MgnServiceException_1.MgnServiceException,
1138
+ errorCode,
1212
1139
  });
1213
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1214
1140
  }
1215
1141
  };
1216
1142
  const deserializeAws_restJson1DeleteSourceServerCommand = async (output, context) => {
1217
1143
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1218
1144
  return deserializeAws_restJson1DeleteSourceServerCommandError(output, context);
1219
1145
  }
1220
- const contents = {
1146
+ const contents = map({
1221
1147
  $metadata: deserializeMetadata(output),
1222
- };
1148
+ });
1223
1149
  await collectBody(output.body, context);
1224
- return Promise.resolve(contents);
1150
+ return contents;
1225
1151
  };
1226
1152
  exports.deserializeAws_restJson1DeleteSourceServerCommand = deserializeAws_restJson1DeleteSourceServerCommand;
1227
1153
  const deserializeAws_restJson1DeleteSourceServerCommandError = async (output, context) => {
@@ -1229,7 +1155,6 @@ const deserializeAws_restJson1DeleteSourceServerCommandError = async (output, co
1229
1155
  ...output,
1230
1156
  body: await parseBody(output.body, context),
1231
1157
  };
1232
- let response;
1233
1158
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1234
1159
  switch (errorCode) {
1235
1160
  case "ConflictException":
@@ -1243,25 +1168,23 @@ const deserializeAws_restJson1DeleteSourceServerCommandError = async (output, co
1243
1168
  throw await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context);
1244
1169
  default:
1245
1170
  const parsedBody = parsedOutput.body;
1246
- const $metadata = deserializeMetadata(output);
1247
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1248
- response = new MgnServiceException_1.MgnServiceException({
1249
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1250
- $fault: "client",
1251
- $metadata,
1171
+ (0, smithy_client_1.throwDefaultError)({
1172
+ output,
1173
+ parsedBody,
1174
+ exceptionCtor: MgnServiceException_1.MgnServiceException,
1175
+ errorCode,
1252
1176
  });
1253
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1254
1177
  }
1255
1178
  };
1256
1179
  const deserializeAws_restJson1DeleteVcenterClientCommand = async (output, context) => {
1257
1180
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1258
1181
  return deserializeAws_restJson1DeleteVcenterClientCommandError(output, context);
1259
1182
  }
1260
- const contents = {
1183
+ const contents = map({
1261
1184
  $metadata: deserializeMetadata(output),
1262
- };
1185
+ });
1263
1186
  await collectBody(output.body, context);
1264
- return Promise.resolve(contents);
1187
+ return contents;
1265
1188
  };
1266
1189
  exports.deserializeAws_restJson1DeleteVcenterClientCommand = deserializeAws_restJson1DeleteVcenterClientCommand;
1267
1190
  const deserializeAws_restJson1DeleteVcenterClientCommandError = async (output, context) => {
@@ -1269,7 +1192,6 @@ const deserializeAws_restJson1DeleteVcenterClientCommandError = async (output, c
1269
1192
  ...output,
1270
1193
  body: await parseBody(output.body, context),
1271
1194
  };
1272
- let response;
1273
1195
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1274
1196
  switch (errorCode) {
1275
1197
  case "ResourceNotFoundException":
@@ -1283,33 +1205,29 @@ const deserializeAws_restJson1DeleteVcenterClientCommandError = async (output, c
1283
1205
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1284
1206
  default:
1285
1207
  const parsedBody = parsedOutput.body;
1286
- const $metadata = deserializeMetadata(output);
1287
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1288
- response = new MgnServiceException_1.MgnServiceException({
1289
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1290
- $fault: "client",
1291
- $metadata,
1208
+ (0, smithy_client_1.throwDefaultError)({
1209
+ output,
1210
+ parsedBody,
1211
+ exceptionCtor: MgnServiceException_1.MgnServiceException,
1212
+ errorCode,
1292
1213
  });
1293
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1294
1214
  }
1295
1215
  };
1296
1216
  const deserializeAws_restJson1DescribeJobLogItemsCommand = async (output, context) => {
1297
1217
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1298
1218
  return deserializeAws_restJson1DescribeJobLogItemsCommandError(output, context);
1299
1219
  }
1300
- const contents = {
1220
+ const contents = map({
1301
1221
  $metadata: deserializeMetadata(output),
1302
- items: undefined,
1303
- nextToken: undefined,
1304
- };
1222
+ });
1305
1223
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1306
- if (data.items !== undefined && data.items !== null) {
1224
+ if (data.items != null) {
1307
1225
  contents.items = deserializeAws_restJson1JobLogs(data.items, context);
1308
1226
  }
1309
- if (data.nextToken !== undefined && data.nextToken !== null) {
1227
+ if (data.nextToken != null) {
1310
1228
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1311
1229
  }
1312
- return Promise.resolve(contents);
1230
+ return contents;
1313
1231
  };
1314
1232
  exports.deserializeAws_restJson1DescribeJobLogItemsCommand = deserializeAws_restJson1DescribeJobLogItemsCommand;
1315
1233
  const deserializeAws_restJson1DescribeJobLogItemsCommandError = async (output, context) => {
@@ -1317,7 +1235,6 @@ const deserializeAws_restJson1DescribeJobLogItemsCommandError = async (output, c
1317
1235
  ...output,
1318
1236
  body: await parseBody(output.body, context),
1319
1237
  };
1320
- let response;
1321
1238
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1322
1239
  switch (errorCode) {
1323
1240
  case "UninitializedAccountException":
@@ -1328,33 +1245,29 @@ const deserializeAws_restJson1DescribeJobLogItemsCommandError = async (output, c
1328
1245
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1329
1246
  default:
1330
1247
  const parsedBody = parsedOutput.body;
1331
- const $metadata = deserializeMetadata(output);
1332
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1333
- response = new MgnServiceException_1.MgnServiceException({
1334
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1335
- $fault: "client",
1336
- $metadata,
1248
+ (0, smithy_client_1.throwDefaultError)({
1249
+ output,
1250
+ parsedBody,
1251
+ exceptionCtor: MgnServiceException_1.MgnServiceException,
1252
+ errorCode,
1337
1253
  });
1338
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1339
1254
  }
1340
1255
  };
1341
1256
  const deserializeAws_restJson1DescribeJobsCommand = async (output, context) => {
1342
1257
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1343
1258
  return deserializeAws_restJson1DescribeJobsCommandError(output, context);
1344
1259
  }
1345
- const contents = {
1260
+ const contents = map({
1346
1261
  $metadata: deserializeMetadata(output),
1347
- items: undefined,
1348
- nextToken: undefined,
1349
- };
1262
+ });
1350
1263
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1351
- if (data.items !== undefined && data.items !== null) {
1264
+ if (data.items != null) {
1352
1265
  contents.items = deserializeAws_restJson1JobsList(data.items, context);
1353
1266
  }
1354
- if (data.nextToken !== undefined && data.nextToken !== null) {
1267
+ if (data.nextToken != null) {
1355
1268
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1356
1269
  }
1357
- return Promise.resolve(contents);
1270
+ return contents;
1358
1271
  };
1359
1272
  exports.deserializeAws_restJson1DescribeJobsCommand = deserializeAws_restJson1DescribeJobsCommand;
1360
1273
  const deserializeAws_restJson1DescribeJobsCommandError = async (output, context) => {
@@ -1362,7 +1275,6 @@ const deserializeAws_restJson1DescribeJobsCommandError = async (output, context)
1362
1275
  ...output,
1363
1276
  body: await parseBody(output.body, context),
1364
1277
  };
1365
- let response;
1366
1278
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1367
1279
  switch (errorCode) {
1368
1280
  case "UninitializedAccountException":
@@ -1373,33 +1285,29 @@ const deserializeAws_restJson1DescribeJobsCommandError = async (output, context)
1373
1285
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1374
1286
  default:
1375
1287
  const parsedBody = parsedOutput.body;
1376
- const $metadata = deserializeMetadata(output);
1377
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1378
- response = new MgnServiceException_1.MgnServiceException({
1379
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1380
- $fault: "client",
1381
- $metadata,
1288
+ (0, smithy_client_1.throwDefaultError)({
1289
+ output,
1290
+ parsedBody,
1291
+ exceptionCtor: MgnServiceException_1.MgnServiceException,
1292
+ errorCode,
1382
1293
  });
1383
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1384
1294
  }
1385
1295
  };
1386
1296
  const deserializeAws_restJson1DescribeLaunchConfigurationTemplatesCommand = async (output, context) => {
1387
1297
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1388
1298
  return deserializeAws_restJson1DescribeLaunchConfigurationTemplatesCommandError(output, context);
1389
1299
  }
1390
- const contents = {
1300
+ const contents = map({
1391
1301
  $metadata: deserializeMetadata(output),
1392
- items: undefined,
1393
- nextToken: undefined,
1394
- };
1302
+ });
1395
1303
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1396
- if (data.items !== undefined && data.items !== null) {
1304
+ if (data.items != null) {
1397
1305
  contents.items = deserializeAws_restJson1LaunchConfigurationTemplates(data.items, context);
1398
1306
  }
1399
- if (data.nextToken !== undefined && data.nextToken !== null) {
1307
+ if (data.nextToken != null) {
1400
1308
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1401
1309
  }
1402
- return Promise.resolve(contents);
1310
+ return contents;
1403
1311
  };
1404
1312
  exports.deserializeAws_restJson1DescribeLaunchConfigurationTemplatesCommand = deserializeAws_restJson1DescribeLaunchConfigurationTemplatesCommand;
1405
1313
  const deserializeAws_restJson1DescribeLaunchConfigurationTemplatesCommandError = async (output, context) => {
@@ -1407,7 +1315,6 @@ const deserializeAws_restJson1DescribeLaunchConfigurationTemplatesCommandError =
1407
1315
  ...output,
1408
1316
  body: await parseBody(output.body, context),
1409
1317
  };
1410
- let response;
1411
1318
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1412
1319
  switch (errorCode) {
1413
1320
  case "ResourceNotFoundException":
@@ -1421,33 +1328,29 @@ const deserializeAws_restJson1DescribeLaunchConfigurationTemplatesCommandError =
1421
1328
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1422
1329
  default:
1423
1330
  const parsedBody = parsedOutput.body;
1424
- const $metadata = deserializeMetadata(output);
1425
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1426
- response = new MgnServiceException_1.MgnServiceException({
1427
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1428
- $fault: "client",
1429
- $metadata,
1331
+ (0, smithy_client_1.throwDefaultError)({
1332
+ output,
1333
+ parsedBody,
1334
+ exceptionCtor: MgnServiceException_1.MgnServiceException,
1335
+ errorCode,
1430
1336
  });
1431
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1432
1337
  }
1433
1338
  };
1434
1339
  const deserializeAws_restJson1DescribeReplicationConfigurationTemplatesCommand = async (output, context) => {
1435
1340
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1436
1341
  return deserializeAws_restJson1DescribeReplicationConfigurationTemplatesCommandError(output, context);
1437
1342
  }
1438
- const contents = {
1343
+ const contents = map({
1439
1344
  $metadata: deserializeMetadata(output),
1440
- items: undefined,
1441
- nextToken: undefined,
1442
- };
1345
+ });
1443
1346
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1444
- if (data.items !== undefined && data.items !== null) {
1347
+ if (data.items != null) {
1445
1348
  contents.items = deserializeAws_restJson1ReplicationConfigurationTemplates(data.items, context);
1446
1349
  }
1447
- if (data.nextToken !== undefined && data.nextToken !== null) {
1350
+ if (data.nextToken != null) {
1448
1351
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1449
1352
  }
1450
- return Promise.resolve(contents);
1353
+ return contents;
1451
1354
  };
1452
1355
  exports.deserializeAws_restJson1DescribeReplicationConfigurationTemplatesCommand = deserializeAws_restJson1DescribeReplicationConfigurationTemplatesCommand;
1453
1356
  const deserializeAws_restJson1DescribeReplicationConfigurationTemplatesCommandError = async (output, context) => {
@@ -1455,7 +1358,6 @@ const deserializeAws_restJson1DescribeReplicationConfigurationTemplatesCommandEr
1455
1358
  ...output,
1456
1359
  body: await parseBody(output.body, context),
1457
1360
  };
1458
- let response;
1459
1361
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1460
1362
  switch (errorCode) {
1461
1363
  case "ResourceNotFoundException":
@@ -1469,33 +1371,29 @@ const deserializeAws_restJson1DescribeReplicationConfigurationTemplatesCommandEr
1469
1371
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1470
1372
  default:
1471
1373
  const parsedBody = parsedOutput.body;
1472
- const $metadata = deserializeMetadata(output);
1473
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1474
- response = new MgnServiceException_1.MgnServiceException({
1475
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1476
- $fault: "client",
1477
- $metadata,
1374
+ (0, smithy_client_1.throwDefaultError)({
1375
+ output,
1376
+ parsedBody,
1377
+ exceptionCtor: MgnServiceException_1.MgnServiceException,
1378
+ errorCode,
1478
1379
  });
1479
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1480
1380
  }
1481
1381
  };
1482
1382
  const deserializeAws_restJson1DescribeSourceServersCommand = async (output, context) => {
1483
1383
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1484
1384
  return deserializeAws_restJson1DescribeSourceServersCommandError(output, context);
1485
1385
  }
1486
- const contents = {
1386
+ const contents = map({
1487
1387
  $metadata: deserializeMetadata(output),
1488
- items: undefined,
1489
- nextToken: undefined,
1490
- };
1388
+ });
1491
1389
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1492
- if (data.items !== undefined && data.items !== null) {
1390
+ if (data.items != null) {
1493
1391
  contents.items = deserializeAws_restJson1SourceServersList(data.items, context);
1494
1392
  }
1495
- if (data.nextToken !== undefined && data.nextToken !== null) {
1393
+ if (data.nextToken != null) {
1496
1394
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1497
1395
  }
1498
- return Promise.resolve(contents);
1396
+ return contents;
1499
1397
  };
1500
1398
  exports.deserializeAws_restJson1DescribeSourceServersCommand = deserializeAws_restJson1DescribeSourceServersCommand;
1501
1399
  const deserializeAws_restJson1DescribeSourceServersCommandError = async (output, context) => {
@@ -1503,7 +1401,6 @@ const deserializeAws_restJson1DescribeSourceServersCommandError = async (output,
1503
1401
  ...output,
1504
1402
  body: await parseBody(output.body, context),
1505
1403
  };
1506
- let response;
1507
1404
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1508
1405
  switch (errorCode) {
1509
1406
  case "UninitializedAccountException":
@@ -1514,33 +1411,29 @@ const deserializeAws_restJson1DescribeSourceServersCommandError = async (output,
1514
1411
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1515
1412
  default:
1516
1413
  const parsedBody = parsedOutput.body;
1517
- const $metadata = deserializeMetadata(output);
1518
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1519
- response = new MgnServiceException_1.MgnServiceException({
1520
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1521
- $fault: "client",
1522
- $metadata,
1414
+ (0, smithy_client_1.throwDefaultError)({
1415
+ output,
1416
+ parsedBody,
1417
+ exceptionCtor: MgnServiceException_1.MgnServiceException,
1418
+ errorCode,
1523
1419
  });
1524
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1525
1420
  }
1526
1421
  };
1527
1422
  const deserializeAws_restJson1DescribeVcenterClientsCommand = async (output, context) => {
1528
1423
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1529
1424
  return deserializeAws_restJson1DescribeVcenterClientsCommandError(output, context);
1530
1425
  }
1531
- const contents = {
1426
+ const contents = map({
1532
1427
  $metadata: deserializeMetadata(output),
1533
- items: undefined,
1534
- nextToken: undefined,
1535
- };
1428
+ });
1536
1429
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1537
- if (data.items !== undefined && data.items !== null) {
1430
+ if (data.items != null) {
1538
1431
  contents.items = deserializeAws_restJson1VcenterClientList(data.items, context);
1539
1432
  }
1540
- if (data.nextToken !== undefined && data.nextToken !== null) {
1433
+ if (data.nextToken != null) {
1541
1434
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1542
1435
  }
1543
- return Promise.resolve(contents);
1436
+ return contents;
1544
1437
  };
1545
1438
  exports.deserializeAws_restJson1DescribeVcenterClientsCommand = deserializeAws_restJson1DescribeVcenterClientsCommand;
1546
1439
  const deserializeAws_restJson1DescribeVcenterClientsCommandError = async (output, context) => {
@@ -1548,7 +1441,6 @@ const deserializeAws_restJson1DescribeVcenterClientsCommandError = async (output
1548
1441
  ...output,
1549
1442
  body: await parseBody(output.body, context),
1550
1443
  };
1551
- let response;
1552
1444
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1553
1445
  switch (errorCode) {
1554
1446
  case "ResourceNotFoundException":
@@ -1562,65 +1454,53 @@ const deserializeAws_restJson1DescribeVcenterClientsCommandError = async (output
1562
1454
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1563
1455
  default:
1564
1456
  const parsedBody = parsedOutput.body;
1565
- const $metadata = deserializeMetadata(output);
1566
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1567
- response = new MgnServiceException_1.MgnServiceException({
1568
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1569
- $fault: "client",
1570
- $metadata,
1457
+ (0, smithy_client_1.throwDefaultError)({
1458
+ output,
1459
+ parsedBody,
1460
+ exceptionCtor: MgnServiceException_1.MgnServiceException,
1461
+ errorCode,
1571
1462
  });
1572
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1573
1463
  }
1574
1464
  };
1575
1465
  const deserializeAws_restJson1DisconnectFromServiceCommand = async (output, context) => {
1576
1466
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1577
1467
  return deserializeAws_restJson1DisconnectFromServiceCommandError(output, context);
1578
1468
  }
1579
- const contents = {
1469
+ const contents = map({
1580
1470
  $metadata: deserializeMetadata(output),
1581
- arn: undefined,
1582
- dataReplicationInfo: undefined,
1583
- isArchived: undefined,
1584
- launchedInstance: undefined,
1585
- lifeCycle: undefined,
1586
- replicationType: undefined,
1587
- sourceProperties: undefined,
1588
- sourceServerID: undefined,
1589
- tags: undefined,
1590
- vcenterClientID: undefined,
1591
- };
1471
+ });
1592
1472
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1593
- if (data.arn !== undefined && data.arn !== null) {
1473
+ if (data.arn != null) {
1594
1474
  contents.arn = (0, smithy_client_1.expectString)(data.arn);
1595
1475
  }
1596
- if (data.dataReplicationInfo !== undefined && data.dataReplicationInfo !== null) {
1476
+ if (data.dataReplicationInfo != null) {
1597
1477
  contents.dataReplicationInfo = deserializeAws_restJson1DataReplicationInfo(data.dataReplicationInfo, context);
1598
1478
  }
1599
- if (data.isArchived !== undefined && data.isArchived !== null) {
1479
+ if (data.isArchived != null) {
1600
1480
  contents.isArchived = (0, smithy_client_1.expectBoolean)(data.isArchived);
1601
1481
  }
1602
- if (data.launchedInstance !== undefined && data.launchedInstance !== null) {
1482
+ if (data.launchedInstance != null) {
1603
1483
  contents.launchedInstance = deserializeAws_restJson1LaunchedInstance(data.launchedInstance, context);
1604
1484
  }
1605
- if (data.lifeCycle !== undefined && data.lifeCycle !== null) {
1485
+ if (data.lifeCycle != null) {
1606
1486
  contents.lifeCycle = deserializeAws_restJson1LifeCycle(data.lifeCycle, context);
1607
1487
  }
1608
- if (data.replicationType !== undefined && data.replicationType !== null) {
1488
+ if (data.replicationType != null) {
1609
1489
  contents.replicationType = (0, smithy_client_1.expectString)(data.replicationType);
1610
1490
  }
1611
- if (data.sourceProperties !== undefined && data.sourceProperties !== null) {
1491
+ if (data.sourceProperties != null) {
1612
1492
  contents.sourceProperties = deserializeAws_restJson1SourceProperties(data.sourceProperties, context);
1613
1493
  }
1614
- if (data.sourceServerID !== undefined && data.sourceServerID !== null) {
1494
+ if (data.sourceServerID != null) {
1615
1495
  contents.sourceServerID = (0, smithy_client_1.expectString)(data.sourceServerID);
1616
1496
  }
1617
- if (data.tags !== undefined && data.tags !== null) {
1497
+ if (data.tags != null) {
1618
1498
  contents.tags = deserializeAws_restJson1TagsMap(data.tags, context);
1619
1499
  }
1620
- if (data.vcenterClientID !== undefined && data.vcenterClientID !== null) {
1500
+ if (data.vcenterClientID != null) {
1621
1501
  contents.vcenterClientID = (0, smithy_client_1.expectString)(data.vcenterClientID);
1622
1502
  }
1623
- return Promise.resolve(contents);
1503
+ return contents;
1624
1504
  };
1625
1505
  exports.deserializeAws_restJson1DisconnectFromServiceCommand = deserializeAws_restJson1DisconnectFromServiceCommand;
1626
1506
  const deserializeAws_restJson1DisconnectFromServiceCommandError = async (output, context) => {
@@ -1628,7 +1508,6 @@ const deserializeAws_restJson1DisconnectFromServiceCommandError = async (output,
1628
1508
  ...output,
1629
1509
  body: await parseBody(output.body, context),
1630
1510
  };
1631
- let response;
1632
1511
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1633
1512
  switch (errorCode) {
1634
1513
  case "ConflictException":
@@ -1642,65 +1521,53 @@ const deserializeAws_restJson1DisconnectFromServiceCommandError = async (output,
1642
1521
  throw await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context);
1643
1522
  default:
1644
1523
  const parsedBody = parsedOutput.body;
1645
- const $metadata = deserializeMetadata(output);
1646
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1647
- response = new MgnServiceException_1.MgnServiceException({
1648
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1649
- $fault: "client",
1650
- $metadata,
1524
+ (0, smithy_client_1.throwDefaultError)({
1525
+ output,
1526
+ parsedBody,
1527
+ exceptionCtor: MgnServiceException_1.MgnServiceException,
1528
+ errorCode,
1651
1529
  });
1652
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1653
1530
  }
1654
1531
  };
1655
1532
  const deserializeAws_restJson1FinalizeCutoverCommand = async (output, context) => {
1656
1533
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1657
1534
  return deserializeAws_restJson1FinalizeCutoverCommandError(output, context);
1658
1535
  }
1659
- const contents = {
1536
+ const contents = map({
1660
1537
  $metadata: deserializeMetadata(output),
1661
- arn: undefined,
1662
- dataReplicationInfo: undefined,
1663
- isArchived: undefined,
1664
- launchedInstance: undefined,
1665
- lifeCycle: undefined,
1666
- replicationType: undefined,
1667
- sourceProperties: undefined,
1668
- sourceServerID: undefined,
1669
- tags: undefined,
1670
- vcenterClientID: undefined,
1671
- };
1538
+ });
1672
1539
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1673
- if (data.arn !== undefined && data.arn !== null) {
1540
+ if (data.arn != null) {
1674
1541
  contents.arn = (0, smithy_client_1.expectString)(data.arn);
1675
1542
  }
1676
- if (data.dataReplicationInfo !== undefined && data.dataReplicationInfo !== null) {
1543
+ if (data.dataReplicationInfo != null) {
1677
1544
  contents.dataReplicationInfo = deserializeAws_restJson1DataReplicationInfo(data.dataReplicationInfo, context);
1678
1545
  }
1679
- if (data.isArchived !== undefined && data.isArchived !== null) {
1546
+ if (data.isArchived != null) {
1680
1547
  contents.isArchived = (0, smithy_client_1.expectBoolean)(data.isArchived);
1681
1548
  }
1682
- if (data.launchedInstance !== undefined && data.launchedInstance !== null) {
1549
+ if (data.launchedInstance != null) {
1683
1550
  contents.launchedInstance = deserializeAws_restJson1LaunchedInstance(data.launchedInstance, context);
1684
1551
  }
1685
- if (data.lifeCycle !== undefined && data.lifeCycle !== null) {
1552
+ if (data.lifeCycle != null) {
1686
1553
  contents.lifeCycle = deserializeAws_restJson1LifeCycle(data.lifeCycle, context);
1687
1554
  }
1688
- if (data.replicationType !== undefined && data.replicationType !== null) {
1555
+ if (data.replicationType != null) {
1689
1556
  contents.replicationType = (0, smithy_client_1.expectString)(data.replicationType);
1690
1557
  }
1691
- if (data.sourceProperties !== undefined && data.sourceProperties !== null) {
1558
+ if (data.sourceProperties != null) {
1692
1559
  contents.sourceProperties = deserializeAws_restJson1SourceProperties(data.sourceProperties, context);
1693
1560
  }
1694
- if (data.sourceServerID !== undefined && data.sourceServerID !== null) {
1561
+ if (data.sourceServerID != null) {
1695
1562
  contents.sourceServerID = (0, smithy_client_1.expectString)(data.sourceServerID);
1696
1563
  }
1697
- if (data.tags !== undefined && data.tags !== null) {
1564
+ if (data.tags != null) {
1698
1565
  contents.tags = deserializeAws_restJson1TagsMap(data.tags, context);
1699
1566
  }
1700
- if (data.vcenterClientID !== undefined && data.vcenterClientID !== null) {
1567
+ if (data.vcenterClientID != null) {
1701
1568
  contents.vcenterClientID = (0, smithy_client_1.expectString)(data.vcenterClientID);
1702
1569
  }
1703
- return Promise.resolve(contents);
1570
+ return contents;
1704
1571
  };
1705
1572
  exports.deserializeAws_restJson1FinalizeCutoverCommand = deserializeAws_restJson1FinalizeCutoverCommand;
1706
1573
  const deserializeAws_restJson1FinalizeCutoverCommandError = async (output, context) => {
@@ -1708,7 +1575,6 @@ const deserializeAws_restJson1FinalizeCutoverCommandError = async (output, conte
1708
1575
  ...output,
1709
1576
  body: await parseBody(output.body, context),
1710
1577
  };
1711
- let response;
1712
1578
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1713
1579
  switch (errorCode) {
1714
1580
  case "ConflictException":
@@ -1725,65 +1591,53 @@ const deserializeAws_restJson1FinalizeCutoverCommandError = async (output, conte
1725
1591
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1726
1592
  default:
1727
1593
  const parsedBody = parsedOutput.body;
1728
- const $metadata = deserializeMetadata(output);
1729
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1730
- response = new MgnServiceException_1.MgnServiceException({
1731
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1732
- $fault: "client",
1733
- $metadata,
1594
+ (0, smithy_client_1.throwDefaultError)({
1595
+ output,
1596
+ parsedBody,
1597
+ exceptionCtor: MgnServiceException_1.MgnServiceException,
1598
+ errorCode,
1734
1599
  });
1735
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1736
1600
  }
1737
1601
  };
1738
1602
  const deserializeAws_restJson1GetLaunchConfigurationCommand = async (output, context) => {
1739
1603
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1740
1604
  return deserializeAws_restJson1GetLaunchConfigurationCommandError(output, context);
1741
1605
  }
1742
- const contents = {
1606
+ const contents = map({
1743
1607
  $metadata: deserializeMetadata(output),
1744
- bootMode: undefined,
1745
- copyPrivateIp: undefined,
1746
- copyTags: undefined,
1747
- ec2LaunchTemplateID: undefined,
1748
- launchDisposition: undefined,
1749
- licensing: undefined,
1750
- name: undefined,
1751
- postLaunchActions: undefined,
1752
- sourceServerID: undefined,
1753
- targetInstanceTypeRightSizingMethod: undefined,
1754
- };
1608
+ });
1755
1609
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1756
- if (data.bootMode !== undefined && data.bootMode !== null) {
1610
+ if (data.bootMode != null) {
1757
1611
  contents.bootMode = (0, smithy_client_1.expectString)(data.bootMode);
1758
1612
  }
1759
- if (data.copyPrivateIp !== undefined && data.copyPrivateIp !== null) {
1613
+ if (data.copyPrivateIp != null) {
1760
1614
  contents.copyPrivateIp = (0, smithy_client_1.expectBoolean)(data.copyPrivateIp);
1761
1615
  }
1762
- if (data.copyTags !== undefined && data.copyTags !== null) {
1616
+ if (data.copyTags != null) {
1763
1617
  contents.copyTags = (0, smithy_client_1.expectBoolean)(data.copyTags);
1764
1618
  }
1765
- if (data.ec2LaunchTemplateID !== undefined && data.ec2LaunchTemplateID !== null) {
1619
+ if (data.ec2LaunchTemplateID != null) {
1766
1620
  contents.ec2LaunchTemplateID = (0, smithy_client_1.expectString)(data.ec2LaunchTemplateID);
1767
1621
  }
1768
- if (data.launchDisposition !== undefined && data.launchDisposition !== null) {
1622
+ if (data.launchDisposition != null) {
1769
1623
  contents.launchDisposition = (0, smithy_client_1.expectString)(data.launchDisposition);
1770
1624
  }
1771
- if (data.licensing !== undefined && data.licensing !== null) {
1625
+ if (data.licensing != null) {
1772
1626
  contents.licensing = deserializeAws_restJson1Licensing(data.licensing, context);
1773
1627
  }
1774
- if (data.name !== undefined && data.name !== null) {
1628
+ if (data.name != null) {
1775
1629
  contents.name = (0, smithy_client_1.expectString)(data.name);
1776
1630
  }
1777
- if (data.postLaunchActions !== undefined && data.postLaunchActions !== null) {
1631
+ if (data.postLaunchActions != null) {
1778
1632
  contents.postLaunchActions = deserializeAws_restJson1PostLaunchActions(data.postLaunchActions, context);
1779
1633
  }
1780
- if (data.sourceServerID !== undefined && data.sourceServerID !== null) {
1634
+ if (data.sourceServerID != null) {
1781
1635
  contents.sourceServerID = (0, smithy_client_1.expectString)(data.sourceServerID);
1782
1636
  }
1783
- if (data.targetInstanceTypeRightSizingMethod !== undefined && data.targetInstanceTypeRightSizingMethod !== null) {
1637
+ if (data.targetInstanceTypeRightSizingMethod != null) {
1784
1638
  contents.targetInstanceTypeRightSizingMethod = (0, smithy_client_1.expectString)(data.targetInstanceTypeRightSizingMethod);
1785
1639
  }
1786
- return Promise.resolve(contents);
1640
+ return contents;
1787
1641
  };
1788
1642
  exports.deserializeAws_restJson1GetLaunchConfigurationCommand = deserializeAws_restJson1GetLaunchConfigurationCommand;
1789
1643
  const deserializeAws_restJson1GetLaunchConfigurationCommandError = async (output, context) => {
@@ -1791,7 +1645,6 @@ const deserializeAws_restJson1GetLaunchConfigurationCommandError = async (output
1791
1645
  ...output,
1792
1646
  body: await parseBody(output.body, context),
1793
1647
  };
1794
- let response;
1795
1648
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1796
1649
  switch (errorCode) {
1797
1650
  case "ResourceNotFoundException":
@@ -1802,85 +1655,68 @@ const deserializeAws_restJson1GetLaunchConfigurationCommandError = async (output
1802
1655
  throw await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context);
1803
1656
  default:
1804
1657
  const parsedBody = parsedOutput.body;
1805
- const $metadata = deserializeMetadata(output);
1806
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1807
- response = new MgnServiceException_1.MgnServiceException({
1808
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1809
- $fault: "client",
1810
- $metadata,
1658
+ (0, smithy_client_1.throwDefaultError)({
1659
+ output,
1660
+ parsedBody,
1661
+ exceptionCtor: MgnServiceException_1.MgnServiceException,
1662
+ errorCode,
1811
1663
  });
1812
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1813
1664
  }
1814
1665
  };
1815
1666
  const deserializeAws_restJson1GetReplicationConfigurationCommand = async (output, context) => {
1816
1667
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1817
1668
  return deserializeAws_restJson1GetReplicationConfigurationCommandError(output, context);
1818
1669
  }
1819
- const contents = {
1670
+ const contents = map({
1820
1671
  $metadata: deserializeMetadata(output),
1821
- associateDefaultSecurityGroup: undefined,
1822
- bandwidthThrottling: undefined,
1823
- createPublicIP: undefined,
1824
- dataPlaneRouting: undefined,
1825
- defaultLargeStagingDiskType: undefined,
1826
- ebsEncryption: undefined,
1827
- ebsEncryptionKeyArn: undefined,
1828
- name: undefined,
1829
- replicatedDisks: undefined,
1830
- replicationServerInstanceType: undefined,
1831
- replicationServersSecurityGroupsIDs: undefined,
1832
- sourceServerID: undefined,
1833
- stagingAreaSubnetId: undefined,
1834
- stagingAreaTags: undefined,
1835
- useDedicatedReplicationServer: undefined,
1836
- };
1672
+ });
1837
1673
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1838
- if (data.associateDefaultSecurityGroup !== undefined && data.associateDefaultSecurityGroup !== null) {
1674
+ if (data.associateDefaultSecurityGroup != null) {
1839
1675
  contents.associateDefaultSecurityGroup = (0, smithy_client_1.expectBoolean)(data.associateDefaultSecurityGroup);
1840
1676
  }
1841
- if (data.bandwidthThrottling !== undefined && data.bandwidthThrottling !== null) {
1677
+ if (data.bandwidthThrottling != null) {
1842
1678
  contents.bandwidthThrottling = (0, smithy_client_1.expectLong)(data.bandwidthThrottling);
1843
1679
  }
1844
- if (data.createPublicIP !== undefined && data.createPublicIP !== null) {
1680
+ if (data.createPublicIP != null) {
1845
1681
  contents.createPublicIP = (0, smithy_client_1.expectBoolean)(data.createPublicIP);
1846
1682
  }
1847
- if (data.dataPlaneRouting !== undefined && data.dataPlaneRouting !== null) {
1683
+ if (data.dataPlaneRouting != null) {
1848
1684
  contents.dataPlaneRouting = (0, smithy_client_1.expectString)(data.dataPlaneRouting);
1849
1685
  }
1850
- if (data.defaultLargeStagingDiskType !== undefined && data.defaultLargeStagingDiskType !== null) {
1686
+ if (data.defaultLargeStagingDiskType != null) {
1851
1687
  contents.defaultLargeStagingDiskType = (0, smithy_client_1.expectString)(data.defaultLargeStagingDiskType);
1852
1688
  }
1853
- if (data.ebsEncryption !== undefined && data.ebsEncryption !== null) {
1689
+ if (data.ebsEncryption != null) {
1854
1690
  contents.ebsEncryption = (0, smithy_client_1.expectString)(data.ebsEncryption);
1855
1691
  }
1856
- if (data.ebsEncryptionKeyArn !== undefined && data.ebsEncryptionKeyArn !== null) {
1692
+ if (data.ebsEncryptionKeyArn != null) {
1857
1693
  contents.ebsEncryptionKeyArn = (0, smithy_client_1.expectString)(data.ebsEncryptionKeyArn);
1858
1694
  }
1859
- if (data.name !== undefined && data.name !== null) {
1695
+ if (data.name != null) {
1860
1696
  contents.name = (0, smithy_client_1.expectString)(data.name);
1861
1697
  }
1862
- if (data.replicatedDisks !== undefined && data.replicatedDisks !== null) {
1698
+ if (data.replicatedDisks != null) {
1863
1699
  contents.replicatedDisks = deserializeAws_restJson1ReplicationConfigurationReplicatedDisks(data.replicatedDisks, context);
1864
1700
  }
1865
- if (data.replicationServerInstanceType !== undefined && data.replicationServerInstanceType !== null) {
1701
+ if (data.replicationServerInstanceType != null) {
1866
1702
  contents.replicationServerInstanceType = (0, smithy_client_1.expectString)(data.replicationServerInstanceType);
1867
1703
  }
1868
- if (data.replicationServersSecurityGroupsIDs !== undefined && data.replicationServersSecurityGroupsIDs !== null) {
1704
+ if (data.replicationServersSecurityGroupsIDs != null) {
1869
1705
  contents.replicationServersSecurityGroupsIDs = deserializeAws_restJson1ReplicationServersSecurityGroupsIDs(data.replicationServersSecurityGroupsIDs, context);
1870
1706
  }
1871
- if (data.sourceServerID !== undefined && data.sourceServerID !== null) {
1707
+ if (data.sourceServerID != null) {
1872
1708
  contents.sourceServerID = (0, smithy_client_1.expectString)(data.sourceServerID);
1873
1709
  }
1874
- if (data.stagingAreaSubnetId !== undefined && data.stagingAreaSubnetId !== null) {
1710
+ if (data.stagingAreaSubnetId != null) {
1875
1711
  contents.stagingAreaSubnetId = (0, smithy_client_1.expectString)(data.stagingAreaSubnetId);
1876
1712
  }
1877
- if (data.stagingAreaTags !== undefined && data.stagingAreaTags !== null) {
1713
+ if (data.stagingAreaTags != null) {
1878
1714
  contents.stagingAreaTags = deserializeAws_restJson1TagsMap(data.stagingAreaTags, context);
1879
1715
  }
1880
- if (data.useDedicatedReplicationServer !== undefined && data.useDedicatedReplicationServer !== null) {
1716
+ if (data.useDedicatedReplicationServer != null) {
1881
1717
  contents.useDedicatedReplicationServer = (0, smithy_client_1.expectBoolean)(data.useDedicatedReplicationServer);
1882
1718
  }
1883
- return Promise.resolve(contents);
1719
+ return contents;
1884
1720
  };
1885
1721
  exports.deserializeAws_restJson1GetReplicationConfigurationCommand = deserializeAws_restJson1GetReplicationConfigurationCommand;
1886
1722
  const deserializeAws_restJson1GetReplicationConfigurationCommandError = async (output, context) => {
@@ -1888,7 +1724,6 @@ const deserializeAws_restJson1GetReplicationConfigurationCommandError = async (o
1888
1724
  ...output,
1889
1725
  body: await parseBody(output.body, context),
1890
1726
  };
1891
- let response;
1892
1727
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1893
1728
  switch (errorCode) {
1894
1729
  case "ResourceNotFoundException":
@@ -1899,25 +1734,23 @@ const deserializeAws_restJson1GetReplicationConfigurationCommandError = async (o
1899
1734
  throw await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context);
1900
1735
  default:
1901
1736
  const parsedBody = parsedOutput.body;
1902
- const $metadata = deserializeMetadata(output);
1903
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1904
- response = new MgnServiceException_1.MgnServiceException({
1905
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1906
- $fault: "client",
1907
- $metadata,
1737
+ (0, smithy_client_1.throwDefaultError)({
1738
+ output,
1739
+ parsedBody,
1740
+ exceptionCtor: MgnServiceException_1.MgnServiceException,
1741
+ errorCode,
1908
1742
  });
1909
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1910
1743
  }
1911
1744
  };
1912
1745
  const deserializeAws_restJson1InitializeServiceCommand = async (output, context) => {
1913
1746
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1914
1747
  return deserializeAws_restJson1InitializeServiceCommandError(output, context);
1915
1748
  }
1916
- const contents = {
1749
+ const contents = map({
1917
1750
  $metadata: deserializeMetadata(output),
1918
- };
1751
+ });
1919
1752
  await collectBody(output.body, context);
1920
- return Promise.resolve(contents);
1753
+ return contents;
1921
1754
  };
1922
1755
  exports.deserializeAws_restJson1InitializeServiceCommand = deserializeAws_restJson1InitializeServiceCommand;
1923
1756
  const deserializeAws_restJson1InitializeServiceCommandError = async (output, context) => {
@@ -1925,7 +1758,6 @@ const deserializeAws_restJson1InitializeServiceCommandError = async (output, con
1925
1758
  ...output,
1926
1759
  body: await parseBody(output.body, context),
1927
1760
  };
1928
- let response;
1929
1761
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1930
1762
  switch (errorCode) {
1931
1763
  case "AccessDeniedException":
@@ -1936,29 +1768,26 @@ const deserializeAws_restJson1InitializeServiceCommandError = async (output, con
1936
1768
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1937
1769
  default:
1938
1770
  const parsedBody = parsedOutput.body;
1939
- const $metadata = deserializeMetadata(output);
1940
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1941
- response = new MgnServiceException_1.MgnServiceException({
1942
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1943
- $fault: "client",
1944
- $metadata,
1771
+ (0, smithy_client_1.throwDefaultError)({
1772
+ output,
1773
+ parsedBody,
1774
+ exceptionCtor: MgnServiceException_1.MgnServiceException,
1775
+ errorCode,
1945
1776
  });
1946
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1947
1777
  }
1948
1778
  };
1949
1779
  const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
1950
1780
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1951
1781
  return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
1952
1782
  }
1953
- const contents = {
1783
+ const contents = map({
1954
1784
  $metadata: deserializeMetadata(output),
1955
- tags: undefined,
1956
- };
1785
+ });
1957
1786
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1958
- if (data.tags !== undefined && data.tags !== null) {
1787
+ if (data.tags != null) {
1959
1788
  contents.tags = deserializeAws_restJson1TagsMap(data.tags, context);
1960
1789
  }
1961
- return Promise.resolve(contents);
1790
+ return contents;
1962
1791
  };
1963
1792
  exports.deserializeAws_restJson1ListTagsForResourceCommand = deserializeAws_restJson1ListTagsForResourceCommand;
1964
1793
  const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
@@ -1966,7 +1795,6 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
1966
1795
  ...output,
1967
1796
  body: await parseBody(output.body, context),
1968
1797
  };
1969
- let response;
1970
1798
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1971
1799
  switch (errorCode) {
1972
1800
  case "AccessDeniedException":
@@ -1986,65 +1814,53 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
1986
1814
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1987
1815
  default:
1988
1816
  const parsedBody = parsedOutput.body;
1989
- const $metadata = deserializeMetadata(output);
1990
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1991
- response = new MgnServiceException_1.MgnServiceException({
1992
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1993
- $fault: "client",
1994
- $metadata,
1817
+ (0, smithy_client_1.throwDefaultError)({
1818
+ output,
1819
+ parsedBody,
1820
+ exceptionCtor: MgnServiceException_1.MgnServiceException,
1821
+ errorCode,
1995
1822
  });
1996
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1997
1823
  }
1998
1824
  };
1999
1825
  const deserializeAws_restJson1MarkAsArchivedCommand = async (output, context) => {
2000
1826
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2001
1827
  return deserializeAws_restJson1MarkAsArchivedCommandError(output, context);
2002
1828
  }
2003
- const contents = {
1829
+ const contents = map({
2004
1830
  $metadata: deserializeMetadata(output),
2005
- arn: undefined,
2006
- dataReplicationInfo: undefined,
2007
- isArchived: undefined,
2008
- launchedInstance: undefined,
2009
- lifeCycle: undefined,
2010
- replicationType: undefined,
2011
- sourceProperties: undefined,
2012
- sourceServerID: undefined,
2013
- tags: undefined,
2014
- vcenterClientID: undefined,
2015
- };
1831
+ });
2016
1832
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2017
- if (data.arn !== undefined && data.arn !== null) {
1833
+ if (data.arn != null) {
2018
1834
  contents.arn = (0, smithy_client_1.expectString)(data.arn);
2019
1835
  }
2020
- if (data.dataReplicationInfo !== undefined && data.dataReplicationInfo !== null) {
1836
+ if (data.dataReplicationInfo != null) {
2021
1837
  contents.dataReplicationInfo = deserializeAws_restJson1DataReplicationInfo(data.dataReplicationInfo, context);
2022
1838
  }
2023
- if (data.isArchived !== undefined && data.isArchived !== null) {
1839
+ if (data.isArchived != null) {
2024
1840
  contents.isArchived = (0, smithy_client_1.expectBoolean)(data.isArchived);
2025
1841
  }
2026
- if (data.launchedInstance !== undefined && data.launchedInstance !== null) {
1842
+ if (data.launchedInstance != null) {
2027
1843
  contents.launchedInstance = deserializeAws_restJson1LaunchedInstance(data.launchedInstance, context);
2028
1844
  }
2029
- if (data.lifeCycle !== undefined && data.lifeCycle !== null) {
1845
+ if (data.lifeCycle != null) {
2030
1846
  contents.lifeCycle = deserializeAws_restJson1LifeCycle(data.lifeCycle, context);
2031
1847
  }
2032
- if (data.replicationType !== undefined && data.replicationType !== null) {
1848
+ if (data.replicationType != null) {
2033
1849
  contents.replicationType = (0, smithy_client_1.expectString)(data.replicationType);
2034
1850
  }
2035
- if (data.sourceProperties !== undefined && data.sourceProperties !== null) {
1851
+ if (data.sourceProperties != null) {
2036
1852
  contents.sourceProperties = deserializeAws_restJson1SourceProperties(data.sourceProperties, context);
2037
1853
  }
2038
- if (data.sourceServerID !== undefined && data.sourceServerID !== null) {
1854
+ if (data.sourceServerID != null) {
2039
1855
  contents.sourceServerID = (0, smithy_client_1.expectString)(data.sourceServerID);
2040
1856
  }
2041
- if (data.tags !== undefined && data.tags !== null) {
1857
+ if (data.tags != null) {
2042
1858
  contents.tags = deserializeAws_restJson1TagsMap(data.tags, context);
2043
1859
  }
2044
- if (data.vcenterClientID !== undefined && data.vcenterClientID !== null) {
1860
+ if (data.vcenterClientID != null) {
2045
1861
  contents.vcenterClientID = (0, smithy_client_1.expectString)(data.vcenterClientID);
2046
1862
  }
2047
- return Promise.resolve(contents);
1863
+ return contents;
2048
1864
  };
2049
1865
  exports.deserializeAws_restJson1MarkAsArchivedCommand = deserializeAws_restJson1MarkAsArchivedCommand;
2050
1866
  const deserializeAws_restJson1MarkAsArchivedCommandError = async (output, context) => {
@@ -2052,7 +1868,6 @@ const deserializeAws_restJson1MarkAsArchivedCommandError = async (output, contex
2052
1868
  ...output,
2053
1869
  body: await parseBody(output.body, context),
2054
1870
  };
2055
- let response;
2056
1871
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2057
1872
  switch (errorCode) {
2058
1873
  case "ConflictException":
@@ -2066,65 +1881,53 @@ const deserializeAws_restJson1MarkAsArchivedCommandError = async (output, contex
2066
1881
  throw await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context);
2067
1882
  default:
2068
1883
  const parsedBody = parsedOutput.body;
2069
- const $metadata = deserializeMetadata(output);
2070
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2071
- response = new MgnServiceException_1.MgnServiceException({
2072
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2073
- $fault: "client",
2074
- $metadata,
1884
+ (0, smithy_client_1.throwDefaultError)({
1885
+ output,
1886
+ parsedBody,
1887
+ exceptionCtor: MgnServiceException_1.MgnServiceException,
1888
+ errorCode,
2075
1889
  });
2076
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2077
1890
  }
2078
1891
  };
2079
1892
  const deserializeAws_restJson1RetryDataReplicationCommand = async (output, context) => {
2080
1893
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2081
1894
  return deserializeAws_restJson1RetryDataReplicationCommandError(output, context);
2082
1895
  }
2083
- const contents = {
1896
+ const contents = map({
2084
1897
  $metadata: deserializeMetadata(output),
2085
- arn: undefined,
2086
- dataReplicationInfo: undefined,
2087
- isArchived: undefined,
2088
- launchedInstance: undefined,
2089
- lifeCycle: undefined,
2090
- replicationType: undefined,
2091
- sourceProperties: undefined,
2092
- sourceServerID: undefined,
2093
- tags: undefined,
2094
- vcenterClientID: undefined,
2095
- };
1898
+ });
2096
1899
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2097
- if (data.arn !== undefined && data.arn !== null) {
1900
+ if (data.arn != null) {
2098
1901
  contents.arn = (0, smithy_client_1.expectString)(data.arn);
2099
1902
  }
2100
- if (data.dataReplicationInfo !== undefined && data.dataReplicationInfo !== null) {
1903
+ if (data.dataReplicationInfo != null) {
2101
1904
  contents.dataReplicationInfo = deserializeAws_restJson1DataReplicationInfo(data.dataReplicationInfo, context);
2102
1905
  }
2103
- if (data.isArchived !== undefined && data.isArchived !== null) {
1906
+ if (data.isArchived != null) {
2104
1907
  contents.isArchived = (0, smithy_client_1.expectBoolean)(data.isArchived);
2105
1908
  }
2106
- if (data.launchedInstance !== undefined && data.launchedInstance !== null) {
1909
+ if (data.launchedInstance != null) {
2107
1910
  contents.launchedInstance = deserializeAws_restJson1LaunchedInstance(data.launchedInstance, context);
2108
1911
  }
2109
- if (data.lifeCycle !== undefined && data.lifeCycle !== null) {
1912
+ if (data.lifeCycle != null) {
2110
1913
  contents.lifeCycle = deserializeAws_restJson1LifeCycle(data.lifeCycle, context);
2111
1914
  }
2112
- if (data.replicationType !== undefined && data.replicationType !== null) {
1915
+ if (data.replicationType != null) {
2113
1916
  contents.replicationType = (0, smithy_client_1.expectString)(data.replicationType);
2114
1917
  }
2115
- if (data.sourceProperties !== undefined && data.sourceProperties !== null) {
1918
+ if (data.sourceProperties != null) {
2116
1919
  contents.sourceProperties = deserializeAws_restJson1SourceProperties(data.sourceProperties, context);
2117
1920
  }
2118
- if (data.sourceServerID !== undefined && data.sourceServerID !== null) {
1921
+ if (data.sourceServerID != null) {
2119
1922
  contents.sourceServerID = (0, smithy_client_1.expectString)(data.sourceServerID);
2120
1923
  }
2121
- if (data.tags !== undefined && data.tags !== null) {
1924
+ if (data.tags != null) {
2122
1925
  contents.tags = deserializeAws_restJson1TagsMap(data.tags, context);
2123
1926
  }
2124
- if (data.vcenterClientID !== undefined && data.vcenterClientID !== null) {
1927
+ if (data.vcenterClientID != null) {
2125
1928
  contents.vcenterClientID = (0, smithy_client_1.expectString)(data.vcenterClientID);
2126
1929
  }
2127
- return Promise.resolve(contents);
1930
+ return contents;
2128
1931
  };
2129
1932
  exports.deserializeAws_restJson1RetryDataReplicationCommand = deserializeAws_restJson1RetryDataReplicationCommand;
2130
1933
  const deserializeAws_restJson1RetryDataReplicationCommandError = async (output, context) => {
@@ -2132,7 +1935,6 @@ const deserializeAws_restJson1RetryDataReplicationCommandError = async (output,
2132
1935
  ...output,
2133
1936
  body: await parseBody(output.body, context),
2134
1937
  };
2135
- let response;
2136
1938
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2137
1939
  switch (errorCode) {
2138
1940
  case "ResourceNotFoundException":
@@ -2146,29 +1948,26 @@ const deserializeAws_restJson1RetryDataReplicationCommandError = async (output,
2146
1948
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2147
1949
  default:
2148
1950
  const parsedBody = parsedOutput.body;
2149
- const $metadata = deserializeMetadata(output);
2150
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2151
- response = new MgnServiceException_1.MgnServiceException({
2152
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2153
- $fault: "client",
2154
- $metadata,
1951
+ (0, smithy_client_1.throwDefaultError)({
1952
+ output,
1953
+ parsedBody,
1954
+ exceptionCtor: MgnServiceException_1.MgnServiceException,
1955
+ errorCode,
2155
1956
  });
2156
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2157
1957
  }
2158
1958
  };
2159
1959
  const deserializeAws_restJson1StartCutoverCommand = async (output, context) => {
2160
1960
  if (output.statusCode !== 202 && output.statusCode >= 300) {
2161
1961
  return deserializeAws_restJson1StartCutoverCommandError(output, context);
2162
1962
  }
2163
- const contents = {
1963
+ const contents = map({
2164
1964
  $metadata: deserializeMetadata(output),
2165
- job: undefined,
2166
- };
1965
+ });
2167
1966
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2168
- if (data.job !== undefined && data.job !== null) {
1967
+ if (data.job != null) {
2169
1968
  contents.job = deserializeAws_restJson1Job(data.job, context);
2170
1969
  }
2171
- return Promise.resolve(contents);
1970
+ return contents;
2172
1971
  };
2173
1972
  exports.deserializeAws_restJson1StartCutoverCommand = deserializeAws_restJson1StartCutoverCommand;
2174
1973
  const deserializeAws_restJson1StartCutoverCommandError = async (output, context) => {
@@ -2176,7 +1975,6 @@ const deserializeAws_restJson1StartCutoverCommandError = async (output, context)
2176
1975
  ...output,
2177
1976
  body: await parseBody(output.body, context),
2178
1977
  };
2179
- let response;
2180
1978
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2181
1979
  switch (errorCode) {
2182
1980
  case "ConflictException":
@@ -2190,65 +1988,53 @@ const deserializeAws_restJson1StartCutoverCommandError = async (output, context)
2190
1988
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2191
1989
  default:
2192
1990
  const parsedBody = parsedOutput.body;
2193
- const $metadata = deserializeMetadata(output);
2194
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2195
- response = new MgnServiceException_1.MgnServiceException({
2196
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2197
- $fault: "client",
2198
- $metadata,
1991
+ (0, smithy_client_1.throwDefaultError)({
1992
+ output,
1993
+ parsedBody,
1994
+ exceptionCtor: MgnServiceException_1.MgnServiceException,
1995
+ errorCode,
2199
1996
  });
2200
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2201
1997
  }
2202
1998
  };
2203
1999
  const deserializeAws_restJson1StartReplicationCommand = async (output, context) => {
2204
2000
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2205
2001
  return deserializeAws_restJson1StartReplicationCommandError(output, context);
2206
2002
  }
2207
- const contents = {
2003
+ const contents = map({
2208
2004
  $metadata: deserializeMetadata(output),
2209
- arn: undefined,
2210
- dataReplicationInfo: undefined,
2211
- isArchived: undefined,
2212
- launchedInstance: undefined,
2213
- lifeCycle: undefined,
2214
- replicationType: undefined,
2215
- sourceProperties: undefined,
2216
- sourceServerID: undefined,
2217
- tags: undefined,
2218
- vcenterClientID: undefined,
2219
- };
2005
+ });
2220
2006
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2221
- if (data.arn !== undefined && data.arn !== null) {
2007
+ if (data.arn != null) {
2222
2008
  contents.arn = (0, smithy_client_1.expectString)(data.arn);
2223
2009
  }
2224
- if (data.dataReplicationInfo !== undefined && data.dataReplicationInfo !== null) {
2010
+ if (data.dataReplicationInfo != null) {
2225
2011
  contents.dataReplicationInfo = deserializeAws_restJson1DataReplicationInfo(data.dataReplicationInfo, context);
2226
2012
  }
2227
- if (data.isArchived !== undefined && data.isArchived !== null) {
2013
+ if (data.isArchived != null) {
2228
2014
  contents.isArchived = (0, smithy_client_1.expectBoolean)(data.isArchived);
2229
2015
  }
2230
- if (data.launchedInstance !== undefined && data.launchedInstance !== null) {
2016
+ if (data.launchedInstance != null) {
2231
2017
  contents.launchedInstance = deserializeAws_restJson1LaunchedInstance(data.launchedInstance, context);
2232
2018
  }
2233
- if (data.lifeCycle !== undefined && data.lifeCycle !== null) {
2019
+ if (data.lifeCycle != null) {
2234
2020
  contents.lifeCycle = deserializeAws_restJson1LifeCycle(data.lifeCycle, context);
2235
2021
  }
2236
- if (data.replicationType !== undefined && data.replicationType !== null) {
2022
+ if (data.replicationType != null) {
2237
2023
  contents.replicationType = (0, smithy_client_1.expectString)(data.replicationType);
2238
2024
  }
2239
- if (data.sourceProperties !== undefined && data.sourceProperties !== null) {
2025
+ if (data.sourceProperties != null) {
2240
2026
  contents.sourceProperties = deserializeAws_restJson1SourceProperties(data.sourceProperties, context);
2241
2027
  }
2242
- if (data.sourceServerID !== undefined && data.sourceServerID !== null) {
2028
+ if (data.sourceServerID != null) {
2243
2029
  contents.sourceServerID = (0, smithy_client_1.expectString)(data.sourceServerID);
2244
2030
  }
2245
- if (data.tags !== undefined && data.tags !== null) {
2031
+ if (data.tags != null) {
2246
2032
  contents.tags = deserializeAws_restJson1TagsMap(data.tags, context);
2247
2033
  }
2248
- if (data.vcenterClientID !== undefined && data.vcenterClientID !== null) {
2034
+ if (data.vcenterClientID != null) {
2249
2035
  contents.vcenterClientID = (0, smithy_client_1.expectString)(data.vcenterClientID);
2250
2036
  }
2251
- return Promise.resolve(contents);
2037
+ return contents;
2252
2038
  };
2253
2039
  exports.deserializeAws_restJson1StartReplicationCommand = deserializeAws_restJson1StartReplicationCommand;
2254
2040
  const deserializeAws_restJson1StartReplicationCommandError = async (output, context) => {
@@ -2256,7 +2042,6 @@ const deserializeAws_restJson1StartReplicationCommandError = async (output, cont
2256
2042
  ...output,
2257
2043
  body: await parseBody(output.body, context),
2258
2044
  };
2259
- let response;
2260
2045
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2261
2046
  switch (errorCode) {
2262
2047
  case "ConflictException":
@@ -2276,29 +2061,26 @@ const deserializeAws_restJson1StartReplicationCommandError = async (output, cont
2276
2061
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2277
2062
  default:
2278
2063
  const parsedBody = parsedOutput.body;
2279
- const $metadata = deserializeMetadata(output);
2280
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2281
- response = new MgnServiceException_1.MgnServiceException({
2282
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2283
- $fault: "client",
2284
- $metadata,
2064
+ (0, smithy_client_1.throwDefaultError)({
2065
+ output,
2066
+ parsedBody,
2067
+ exceptionCtor: MgnServiceException_1.MgnServiceException,
2068
+ errorCode,
2285
2069
  });
2286
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2287
2070
  }
2288
2071
  };
2289
2072
  const deserializeAws_restJson1StartTestCommand = async (output, context) => {
2290
2073
  if (output.statusCode !== 202 && output.statusCode >= 300) {
2291
2074
  return deserializeAws_restJson1StartTestCommandError(output, context);
2292
2075
  }
2293
- const contents = {
2076
+ const contents = map({
2294
2077
  $metadata: deserializeMetadata(output),
2295
- job: undefined,
2296
- };
2078
+ });
2297
2079
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2298
- if (data.job !== undefined && data.job !== null) {
2080
+ if (data.job != null) {
2299
2081
  contents.job = deserializeAws_restJson1Job(data.job, context);
2300
2082
  }
2301
- return Promise.resolve(contents);
2083
+ return contents;
2302
2084
  };
2303
2085
  exports.deserializeAws_restJson1StartTestCommand = deserializeAws_restJson1StartTestCommand;
2304
2086
  const deserializeAws_restJson1StartTestCommandError = async (output, context) => {
@@ -2306,7 +2088,6 @@ const deserializeAws_restJson1StartTestCommandError = async (output, context) =>
2306
2088
  ...output,
2307
2089
  body: await parseBody(output.body, context),
2308
2090
  };
2309
- let response;
2310
2091
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2311
2092
  switch (errorCode) {
2312
2093
  case "ConflictException":
@@ -2320,25 +2101,23 @@ const deserializeAws_restJson1StartTestCommandError = async (output, context) =>
2320
2101
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2321
2102
  default:
2322
2103
  const parsedBody = parsedOutput.body;
2323
- const $metadata = deserializeMetadata(output);
2324
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2325
- response = new MgnServiceException_1.MgnServiceException({
2326
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2327
- $fault: "client",
2328
- $metadata,
2104
+ (0, smithy_client_1.throwDefaultError)({
2105
+ output,
2106
+ parsedBody,
2107
+ exceptionCtor: MgnServiceException_1.MgnServiceException,
2108
+ errorCode,
2329
2109
  });
2330
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2331
2110
  }
2332
2111
  };
2333
2112
  const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
2334
2113
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2335
2114
  return deserializeAws_restJson1TagResourceCommandError(output, context);
2336
2115
  }
2337
- const contents = {
2116
+ const contents = map({
2338
2117
  $metadata: deserializeMetadata(output),
2339
- };
2118
+ });
2340
2119
  await collectBody(output.body, context);
2341
- return Promise.resolve(contents);
2120
+ return contents;
2342
2121
  };
2343
2122
  exports.deserializeAws_restJson1TagResourceCommand = deserializeAws_restJson1TagResourceCommand;
2344
2123
  const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
@@ -2346,7 +2125,6 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
2346
2125
  ...output,
2347
2126
  body: await parseBody(output.body, context),
2348
2127
  };
2349
- let response;
2350
2128
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2351
2129
  switch (errorCode) {
2352
2130
  case "AccessDeniedException":
@@ -2366,29 +2144,26 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
2366
2144
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2367
2145
  default:
2368
2146
  const parsedBody = parsedOutput.body;
2369
- const $metadata = deserializeMetadata(output);
2370
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2371
- response = new MgnServiceException_1.MgnServiceException({
2372
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2373
- $fault: "client",
2374
- $metadata,
2147
+ (0, smithy_client_1.throwDefaultError)({
2148
+ output,
2149
+ parsedBody,
2150
+ exceptionCtor: MgnServiceException_1.MgnServiceException,
2151
+ errorCode,
2375
2152
  });
2376
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2377
2153
  }
2378
2154
  };
2379
2155
  const deserializeAws_restJson1TerminateTargetInstancesCommand = async (output, context) => {
2380
2156
  if (output.statusCode !== 202 && output.statusCode >= 300) {
2381
2157
  return deserializeAws_restJson1TerminateTargetInstancesCommandError(output, context);
2382
2158
  }
2383
- const contents = {
2159
+ const contents = map({
2384
2160
  $metadata: deserializeMetadata(output),
2385
- job: undefined,
2386
- };
2161
+ });
2387
2162
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2388
- if (data.job !== undefined && data.job !== null) {
2163
+ if (data.job != null) {
2389
2164
  contents.job = deserializeAws_restJson1Job(data.job, context);
2390
2165
  }
2391
- return Promise.resolve(contents);
2166
+ return contents;
2392
2167
  };
2393
2168
  exports.deserializeAws_restJson1TerminateTargetInstancesCommand = deserializeAws_restJson1TerminateTargetInstancesCommand;
2394
2169
  const deserializeAws_restJson1TerminateTargetInstancesCommandError = async (output, context) => {
@@ -2396,7 +2171,6 @@ const deserializeAws_restJson1TerminateTargetInstancesCommandError = async (outp
2396
2171
  ...output,
2397
2172
  body: await parseBody(output.body, context),
2398
2173
  };
2399
- let response;
2400
2174
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2401
2175
  switch (errorCode) {
2402
2176
  case "ConflictException":
@@ -2410,25 +2184,23 @@ const deserializeAws_restJson1TerminateTargetInstancesCommandError = async (outp
2410
2184
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2411
2185
  default:
2412
2186
  const parsedBody = parsedOutput.body;
2413
- const $metadata = deserializeMetadata(output);
2414
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2415
- response = new MgnServiceException_1.MgnServiceException({
2416
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2417
- $fault: "client",
2418
- $metadata,
2187
+ (0, smithy_client_1.throwDefaultError)({
2188
+ output,
2189
+ parsedBody,
2190
+ exceptionCtor: MgnServiceException_1.MgnServiceException,
2191
+ errorCode,
2419
2192
  });
2420
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2421
2193
  }
2422
2194
  };
2423
2195
  const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
2424
2196
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2425
2197
  return deserializeAws_restJson1UntagResourceCommandError(output, context);
2426
2198
  }
2427
- const contents = {
2199
+ const contents = map({
2428
2200
  $metadata: deserializeMetadata(output),
2429
- };
2201
+ });
2430
2202
  await collectBody(output.body, context);
2431
- return Promise.resolve(contents);
2203
+ return contents;
2432
2204
  };
2433
2205
  exports.deserializeAws_restJson1UntagResourceCommand = deserializeAws_restJson1UntagResourceCommand;
2434
2206
  const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
@@ -2436,7 +2208,6 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
2436
2208
  ...output,
2437
2209
  body: await parseBody(output.body, context),
2438
2210
  };
2439
- let response;
2440
2211
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2441
2212
  switch (errorCode) {
2442
2213
  case "AccessDeniedException":
@@ -2456,65 +2227,53 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
2456
2227
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2457
2228
  default:
2458
2229
  const parsedBody = parsedOutput.body;
2459
- const $metadata = deserializeMetadata(output);
2460
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2461
- response = new MgnServiceException_1.MgnServiceException({
2462
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2463
- $fault: "client",
2464
- $metadata,
2230
+ (0, smithy_client_1.throwDefaultError)({
2231
+ output,
2232
+ parsedBody,
2233
+ exceptionCtor: MgnServiceException_1.MgnServiceException,
2234
+ errorCode,
2465
2235
  });
2466
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2467
2236
  }
2468
2237
  };
2469
2238
  const deserializeAws_restJson1UpdateLaunchConfigurationCommand = async (output, context) => {
2470
2239
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2471
2240
  return deserializeAws_restJson1UpdateLaunchConfigurationCommandError(output, context);
2472
2241
  }
2473
- const contents = {
2242
+ const contents = map({
2474
2243
  $metadata: deserializeMetadata(output),
2475
- bootMode: undefined,
2476
- copyPrivateIp: undefined,
2477
- copyTags: undefined,
2478
- ec2LaunchTemplateID: undefined,
2479
- launchDisposition: undefined,
2480
- licensing: undefined,
2481
- name: undefined,
2482
- postLaunchActions: undefined,
2483
- sourceServerID: undefined,
2484
- targetInstanceTypeRightSizingMethod: undefined,
2485
- };
2244
+ });
2486
2245
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2487
- if (data.bootMode !== undefined && data.bootMode !== null) {
2246
+ if (data.bootMode != null) {
2488
2247
  contents.bootMode = (0, smithy_client_1.expectString)(data.bootMode);
2489
2248
  }
2490
- if (data.copyPrivateIp !== undefined && data.copyPrivateIp !== null) {
2249
+ if (data.copyPrivateIp != null) {
2491
2250
  contents.copyPrivateIp = (0, smithy_client_1.expectBoolean)(data.copyPrivateIp);
2492
2251
  }
2493
- if (data.copyTags !== undefined && data.copyTags !== null) {
2252
+ if (data.copyTags != null) {
2494
2253
  contents.copyTags = (0, smithy_client_1.expectBoolean)(data.copyTags);
2495
2254
  }
2496
- if (data.ec2LaunchTemplateID !== undefined && data.ec2LaunchTemplateID !== null) {
2255
+ if (data.ec2LaunchTemplateID != null) {
2497
2256
  contents.ec2LaunchTemplateID = (0, smithy_client_1.expectString)(data.ec2LaunchTemplateID);
2498
2257
  }
2499
- if (data.launchDisposition !== undefined && data.launchDisposition !== null) {
2258
+ if (data.launchDisposition != null) {
2500
2259
  contents.launchDisposition = (0, smithy_client_1.expectString)(data.launchDisposition);
2501
2260
  }
2502
- if (data.licensing !== undefined && data.licensing !== null) {
2261
+ if (data.licensing != null) {
2503
2262
  contents.licensing = deserializeAws_restJson1Licensing(data.licensing, context);
2504
2263
  }
2505
- if (data.name !== undefined && data.name !== null) {
2264
+ if (data.name != null) {
2506
2265
  contents.name = (0, smithy_client_1.expectString)(data.name);
2507
2266
  }
2508
- if (data.postLaunchActions !== undefined && data.postLaunchActions !== null) {
2267
+ if (data.postLaunchActions != null) {
2509
2268
  contents.postLaunchActions = deserializeAws_restJson1PostLaunchActions(data.postLaunchActions, context);
2510
2269
  }
2511
- if (data.sourceServerID !== undefined && data.sourceServerID !== null) {
2270
+ if (data.sourceServerID != null) {
2512
2271
  contents.sourceServerID = (0, smithy_client_1.expectString)(data.sourceServerID);
2513
2272
  }
2514
- if (data.targetInstanceTypeRightSizingMethod !== undefined && data.targetInstanceTypeRightSizingMethod !== null) {
2273
+ if (data.targetInstanceTypeRightSizingMethod != null) {
2515
2274
  contents.targetInstanceTypeRightSizingMethod = (0, smithy_client_1.expectString)(data.targetInstanceTypeRightSizingMethod);
2516
2275
  }
2517
- return Promise.resolve(contents);
2276
+ return contents;
2518
2277
  };
2519
2278
  exports.deserializeAws_restJson1UpdateLaunchConfigurationCommand = deserializeAws_restJson1UpdateLaunchConfigurationCommand;
2520
2279
  const deserializeAws_restJson1UpdateLaunchConfigurationCommandError = async (output, context) => {
@@ -2522,7 +2281,6 @@ const deserializeAws_restJson1UpdateLaunchConfigurationCommandError = async (out
2522
2281
  ...output,
2523
2282
  body: await parseBody(output.body, context),
2524
2283
  };
2525
- let response;
2526
2284
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2527
2285
  switch (errorCode) {
2528
2286
  case "ConflictException":
@@ -2539,41 +2297,35 @@ const deserializeAws_restJson1UpdateLaunchConfigurationCommandError = async (out
2539
2297
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2540
2298
  default:
2541
2299
  const parsedBody = parsedOutput.body;
2542
- const $metadata = deserializeMetadata(output);
2543
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2544
- response = new MgnServiceException_1.MgnServiceException({
2545
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2546
- $fault: "client",
2547
- $metadata,
2300
+ (0, smithy_client_1.throwDefaultError)({
2301
+ output,
2302
+ parsedBody,
2303
+ exceptionCtor: MgnServiceException_1.MgnServiceException,
2304
+ errorCode,
2548
2305
  });
2549
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2550
2306
  }
2551
2307
  };
2552
2308
  const deserializeAws_restJson1UpdateLaunchConfigurationTemplateCommand = async (output, context) => {
2553
2309
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2554
2310
  return deserializeAws_restJson1UpdateLaunchConfigurationTemplateCommandError(output, context);
2555
2311
  }
2556
- const contents = {
2312
+ const contents = map({
2557
2313
  $metadata: deserializeMetadata(output),
2558
- arn: undefined,
2559
- launchConfigurationTemplateID: undefined,
2560
- postLaunchActions: undefined,
2561
- tags: undefined,
2562
- };
2314
+ });
2563
2315
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2564
- if (data.arn !== undefined && data.arn !== null) {
2316
+ if (data.arn != null) {
2565
2317
  contents.arn = (0, smithy_client_1.expectString)(data.arn);
2566
2318
  }
2567
- if (data.launchConfigurationTemplateID !== undefined && data.launchConfigurationTemplateID !== null) {
2319
+ if (data.launchConfigurationTemplateID != null) {
2568
2320
  contents.launchConfigurationTemplateID = (0, smithy_client_1.expectString)(data.launchConfigurationTemplateID);
2569
2321
  }
2570
- if (data.postLaunchActions !== undefined && data.postLaunchActions !== null) {
2322
+ if (data.postLaunchActions != null) {
2571
2323
  contents.postLaunchActions = deserializeAws_restJson1PostLaunchActions(data.postLaunchActions, context);
2572
2324
  }
2573
- if (data.tags !== undefined && data.tags !== null) {
2325
+ if (data.tags != null) {
2574
2326
  contents.tags = deserializeAws_restJson1TagsMap(data.tags, context);
2575
2327
  }
2576
- return Promise.resolve(contents);
2328
+ return contents;
2577
2329
  };
2578
2330
  exports.deserializeAws_restJson1UpdateLaunchConfigurationTemplateCommand = deserializeAws_restJson1UpdateLaunchConfigurationTemplateCommand;
2579
2331
  const deserializeAws_restJson1UpdateLaunchConfigurationTemplateCommandError = async (output, context) => {
@@ -2581,7 +2333,6 @@ const deserializeAws_restJson1UpdateLaunchConfigurationTemplateCommandError = as
2581
2333
  ...output,
2582
2334
  body: await parseBody(output.body, context),
2583
2335
  };
2584
- let response;
2585
2336
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2586
2337
  switch (errorCode) {
2587
2338
  case "AccessDeniedException":
@@ -2598,85 +2349,68 @@ const deserializeAws_restJson1UpdateLaunchConfigurationTemplateCommandError = as
2598
2349
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2599
2350
  default:
2600
2351
  const parsedBody = parsedOutput.body;
2601
- const $metadata = deserializeMetadata(output);
2602
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2603
- response = new MgnServiceException_1.MgnServiceException({
2604
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2605
- $fault: "client",
2606
- $metadata,
2352
+ (0, smithy_client_1.throwDefaultError)({
2353
+ output,
2354
+ parsedBody,
2355
+ exceptionCtor: MgnServiceException_1.MgnServiceException,
2356
+ errorCode,
2607
2357
  });
2608
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2609
2358
  }
2610
2359
  };
2611
2360
  const deserializeAws_restJson1UpdateReplicationConfigurationCommand = async (output, context) => {
2612
2361
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2613
2362
  return deserializeAws_restJson1UpdateReplicationConfigurationCommandError(output, context);
2614
2363
  }
2615
- const contents = {
2364
+ const contents = map({
2616
2365
  $metadata: deserializeMetadata(output),
2617
- associateDefaultSecurityGroup: undefined,
2618
- bandwidthThrottling: undefined,
2619
- createPublicIP: undefined,
2620
- dataPlaneRouting: undefined,
2621
- defaultLargeStagingDiskType: undefined,
2622
- ebsEncryption: undefined,
2623
- ebsEncryptionKeyArn: undefined,
2624
- name: undefined,
2625
- replicatedDisks: undefined,
2626
- replicationServerInstanceType: undefined,
2627
- replicationServersSecurityGroupsIDs: undefined,
2628
- sourceServerID: undefined,
2629
- stagingAreaSubnetId: undefined,
2630
- stagingAreaTags: undefined,
2631
- useDedicatedReplicationServer: undefined,
2632
- };
2366
+ });
2633
2367
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2634
- if (data.associateDefaultSecurityGroup !== undefined && data.associateDefaultSecurityGroup !== null) {
2368
+ if (data.associateDefaultSecurityGroup != null) {
2635
2369
  contents.associateDefaultSecurityGroup = (0, smithy_client_1.expectBoolean)(data.associateDefaultSecurityGroup);
2636
2370
  }
2637
- if (data.bandwidthThrottling !== undefined && data.bandwidthThrottling !== null) {
2371
+ if (data.bandwidthThrottling != null) {
2638
2372
  contents.bandwidthThrottling = (0, smithy_client_1.expectLong)(data.bandwidthThrottling);
2639
2373
  }
2640
- if (data.createPublicIP !== undefined && data.createPublicIP !== null) {
2374
+ if (data.createPublicIP != null) {
2641
2375
  contents.createPublicIP = (0, smithy_client_1.expectBoolean)(data.createPublicIP);
2642
2376
  }
2643
- if (data.dataPlaneRouting !== undefined && data.dataPlaneRouting !== null) {
2377
+ if (data.dataPlaneRouting != null) {
2644
2378
  contents.dataPlaneRouting = (0, smithy_client_1.expectString)(data.dataPlaneRouting);
2645
2379
  }
2646
- if (data.defaultLargeStagingDiskType !== undefined && data.defaultLargeStagingDiskType !== null) {
2380
+ if (data.defaultLargeStagingDiskType != null) {
2647
2381
  contents.defaultLargeStagingDiskType = (0, smithy_client_1.expectString)(data.defaultLargeStagingDiskType);
2648
2382
  }
2649
- if (data.ebsEncryption !== undefined && data.ebsEncryption !== null) {
2383
+ if (data.ebsEncryption != null) {
2650
2384
  contents.ebsEncryption = (0, smithy_client_1.expectString)(data.ebsEncryption);
2651
2385
  }
2652
- if (data.ebsEncryptionKeyArn !== undefined && data.ebsEncryptionKeyArn !== null) {
2386
+ if (data.ebsEncryptionKeyArn != null) {
2653
2387
  contents.ebsEncryptionKeyArn = (0, smithy_client_1.expectString)(data.ebsEncryptionKeyArn);
2654
2388
  }
2655
- if (data.name !== undefined && data.name !== null) {
2389
+ if (data.name != null) {
2656
2390
  contents.name = (0, smithy_client_1.expectString)(data.name);
2657
2391
  }
2658
- if (data.replicatedDisks !== undefined && data.replicatedDisks !== null) {
2392
+ if (data.replicatedDisks != null) {
2659
2393
  contents.replicatedDisks = deserializeAws_restJson1ReplicationConfigurationReplicatedDisks(data.replicatedDisks, context);
2660
2394
  }
2661
- if (data.replicationServerInstanceType !== undefined && data.replicationServerInstanceType !== null) {
2395
+ if (data.replicationServerInstanceType != null) {
2662
2396
  contents.replicationServerInstanceType = (0, smithy_client_1.expectString)(data.replicationServerInstanceType);
2663
2397
  }
2664
- if (data.replicationServersSecurityGroupsIDs !== undefined && data.replicationServersSecurityGroupsIDs !== null) {
2398
+ if (data.replicationServersSecurityGroupsIDs != null) {
2665
2399
  contents.replicationServersSecurityGroupsIDs = deserializeAws_restJson1ReplicationServersSecurityGroupsIDs(data.replicationServersSecurityGroupsIDs, context);
2666
2400
  }
2667
- if (data.sourceServerID !== undefined && data.sourceServerID !== null) {
2401
+ if (data.sourceServerID != null) {
2668
2402
  contents.sourceServerID = (0, smithy_client_1.expectString)(data.sourceServerID);
2669
2403
  }
2670
- if (data.stagingAreaSubnetId !== undefined && data.stagingAreaSubnetId !== null) {
2404
+ if (data.stagingAreaSubnetId != null) {
2671
2405
  contents.stagingAreaSubnetId = (0, smithy_client_1.expectString)(data.stagingAreaSubnetId);
2672
2406
  }
2673
- if (data.stagingAreaTags !== undefined && data.stagingAreaTags !== null) {
2407
+ if (data.stagingAreaTags != null) {
2674
2408
  contents.stagingAreaTags = deserializeAws_restJson1TagsMap(data.stagingAreaTags, context);
2675
2409
  }
2676
- if (data.useDedicatedReplicationServer !== undefined && data.useDedicatedReplicationServer !== null) {
2410
+ if (data.useDedicatedReplicationServer != null) {
2677
2411
  contents.useDedicatedReplicationServer = (0, smithy_client_1.expectBoolean)(data.useDedicatedReplicationServer);
2678
2412
  }
2679
- return Promise.resolve(contents);
2413
+ return contents;
2680
2414
  };
2681
2415
  exports.deserializeAws_restJson1UpdateReplicationConfigurationCommand = deserializeAws_restJson1UpdateReplicationConfigurationCommand;
2682
2416
  const deserializeAws_restJson1UpdateReplicationConfigurationCommandError = async (output, context) => {
@@ -2684,7 +2418,6 @@ const deserializeAws_restJson1UpdateReplicationConfigurationCommandError = async
2684
2418
  ...output,
2685
2419
  body: await parseBody(output.body, context),
2686
2420
  };
2687
- let response;
2688
2421
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2689
2422
  switch (errorCode) {
2690
2423
  case "AccessDeniedException":
@@ -2704,85 +2437,68 @@ const deserializeAws_restJson1UpdateReplicationConfigurationCommandError = async
2704
2437
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2705
2438
  default:
2706
2439
  const parsedBody = parsedOutput.body;
2707
- const $metadata = deserializeMetadata(output);
2708
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2709
- response = new MgnServiceException_1.MgnServiceException({
2710
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2711
- $fault: "client",
2712
- $metadata,
2440
+ (0, smithy_client_1.throwDefaultError)({
2441
+ output,
2442
+ parsedBody,
2443
+ exceptionCtor: MgnServiceException_1.MgnServiceException,
2444
+ errorCode,
2713
2445
  });
2714
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2715
2446
  }
2716
2447
  };
2717
2448
  const deserializeAws_restJson1UpdateReplicationConfigurationTemplateCommand = async (output, context) => {
2718
2449
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2719
2450
  return deserializeAws_restJson1UpdateReplicationConfigurationTemplateCommandError(output, context);
2720
2451
  }
2721
- const contents = {
2452
+ const contents = map({
2722
2453
  $metadata: deserializeMetadata(output),
2723
- arn: undefined,
2724
- associateDefaultSecurityGroup: undefined,
2725
- bandwidthThrottling: undefined,
2726
- createPublicIP: undefined,
2727
- dataPlaneRouting: undefined,
2728
- defaultLargeStagingDiskType: undefined,
2729
- ebsEncryption: undefined,
2730
- ebsEncryptionKeyArn: undefined,
2731
- replicationConfigurationTemplateID: undefined,
2732
- replicationServerInstanceType: undefined,
2733
- replicationServersSecurityGroupsIDs: undefined,
2734
- stagingAreaSubnetId: undefined,
2735
- stagingAreaTags: undefined,
2736
- tags: undefined,
2737
- useDedicatedReplicationServer: undefined,
2738
- };
2454
+ });
2739
2455
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2740
- if (data.arn !== undefined && data.arn !== null) {
2456
+ if (data.arn != null) {
2741
2457
  contents.arn = (0, smithy_client_1.expectString)(data.arn);
2742
2458
  }
2743
- if (data.associateDefaultSecurityGroup !== undefined && data.associateDefaultSecurityGroup !== null) {
2459
+ if (data.associateDefaultSecurityGroup != null) {
2744
2460
  contents.associateDefaultSecurityGroup = (0, smithy_client_1.expectBoolean)(data.associateDefaultSecurityGroup);
2745
2461
  }
2746
- if (data.bandwidthThrottling !== undefined && data.bandwidthThrottling !== null) {
2462
+ if (data.bandwidthThrottling != null) {
2747
2463
  contents.bandwidthThrottling = (0, smithy_client_1.expectLong)(data.bandwidthThrottling);
2748
2464
  }
2749
- if (data.createPublicIP !== undefined && data.createPublicIP !== null) {
2465
+ if (data.createPublicIP != null) {
2750
2466
  contents.createPublicIP = (0, smithy_client_1.expectBoolean)(data.createPublicIP);
2751
2467
  }
2752
- if (data.dataPlaneRouting !== undefined && data.dataPlaneRouting !== null) {
2468
+ if (data.dataPlaneRouting != null) {
2753
2469
  contents.dataPlaneRouting = (0, smithy_client_1.expectString)(data.dataPlaneRouting);
2754
2470
  }
2755
- if (data.defaultLargeStagingDiskType !== undefined && data.defaultLargeStagingDiskType !== null) {
2471
+ if (data.defaultLargeStagingDiskType != null) {
2756
2472
  contents.defaultLargeStagingDiskType = (0, smithy_client_1.expectString)(data.defaultLargeStagingDiskType);
2757
2473
  }
2758
- if (data.ebsEncryption !== undefined && data.ebsEncryption !== null) {
2474
+ if (data.ebsEncryption != null) {
2759
2475
  contents.ebsEncryption = (0, smithy_client_1.expectString)(data.ebsEncryption);
2760
2476
  }
2761
- if (data.ebsEncryptionKeyArn !== undefined && data.ebsEncryptionKeyArn !== null) {
2477
+ if (data.ebsEncryptionKeyArn != null) {
2762
2478
  contents.ebsEncryptionKeyArn = (0, smithy_client_1.expectString)(data.ebsEncryptionKeyArn);
2763
2479
  }
2764
- if (data.replicationConfigurationTemplateID !== undefined && data.replicationConfigurationTemplateID !== null) {
2480
+ if (data.replicationConfigurationTemplateID != null) {
2765
2481
  contents.replicationConfigurationTemplateID = (0, smithy_client_1.expectString)(data.replicationConfigurationTemplateID);
2766
2482
  }
2767
- if (data.replicationServerInstanceType !== undefined && data.replicationServerInstanceType !== null) {
2483
+ if (data.replicationServerInstanceType != null) {
2768
2484
  contents.replicationServerInstanceType = (0, smithy_client_1.expectString)(data.replicationServerInstanceType);
2769
2485
  }
2770
- if (data.replicationServersSecurityGroupsIDs !== undefined && data.replicationServersSecurityGroupsIDs !== null) {
2486
+ if (data.replicationServersSecurityGroupsIDs != null) {
2771
2487
  contents.replicationServersSecurityGroupsIDs = deserializeAws_restJson1ReplicationServersSecurityGroupsIDs(data.replicationServersSecurityGroupsIDs, context);
2772
2488
  }
2773
- if (data.stagingAreaSubnetId !== undefined && data.stagingAreaSubnetId !== null) {
2489
+ if (data.stagingAreaSubnetId != null) {
2774
2490
  contents.stagingAreaSubnetId = (0, smithy_client_1.expectString)(data.stagingAreaSubnetId);
2775
2491
  }
2776
- if (data.stagingAreaTags !== undefined && data.stagingAreaTags !== null) {
2492
+ if (data.stagingAreaTags != null) {
2777
2493
  contents.stagingAreaTags = deserializeAws_restJson1TagsMap(data.stagingAreaTags, context);
2778
2494
  }
2779
- if (data.tags !== undefined && data.tags !== null) {
2495
+ if (data.tags != null) {
2780
2496
  contents.tags = deserializeAws_restJson1TagsMap(data.tags, context);
2781
2497
  }
2782
- if (data.useDedicatedReplicationServer !== undefined && data.useDedicatedReplicationServer !== null) {
2498
+ if (data.useDedicatedReplicationServer != null) {
2783
2499
  contents.useDedicatedReplicationServer = (0, smithy_client_1.expectBoolean)(data.useDedicatedReplicationServer);
2784
2500
  }
2785
- return Promise.resolve(contents);
2501
+ return contents;
2786
2502
  };
2787
2503
  exports.deserializeAws_restJson1UpdateReplicationConfigurationTemplateCommand = deserializeAws_restJson1UpdateReplicationConfigurationTemplateCommand;
2788
2504
  const deserializeAws_restJson1UpdateReplicationConfigurationTemplateCommandError = async (output, context) => {
@@ -2790,7 +2506,6 @@ const deserializeAws_restJson1UpdateReplicationConfigurationTemplateCommandError
2790
2506
  ...output,
2791
2507
  body: await parseBody(output.body, context),
2792
2508
  };
2793
- let response;
2794
2509
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2795
2510
  switch (errorCode) {
2796
2511
  case "AccessDeniedException":
@@ -2807,65 +2522,53 @@ const deserializeAws_restJson1UpdateReplicationConfigurationTemplateCommandError
2807
2522
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2808
2523
  default:
2809
2524
  const parsedBody = parsedOutput.body;
2810
- const $metadata = deserializeMetadata(output);
2811
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2812
- response = new MgnServiceException_1.MgnServiceException({
2813
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2814
- $fault: "client",
2815
- $metadata,
2525
+ (0, smithy_client_1.throwDefaultError)({
2526
+ output,
2527
+ parsedBody,
2528
+ exceptionCtor: MgnServiceException_1.MgnServiceException,
2529
+ errorCode,
2816
2530
  });
2817
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2818
2531
  }
2819
2532
  };
2820
2533
  const deserializeAws_restJson1UpdateSourceServerReplicationTypeCommand = async (output, context) => {
2821
2534
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2822
2535
  return deserializeAws_restJson1UpdateSourceServerReplicationTypeCommandError(output, context);
2823
2536
  }
2824
- const contents = {
2537
+ const contents = map({
2825
2538
  $metadata: deserializeMetadata(output),
2826
- arn: undefined,
2827
- dataReplicationInfo: undefined,
2828
- isArchived: undefined,
2829
- launchedInstance: undefined,
2830
- lifeCycle: undefined,
2831
- replicationType: undefined,
2832
- sourceProperties: undefined,
2833
- sourceServerID: undefined,
2834
- tags: undefined,
2835
- vcenterClientID: undefined,
2836
- };
2539
+ });
2837
2540
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2838
- if (data.arn !== undefined && data.arn !== null) {
2541
+ if (data.arn != null) {
2839
2542
  contents.arn = (0, smithy_client_1.expectString)(data.arn);
2840
2543
  }
2841
- if (data.dataReplicationInfo !== undefined && data.dataReplicationInfo !== null) {
2544
+ if (data.dataReplicationInfo != null) {
2842
2545
  contents.dataReplicationInfo = deserializeAws_restJson1DataReplicationInfo(data.dataReplicationInfo, context);
2843
2546
  }
2844
- if (data.isArchived !== undefined && data.isArchived !== null) {
2547
+ if (data.isArchived != null) {
2845
2548
  contents.isArchived = (0, smithy_client_1.expectBoolean)(data.isArchived);
2846
2549
  }
2847
- if (data.launchedInstance !== undefined && data.launchedInstance !== null) {
2550
+ if (data.launchedInstance != null) {
2848
2551
  contents.launchedInstance = deserializeAws_restJson1LaunchedInstance(data.launchedInstance, context);
2849
2552
  }
2850
- if (data.lifeCycle !== undefined && data.lifeCycle !== null) {
2553
+ if (data.lifeCycle != null) {
2851
2554
  contents.lifeCycle = deserializeAws_restJson1LifeCycle(data.lifeCycle, context);
2852
2555
  }
2853
- if (data.replicationType !== undefined && data.replicationType !== null) {
2556
+ if (data.replicationType != null) {
2854
2557
  contents.replicationType = (0, smithy_client_1.expectString)(data.replicationType);
2855
2558
  }
2856
- if (data.sourceProperties !== undefined && data.sourceProperties !== null) {
2559
+ if (data.sourceProperties != null) {
2857
2560
  contents.sourceProperties = deserializeAws_restJson1SourceProperties(data.sourceProperties, context);
2858
2561
  }
2859
- if (data.sourceServerID !== undefined && data.sourceServerID !== null) {
2562
+ if (data.sourceServerID != null) {
2860
2563
  contents.sourceServerID = (0, smithy_client_1.expectString)(data.sourceServerID);
2861
2564
  }
2862
- if (data.tags !== undefined && data.tags !== null) {
2565
+ if (data.tags != null) {
2863
2566
  contents.tags = deserializeAws_restJson1TagsMap(data.tags, context);
2864
2567
  }
2865
- if (data.vcenterClientID !== undefined && data.vcenterClientID !== null) {
2568
+ if (data.vcenterClientID != null) {
2866
2569
  contents.vcenterClientID = (0, smithy_client_1.expectString)(data.vcenterClientID);
2867
2570
  }
2868
- return Promise.resolve(contents);
2571
+ return contents;
2869
2572
  };
2870
2573
  exports.deserializeAws_restJson1UpdateSourceServerReplicationTypeCommand = deserializeAws_restJson1UpdateSourceServerReplicationTypeCommand;
2871
2574
  const deserializeAws_restJson1UpdateSourceServerReplicationTypeCommandError = async (output, context) => {
@@ -2873,7 +2576,6 @@ const deserializeAws_restJson1UpdateSourceServerReplicationTypeCommandError = as
2873
2576
  ...output,
2874
2577
  body: await parseBody(output.body, context),
2875
2578
  };
2876
- let response;
2877
2579
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2878
2580
  switch (errorCode) {
2879
2581
  case "ConflictException":
@@ -2890,23 +2592,22 @@ const deserializeAws_restJson1UpdateSourceServerReplicationTypeCommandError = as
2890
2592
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2891
2593
  default:
2892
2594
  const parsedBody = parsedOutput.body;
2893
- const $metadata = deserializeMetadata(output);
2894
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2895
- response = new MgnServiceException_1.MgnServiceException({
2896
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2897
- $fault: "client",
2898
- $metadata,
2595
+ (0, smithy_client_1.throwDefaultError)({
2596
+ output,
2597
+ parsedBody,
2598
+ exceptionCtor: MgnServiceException_1.MgnServiceException,
2599
+ errorCode,
2899
2600
  });
2900
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2901
2601
  }
2902
2602
  };
2603
+ const map = smithy_client_1.map;
2903
2604
  const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
2904
- const contents = {};
2605
+ const contents = map({});
2905
2606
  const data = parsedOutput.body;
2906
- if (data.code !== undefined && data.code !== null) {
2607
+ if (data.code != null) {
2907
2608
  contents.code = (0, smithy_client_1.expectString)(data.code);
2908
2609
  }
2909
- if (data.message !== undefined && data.message !== null) {
2610
+ if (data.message != null) {
2910
2611
  contents.message = (0, smithy_client_1.expectString)(data.message);
2911
2612
  }
2912
2613
  const exception = new models_0_1.AccessDeniedException({
@@ -2916,21 +2617,21 @@ const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutpu
2916
2617
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2917
2618
  };
2918
2619
  const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
2919
- const contents = {};
2620
+ const contents = map({});
2920
2621
  const data = parsedOutput.body;
2921
- if (data.code !== undefined && data.code !== null) {
2622
+ if (data.code != null) {
2922
2623
  contents.code = (0, smithy_client_1.expectString)(data.code);
2923
2624
  }
2924
- if (data.errors !== undefined && data.errors !== null) {
2625
+ if (data.errors != null) {
2925
2626
  contents.errors = deserializeAws_restJson1ConflictExceptionErrors(data.errors, context);
2926
2627
  }
2927
- if (data.message !== undefined && data.message !== null) {
2628
+ if (data.message != null) {
2928
2629
  contents.message = (0, smithy_client_1.expectString)(data.message);
2929
2630
  }
2930
- if (data.resourceId !== undefined && data.resourceId !== null) {
2631
+ if (data.resourceId != null) {
2931
2632
  contents.resourceId = (0, smithy_client_1.expectString)(data.resourceId);
2932
2633
  }
2933
- if (data.resourceType !== undefined && data.resourceType !== null) {
2634
+ if (data.resourceType != null) {
2934
2635
  contents.resourceType = (0, smithy_client_1.expectString)(data.resourceType);
2935
2636
  }
2936
2637
  const exception = new models_0_1.ConflictException({
@@ -2940,12 +2641,14 @@ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, c
2940
2641
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2941
2642
  };
2942
2643
  const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
2943
- const contents = {};
2944
- if (parsedOutput.headers["retry-after"] !== undefined) {
2945
- contents.retryAfterSeconds = (0, smithy_client_1.strictParseLong)(parsedOutput.headers["retry-after"]);
2946
- }
2644
+ const contents = map({
2645
+ retryAfterSeconds: [
2646
+ () => void 0 !== parsedOutput.headers["retry-after"],
2647
+ () => (0, smithy_client_1.strictParseLong)(parsedOutput.headers["retry-after"]),
2648
+ ],
2649
+ });
2947
2650
  const data = parsedOutput.body;
2948
- if (data.message !== undefined && data.message !== null) {
2651
+ if (data.message != null) {
2949
2652
  contents.message = (0, smithy_client_1.expectString)(data.message);
2950
2653
  }
2951
2654
  const exception = new models_0_1.InternalServerException({
@@ -2955,18 +2658,18 @@ const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOut
2955
2658
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2956
2659
  };
2957
2660
  const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
2958
- const contents = {};
2661
+ const contents = map({});
2959
2662
  const data = parsedOutput.body;
2960
- if (data.code !== undefined && data.code !== null) {
2663
+ if (data.code != null) {
2961
2664
  contents.code = (0, smithy_client_1.expectString)(data.code);
2962
2665
  }
2963
- if (data.message !== undefined && data.message !== null) {
2666
+ if (data.message != null) {
2964
2667
  contents.message = (0, smithy_client_1.expectString)(data.message);
2965
2668
  }
2966
- if (data.resourceId !== undefined && data.resourceId !== null) {
2669
+ if (data.resourceId != null) {
2967
2670
  contents.resourceId = (0, smithy_client_1.expectString)(data.resourceId);
2968
2671
  }
2969
- if (data.resourceType !== undefined && data.resourceType !== null) {
2672
+ if (data.resourceType != null) {
2970
2673
  contents.resourceType = (0, smithy_client_1.expectString)(data.resourceType);
2971
2674
  }
2972
2675
  const exception = new models_0_1.ResourceNotFoundException({
@@ -2976,27 +2679,27 @@ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedO
2976
2679
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2977
2680
  };
2978
2681
  const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
2979
- const contents = {};
2682
+ const contents = map({});
2980
2683
  const data = parsedOutput.body;
2981
- if (data.code !== undefined && data.code !== null) {
2684
+ if (data.code != null) {
2982
2685
  contents.code = (0, smithy_client_1.expectString)(data.code);
2983
2686
  }
2984
- if (data.message !== undefined && data.message !== null) {
2687
+ if (data.message != null) {
2985
2688
  contents.message = (0, smithy_client_1.expectString)(data.message);
2986
2689
  }
2987
- if (data.quotaCode !== undefined && data.quotaCode !== null) {
2690
+ if (data.quotaCode != null) {
2988
2691
  contents.quotaCode = (0, smithy_client_1.expectString)(data.quotaCode);
2989
2692
  }
2990
- if (data.quotaValue !== undefined && data.quotaValue !== null) {
2693
+ if (data.quotaValue != null) {
2991
2694
  contents.quotaValue = (0, smithy_client_1.expectInt32)(data.quotaValue);
2992
2695
  }
2993
- if (data.resourceId !== undefined && data.resourceId !== null) {
2696
+ if (data.resourceId != null) {
2994
2697
  contents.resourceId = (0, smithy_client_1.expectString)(data.resourceId);
2995
2698
  }
2996
- if (data.resourceType !== undefined && data.resourceType !== null) {
2699
+ if (data.resourceType != null) {
2997
2700
  contents.resourceType = (0, smithy_client_1.expectString)(data.resourceType);
2998
2701
  }
2999
- if (data.serviceCode !== undefined && data.serviceCode !== null) {
2702
+ if (data.serviceCode != null) {
3000
2703
  contents.serviceCode = (0, smithy_client_1.expectString)(data.serviceCode);
3001
2704
  }
3002
2705
  const exception = new models_0_1.ServiceQuotaExceededException({
@@ -3006,18 +2709,17 @@ const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (par
3006
2709
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
3007
2710
  };
3008
2711
  const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
3009
- const contents = {};
3010
- if (parsedOutput.headers["retry-after"] !== undefined) {
3011
- contents.retryAfterSeconds = parsedOutput.headers["retry-after"];
3012
- }
2712
+ const contents = map({
2713
+ retryAfterSeconds: [, parsedOutput.headers["retry-after"]],
2714
+ });
3013
2715
  const data = parsedOutput.body;
3014
- if (data.message !== undefined && data.message !== null) {
2716
+ if (data.message != null) {
3015
2717
  contents.message = (0, smithy_client_1.expectString)(data.message);
3016
2718
  }
3017
- if (data.quotaCode !== undefined && data.quotaCode !== null) {
2719
+ if (data.quotaCode != null) {
3018
2720
  contents.quotaCode = (0, smithy_client_1.expectString)(data.quotaCode);
3019
2721
  }
3020
- if (data.serviceCode !== undefined && data.serviceCode !== null) {
2722
+ if (data.serviceCode != null) {
3021
2723
  contents.serviceCode = (0, smithy_client_1.expectString)(data.serviceCode);
3022
2724
  }
3023
2725
  const exception = new models_0_1.ThrottlingException({
@@ -3027,12 +2729,12 @@ const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput,
3027
2729
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
3028
2730
  };
3029
2731
  const deserializeAws_restJson1UninitializedAccountExceptionResponse = async (parsedOutput, context) => {
3030
- const contents = {};
2732
+ const contents = map({});
3031
2733
  const data = parsedOutput.body;
3032
- if (data.code !== undefined && data.code !== null) {
2734
+ if (data.code != null) {
3033
2735
  contents.code = (0, smithy_client_1.expectString)(data.code);
3034
2736
  }
3035
- if (data.message !== undefined && data.message !== null) {
2737
+ if (data.message != null) {
3036
2738
  contents.message = (0, smithy_client_1.expectString)(data.message);
3037
2739
  }
3038
2740
  const exception = new models_0_1.UninitializedAccountException({
@@ -3042,18 +2744,18 @@ const deserializeAws_restJson1UninitializedAccountExceptionResponse = async (par
3042
2744
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
3043
2745
  };
3044
2746
  const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
3045
- const contents = {};
2747
+ const contents = map({});
3046
2748
  const data = parsedOutput.body;
3047
- if (data.code !== undefined && data.code !== null) {
2749
+ if (data.code != null) {
3048
2750
  contents.code = (0, smithy_client_1.expectString)(data.code);
3049
2751
  }
3050
- if (data.fieldList !== undefined && data.fieldList !== null) {
2752
+ if (data.fieldList != null) {
3051
2753
  contents.fieldList = deserializeAws_restJson1ValidationExceptionFieldList(data.fieldList, context);
3052
2754
  }
3053
- if (data.message !== undefined && data.message !== null) {
2755
+ if (data.message != null) {
3054
2756
  contents.message = (0, smithy_client_1.expectString)(data.message);
3055
2757
  }
3056
- if (data.reason !== undefined && data.reason !== null) {
2758
+ if (data.reason != null) {
3057
2759
  contents.reason = (0, smithy_client_1.expectString)(data.reason);
3058
2760
  }
3059
2761
  const exception = new models_0_1.ValidationException({
@@ -3080,9 +2782,6 @@ const serializeAws_restJson1DescribeJobsRequestFiltersJobIDs = (input, context)
3080
2782
  return input
3081
2783
  .filter((e) => e != null)
3082
2784
  .map((entry) => {
3083
- if (entry === null) {
3084
- return null;
3085
- }
3086
2785
  return entry;
3087
2786
  });
3088
2787
  };
@@ -3104,9 +2803,6 @@ const serializeAws_restJson1DescribeSourceServersRequestFiltersIDs = (input, con
3104
2803
  return input
3105
2804
  .filter((e) => e != null)
3106
2805
  .map((entry) => {
3107
- if (entry === null) {
3108
- return null;
3109
- }
3110
2806
  return entry;
3111
2807
  });
3112
2808
  };
@@ -3114,9 +2810,6 @@ const serializeAws_restJson1LaunchConfigurationTemplateIDs = (input, context) =>
3114
2810
  return input
3115
2811
  .filter((e) => e != null)
3116
2812
  .map((entry) => {
3117
- if (entry === null) {
3118
- return null;
3119
- }
3120
2813
  return entry;
3121
2814
  });
3122
2815
  };
@@ -3129,9 +2822,6 @@ const serializeAws_restJson1LifeCycleStates = (input, context) => {
3129
2822
  return input
3130
2823
  .filter((e) => e != null)
3131
2824
  .map((entry) => {
3132
- if (entry === null) {
3133
- return null;
3134
- }
3135
2825
  return entry;
3136
2826
  });
3137
2827
  };
@@ -3159,9 +2849,6 @@ const serializeAws_restJson1ReplicationConfigurationReplicatedDisks = (input, co
3159
2849
  return input
3160
2850
  .filter((e) => e != null)
3161
2851
  .map((entry) => {
3162
- if (entry === null) {
3163
- return null;
3164
- }
3165
2852
  return serializeAws_restJson1ReplicationConfigurationReplicatedDisk(entry, context);
3166
2853
  });
3167
2854
  };
@@ -3169,9 +2856,6 @@ const serializeAws_restJson1ReplicationConfigurationTemplateIDs = (input, contex
3169
2856
  return input
3170
2857
  .filter((e) => e != null)
3171
2858
  .map((entry) => {
3172
- if (entry === null) {
3173
- return null;
3174
- }
3175
2859
  return entry;
3176
2860
  });
3177
2861
  };
@@ -3179,9 +2863,6 @@ const serializeAws_restJson1ReplicationServersSecurityGroupsIDs = (input, contex
3179
2863
  return input
3180
2864
  .filter((e) => e != null)
3181
2865
  .map((entry) => {
3182
- if (entry === null) {
3183
- return null;
3184
- }
3185
2866
  return entry;
3186
2867
  });
3187
2868
  };
@@ -3189,9 +2870,6 @@ const serializeAws_restJson1ReplicationTypes = (input, context) => {
3189
2870
  return input
3190
2871
  .filter((e) => e != null)
3191
2872
  .map((entry) => {
3192
- if (entry === null) {
3193
- return null;
3194
- }
3195
2873
  return entry;
3196
2874
  });
3197
2875
  };
@@ -3221,9 +2899,6 @@ const serializeAws_restJson1SsmDocuments = (input, context) => {
3221
2899
  return input
3222
2900
  .filter((e) => e != null)
3223
2901
  .map((entry) => {
3224
- if (entry === null) {
3225
- return null;
3226
- }
3227
2902
  return serializeAws_restJson1SsmDocument(entry, context);
3228
2903
  });
3229
2904
  };
@@ -3237,9 +2912,6 @@ const serializeAws_restJson1SsmParameterStoreParameters = (input, context) => {
3237
2912
  return input
3238
2913
  .filter((e) => e != null)
3239
2914
  .map((entry) => {
3240
- if (entry === null) {
3241
- return null;
3242
- }
3243
2915
  return serializeAws_restJson1SsmParameterStoreParameter(entry, context);
3244
2916
  });
3245
2917
  };
@@ -3247,9 +2919,6 @@ const serializeAws_restJson1StartCutoverRequestSourceServerIDs = (input, context
3247
2919
  return input
3248
2920
  .filter((e) => e != null)
3249
2921
  .map((entry) => {
3250
- if (entry === null) {
3251
- return null;
3252
- }
3253
2922
  return entry;
3254
2923
  });
3255
2924
  };
@@ -3257,9 +2926,6 @@ const serializeAws_restJson1StartTestRequestSourceServerIDs = (input, context) =
3257
2926
  return input
3258
2927
  .filter((e) => e != null)
3259
2928
  .map((entry) => {
3260
- if (entry === null) {
3261
- return null;
3262
- }
3263
2929
  return entry;
3264
2930
  });
3265
2931
  };
@@ -3278,9 +2944,6 @@ const serializeAws_restJson1TerminateTargetInstancesRequestSourceServerIDs = (in
3278
2944
  return input
3279
2945
  .filter((e) => e != null)
3280
2946
  .map((entry) => {
3281
- if (entry === null) {
3282
- return null;
3283
- }
3284
2947
  return entry;
3285
2948
  });
3286
2949
  };