@aws-sdk/client-vpc-lattice 3.312.0 → 3.316.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
- import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, expectUnion as __expectUnion, map as __map, parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, resolvedPath as __resolvedPath, strictParseInt32 as __strictParseInt32, throwDefaultError, } from "@aws-sdk/smithy-client";
2
+ import { _json, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, expectUnion as __expectUnion, map, parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, resolvedPath as __resolvedPath, strictParseInt32 as __strictParseInt32, take, withBaseException, } from "@aws-sdk/smithy-client";
3
3
  import { v4 as generateIdempotencyToken } from "uuid";
4
- import { AccessDeniedException, ConflictException, HeaderMatchType, InternalServerException, Matcher, PathMatchType, ResourceNotFoundException, RuleAction, RuleMatch, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
4
+ import { AccessDeniedException, ConflictException, InternalServerException, ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
5
5
  import { VPCLatticeServiceException as __BaseException } from "../models/VPCLatticeServiceException";
6
6
  export const se_BatchUpdateRuleCommand = async (input, context) => {
7
7
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
@@ -13,9 +13,9 @@ export const se_BatchUpdateRuleCommand = async (input, context) => {
13
13
  resolvedPath = __resolvedPath(resolvedPath, input, "serviceIdentifier", () => input.serviceIdentifier, "{serviceIdentifier}", false);
14
14
  resolvedPath = __resolvedPath(resolvedPath, input, "listenerIdentifier", () => input.listenerIdentifier, "{listenerIdentifier}", false);
15
15
  let body;
16
- body = JSON.stringify({
17
- ...(input.rules != null && { rules: se_RuleUpdateList(input.rules, context) }),
18
- });
16
+ body = JSON.stringify(take(input, {
17
+ rules: (_) => _json(_),
18
+ }));
19
19
  return new __HttpRequest({
20
20
  protocol,
21
21
  hostname,
@@ -33,12 +33,12 @@ export const se_CreateAccessLogSubscriptionCommand = async (input, context) => {
33
33
  };
34
34
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/accesslogsubscriptions";
35
35
  let body;
36
- body = JSON.stringify({
37
- clientToken: input.clientToken ?? generateIdempotencyToken(),
38
- ...(input.destinationArn != null && { destinationArn: input.destinationArn }),
39
- ...(input.resourceIdentifier != null && { resourceIdentifier: input.resourceIdentifier }),
40
- ...(input.tags != null && { tags: se_TagMap(input.tags, context) }),
41
- });
36
+ body = JSON.stringify(take(input, {
37
+ clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
38
+ destinationArn: [],
39
+ resourceIdentifier: [],
40
+ tags: (_) => _json(_),
41
+ }));
42
42
  return new __HttpRequest({
43
43
  protocol,
44
44
  hostname,
@@ -57,14 +57,14 @@ export const se_CreateListenerCommand = async (input, context) => {
57
57
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/services/{serviceIdentifier}/listeners";
58
58
  resolvedPath = __resolvedPath(resolvedPath, input, "serviceIdentifier", () => input.serviceIdentifier, "{serviceIdentifier}", false);
59
59
  let body;
60
- body = JSON.stringify({
61
- clientToken: input.clientToken ?? generateIdempotencyToken(),
62
- ...(input.defaultAction != null && { defaultAction: se_RuleAction(input.defaultAction, context) }),
63
- ...(input.name != null && { name: input.name }),
64
- ...(input.port != null && { port: input.port }),
65
- ...(input.protocol != null && { protocol: input.protocol }),
66
- ...(input.tags != null && { tags: se_TagMap(input.tags, context) }),
67
- });
60
+ body = JSON.stringify(take(input, {
61
+ clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
62
+ defaultAction: (_) => _json(_),
63
+ name: [],
64
+ port: [],
65
+ protocol: [],
66
+ tags: (_) => _json(_),
67
+ }));
68
68
  return new __HttpRequest({
69
69
  protocol,
70
70
  hostname,
@@ -85,14 +85,14 @@ export const se_CreateRuleCommand = async (input, context) => {
85
85
  resolvedPath = __resolvedPath(resolvedPath, input, "serviceIdentifier", () => input.serviceIdentifier, "{serviceIdentifier}", false);
86
86
  resolvedPath = __resolvedPath(resolvedPath, input, "listenerIdentifier", () => input.listenerIdentifier, "{listenerIdentifier}", false);
87
87
  let body;
88
- body = JSON.stringify({
89
- ...(input.action != null && { action: se_RuleAction(input.action, context) }),
90
- clientToken: input.clientToken ?? generateIdempotencyToken(),
91
- ...(input.match != null && { match: se_RuleMatch(input.match, context) }),
92
- ...(input.name != null && { name: input.name }),
93
- ...(input.priority != null && { priority: input.priority }),
94
- ...(input.tags != null && { tags: se_TagMap(input.tags, context) }),
95
- });
88
+ body = JSON.stringify(take(input, {
89
+ action: (_) => _json(_),
90
+ clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
91
+ match: (_) => _json(_),
92
+ name: [],
93
+ priority: [],
94
+ tags: (_) => _json(_),
95
+ }));
96
96
  return new __HttpRequest({
97
97
  protocol,
98
98
  hostname,
@@ -110,14 +110,14 @@ export const se_CreateServiceCommand = async (input, context) => {
110
110
  };
111
111
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/services";
112
112
  let body;
113
- body = JSON.stringify({
114
- ...(input.authType != null && { authType: input.authType }),
115
- ...(input.certificateArn != null && { certificateArn: input.certificateArn }),
116
- clientToken: input.clientToken ?? generateIdempotencyToken(),
117
- ...(input.customDomainName != null && { customDomainName: input.customDomainName }),
118
- ...(input.name != null && { name: input.name }),
119
- ...(input.tags != null && { tags: se_TagMap(input.tags, context) }),
120
- });
113
+ body = JSON.stringify(take(input, {
114
+ authType: [],
115
+ certificateArn: [],
116
+ clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
117
+ customDomainName: [],
118
+ name: [],
119
+ tags: (_) => _json(_),
120
+ }));
121
121
  return new __HttpRequest({
122
122
  protocol,
123
123
  hostname,
@@ -135,12 +135,12 @@ export const se_CreateServiceNetworkCommand = async (input, context) => {
135
135
  };
136
136
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/servicenetworks";
137
137
  let body;
138
- body = JSON.stringify({
139
- ...(input.authType != null && { authType: input.authType }),
140
- clientToken: input.clientToken ?? generateIdempotencyToken(),
141
- ...(input.name != null && { name: input.name }),
142
- ...(input.tags != null && { tags: se_TagMap(input.tags, context) }),
143
- });
138
+ body = JSON.stringify(take(input, {
139
+ authType: [],
140
+ clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
141
+ name: [],
142
+ tags: (_) => _json(_),
143
+ }));
144
144
  return new __HttpRequest({
145
145
  protocol,
146
146
  hostname,
@@ -158,12 +158,12 @@ export const se_CreateServiceNetworkServiceAssociationCommand = async (input, co
158
158
  };
159
159
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/servicenetworkserviceassociations";
160
160
  let body;
161
- body = JSON.stringify({
162
- clientToken: input.clientToken ?? generateIdempotencyToken(),
163
- ...(input.serviceIdentifier != null && { serviceIdentifier: input.serviceIdentifier }),
164
- ...(input.serviceNetworkIdentifier != null && { serviceNetworkIdentifier: input.serviceNetworkIdentifier }),
165
- ...(input.tags != null && { tags: se_TagMap(input.tags, context) }),
166
- });
161
+ body = JSON.stringify(take(input, {
162
+ clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
163
+ serviceIdentifier: [],
164
+ serviceNetworkIdentifier: [],
165
+ tags: (_) => _json(_),
166
+ }));
167
167
  return new __HttpRequest({
168
168
  protocol,
169
169
  hostname,
@@ -181,13 +181,13 @@ export const se_CreateServiceNetworkVpcAssociationCommand = async (input, contex
181
181
  };
182
182
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/servicenetworkvpcassociations";
183
183
  let body;
184
- body = JSON.stringify({
185
- clientToken: input.clientToken ?? generateIdempotencyToken(),
186
- ...(input.securityGroupIds != null && { securityGroupIds: se_SecurityGroupList(input.securityGroupIds, context) }),
187
- ...(input.serviceNetworkIdentifier != null && { serviceNetworkIdentifier: input.serviceNetworkIdentifier }),
188
- ...(input.tags != null && { tags: se_TagMap(input.tags, context) }),
189
- ...(input.vpcIdentifier != null && { vpcIdentifier: input.vpcIdentifier }),
190
- });
184
+ body = JSON.stringify(take(input, {
185
+ clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
186
+ securityGroupIds: (_) => _json(_),
187
+ serviceNetworkIdentifier: [],
188
+ tags: (_) => _json(_),
189
+ vpcIdentifier: [],
190
+ }));
191
191
  return new __HttpRequest({
192
192
  protocol,
193
193
  hostname,
@@ -205,13 +205,13 @@ export const se_CreateTargetGroupCommand = async (input, context) => {
205
205
  };
206
206
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/targetgroups";
207
207
  let body;
208
- body = JSON.stringify({
209
- clientToken: input.clientToken ?? generateIdempotencyToken(),
210
- ...(input.config != null && { config: se_TargetGroupConfig(input.config, context) }),
211
- ...(input.name != null && { name: input.name }),
212
- ...(input.tags != null && { tags: se_TagMap(input.tags, context) }),
213
- ...(input.type != null && { type: input.type }),
214
- });
208
+ body = JSON.stringify(take(input, {
209
+ clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
210
+ config: (_) => _json(_),
211
+ name: [],
212
+ tags: (_) => _json(_),
213
+ type: [],
214
+ }));
215
215
  return new __HttpRequest({
216
216
  protocol,
217
217
  hostname,
@@ -400,9 +400,9 @@ export const se_DeregisterTargetsCommand = async (input, context) => {
400
400
  "/targetgroups/{targetGroupIdentifier}/deregistertargets";
401
401
  resolvedPath = __resolvedPath(resolvedPath, input, "targetGroupIdentifier", () => input.targetGroupIdentifier, "{targetGroupIdentifier}", false);
402
402
  let body;
403
- body = JSON.stringify({
404
- ...(input.targets != null && { targets: se_TargetList(input.targets, context) }),
405
- });
403
+ body = JSON.stringify(take(input, {
404
+ targets: (_) => _json(_),
405
+ }));
406
406
  return new __HttpRequest({
407
407
  protocol,
408
408
  hostname,
@@ -782,9 +782,9 @@ export const se_ListTargetsCommand = async (input, context) => {
782
782
  nextToken: [, input.nextToken],
783
783
  });
784
784
  let body;
785
- body = JSON.stringify({
786
- ...(input.targets != null && { targets: se_TargetList(input.targets, context) }),
787
- });
785
+ body = JSON.stringify(take(input, {
786
+ targets: (_) => _json(_),
787
+ }));
788
788
  return new __HttpRequest({
789
789
  protocol,
790
790
  hostname,
@@ -804,9 +804,9 @@ export const se_PutAuthPolicyCommand = async (input, context) => {
804
804
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/authpolicy/{resourceIdentifier}";
805
805
  resolvedPath = __resolvedPath(resolvedPath, input, "resourceIdentifier", () => input.resourceIdentifier, "{resourceIdentifier}", false);
806
806
  let body;
807
- body = JSON.stringify({
808
- ...(input.policy != null && { policy: input.policy }),
809
- });
807
+ body = JSON.stringify(take(input, {
808
+ policy: [],
809
+ }));
810
810
  return new __HttpRequest({
811
811
  protocol,
812
812
  hostname,
@@ -825,9 +825,9 @@ export const se_PutResourcePolicyCommand = async (input, context) => {
825
825
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/resourcepolicy/{resourceArn}";
826
826
  resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
827
827
  let body;
828
- body = JSON.stringify({
829
- ...(input.policy != null && { policy: input.policy }),
830
- });
828
+ body = JSON.stringify(take(input, {
829
+ policy: [],
830
+ }));
831
831
  return new __HttpRequest({
832
832
  protocol,
833
833
  hostname,
@@ -847,9 +847,9 @@ export const se_RegisterTargetsCommand = async (input, context) => {
847
847
  "/targetgroups/{targetGroupIdentifier}/registertargets";
848
848
  resolvedPath = __resolvedPath(resolvedPath, input, "targetGroupIdentifier", () => input.targetGroupIdentifier, "{targetGroupIdentifier}", false);
849
849
  let body;
850
- body = JSON.stringify({
851
- ...(input.targets != null && { targets: se_TargetList(input.targets, context) }),
852
- });
850
+ body = JSON.stringify(take(input, {
851
+ targets: (_) => _json(_),
852
+ }));
853
853
  return new __HttpRequest({
854
854
  protocol,
855
855
  hostname,
@@ -868,9 +868,9 @@ export const se_TagResourceCommand = async (input, context) => {
868
868
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
869
869
  resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
870
870
  let body;
871
- body = JSON.stringify({
872
- ...(input.tags != null && { tags: se_TagMap(input.tags, context) }),
873
- });
871
+ body = JSON.stringify(take(input, {
872
+ tags: (_) => _json(_),
873
+ }));
874
874
  return new __HttpRequest({
875
875
  protocol,
876
876
  hostname,
@@ -913,9 +913,9 @@ export const se_UpdateAccessLogSubscriptionCommand = async (input, context) => {
913
913
  "/accesslogsubscriptions/{accessLogSubscriptionIdentifier}";
914
914
  resolvedPath = __resolvedPath(resolvedPath, input, "accessLogSubscriptionIdentifier", () => input.accessLogSubscriptionIdentifier, "{accessLogSubscriptionIdentifier}", false);
915
915
  let body;
916
- body = JSON.stringify({
917
- ...(input.destinationArn != null && { destinationArn: input.destinationArn }),
918
- });
916
+ body = JSON.stringify(take(input, {
917
+ destinationArn: [],
918
+ }));
919
919
  return new __HttpRequest({
920
920
  protocol,
921
921
  hostname,
@@ -936,9 +936,9 @@ export const se_UpdateListenerCommand = async (input, context) => {
936
936
  resolvedPath = __resolvedPath(resolvedPath, input, "serviceIdentifier", () => input.serviceIdentifier, "{serviceIdentifier}", false);
937
937
  resolvedPath = __resolvedPath(resolvedPath, input, "listenerIdentifier", () => input.listenerIdentifier, "{listenerIdentifier}", false);
938
938
  let body;
939
- body = JSON.stringify({
940
- ...(input.defaultAction != null && { defaultAction: se_RuleAction(input.defaultAction, context) }),
941
- });
939
+ body = JSON.stringify(take(input, {
940
+ defaultAction: (_) => _json(_),
941
+ }));
942
942
  return new __HttpRequest({
943
943
  protocol,
944
944
  hostname,
@@ -960,11 +960,11 @@ export const se_UpdateRuleCommand = async (input, context) => {
960
960
  resolvedPath = __resolvedPath(resolvedPath, input, "listenerIdentifier", () => input.listenerIdentifier, "{listenerIdentifier}", false);
961
961
  resolvedPath = __resolvedPath(resolvedPath, input, "ruleIdentifier", () => input.ruleIdentifier, "{ruleIdentifier}", false);
962
962
  let body;
963
- body = JSON.stringify({
964
- ...(input.action != null && { action: se_RuleAction(input.action, context) }),
965
- ...(input.match != null && { match: se_RuleMatch(input.match, context) }),
966
- ...(input.priority != null && { priority: input.priority }),
967
- });
963
+ body = JSON.stringify(take(input, {
964
+ action: (_) => _json(_),
965
+ match: (_) => _json(_),
966
+ priority: [],
967
+ }));
968
968
  return new __HttpRequest({
969
969
  protocol,
970
970
  hostname,
@@ -983,10 +983,10 @@ export const se_UpdateServiceCommand = async (input, context) => {
983
983
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/services/{serviceIdentifier}";
984
984
  resolvedPath = __resolvedPath(resolvedPath, input, "serviceIdentifier", () => input.serviceIdentifier, "{serviceIdentifier}", false);
985
985
  let body;
986
- body = JSON.stringify({
987
- ...(input.authType != null && { authType: input.authType }),
988
- ...(input.certificateArn != null && { certificateArn: input.certificateArn }),
989
- });
986
+ body = JSON.stringify(take(input, {
987
+ authType: [],
988
+ certificateArn: [],
989
+ }));
990
990
  return new __HttpRequest({
991
991
  protocol,
992
992
  hostname,
@@ -1006,9 +1006,9 @@ export const se_UpdateServiceNetworkCommand = async (input, context) => {
1006
1006
  "/servicenetworks/{serviceNetworkIdentifier}";
1007
1007
  resolvedPath = __resolvedPath(resolvedPath, input, "serviceNetworkIdentifier", () => input.serviceNetworkIdentifier, "{serviceNetworkIdentifier}", false);
1008
1008
  let body;
1009
- body = JSON.stringify({
1010
- ...(input.authType != null && { authType: input.authType }),
1011
- });
1009
+ body = JSON.stringify(take(input, {
1010
+ authType: [],
1011
+ }));
1012
1012
  return new __HttpRequest({
1013
1013
  protocol,
1014
1014
  hostname,
@@ -1028,9 +1028,9 @@ export const se_UpdateServiceNetworkVpcAssociationCommand = async (input, contex
1028
1028
  "/servicenetworkvpcassociations/{serviceNetworkVpcAssociationIdentifier}";
1029
1029
  resolvedPath = __resolvedPath(resolvedPath, input, "serviceNetworkVpcAssociationIdentifier", () => input.serviceNetworkVpcAssociationIdentifier, "{serviceNetworkVpcAssociationIdentifier}", false);
1030
1030
  let body;
1031
- body = JSON.stringify({
1032
- ...(input.securityGroupIds != null && { securityGroupIds: se_SecurityGroupList(input.securityGroupIds, context) }),
1033
- });
1031
+ body = JSON.stringify(take(input, {
1032
+ securityGroupIds: (_) => _json(_),
1033
+ }));
1034
1034
  return new __HttpRequest({
1035
1035
  protocol,
1036
1036
  hostname,
@@ -1049,9 +1049,9 @@ export const se_UpdateTargetGroupCommand = async (input, context) => {
1049
1049
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/targetgroups/{targetGroupIdentifier}";
1050
1050
  resolvedPath = __resolvedPath(resolvedPath, input, "targetGroupIdentifier", () => input.targetGroupIdentifier, "{targetGroupIdentifier}", false);
1051
1051
  let body;
1052
- body = JSON.stringify({
1053
- ...(input.healthCheck != null && { healthCheck: se_HealthCheckConfig(input.healthCheck, context) }),
1054
- });
1052
+ body = JSON.stringify(take(input, {
1053
+ healthCheck: (_) => _json(_),
1054
+ }));
1055
1055
  return new __HttpRequest({
1056
1056
  protocol,
1057
1057
  hostname,
@@ -1070,12 +1070,11 @@ export const de_BatchUpdateRuleCommand = async (output, context) => {
1070
1070
  $metadata: deserializeMetadata(output),
1071
1071
  });
1072
1072
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1073
- if (data.successful != null) {
1074
- contents.successful = de_RuleUpdateSuccessList(data.successful, context);
1075
- }
1076
- if (data.unsuccessful != null) {
1077
- contents.unsuccessful = de_RuleUpdateFailureList(data.unsuccessful, context);
1078
- }
1073
+ const doc = take(data, {
1074
+ successful: _json,
1075
+ unsuccessful: _json,
1076
+ });
1077
+ Object.assign(contents, doc);
1079
1078
  return contents;
1080
1079
  };
1081
1080
  const de_BatchUpdateRuleCommandError = async (output, context) => {
@@ -1105,10 +1104,9 @@ const de_BatchUpdateRuleCommandError = async (output, context) => {
1105
1104
  throw await de_ValidationExceptionRes(parsedOutput, context);
1106
1105
  default:
1107
1106
  const parsedBody = parsedOutput.body;
1108
- throwDefaultError({
1107
+ return throwDefaultError({
1109
1108
  output,
1110
1109
  parsedBody,
1111
- exceptionCtor: __BaseException,
1112
1110
  errorCode,
1113
1111
  });
1114
1112
  }
@@ -1121,21 +1119,14 @@ export const de_CreateAccessLogSubscriptionCommand = async (output, context) =>
1121
1119
  $metadata: deserializeMetadata(output),
1122
1120
  });
1123
1121
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1124
- if (data.arn != null) {
1125
- contents.arn = __expectString(data.arn);
1126
- }
1127
- if (data.destinationArn != null) {
1128
- contents.destinationArn = __expectString(data.destinationArn);
1129
- }
1130
- if (data.id != null) {
1131
- contents.id = __expectString(data.id);
1132
- }
1133
- if (data.resourceArn != null) {
1134
- contents.resourceArn = __expectString(data.resourceArn);
1135
- }
1136
- if (data.resourceId != null) {
1137
- contents.resourceId = __expectString(data.resourceId);
1138
- }
1122
+ const doc = take(data, {
1123
+ arn: __expectString,
1124
+ destinationArn: __expectString,
1125
+ id: __expectString,
1126
+ resourceArn: __expectString,
1127
+ resourceId: __expectString,
1128
+ });
1129
+ Object.assign(contents, doc);
1139
1130
  return contents;
1140
1131
  };
1141
1132
  const de_CreateAccessLogSubscriptionCommandError = async (output, context) => {
@@ -1165,10 +1156,9 @@ const de_CreateAccessLogSubscriptionCommandError = async (output, context) => {
1165
1156
  throw await de_ValidationExceptionRes(parsedOutput, context);
1166
1157
  default:
1167
1158
  const parsedBody = parsedOutput.body;
1168
- throwDefaultError({
1159
+ return throwDefaultError({
1169
1160
  output,
1170
1161
  parsedBody,
1171
- exceptionCtor: __BaseException,
1172
1162
  errorCode,
1173
1163
  });
1174
1164
  }
@@ -1181,30 +1171,17 @@ export const de_CreateListenerCommand = async (output, context) => {
1181
1171
  $metadata: deserializeMetadata(output),
1182
1172
  });
1183
1173
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1184
- if (data.arn != null) {
1185
- contents.arn = __expectString(data.arn);
1186
- }
1187
- if (data.defaultAction != null) {
1188
- contents.defaultAction = de_RuleAction(__expectUnion(data.defaultAction), context);
1189
- }
1190
- if (data.id != null) {
1191
- contents.id = __expectString(data.id);
1192
- }
1193
- if (data.name != null) {
1194
- contents.name = __expectString(data.name);
1195
- }
1196
- if (data.port != null) {
1197
- contents.port = __expectInt32(data.port);
1198
- }
1199
- if (data.protocol != null) {
1200
- contents.protocol = __expectString(data.protocol);
1201
- }
1202
- if (data.serviceArn != null) {
1203
- contents.serviceArn = __expectString(data.serviceArn);
1204
- }
1205
- if (data.serviceId != null) {
1206
- contents.serviceId = __expectString(data.serviceId);
1207
- }
1174
+ const doc = take(data, {
1175
+ arn: __expectString,
1176
+ defaultAction: (_) => _json(__expectUnion(_)),
1177
+ id: __expectString,
1178
+ name: __expectString,
1179
+ port: __expectInt32,
1180
+ protocol: __expectString,
1181
+ serviceArn: __expectString,
1182
+ serviceId: __expectString,
1183
+ });
1184
+ Object.assign(contents, doc);
1208
1185
  return contents;
1209
1186
  };
1210
1187
  const de_CreateListenerCommandError = async (output, context) => {
@@ -1237,10 +1214,9 @@ const de_CreateListenerCommandError = async (output, context) => {
1237
1214
  throw await de_ValidationExceptionRes(parsedOutput, context);
1238
1215
  default:
1239
1216
  const parsedBody = parsedOutput.body;
1240
- throwDefaultError({
1217
+ return throwDefaultError({
1241
1218
  output,
1242
1219
  parsedBody,
1243
- exceptionCtor: __BaseException,
1244
1220
  errorCode,
1245
1221
  });
1246
1222
  }
@@ -1253,24 +1229,15 @@ export const de_CreateRuleCommand = async (output, context) => {
1253
1229
  $metadata: deserializeMetadata(output),
1254
1230
  });
1255
1231
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1256
- if (data.action != null) {
1257
- contents.action = de_RuleAction(__expectUnion(data.action), context);
1258
- }
1259
- if (data.arn != null) {
1260
- contents.arn = __expectString(data.arn);
1261
- }
1262
- if (data.id != null) {
1263
- contents.id = __expectString(data.id);
1264
- }
1265
- if (data.match != null) {
1266
- contents.match = de_RuleMatch(__expectUnion(data.match), context);
1267
- }
1268
- if (data.name != null) {
1269
- contents.name = __expectString(data.name);
1270
- }
1271
- if (data.priority != null) {
1272
- contents.priority = __expectInt32(data.priority);
1273
- }
1232
+ const doc = take(data, {
1233
+ action: (_) => _json(__expectUnion(_)),
1234
+ arn: __expectString,
1235
+ id: __expectString,
1236
+ match: (_) => _json(__expectUnion(_)),
1237
+ name: __expectString,
1238
+ priority: __expectInt32,
1239
+ });
1240
+ Object.assign(contents, doc);
1274
1241
  return contents;
1275
1242
  };
1276
1243
  const de_CreateRuleCommandError = async (output, context) => {
@@ -1303,10 +1270,9 @@ const de_CreateRuleCommandError = async (output, context) => {
1303
1270
  throw await de_ValidationExceptionRes(parsedOutput, context);
1304
1271
  default:
1305
1272
  const parsedBody = parsedOutput.body;
1306
- throwDefaultError({
1273
+ return throwDefaultError({
1307
1274
  output,
1308
1275
  parsedBody,
1309
- exceptionCtor: __BaseException,
1310
1276
  errorCode,
1311
1277
  });
1312
1278
  }
@@ -1319,30 +1285,17 @@ export const de_CreateServiceCommand = async (output, context) => {
1319
1285
  $metadata: deserializeMetadata(output),
1320
1286
  });
1321
1287
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1322
- if (data.arn != null) {
1323
- contents.arn = __expectString(data.arn);
1324
- }
1325
- if (data.authType != null) {
1326
- contents.authType = __expectString(data.authType);
1327
- }
1328
- if (data.certificateArn != null) {
1329
- contents.certificateArn = __expectString(data.certificateArn);
1330
- }
1331
- if (data.customDomainName != null) {
1332
- contents.customDomainName = __expectString(data.customDomainName);
1333
- }
1334
- if (data.dnsEntry != null) {
1335
- contents.dnsEntry = de_DnsEntry(data.dnsEntry, context);
1336
- }
1337
- if (data.id != null) {
1338
- contents.id = __expectString(data.id);
1339
- }
1340
- if (data.name != null) {
1341
- contents.name = __expectString(data.name);
1342
- }
1343
- if (data.status != null) {
1344
- contents.status = __expectString(data.status);
1345
- }
1288
+ const doc = take(data, {
1289
+ arn: __expectString,
1290
+ authType: __expectString,
1291
+ certificateArn: __expectString,
1292
+ customDomainName: __expectString,
1293
+ dnsEntry: _json,
1294
+ id: __expectString,
1295
+ name: __expectString,
1296
+ status: __expectString,
1297
+ });
1298
+ Object.assign(contents, doc);
1346
1299
  return contents;
1347
1300
  };
1348
1301
  const de_CreateServiceCommandError = async (output, context) => {
@@ -1375,10 +1328,9 @@ const de_CreateServiceCommandError = async (output, context) => {
1375
1328
  throw await de_ValidationExceptionRes(parsedOutput, context);
1376
1329
  default:
1377
1330
  const parsedBody = parsedOutput.body;
1378
- throwDefaultError({
1331
+ return throwDefaultError({
1379
1332
  output,
1380
1333
  parsedBody,
1381
- exceptionCtor: __BaseException,
1382
1334
  errorCode,
1383
1335
  });
1384
1336
  }
@@ -1391,18 +1343,13 @@ export const de_CreateServiceNetworkCommand = async (output, context) => {
1391
1343
  $metadata: deserializeMetadata(output),
1392
1344
  });
1393
1345
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1394
- if (data.arn != null) {
1395
- contents.arn = __expectString(data.arn);
1396
- }
1397
- if (data.authType != null) {
1398
- contents.authType = __expectString(data.authType);
1399
- }
1400
- if (data.id != null) {
1401
- contents.id = __expectString(data.id);
1402
- }
1403
- if (data.name != null) {
1404
- contents.name = __expectString(data.name);
1405
- }
1346
+ const doc = take(data, {
1347
+ arn: __expectString,
1348
+ authType: __expectString,
1349
+ id: __expectString,
1350
+ name: __expectString,
1351
+ });
1352
+ Object.assign(contents, doc);
1406
1353
  return contents;
1407
1354
  };
1408
1355
  const de_CreateServiceNetworkCommandError = async (output, context) => {
@@ -1435,10 +1382,9 @@ const de_CreateServiceNetworkCommandError = async (output, context) => {
1435
1382
  throw await de_ValidationExceptionRes(parsedOutput, context);
1436
1383
  default:
1437
1384
  const parsedBody = parsedOutput.body;
1438
- throwDefaultError({
1385
+ return throwDefaultError({
1439
1386
  output,
1440
1387
  parsedBody,
1441
- exceptionCtor: __BaseException,
1442
1388
  errorCode,
1443
1389
  });
1444
1390
  }
@@ -1451,24 +1397,15 @@ export const de_CreateServiceNetworkServiceAssociationCommand = async (output, c
1451
1397
  $metadata: deserializeMetadata(output),
1452
1398
  });
1453
1399
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1454
- if (data.arn != null) {
1455
- contents.arn = __expectString(data.arn);
1456
- }
1457
- if (data.createdBy != null) {
1458
- contents.createdBy = __expectString(data.createdBy);
1459
- }
1460
- if (data.customDomainName != null) {
1461
- contents.customDomainName = __expectString(data.customDomainName);
1462
- }
1463
- if (data.dnsEntry != null) {
1464
- contents.dnsEntry = de_DnsEntry(data.dnsEntry, context);
1465
- }
1466
- if (data.id != null) {
1467
- contents.id = __expectString(data.id);
1468
- }
1469
- if (data.status != null) {
1470
- contents.status = __expectString(data.status);
1471
- }
1400
+ const doc = take(data, {
1401
+ arn: __expectString,
1402
+ createdBy: __expectString,
1403
+ customDomainName: __expectString,
1404
+ dnsEntry: _json,
1405
+ id: __expectString,
1406
+ status: __expectString,
1407
+ });
1408
+ Object.assign(contents, doc);
1472
1409
  return contents;
1473
1410
  };
1474
1411
  const de_CreateServiceNetworkServiceAssociationCommandError = async (output, context) => {
@@ -1498,10 +1435,9 @@ const de_CreateServiceNetworkServiceAssociationCommandError = async (output, con
1498
1435
  throw await de_ValidationExceptionRes(parsedOutput, context);
1499
1436
  default:
1500
1437
  const parsedBody = parsedOutput.body;
1501
- throwDefaultError({
1438
+ return throwDefaultError({
1502
1439
  output,
1503
1440
  parsedBody,
1504
- exceptionCtor: __BaseException,
1505
1441
  errorCode,
1506
1442
  });
1507
1443
  }
@@ -1514,21 +1450,14 @@ export const de_CreateServiceNetworkVpcAssociationCommand = async (output, conte
1514
1450
  $metadata: deserializeMetadata(output),
1515
1451
  });
1516
1452
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1517
- if (data.arn != null) {
1518
- contents.arn = __expectString(data.arn);
1519
- }
1520
- if (data.createdBy != null) {
1521
- contents.createdBy = __expectString(data.createdBy);
1522
- }
1523
- if (data.id != null) {
1524
- contents.id = __expectString(data.id);
1525
- }
1526
- if (data.securityGroupIds != null) {
1527
- contents.securityGroupIds = de_SecurityGroupList(data.securityGroupIds, context);
1528
- }
1529
- if (data.status != null) {
1530
- contents.status = __expectString(data.status);
1531
- }
1453
+ const doc = take(data, {
1454
+ arn: __expectString,
1455
+ createdBy: __expectString,
1456
+ id: __expectString,
1457
+ securityGroupIds: _json,
1458
+ status: __expectString,
1459
+ });
1460
+ Object.assign(contents, doc);
1532
1461
  return contents;
1533
1462
  };
1534
1463
  const de_CreateServiceNetworkVpcAssociationCommandError = async (output, context) => {
@@ -1561,10 +1490,9 @@ const de_CreateServiceNetworkVpcAssociationCommandError = async (output, context
1561
1490
  throw await de_ValidationExceptionRes(parsedOutput, context);
1562
1491
  default:
1563
1492
  const parsedBody = parsedOutput.body;
1564
- throwDefaultError({
1493
+ return throwDefaultError({
1565
1494
  output,
1566
1495
  parsedBody,
1567
- exceptionCtor: __BaseException,
1568
1496
  errorCode,
1569
1497
  });
1570
1498
  }
@@ -1577,24 +1505,15 @@ export const de_CreateTargetGroupCommand = async (output, context) => {
1577
1505
  $metadata: deserializeMetadata(output),
1578
1506
  });
1579
1507
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1580
- if (data.arn != null) {
1581
- contents.arn = __expectString(data.arn);
1582
- }
1583
- if (data.config != null) {
1584
- contents.config = de_TargetGroupConfig(data.config, context);
1585
- }
1586
- if (data.id != null) {
1587
- contents.id = __expectString(data.id);
1588
- }
1589
- if (data.name != null) {
1590
- contents.name = __expectString(data.name);
1591
- }
1592
- if (data.status != null) {
1593
- contents.status = __expectString(data.status);
1594
- }
1595
- if (data.type != null) {
1596
- contents.type = __expectString(data.type);
1597
- }
1508
+ const doc = take(data, {
1509
+ arn: __expectString,
1510
+ config: _json,
1511
+ id: __expectString,
1512
+ name: __expectString,
1513
+ status: __expectString,
1514
+ type: __expectString,
1515
+ });
1516
+ Object.assign(contents, doc);
1598
1517
  return contents;
1599
1518
  };
1600
1519
  const de_CreateTargetGroupCommandError = async (output, context) => {
@@ -1627,10 +1546,9 @@ const de_CreateTargetGroupCommandError = async (output, context) => {
1627
1546
  throw await de_ValidationExceptionRes(parsedOutput, context);
1628
1547
  default:
1629
1548
  const parsedBody = parsedOutput.body;
1630
- throwDefaultError({
1549
+ return throwDefaultError({
1631
1550
  output,
1632
1551
  parsedBody,
1633
- exceptionCtor: __BaseException,
1634
1552
  errorCode,
1635
1553
  });
1636
1554
  }
@@ -1669,10 +1587,9 @@ const de_DeleteAccessLogSubscriptionCommandError = async (output, context) => {
1669
1587
  throw await de_ValidationExceptionRes(parsedOutput, context);
1670
1588
  default:
1671
1589
  const parsedBody = parsedOutput.body;
1672
- throwDefaultError({
1590
+ return throwDefaultError({
1673
1591
  output,
1674
1592
  parsedBody,
1675
- exceptionCtor: __BaseException,
1676
1593
  errorCode,
1677
1594
  });
1678
1595
  }
@@ -1711,10 +1628,9 @@ const de_DeleteAuthPolicyCommandError = async (output, context) => {
1711
1628
  throw await de_ValidationExceptionRes(parsedOutput, context);
1712
1629
  default:
1713
1630
  const parsedBody = parsedOutput.body;
1714
- throwDefaultError({
1631
+ return throwDefaultError({
1715
1632
  output,
1716
1633
  parsedBody,
1717
- exceptionCtor: __BaseException,
1718
1634
  errorCode,
1719
1635
  });
1720
1636
  }
@@ -1756,10 +1672,9 @@ const de_DeleteListenerCommandError = async (output, context) => {
1756
1672
  throw await de_ValidationExceptionRes(parsedOutput, context);
1757
1673
  default:
1758
1674
  const parsedBody = parsedOutput.body;
1759
- throwDefaultError({
1675
+ return throwDefaultError({
1760
1676
  output,
1761
1677
  parsedBody,
1762
- exceptionCtor: __BaseException,
1763
1678
  errorCode,
1764
1679
  });
1765
1680
  }
@@ -1798,10 +1713,9 @@ const de_DeleteResourcePolicyCommandError = async (output, context) => {
1798
1713
  throw await de_ValidationExceptionRes(parsedOutput, context);
1799
1714
  default:
1800
1715
  const parsedBody = parsedOutput.body;
1801
- throwDefaultError({
1716
+ return throwDefaultError({
1802
1717
  output,
1803
1718
  parsedBody,
1804
- exceptionCtor: __BaseException,
1805
1719
  errorCode,
1806
1720
  });
1807
1721
  }
@@ -1843,10 +1757,9 @@ const de_DeleteRuleCommandError = async (output, context) => {
1843
1757
  throw await de_ValidationExceptionRes(parsedOutput, context);
1844
1758
  default:
1845
1759
  const parsedBody = parsedOutput.body;
1846
- throwDefaultError({
1760
+ return throwDefaultError({
1847
1761
  output,
1848
1762
  parsedBody,
1849
- exceptionCtor: __BaseException,
1850
1763
  errorCode,
1851
1764
  });
1852
1765
  }
@@ -1859,18 +1772,13 @@ export const de_DeleteServiceCommand = async (output, context) => {
1859
1772
  $metadata: deserializeMetadata(output),
1860
1773
  });
1861
1774
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1862
- if (data.arn != null) {
1863
- contents.arn = __expectString(data.arn);
1864
- }
1865
- if (data.id != null) {
1866
- contents.id = __expectString(data.id);
1867
- }
1868
- if (data.name != null) {
1869
- contents.name = __expectString(data.name);
1870
- }
1871
- if (data.status != null) {
1872
- contents.status = __expectString(data.status);
1873
- }
1775
+ const doc = take(data, {
1776
+ arn: __expectString,
1777
+ id: __expectString,
1778
+ name: __expectString,
1779
+ status: __expectString,
1780
+ });
1781
+ Object.assign(contents, doc);
1874
1782
  return contents;
1875
1783
  };
1876
1784
  const de_DeleteServiceCommandError = async (output, context) => {
@@ -1900,10 +1808,9 @@ const de_DeleteServiceCommandError = async (output, context) => {
1900
1808
  throw await de_ValidationExceptionRes(parsedOutput, context);
1901
1809
  default:
1902
1810
  const parsedBody = parsedOutput.body;
1903
- throwDefaultError({
1811
+ return throwDefaultError({
1904
1812
  output,
1905
1813
  parsedBody,
1906
- exceptionCtor: __BaseException,
1907
1814
  errorCode,
1908
1815
  });
1909
1816
  }
@@ -1945,10 +1852,9 @@ const de_DeleteServiceNetworkCommandError = async (output, context) => {
1945
1852
  throw await de_ValidationExceptionRes(parsedOutput, context);
1946
1853
  default:
1947
1854
  const parsedBody = parsedOutput.body;
1948
- throwDefaultError({
1855
+ return throwDefaultError({
1949
1856
  output,
1950
1857
  parsedBody,
1951
- exceptionCtor: __BaseException,
1952
1858
  errorCode,
1953
1859
  });
1954
1860
  }
@@ -1961,15 +1867,12 @@ export const de_DeleteServiceNetworkServiceAssociationCommand = async (output, c
1961
1867
  $metadata: deserializeMetadata(output),
1962
1868
  });
1963
1869
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1964
- if (data.arn != null) {
1965
- contents.arn = __expectString(data.arn);
1966
- }
1967
- if (data.id != null) {
1968
- contents.id = __expectString(data.id);
1969
- }
1970
- if (data.status != null) {
1971
- contents.status = __expectString(data.status);
1972
- }
1870
+ const doc = take(data, {
1871
+ arn: __expectString,
1872
+ id: __expectString,
1873
+ status: __expectString,
1874
+ });
1875
+ Object.assign(contents, doc);
1973
1876
  return contents;
1974
1877
  };
1975
1878
  const de_DeleteServiceNetworkServiceAssociationCommandError = async (output, context) => {
@@ -1999,10 +1902,9 @@ const de_DeleteServiceNetworkServiceAssociationCommandError = async (output, con
1999
1902
  throw await de_ValidationExceptionRes(parsedOutput, context);
2000
1903
  default:
2001
1904
  const parsedBody = parsedOutput.body;
2002
- throwDefaultError({
1905
+ return throwDefaultError({
2003
1906
  output,
2004
1907
  parsedBody,
2005
- exceptionCtor: __BaseException,
2006
1908
  errorCode,
2007
1909
  });
2008
1910
  }
@@ -2015,15 +1917,12 @@ export const de_DeleteServiceNetworkVpcAssociationCommand = async (output, conte
2015
1917
  $metadata: deserializeMetadata(output),
2016
1918
  });
2017
1919
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2018
- if (data.arn != null) {
2019
- contents.arn = __expectString(data.arn);
2020
- }
2021
- if (data.id != null) {
2022
- contents.id = __expectString(data.id);
2023
- }
2024
- if (data.status != null) {
2025
- contents.status = __expectString(data.status);
2026
- }
1920
+ const doc = take(data, {
1921
+ arn: __expectString,
1922
+ id: __expectString,
1923
+ status: __expectString,
1924
+ });
1925
+ Object.assign(contents, doc);
2027
1926
  return contents;
2028
1927
  };
2029
1928
  const de_DeleteServiceNetworkVpcAssociationCommandError = async (output, context) => {
@@ -2053,10 +1952,9 @@ const de_DeleteServiceNetworkVpcAssociationCommandError = async (output, context
2053
1952
  throw await de_ValidationExceptionRes(parsedOutput, context);
2054
1953
  default:
2055
1954
  const parsedBody = parsedOutput.body;
2056
- throwDefaultError({
1955
+ return throwDefaultError({
2057
1956
  output,
2058
1957
  parsedBody,
2059
- exceptionCtor: __BaseException,
2060
1958
  errorCode,
2061
1959
  });
2062
1960
  }
@@ -2069,15 +1967,12 @@ export const de_DeleteTargetGroupCommand = async (output, context) => {
2069
1967
  $metadata: deserializeMetadata(output),
2070
1968
  });
2071
1969
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2072
- if (data.arn != null) {
2073
- contents.arn = __expectString(data.arn);
2074
- }
2075
- if (data.id != null) {
2076
- contents.id = __expectString(data.id);
2077
- }
2078
- if (data.status != null) {
2079
- contents.status = __expectString(data.status);
2080
- }
1970
+ const doc = take(data, {
1971
+ arn: __expectString,
1972
+ id: __expectString,
1973
+ status: __expectString,
1974
+ });
1975
+ Object.assign(contents, doc);
2081
1976
  return contents;
2082
1977
  };
2083
1978
  const de_DeleteTargetGroupCommandError = async (output, context) => {
@@ -2104,10 +1999,9 @@ const de_DeleteTargetGroupCommandError = async (output, context) => {
2104
1999
  throw await de_ValidationExceptionRes(parsedOutput, context);
2105
2000
  default:
2106
2001
  const parsedBody = parsedOutput.body;
2107
- throwDefaultError({
2002
+ return throwDefaultError({
2108
2003
  output,
2109
2004
  parsedBody,
2110
- exceptionCtor: __BaseException,
2111
2005
  errorCode,
2112
2006
  });
2113
2007
  }
@@ -2120,12 +2014,11 @@ export const de_DeregisterTargetsCommand = async (output, context) => {
2120
2014
  $metadata: deserializeMetadata(output),
2121
2015
  });
2122
2016
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2123
- if (data.successful != null) {
2124
- contents.successful = de_TargetList(data.successful, context);
2125
- }
2126
- if (data.unsuccessful != null) {
2127
- contents.unsuccessful = de_TargetFailureList(data.unsuccessful, context);
2128
- }
2017
+ const doc = take(data, {
2018
+ successful: _json,
2019
+ unsuccessful: _json,
2020
+ });
2021
+ Object.assign(contents, doc);
2129
2022
  return contents;
2130
2023
  };
2131
2024
  const de_DeregisterTargetsCommandError = async (output, context) => {
@@ -2155,10 +2048,9 @@ const de_DeregisterTargetsCommandError = async (output, context) => {
2155
2048
  throw await de_ValidationExceptionRes(parsedOutput, context);
2156
2049
  default:
2157
2050
  const parsedBody = parsedOutput.body;
2158
- throwDefaultError({
2051
+ return throwDefaultError({
2159
2052
  output,
2160
2053
  parsedBody,
2161
- exceptionCtor: __BaseException,
2162
2054
  errorCode,
2163
2055
  });
2164
2056
  }
@@ -2171,27 +2063,16 @@ export const de_GetAccessLogSubscriptionCommand = async (output, context) => {
2171
2063
  $metadata: deserializeMetadata(output),
2172
2064
  });
2173
2065
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2174
- if (data.arn != null) {
2175
- contents.arn = __expectString(data.arn);
2176
- }
2177
- if (data.createdAt != null) {
2178
- contents.createdAt = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.createdAt));
2179
- }
2180
- if (data.destinationArn != null) {
2181
- contents.destinationArn = __expectString(data.destinationArn);
2182
- }
2183
- if (data.id != null) {
2184
- contents.id = __expectString(data.id);
2185
- }
2186
- if (data.lastUpdatedAt != null) {
2187
- contents.lastUpdatedAt = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.lastUpdatedAt));
2188
- }
2189
- if (data.resourceArn != null) {
2190
- contents.resourceArn = __expectString(data.resourceArn);
2191
- }
2192
- if (data.resourceId != null) {
2193
- contents.resourceId = __expectString(data.resourceId);
2194
- }
2066
+ const doc = take(data, {
2067
+ arn: __expectString,
2068
+ createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
2069
+ destinationArn: __expectString,
2070
+ id: __expectString,
2071
+ lastUpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
2072
+ resourceArn: __expectString,
2073
+ resourceId: __expectString,
2074
+ });
2075
+ Object.assign(contents, doc);
2195
2076
  return contents;
2196
2077
  };
2197
2078
  const de_GetAccessLogSubscriptionCommandError = async (output, context) => {
@@ -2218,10 +2099,9 @@ const de_GetAccessLogSubscriptionCommandError = async (output, context) => {
2218
2099
  throw await de_ValidationExceptionRes(parsedOutput, context);
2219
2100
  default:
2220
2101
  const parsedBody = parsedOutput.body;
2221
- throwDefaultError({
2102
+ return throwDefaultError({
2222
2103
  output,
2223
2104
  parsedBody,
2224
- exceptionCtor: __BaseException,
2225
2105
  errorCode,
2226
2106
  });
2227
2107
  }
@@ -2234,18 +2114,13 @@ export const de_GetAuthPolicyCommand = async (output, context) => {
2234
2114
  $metadata: deserializeMetadata(output),
2235
2115
  });
2236
2116
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2237
- if (data.createdAt != null) {
2238
- contents.createdAt = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.createdAt));
2239
- }
2240
- if (data.lastUpdatedAt != null) {
2241
- contents.lastUpdatedAt = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.lastUpdatedAt));
2242
- }
2243
- if (data.policy != null) {
2244
- contents.policy = __expectString(data.policy);
2245
- }
2246
- if (data.state != null) {
2247
- contents.state = __expectString(data.state);
2248
- }
2117
+ const doc = take(data, {
2118
+ createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
2119
+ lastUpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
2120
+ policy: __expectString,
2121
+ state: __expectString,
2122
+ });
2123
+ Object.assign(contents, doc);
2249
2124
  return contents;
2250
2125
  };
2251
2126
  const de_GetAuthPolicyCommandError = async (output, context) => {
@@ -2272,10 +2147,9 @@ const de_GetAuthPolicyCommandError = async (output, context) => {
2272
2147
  throw await de_ValidationExceptionRes(parsedOutput, context);
2273
2148
  default:
2274
2149
  const parsedBody = parsedOutput.body;
2275
- throwDefaultError({
2150
+ return throwDefaultError({
2276
2151
  output,
2277
2152
  parsedBody,
2278
- exceptionCtor: __BaseException,
2279
2153
  errorCode,
2280
2154
  });
2281
2155
  }
@@ -2288,36 +2162,19 @@ export const de_GetListenerCommand = async (output, context) => {
2288
2162
  $metadata: deserializeMetadata(output),
2289
2163
  });
2290
2164
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2291
- if (data.arn != null) {
2292
- contents.arn = __expectString(data.arn);
2293
- }
2294
- if (data.createdAt != null) {
2295
- contents.createdAt = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.createdAt));
2296
- }
2297
- if (data.defaultAction != null) {
2298
- contents.defaultAction = de_RuleAction(__expectUnion(data.defaultAction), context);
2299
- }
2300
- if (data.id != null) {
2301
- contents.id = __expectString(data.id);
2302
- }
2303
- if (data.lastUpdatedAt != null) {
2304
- contents.lastUpdatedAt = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.lastUpdatedAt));
2305
- }
2306
- if (data.name != null) {
2307
- contents.name = __expectString(data.name);
2308
- }
2309
- if (data.port != null) {
2310
- contents.port = __expectInt32(data.port);
2311
- }
2312
- if (data.protocol != null) {
2313
- contents.protocol = __expectString(data.protocol);
2314
- }
2315
- if (data.serviceArn != null) {
2316
- contents.serviceArn = __expectString(data.serviceArn);
2317
- }
2318
- if (data.serviceId != null) {
2319
- contents.serviceId = __expectString(data.serviceId);
2320
- }
2165
+ const doc = take(data, {
2166
+ arn: __expectString,
2167
+ createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
2168
+ defaultAction: (_) => _json(__expectUnion(_)),
2169
+ id: __expectString,
2170
+ lastUpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
2171
+ name: __expectString,
2172
+ port: __expectInt32,
2173
+ protocol: __expectString,
2174
+ serviceArn: __expectString,
2175
+ serviceId: __expectString,
2176
+ });
2177
+ Object.assign(contents, doc);
2321
2178
  return contents;
2322
2179
  };
2323
2180
  const de_GetListenerCommandError = async (output, context) => {
@@ -2344,10 +2201,9 @@ const de_GetListenerCommandError = async (output, context) => {
2344
2201
  throw await de_ValidationExceptionRes(parsedOutput, context);
2345
2202
  default:
2346
2203
  const parsedBody = parsedOutput.body;
2347
- throwDefaultError({
2204
+ return throwDefaultError({
2348
2205
  output,
2349
2206
  parsedBody,
2350
- exceptionCtor: __BaseException,
2351
2207
  errorCode,
2352
2208
  });
2353
2209
  }
@@ -2360,9 +2216,10 @@ export const de_GetResourcePolicyCommand = async (output, context) => {
2360
2216
  $metadata: deserializeMetadata(output),
2361
2217
  });
2362
2218
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2363
- if (data.policy != null) {
2364
- contents.policy = __expectString(data.policy);
2365
- }
2219
+ const doc = take(data, {
2220
+ policy: __expectString,
2221
+ });
2222
+ Object.assign(contents, doc);
2366
2223
  return contents;
2367
2224
  };
2368
2225
  const de_GetResourcePolicyCommandError = async (output, context) => {
@@ -2389,10 +2246,9 @@ const de_GetResourcePolicyCommandError = async (output, context) => {
2389
2246
  throw await de_ValidationExceptionRes(parsedOutput, context);
2390
2247
  default:
2391
2248
  const parsedBody = parsedOutput.body;
2392
- throwDefaultError({
2249
+ return throwDefaultError({
2393
2250
  output,
2394
2251
  parsedBody,
2395
- exceptionCtor: __BaseException,
2396
2252
  errorCode,
2397
2253
  });
2398
2254
  }
@@ -2405,33 +2261,18 @@ export const de_GetRuleCommand = async (output, context) => {
2405
2261
  $metadata: deserializeMetadata(output),
2406
2262
  });
2407
2263
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2408
- if (data.action != null) {
2409
- contents.action = de_RuleAction(__expectUnion(data.action), context);
2410
- }
2411
- if (data.arn != null) {
2412
- contents.arn = __expectString(data.arn);
2413
- }
2414
- if (data.createdAt != null) {
2415
- contents.createdAt = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.createdAt));
2416
- }
2417
- if (data.id != null) {
2418
- contents.id = __expectString(data.id);
2419
- }
2420
- if (data.isDefault != null) {
2421
- contents.isDefault = __expectBoolean(data.isDefault);
2422
- }
2423
- if (data.lastUpdatedAt != null) {
2424
- contents.lastUpdatedAt = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.lastUpdatedAt));
2425
- }
2426
- if (data.match != null) {
2427
- contents.match = de_RuleMatch(__expectUnion(data.match), context);
2428
- }
2429
- if (data.name != null) {
2430
- contents.name = __expectString(data.name);
2431
- }
2432
- if (data.priority != null) {
2433
- contents.priority = __expectInt32(data.priority);
2434
- }
2264
+ const doc = take(data, {
2265
+ action: (_) => _json(__expectUnion(_)),
2266
+ arn: __expectString,
2267
+ createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
2268
+ id: __expectString,
2269
+ isDefault: __expectBoolean,
2270
+ lastUpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
2271
+ match: (_) => _json(__expectUnion(_)),
2272
+ name: __expectString,
2273
+ priority: __expectInt32,
2274
+ });
2275
+ Object.assign(contents, doc);
2435
2276
  return contents;
2436
2277
  };
2437
2278
  const de_GetRuleCommandError = async (output, context) => {
@@ -2458,10 +2299,9 @@ const de_GetRuleCommandError = async (output, context) => {
2458
2299
  throw await de_ValidationExceptionRes(parsedOutput, context);
2459
2300
  default:
2460
2301
  const parsedBody = parsedOutput.body;
2461
- throwDefaultError({
2302
+ return throwDefaultError({
2462
2303
  output,
2463
2304
  parsedBody,
2464
- exceptionCtor: __BaseException,
2465
2305
  errorCode,
2466
2306
  });
2467
2307
  }
@@ -2474,42 +2314,21 @@ export const de_GetServiceCommand = async (output, context) => {
2474
2314
  $metadata: deserializeMetadata(output),
2475
2315
  });
2476
2316
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2477
- if (data.arn != null) {
2478
- contents.arn = __expectString(data.arn);
2479
- }
2480
- if (data.authType != null) {
2481
- contents.authType = __expectString(data.authType);
2482
- }
2483
- if (data.certificateArn != null) {
2484
- contents.certificateArn = __expectString(data.certificateArn);
2485
- }
2486
- if (data.createdAt != null) {
2487
- contents.createdAt = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.createdAt));
2488
- }
2489
- if (data.customDomainName != null) {
2490
- contents.customDomainName = __expectString(data.customDomainName);
2491
- }
2492
- if (data.dnsEntry != null) {
2493
- contents.dnsEntry = de_DnsEntry(data.dnsEntry, context);
2494
- }
2495
- if (data.failureCode != null) {
2496
- contents.failureCode = __expectString(data.failureCode);
2497
- }
2498
- if (data.failureMessage != null) {
2499
- contents.failureMessage = __expectString(data.failureMessage);
2500
- }
2501
- if (data.id != null) {
2502
- contents.id = __expectString(data.id);
2503
- }
2504
- if (data.lastUpdatedAt != null) {
2505
- contents.lastUpdatedAt = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.lastUpdatedAt));
2506
- }
2507
- if (data.name != null) {
2508
- contents.name = __expectString(data.name);
2509
- }
2510
- if (data.status != null) {
2511
- contents.status = __expectString(data.status);
2512
- }
2317
+ const doc = take(data, {
2318
+ arn: __expectString,
2319
+ authType: __expectString,
2320
+ certificateArn: __expectString,
2321
+ createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
2322
+ customDomainName: __expectString,
2323
+ dnsEntry: _json,
2324
+ failureCode: __expectString,
2325
+ failureMessage: __expectString,
2326
+ id: __expectString,
2327
+ lastUpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
2328
+ name: __expectString,
2329
+ status: __expectString,
2330
+ });
2331
+ Object.assign(contents, doc);
2513
2332
  return contents;
2514
2333
  };
2515
2334
  const de_GetServiceCommandError = async (output, context) => {
@@ -2536,10 +2355,9 @@ const de_GetServiceCommandError = async (output, context) => {
2536
2355
  throw await de_ValidationExceptionRes(parsedOutput, context);
2537
2356
  default:
2538
2357
  const parsedBody = parsedOutput.body;
2539
- throwDefaultError({
2358
+ return throwDefaultError({
2540
2359
  output,
2541
2360
  parsedBody,
2542
- exceptionCtor: __BaseException,
2543
2361
  errorCode,
2544
2362
  });
2545
2363
  }
@@ -2552,30 +2370,17 @@ export const de_GetServiceNetworkCommand = async (output, context) => {
2552
2370
  $metadata: deserializeMetadata(output),
2553
2371
  });
2554
2372
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2555
- if (data.arn != null) {
2556
- contents.arn = __expectString(data.arn);
2557
- }
2558
- if (data.authType != null) {
2559
- contents.authType = __expectString(data.authType);
2560
- }
2561
- if (data.createdAt != null) {
2562
- contents.createdAt = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.createdAt));
2563
- }
2564
- if (data.id != null) {
2565
- contents.id = __expectString(data.id);
2566
- }
2567
- if (data.lastUpdatedAt != null) {
2568
- contents.lastUpdatedAt = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.lastUpdatedAt));
2569
- }
2570
- if (data.name != null) {
2571
- contents.name = __expectString(data.name);
2572
- }
2573
- if (data.numberOfAssociatedServices != null) {
2574
- contents.numberOfAssociatedServices = __expectLong(data.numberOfAssociatedServices);
2575
- }
2576
- if (data.numberOfAssociatedVPCs != null) {
2577
- contents.numberOfAssociatedVPCs = __expectLong(data.numberOfAssociatedVPCs);
2578
- }
2373
+ const doc = take(data, {
2374
+ arn: __expectString,
2375
+ authType: __expectString,
2376
+ createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
2377
+ id: __expectString,
2378
+ lastUpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
2379
+ name: __expectString,
2380
+ numberOfAssociatedServices: __expectLong,
2381
+ numberOfAssociatedVPCs: __expectLong,
2382
+ });
2383
+ Object.assign(contents, doc);
2579
2384
  return contents;
2580
2385
  };
2581
2386
  const de_GetServiceNetworkCommandError = async (output, context) => {
@@ -2602,10 +2407,9 @@ const de_GetServiceNetworkCommandError = async (output, context) => {
2602
2407
  throw await de_ValidationExceptionRes(parsedOutput, context);
2603
2408
  default:
2604
2409
  const parsedBody = parsedOutput.body;
2605
- throwDefaultError({
2410
+ return throwDefaultError({
2606
2411
  output,
2607
2412
  parsedBody,
2608
- exceptionCtor: __BaseException,
2609
2413
  errorCode,
2610
2414
  });
2611
2415
  }
@@ -2618,51 +2422,24 @@ export const de_GetServiceNetworkServiceAssociationCommand = async (output, cont
2618
2422
  $metadata: deserializeMetadata(output),
2619
2423
  });
2620
2424
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2621
- if (data.arn != null) {
2622
- contents.arn = __expectString(data.arn);
2623
- }
2624
- if (data.createdAt != null) {
2625
- contents.createdAt = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.createdAt));
2626
- }
2627
- if (data.createdBy != null) {
2628
- contents.createdBy = __expectString(data.createdBy);
2629
- }
2630
- if (data.customDomainName != null) {
2631
- contents.customDomainName = __expectString(data.customDomainName);
2632
- }
2633
- if (data.dnsEntry != null) {
2634
- contents.dnsEntry = de_DnsEntry(data.dnsEntry, context);
2635
- }
2636
- if (data.failureCode != null) {
2637
- contents.failureCode = __expectString(data.failureCode);
2638
- }
2639
- if (data.failureMessage != null) {
2640
- contents.failureMessage = __expectString(data.failureMessage);
2641
- }
2642
- if (data.id != null) {
2643
- contents.id = __expectString(data.id);
2644
- }
2645
- if (data.serviceArn != null) {
2646
- contents.serviceArn = __expectString(data.serviceArn);
2647
- }
2648
- if (data.serviceId != null) {
2649
- contents.serviceId = __expectString(data.serviceId);
2650
- }
2651
- if (data.serviceName != null) {
2652
- contents.serviceName = __expectString(data.serviceName);
2653
- }
2654
- if (data.serviceNetworkArn != null) {
2655
- contents.serviceNetworkArn = __expectString(data.serviceNetworkArn);
2656
- }
2657
- if (data.serviceNetworkId != null) {
2658
- contents.serviceNetworkId = __expectString(data.serviceNetworkId);
2659
- }
2660
- if (data.serviceNetworkName != null) {
2661
- contents.serviceNetworkName = __expectString(data.serviceNetworkName);
2662
- }
2663
- if (data.status != null) {
2664
- contents.status = __expectString(data.status);
2665
- }
2425
+ const doc = take(data, {
2426
+ arn: __expectString,
2427
+ createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
2428
+ createdBy: __expectString,
2429
+ customDomainName: __expectString,
2430
+ dnsEntry: _json,
2431
+ failureCode: __expectString,
2432
+ failureMessage: __expectString,
2433
+ id: __expectString,
2434
+ serviceArn: __expectString,
2435
+ serviceId: __expectString,
2436
+ serviceName: __expectString,
2437
+ serviceNetworkArn: __expectString,
2438
+ serviceNetworkId: __expectString,
2439
+ serviceNetworkName: __expectString,
2440
+ status: __expectString,
2441
+ });
2442
+ Object.assign(contents, doc);
2666
2443
  return contents;
2667
2444
  };
2668
2445
  const de_GetServiceNetworkServiceAssociationCommandError = async (output, context) => {
@@ -2689,10 +2466,9 @@ const de_GetServiceNetworkServiceAssociationCommandError = async (output, contex
2689
2466
  throw await de_ValidationExceptionRes(parsedOutput, context);
2690
2467
  default:
2691
2468
  const parsedBody = parsedOutput.body;
2692
- throwDefaultError({
2469
+ return throwDefaultError({
2693
2470
  output,
2694
2471
  parsedBody,
2695
- exceptionCtor: __BaseException,
2696
2472
  errorCode,
2697
2473
  });
2698
2474
  }
@@ -2705,45 +2481,22 @@ export const de_GetServiceNetworkVpcAssociationCommand = async (output, context)
2705
2481
  $metadata: deserializeMetadata(output),
2706
2482
  });
2707
2483
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2708
- if (data.arn != null) {
2709
- contents.arn = __expectString(data.arn);
2710
- }
2711
- if (data.createdAt != null) {
2712
- contents.createdAt = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.createdAt));
2713
- }
2714
- if (data.createdBy != null) {
2715
- contents.createdBy = __expectString(data.createdBy);
2716
- }
2717
- if (data.failureCode != null) {
2718
- contents.failureCode = __expectString(data.failureCode);
2719
- }
2720
- if (data.failureMessage != null) {
2721
- contents.failureMessage = __expectString(data.failureMessage);
2722
- }
2723
- if (data.id != null) {
2724
- contents.id = __expectString(data.id);
2725
- }
2726
- if (data.lastUpdatedAt != null) {
2727
- contents.lastUpdatedAt = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.lastUpdatedAt));
2728
- }
2729
- if (data.securityGroupIds != null) {
2730
- contents.securityGroupIds = de_SecurityGroupList(data.securityGroupIds, context);
2731
- }
2732
- if (data.serviceNetworkArn != null) {
2733
- contents.serviceNetworkArn = __expectString(data.serviceNetworkArn);
2734
- }
2735
- if (data.serviceNetworkId != null) {
2736
- contents.serviceNetworkId = __expectString(data.serviceNetworkId);
2737
- }
2738
- if (data.serviceNetworkName != null) {
2739
- contents.serviceNetworkName = __expectString(data.serviceNetworkName);
2740
- }
2741
- if (data.status != null) {
2742
- contents.status = __expectString(data.status);
2743
- }
2744
- if (data.vpcId != null) {
2745
- contents.vpcId = __expectString(data.vpcId);
2746
- }
2484
+ const doc = take(data, {
2485
+ arn: __expectString,
2486
+ createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
2487
+ createdBy: __expectString,
2488
+ failureCode: __expectString,
2489
+ failureMessage: __expectString,
2490
+ id: __expectString,
2491
+ lastUpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
2492
+ securityGroupIds: _json,
2493
+ serviceNetworkArn: __expectString,
2494
+ serviceNetworkId: __expectString,
2495
+ serviceNetworkName: __expectString,
2496
+ status: __expectString,
2497
+ vpcId: __expectString,
2498
+ });
2499
+ Object.assign(contents, doc);
2747
2500
  return contents;
2748
2501
  };
2749
2502
  const de_GetServiceNetworkVpcAssociationCommandError = async (output, context) => {
@@ -2770,10 +2523,9 @@ const de_GetServiceNetworkVpcAssociationCommandError = async (output, context) =
2770
2523
  throw await de_ValidationExceptionRes(parsedOutput, context);
2771
2524
  default:
2772
2525
  const parsedBody = parsedOutput.body;
2773
- throwDefaultError({
2526
+ return throwDefaultError({
2774
2527
  output,
2775
2528
  parsedBody,
2776
- exceptionCtor: __BaseException,
2777
2529
  errorCode,
2778
2530
  });
2779
2531
  }
@@ -2786,39 +2538,20 @@ export const de_GetTargetGroupCommand = async (output, context) => {
2786
2538
  $metadata: deserializeMetadata(output),
2787
2539
  });
2788
2540
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2789
- if (data.arn != null) {
2790
- contents.arn = __expectString(data.arn);
2791
- }
2792
- if (data.config != null) {
2793
- contents.config = de_TargetGroupConfig(data.config, context);
2794
- }
2795
- if (data.createdAt != null) {
2796
- contents.createdAt = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.createdAt));
2797
- }
2798
- if (data.failureCode != null) {
2799
- contents.failureCode = __expectString(data.failureCode);
2800
- }
2801
- if (data.failureMessage != null) {
2802
- contents.failureMessage = __expectString(data.failureMessage);
2803
- }
2804
- if (data.id != null) {
2805
- contents.id = __expectString(data.id);
2806
- }
2807
- if (data.lastUpdatedAt != null) {
2808
- contents.lastUpdatedAt = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.lastUpdatedAt));
2809
- }
2810
- if (data.name != null) {
2811
- contents.name = __expectString(data.name);
2812
- }
2813
- if (data.serviceArns != null) {
2814
- contents.serviceArns = de_ServiceArnList(data.serviceArns, context);
2815
- }
2816
- if (data.status != null) {
2817
- contents.status = __expectString(data.status);
2818
- }
2819
- if (data.type != null) {
2820
- contents.type = __expectString(data.type);
2821
- }
2541
+ const doc = take(data, {
2542
+ arn: __expectString,
2543
+ config: _json,
2544
+ createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
2545
+ failureCode: __expectString,
2546
+ failureMessage: __expectString,
2547
+ id: __expectString,
2548
+ lastUpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
2549
+ name: __expectString,
2550
+ serviceArns: _json,
2551
+ status: __expectString,
2552
+ type: __expectString,
2553
+ });
2554
+ Object.assign(contents, doc);
2822
2555
  return contents;
2823
2556
  };
2824
2557
  const de_GetTargetGroupCommandError = async (output, context) => {
@@ -2842,10 +2575,9 @@ const de_GetTargetGroupCommandError = async (output, context) => {
2842
2575
  throw await de_ValidationExceptionRes(parsedOutput, context);
2843
2576
  default:
2844
2577
  const parsedBody = parsedOutput.body;
2845
- throwDefaultError({
2578
+ return throwDefaultError({
2846
2579
  output,
2847
2580
  parsedBody,
2848
- exceptionCtor: __BaseException,
2849
2581
  errorCode,
2850
2582
  });
2851
2583
  }
@@ -2858,12 +2590,11 @@ export const de_ListAccessLogSubscriptionsCommand = async (output, context) => {
2858
2590
  $metadata: deserializeMetadata(output),
2859
2591
  });
2860
2592
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2861
- if (data.items != null) {
2862
- contents.items = de_AccessLogSubscriptionList(data.items, context);
2863
- }
2864
- if (data.nextToken != null) {
2865
- contents.nextToken = __expectString(data.nextToken);
2866
- }
2593
+ const doc = take(data, {
2594
+ items: (_) => de_AccessLogSubscriptionList(_, context),
2595
+ nextToken: __expectString,
2596
+ });
2597
+ Object.assign(contents, doc);
2867
2598
  return contents;
2868
2599
  };
2869
2600
  const de_ListAccessLogSubscriptionsCommandError = async (output, context) => {
@@ -2884,10 +2615,9 @@ const de_ListAccessLogSubscriptionsCommandError = async (output, context) => {
2884
2615
  throw await de_ValidationExceptionRes(parsedOutput, context);
2885
2616
  default:
2886
2617
  const parsedBody = parsedOutput.body;
2887
- throwDefaultError({
2618
+ return throwDefaultError({
2888
2619
  output,
2889
2620
  parsedBody,
2890
- exceptionCtor: __BaseException,
2891
2621
  errorCode,
2892
2622
  });
2893
2623
  }
@@ -2900,12 +2630,11 @@ export const de_ListListenersCommand = async (output, context) => {
2900
2630
  $metadata: deserializeMetadata(output),
2901
2631
  });
2902
2632
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2903
- if (data.items != null) {
2904
- contents.items = de_ListenerSummaryList(data.items, context);
2905
- }
2906
- if (data.nextToken != null) {
2907
- contents.nextToken = __expectString(data.nextToken);
2908
- }
2633
+ const doc = take(data, {
2634
+ items: (_) => de_ListenerSummaryList(_, context),
2635
+ nextToken: __expectString,
2636
+ });
2637
+ Object.assign(contents, doc);
2909
2638
  return contents;
2910
2639
  };
2911
2640
  const de_ListListenersCommandError = async (output, context) => {
@@ -2932,10 +2661,9 @@ const de_ListListenersCommandError = async (output, context) => {
2932
2661
  throw await de_ValidationExceptionRes(parsedOutput, context);
2933
2662
  default:
2934
2663
  const parsedBody = parsedOutput.body;
2935
- throwDefaultError({
2664
+ return throwDefaultError({
2936
2665
  output,
2937
2666
  parsedBody,
2938
- exceptionCtor: __BaseException,
2939
2667
  errorCode,
2940
2668
  });
2941
2669
  }
@@ -2948,12 +2676,11 @@ export const de_ListRulesCommand = async (output, context) => {
2948
2676
  $metadata: deserializeMetadata(output),
2949
2677
  });
2950
2678
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2951
- if (data.items != null) {
2952
- contents.items = de_RuleSummaryList(data.items, context);
2953
- }
2954
- if (data.nextToken != null) {
2955
- contents.nextToken = __expectString(data.nextToken);
2956
- }
2679
+ const doc = take(data, {
2680
+ items: (_) => de_RuleSummaryList(_, context),
2681
+ nextToken: __expectString,
2682
+ });
2683
+ Object.assign(contents, doc);
2957
2684
  return contents;
2958
2685
  };
2959
2686
  const de_ListRulesCommandError = async (output, context) => {
@@ -2980,10 +2707,9 @@ const de_ListRulesCommandError = async (output, context) => {
2980
2707
  throw await de_ValidationExceptionRes(parsedOutput, context);
2981
2708
  default:
2982
2709
  const parsedBody = parsedOutput.body;
2983
- throwDefaultError({
2710
+ return throwDefaultError({
2984
2711
  output,
2985
2712
  parsedBody,
2986
- exceptionCtor: __BaseException,
2987
2713
  errorCode,
2988
2714
  });
2989
2715
  }
@@ -2996,12 +2722,11 @@ export const de_ListServiceNetworksCommand = async (output, context) => {
2996
2722
  $metadata: deserializeMetadata(output),
2997
2723
  });
2998
2724
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2999
- if (data.items != null) {
3000
- contents.items = de_ServiceNetworkList(data.items, context);
3001
- }
3002
- if (data.nextToken != null) {
3003
- contents.nextToken = __expectString(data.nextToken);
3004
- }
2725
+ const doc = take(data, {
2726
+ items: (_) => de_ServiceNetworkList(_, context),
2727
+ nextToken: __expectString,
2728
+ });
2729
+ Object.assign(contents, doc);
3005
2730
  return contents;
3006
2731
  };
3007
2732
  const de_ListServiceNetworksCommandError = async (output, context) => {
@@ -3025,10 +2750,9 @@ const de_ListServiceNetworksCommandError = async (output, context) => {
3025
2750
  throw await de_ValidationExceptionRes(parsedOutput, context);
3026
2751
  default:
3027
2752
  const parsedBody = parsedOutput.body;
3028
- throwDefaultError({
2753
+ return throwDefaultError({
3029
2754
  output,
3030
2755
  parsedBody,
3031
- exceptionCtor: __BaseException,
3032
2756
  errorCode,
3033
2757
  });
3034
2758
  }
@@ -3041,12 +2765,11 @@ export const de_ListServiceNetworkServiceAssociationsCommand = async (output, co
3041
2765
  $metadata: deserializeMetadata(output),
3042
2766
  });
3043
2767
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
3044
- if (data.items != null) {
3045
- contents.items = de_ServiceNetworkServiceAssociationList(data.items, context);
3046
- }
3047
- if (data.nextToken != null) {
3048
- contents.nextToken = __expectString(data.nextToken);
3049
- }
2768
+ const doc = take(data, {
2769
+ items: (_) => de_ServiceNetworkServiceAssociationList(_, context),
2770
+ nextToken: __expectString,
2771
+ });
2772
+ Object.assign(contents, doc);
3050
2773
  return contents;
3051
2774
  };
3052
2775
  const de_ListServiceNetworkServiceAssociationsCommandError = async (output, context) => {
@@ -3070,10 +2793,9 @@ const de_ListServiceNetworkServiceAssociationsCommandError = async (output, cont
3070
2793
  throw await de_ValidationExceptionRes(parsedOutput, context);
3071
2794
  default:
3072
2795
  const parsedBody = parsedOutput.body;
3073
- throwDefaultError({
2796
+ return throwDefaultError({
3074
2797
  output,
3075
2798
  parsedBody,
3076
- exceptionCtor: __BaseException,
3077
2799
  errorCode,
3078
2800
  });
3079
2801
  }
@@ -3086,12 +2808,11 @@ export const de_ListServiceNetworkVpcAssociationsCommand = async (output, contex
3086
2808
  $metadata: deserializeMetadata(output),
3087
2809
  });
3088
2810
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
3089
- if (data.items != null) {
3090
- contents.items = de_ServiceNetworkVpcAssociationList(data.items, context);
3091
- }
3092
- if (data.nextToken != null) {
3093
- contents.nextToken = __expectString(data.nextToken);
3094
- }
2811
+ const doc = take(data, {
2812
+ items: (_) => de_ServiceNetworkVpcAssociationList(_, context),
2813
+ nextToken: __expectString,
2814
+ });
2815
+ Object.assign(contents, doc);
3095
2816
  return contents;
3096
2817
  };
3097
2818
  const de_ListServiceNetworkVpcAssociationsCommandError = async (output, context) => {
@@ -3115,10 +2836,9 @@ const de_ListServiceNetworkVpcAssociationsCommandError = async (output, context)
3115
2836
  throw await de_ValidationExceptionRes(parsedOutput, context);
3116
2837
  default:
3117
2838
  const parsedBody = parsedOutput.body;
3118
- throwDefaultError({
2839
+ return throwDefaultError({
3119
2840
  output,
3120
2841
  parsedBody,
3121
- exceptionCtor: __BaseException,
3122
2842
  errorCode,
3123
2843
  });
3124
2844
  }
@@ -3131,12 +2851,11 @@ export const de_ListServicesCommand = async (output, context) => {
3131
2851
  $metadata: deserializeMetadata(output),
3132
2852
  });
3133
2853
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
3134
- if (data.items != null) {
3135
- contents.items = de_ServiceList(data.items, context);
3136
- }
3137
- if (data.nextToken != null) {
3138
- contents.nextToken = __expectString(data.nextToken);
3139
- }
2854
+ const doc = take(data, {
2855
+ items: (_) => de_ServiceList(_, context),
2856
+ nextToken: __expectString,
2857
+ });
2858
+ Object.assign(contents, doc);
3140
2859
  return contents;
3141
2860
  };
3142
2861
  const de_ListServicesCommandError = async (output, context) => {
@@ -3160,10 +2879,9 @@ const de_ListServicesCommandError = async (output, context) => {
3160
2879
  throw await de_ValidationExceptionRes(parsedOutput, context);
3161
2880
  default:
3162
2881
  const parsedBody = parsedOutput.body;
3163
- throwDefaultError({
2882
+ return throwDefaultError({
3164
2883
  output,
3165
2884
  parsedBody,
3166
- exceptionCtor: __BaseException,
3167
2885
  errorCode,
3168
2886
  });
3169
2887
  }
@@ -3176,9 +2894,10 @@ export const de_ListTagsForResourceCommand = async (output, context) => {
3176
2894
  $metadata: deserializeMetadata(output),
3177
2895
  });
3178
2896
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
3179
- if (data.tags != null) {
3180
- contents.tags = de_TagMap(data.tags, context);
3181
- }
2897
+ const doc = take(data, {
2898
+ tags: _json,
2899
+ });
2900
+ Object.assign(contents, doc);
3182
2901
  return contents;
3183
2902
  };
3184
2903
  const de_ListTagsForResourceCommandError = async (output, context) => {
@@ -3199,10 +2918,9 @@ const de_ListTagsForResourceCommandError = async (output, context) => {
3199
2918
  throw await de_ValidationExceptionRes(parsedOutput, context);
3200
2919
  default:
3201
2920
  const parsedBody = parsedOutput.body;
3202
- throwDefaultError({
2921
+ return throwDefaultError({
3203
2922
  output,
3204
2923
  parsedBody,
3205
- exceptionCtor: __BaseException,
3206
2924
  errorCode,
3207
2925
  });
3208
2926
  }
@@ -3215,12 +2933,11 @@ export const de_ListTargetGroupsCommand = async (output, context) => {
3215
2933
  $metadata: deserializeMetadata(output),
3216
2934
  });
3217
2935
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
3218
- if (data.items != null) {
3219
- contents.items = de_TargetGroupList(data.items, context);
3220
- }
3221
- if (data.nextToken != null) {
3222
- contents.nextToken = __expectString(data.nextToken);
3223
- }
2936
+ const doc = take(data, {
2937
+ items: (_) => de_TargetGroupList(_, context),
2938
+ nextToken: __expectString,
2939
+ });
2940
+ Object.assign(contents, doc);
3224
2941
  return contents;
3225
2942
  };
3226
2943
  const de_ListTargetGroupsCommandError = async (output, context) => {
@@ -3244,10 +2961,9 @@ const de_ListTargetGroupsCommandError = async (output, context) => {
3244
2961
  throw await de_ValidationExceptionRes(parsedOutput, context);
3245
2962
  default:
3246
2963
  const parsedBody = parsedOutput.body;
3247
- throwDefaultError({
2964
+ return throwDefaultError({
3248
2965
  output,
3249
2966
  parsedBody,
3250
- exceptionCtor: __BaseException,
3251
2967
  errorCode,
3252
2968
  });
3253
2969
  }
@@ -3260,12 +2976,11 @@ export const de_ListTargetsCommand = async (output, context) => {
3260
2976
  $metadata: deserializeMetadata(output),
3261
2977
  });
3262
2978
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
3263
- if (data.items != null) {
3264
- contents.items = de_TargetSummaryList(data.items, context);
3265
- }
3266
- if (data.nextToken != null) {
3267
- contents.nextToken = __expectString(data.nextToken);
3268
- }
2979
+ const doc = take(data, {
2980
+ items: _json,
2981
+ nextToken: __expectString,
2982
+ });
2983
+ Object.assign(contents, doc);
3269
2984
  return contents;
3270
2985
  };
3271
2986
  const de_ListTargetsCommandError = async (output, context) => {
@@ -3292,10 +3007,9 @@ const de_ListTargetsCommandError = async (output, context) => {
3292
3007
  throw await de_ValidationExceptionRes(parsedOutput, context);
3293
3008
  default:
3294
3009
  const parsedBody = parsedOutput.body;
3295
- throwDefaultError({
3010
+ return throwDefaultError({
3296
3011
  output,
3297
3012
  parsedBody,
3298
- exceptionCtor: __BaseException,
3299
3013
  errorCode,
3300
3014
  });
3301
3015
  }
@@ -3308,12 +3022,11 @@ export const de_PutAuthPolicyCommand = async (output, context) => {
3308
3022
  $metadata: deserializeMetadata(output),
3309
3023
  });
3310
3024
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
3311
- if (data.policy != null) {
3312
- contents.policy = __expectString(data.policy);
3313
- }
3314
- if (data.state != null) {
3315
- contents.state = __expectString(data.state);
3316
- }
3025
+ const doc = take(data, {
3026
+ policy: __expectString,
3027
+ state: __expectString,
3028
+ });
3029
+ Object.assign(contents, doc);
3317
3030
  return contents;
3318
3031
  };
3319
3032
  const de_PutAuthPolicyCommandError = async (output, context) => {
@@ -3340,10 +3053,9 @@ const de_PutAuthPolicyCommandError = async (output, context) => {
3340
3053
  throw await de_ValidationExceptionRes(parsedOutput, context);
3341
3054
  default:
3342
3055
  const parsedBody = parsedOutput.body;
3343
- throwDefaultError({
3056
+ return throwDefaultError({
3344
3057
  output,
3345
3058
  parsedBody,
3346
- exceptionCtor: __BaseException,
3347
3059
  errorCode,
3348
3060
  });
3349
3061
  }
@@ -3382,10 +3094,9 @@ const de_PutResourcePolicyCommandError = async (output, context) => {
3382
3094
  throw await de_ValidationExceptionRes(parsedOutput, context);
3383
3095
  default:
3384
3096
  const parsedBody = parsedOutput.body;
3385
- throwDefaultError({
3097
+ return throwDefaultError({
3386
3098
  output,
3387
3099
  parsedBody,
3388
- exceptionCtor: __BaseException,
3389
3100
  errorCode,
3390
3101
  });
3391
3102
  }
@@ -3398,12 +3109,11 @@ export const de_RegisterTargetsCommand = async (output, context) => {
3398
3109
  $metadata: deserializeMetadata(output),
3399
3110
  });
3400
3111
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
3401
- if (data.successful != null) {
3402
- contents.successful = de_TargetList(data.successful, context);
3403
- }
3404
- if (data.unsuccessful != null) {
3405
- contents.unsuccessful = de_TargetFailureList(data.unsuccessful, context);
3406
- }
3112
+ const doc = take(data, {
3113
+ successful: _json,
3114
+ unsuccessful: _json,
3115
+ });
3116
+ Object.assign(contents, doc);
3407
3117
  return contents;
3408
3118
  };
3409
3119
  const de_RegisterTargetsCommandError = async (output, context) => {
@@ -3436,10 +3146,9 @@ const de_RegisterTargetsCommandError = async (output, context) => {
3436
3146
  throw await de_ValidationExceptionRes(parsedOutput, context);
3437
3147
  default:
3438
3148
  const parsedBody = parsedOutput.body;
3439
- throwDefaultError({
3149
+ return throwDefaultError({
3440
3150
  output,
3441
3151
  parsedBody,
3442
- exceptionCtor: __BaseException,
3443
3152
  errorCode,
3444
3153
  });
3445
3154
  }
@@ -3478,10 +3187,9 @@ const de_TagResourceCommandError = async (output, context) => {
3478
3187
  throw await de_ValidationExceptionRes(parsedOutput, context);
3479
3188
  default:
3480
3189
  const parsedBody = parsedOutput.body;
3481
- throwDefaultError({
3190
+ return throwDefaultError({
3482
3191
  output,
3483
3192
  parsedBody,
3484
- exceptionCtor: __BaseException,
3485
3193
  errorCode,
3486
3194
  });
3487
3195
  }
@@ -3514,10 +3222,9 @@ const de_UntagResourceCommandError = async (output, context) => {
3514
3222
  throw await de_ValidationExceptionRes(parsedOutput, context);
3515
3223
  default:
3516
3224
  const parsedBody = parsedOutput.body;
3517
- throwDefaultError({
3225
+ return throwDefaultError({
3518
3226
  output,
3519
3227
  parsedBody,
3520
- exceptionCtor: __BaseException,
3521
3228
  errorCode,
3522
3229
  });
3523
3230
  }
@@ -3530,21 +3237,14 @@ export const de_UpdateAccessLogSubscriptionCommand = async (output, context) =>
3530
3237
  $metadata: deserializeMetadata(output),
3531
3238
  });
3532
3239
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
3533
- if (data.arn != null) {
3534
- contents.arn = __expectString(data.arn);
3535
- }
3536
- if (data.destinationArn != null) {
3537
- contents.destinationArn = __expectString(data.destinationArn);
3538
- }
3539
- if (data.id != null) {
3540
- contents.id = __expectString(data.id);
3541
- }
3542
- if (data.resourceArn != null) {
3543
- contents.resourceArn = __expectString(data.resourceArn);
3544
- }
3545
- if (data.resourceId != null) {
3546
- contents.resourceId = __expectString(data.resourceId);
3547
- }
3240
+ const doc = take(data, {
3241
+ arn: __expectString,
3242
+ destinationArn: __expectString,
3243
+ id: __expectString,
3244
+ resourceArn: __expectString,
3245
+ resourceId: __expectString,
3246
+ });
3247
+ Object.assign(contents, doc);
3548
3248
  return contents;
3549
3249
  };
3550
3250
  const de_UpdateAccessLogSubscriptionCommandError = async (output, context) => {
@@ -3574,10 +3274,9 @@ const de_UpdateAccessLogSubscriptionCommandError = async (output, context) => {
3574
3274
  throw await de_ValidationExceptionRes(parsedOutput, context);
3575
3275
  default:
3576
3276
  const parsedBody = parsedOutput.body;
3577
- throwDefaultError({
3277
+ return throwDefaultError({
3578
3278
  output,
3579
3279
  parsedBody,
3580
- exceptionCtor: __BaseException,
3581
3280
  errorCode,
3582
3281
  });
3583
3282
  }
@@ -3590,30 +3289,17 @@ export const de_UpdateListenerCommand = async (output, context) => {
3590
3289
  $metadata: deserializeMetadata(output),
3591
3290
  });
3592
3291
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
3593
- if (data.arn != null) {
3594
- contents.arn = __expectString(data.arn);
3595
- }
3596
- if (data.defaultAction != null) {
3597
- contents.defaultAction = de_RuleAction(__expectUnion(data.defaultAction), context);
3598
- }
3599
- if (data.id != null) {
3600
- contents.id = __expectString(data.id);
3601
- }
3602
- if (data.name != null) {
3603
- contents.name = __expectString(data.name);
3604
- }
3605
- if (data.port != null) {
3606
- contents.port = __expectInt32(data.port);
3607
- }
3608
- if (data.protocol != null) {
3609
- contents.protocol = __expectString(data.protocol);
3610
- }
3611
- if (data.serviceArn != null) {
3612
- contents.serviceArn = __expectString(data.serviceArn);
3613
- }
3614
- if (data.serviceId != null) {
3615
- contents.serviceId = __expectString(data.serviceId);
3616
- }
3292
+ const doc = take(data, {
3293
+ arn: __expectString,
3294
+ defaultAction: (_) => _json(__expectUnion(_)),
3295
+ id: __expectString,
3296
+ name: __expectString,
3297
+ port: __expectInt32,
3298
+ protocol: __expectString,
3299
+ serviceArn: __expectString,
3300
+ serviceId: __expectString,
3301
+ });
3302
+ Object.assign(contents, doc);
3617
3303
  return contents;
3618
3304
  };
3619
3305
  const de_UpdateListenerCommandError = async (output, context) => {
@@ -3643,10 +3329,9 @@ const de_UpdateListenerCommandError = async (output, context) => {
3643
3329
  throw await de_ValidationExceptionRes(parsedOutput, context);
3644
3330
  default:
3645
3331
  const parsedBody = parsedOutput.body;
3646
- throwDefaultError({
3332
+ return throwDefaultError({
3647
3333
  output,
3648
3334
  parsedBody,
3649
- exceptionCtor: __BaseException,
3650
3335
  errorCode,
3651
3336
  });
3652
3337
  }
@@ -3659,27 +3344,16 @@ export const de_UpdateRuleCommand = async (output, context) => {
3659
3344
  $metadata: deserializeMetadata(output),
3660
3345
  });
3661
3346
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
3662
- if (data.action != null) {
3663
- contents.action = de_RuleAction(__expectUnion(data.action), context);
3664
- }
3665
- if (data.arn != null) {
3666
- contents.arn = __expectString(data.arn);
3667
- }
3668
- if (data.id != null) {
3669
- contents.id = __expectString(data.id);
3670
- }
3671
- if (data.isDefault != null) {
3672
- contents.isDefault = __expectBoolean(data.isDefault);
3673
- }
3674
- if (data.match != null) {
3675
- contents.match = de_RuleMatch(__expectUnion(data.match), context);
3676
- }
3677
- if (data.name != null) {
3678
- contents.name = __expectString(data.name);
3679
- }
3680
- if (data.priority != null) {
3681
- contents.priority = __expectInt32(data.priority);
3682
- }
3347
+ const doc = take(data, {
3348
+ action: (_) => _json(__expectUnion(_)),
3349
+ arn: __expectString,
3350
+ id: __expectString,
3351
+ isDefault: __expectBoolean,
3352
+ match: (_) => _json(__expectUnion(_)),
3353
+ name: __expectString,
3354
+ priority: __expectInt32,
3355
+ });
3356
+ Object.assign(contents, doc);
3683
3357
  return contents;
3684
3358
  };
3685
3359
  const de_UpdateRuleCommandError = async (output, context) => {
@@ -3709,10 +3383,9 @@ const de_UpdateRuleCommandError = async (output, context) => {
3709
3383
  throw await de_ValidationExceptionRes(parsedOutput, context);
3710
3384
  default:
3711
3385
  const parsedBody = parsedOutput.body;
3712
- throwDefaultError({
3386
+ return throwDefaultError({
3713
3387
  output,
3714
3388
  parsedBody,
3715
- exceptionCtor: __BaseException,
3716
3389
  errorCode,
3717
3390
  });
3718
3391
  }
@@ -3725,24 +3398,15 @@ export const de_UpdateServiceCommand = async (output, context) => {
3725
3398
  $metadata: deserializeMetadata(output),
3726
3399
  });
3727
3400
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
3728
- if (data.arn != null) {
3729
- contents.arn = __expectString(data.arn);
3730
- }
3731
- if (data.authType != null) {
3732
- contents.authType = __expectString(data.authType);
3733
- }
3734
- if (data.certificateArn != null) {
3735
- contents.certificateArn = __expectString(data.certificateArn);
3736
- }
3737
- if (data.customDomainName != null) {
3738
- contents.customDomainName = __expectString(data.customDomainName);
3739
- }
3740
- if (data.id != null) {
3741
- contents.id = __expectString(data.id);
3742
- }
3743
- if (data.name != null) {
3744
- contents.name = __expectString(data.name);
3745
- }
3401
+ const doc = take(data, {
3402
+ arn: __expectString,
3403
+ authType: __expectString,
3404
+ certificateArn: __expectString,
3405
+ customDomainName: __expectString,
3406
+ id: __expectString,
3407
+ name: __expectString,
3408
+ });
3409
+ Object.assign(contents, doc);
3746
3410
  return contents;
3747
3411
  };
3748
3412
  const de_UpdateServiceCommandError = async (output, context) => {
@@ -3772,10 +3436,9 @@ const de_UpdateServiceCommandError = async (output, context) => {
3772
3436
  throw await de_ValidationExceptionRes(parsedOutput, context);
3773
3437
  default:
3774
3438
  const parsedBody = parsedOutput.body;
3775
- throwDefaultError({
3439
+ return throwDefaultError({
3776
3440
  output,
3777
3441
  parsedBody,
3778
- exceptionCtor: __BaseException,
3779
3442
  errorCode,
3780
3443
  });
3781
3444
  }
@@ -3788,18 +3451,13 @@ export const de_UpdateServiceNetworkCommand = async (output, context) => {
3788
3451
  $metadata: deserializeMetadata(output),
3789
3452
  });
3790
3453
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
3791
- if (data.arn != null) {
3792
- contents.arn = __expectString(data.arn);
3793
- }
3794
- if (data.authType != null) {
3795
- contents.authType = __expectString(data.authType);
3796
- }
3797
- if (data.id != null) {
3798
- contents.id = __expectString(data.id);
3799
- }
3800
- if (data.name != null) {
3801
- contents.name = __expectString(data.name);
3802
- }
3454
+ const doc = take(data, {
3455
+ arn: __expectString,
3456
+ authType: __expectString,
3457
+ id: __expectString,
3458
+ name: __expectString,
3459
+ });
3460
+ Object.assign(contents, doc);
3803
3461
  return contents;
3804
3462
  };
3805
3463
  const de_UpdateServiceNetworkCommandError = async (output, context) => {
@@ -3829,10 +3487,9 @@ const de_UpdateServiceNetworkCommandError = async (output, context) => {
3829
3487
  throw await de_ValidationExceptionRes(parsedOutput, context);
3830
3488
  default:
3831
3489
  const parsedBody = parsedOutput.body;
3832
- throwDefaultError({
3490
+ return throwDefaultError({
3833
3491
  output,
3834
3492
  parsedBody,
3835
- exceptionCtor: __BaseException,
3836
3493
  errorCode,
3837
3494
  });
3838
3495
  }
@@ -3845,21 +3502,14 @@ export const de_UpdateServiceNetworkVpcAssociationCommand = async (output, conte
3845
3502
  $metadata: deserializeMetadata(output),
3846
3503
  });
3847
3504
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
3848
- if (data.arn != null) {
3849
- contents.arn = __expectString(data.arn);
3850
- }
3851
- if (data.createdBy != null) {
3852
- contents.createdBy = __expectString(data.createdBy);
3853
- }
3854
- if (data.id != null) {
3855
- contents.id = __expectString(data.id);
3856
- }
3857
- if (data.securityGroupIds != null) {
3858
- contents.securityGroupIds = de_SecurityGroupList(data.securityGroupIds, context);
3859
- }
3860
- if (data.status != null) {
3861
- contents.status = __expectString(data.status);
3862
- }
3505
+ const doc = take(data, {
3506
+ arn: __expectString,
3507
+ createdBy: __expectString,
3508
+ id: __expectString,
3509
+ securityGroupIds: _json,
3510
+ status: __expectString,
3511
+ });
3512
+ Object.assign(contents, doc);
3863
3513
  return contents;
3864
3514
  };
3865
3515
  const de_UpdateServiceNetworkVpcAssociationCommandError = async (output, context) => {
@@ -3889,10 +3539,9 @@ const de_UpdateServiceNetworkVpcAssociationCommandError = async (output, context
3889
3539
  throw await de_ValidationExceptionRes(parsedOutput, context);
3890
3540
  default:
3891
3541
  const parsedBody = parsedOutput.body;
3892
- throwDefaultError({
3542
+ return throwDefaultError({
3893
3543
  output,
3894
3544
  parsedBody,
3895
- exceptionCtor: __BaseException,
3896
3545
  errorCode,
3897
3546
  });
3898
3547
  }
@@ -3905,24 +3554,15 @@ export const de_UpdateTargetGroupCommand = async (output, context) => {
3905
3554
  $metadata: deserializeMetadata(output),
3906
3555
  });
3907
3556
  const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
3908
- if (data.arn != null) {
3909
- contents.arn = __expectString(data.arn);
3910
- }
3911
- if (data.config != null) {
3912
- contents.config = de_TargetGroupConfig(data.config, context);
3913
- }
3914
- if (data.id != null) {
3915
- contents.id = __expectString(data.id);
3916
- }
3917
- if (data.name != null) {
3918
- contents.name = __expectString(data.name);
3919
- }
3920
- if (data.status != null) {
3921
- contents.status = __expectString(data.status);
3922
- }
3923
- if (data.type != null) {
3924
- contents.type = __expectString(data.type);
3925
- }
3557
+ const doc = take(data, {
3558
+ arn: __expectString,
3559
+ config: _json,
3560
+ id: __expectString,
3561
+ name: __expectString,
3562
+ status: __expectString,
3563
+ type: __expectString,
3564
+ });
3565
+ Object.assign(contents, doc);
3926
3566
  return contents;
3927
3567
  };
3928
3568
  const de_UpdateTargetGroupCommandError = async (output, context) => {
@@ -3949,21 +3589,21 @@ const de_UpdateTargetGroupCommandError = async (output, context) => {
3949
3589
  throw await de_ValidationExceptionRes(parsedOutput, context);
3950
3590
  default:
3951
3591
  const parsedBody = parsedOutput.body;
3952
- throwDefaultError({
3592
+ return throwDefaultError({
3953
3593
  output,
3954
3594
  parsedBody,
3955
- exceptionCtor: __BaseException,
3956
3595
  errorCode,
3957
3596
  });
3958
3597
  }
3959
3598
  };
3960
- const map = __map;
3599
+ const throwDefaultError = withBaseException(__BaseException);
3961
3600
  const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
3962
3601
  const contents = map({});
3963
3602
  const data = parsedOutput.body;
3964
- if (data.message != null) {
3965
- contents.message = __expectString(data.message);
3966
- }
3603
+ const doc = take(data, {
3604
+ message: __expectString,
3605
+ });
3606
+ Object.assign(contents, doc);
3967
3607
  const exception = new AccessDeniedException({
3968
3608
  $metadata: deserializeMetadata(parsedOutput),
3969
3609
  ...contents,
@@ -3973,15 +3613,12 @@ const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
3973
3613
  const de_ConflictExceptionRes = async (parsedOutput, context) => {
3974
3614
  const contents = map({});
3975
3615
  const data = parsedOutput.body;
3976
- if (data.message != null) {
3977
- contents.message = __expectString(data.message);
3978
- }
3979
- if (data.resourceId != null) {
3980
- contents.resourceId = __expectString(data.resourceId);
3981
- }
3982
- if (data.resourceType != null) {
3983
- contents.resourceType = __expectString(data.resourceType);
3984
- }
3616
+ const doc = take(data, {
3617
+ message: __expectString,
3618
+ resourceId: __expectString,
3619
+ resourceType: __expectString,
3620
+ });
3621
+ Object.assign(contents, doc);
3985
3622
  const exception = new ConflictException({
3986
3623
  $metadata: deserializeMetadata(parsedOutput),
3987
3624
  ...contents,
@@ -3996,9 +3633,10 @@ const de_InternalServerExceptionRes = async (parsedOutput, context) => {
3996
3633
  ],
3997
3634
  });
3998
3635
  const data = parsedOutput.body;
3999
- if (data.message != null) {
4000
- contents.message = __expectString(data.message);
4001
- }
3636
+ const doc = take(data, {
3637
+ message: __expectString,
3638
+ });
3639
+ Object.assign(contents, doc);
4002
3640
  const exception = new InternalServerException({
4003
3641
  $metadata: deserializeMetadata(parsedOutput),
4004
3642
  ...contents,
@@ -4008,15 +3646,12 @@ const de_InternalServerExceptionRes = async (parsedOutput, context) => {
4008
3646
  const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
4009
3647
  const contents = map({});
4010
3648
  const data = parsedOutput.body;
4011
- if (data.message != null) {
4012
- contents.message = __expectString(data.message);
4013
- }
4014
- if (data.resourceId != null) {
4015
- contents.resourceId = __expectString(data.resourceId);
4016
- }
4017
- if (data.resourceType != null) {
4018
- contents.resourceType = __expectString(data.resourceType);
4019
- }
3649
+ const doc = take(data, {
3650
+ message: __expectString,
3651
+ resourceId: __expectString,
3652
+ resourceType: __expectString,
3653
+ });
3654
+ Object.assign(contents, doc);
4020
3655
  const exception = new ResourceNotFoundException({
4021
3656
  $metadata: deserializeMetadata(parsedOutput),
4022
3657
  ...contents,
@@ -4026,21 +3661,14 @@ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
4026
3661
  const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
4027
3662
  const contents = map({});
4028
3663
  const data = parsedOutput.body;
4029
- if (data.message != null) {
4030
- contents.message = __expectString(data.message);
4031
- }
4032
- if (data.quotaCode != null) {
4033
- contents.quotaCode = __expectString(data.quotaCode);
4034
- }
4035
- if (data.resourceId != null) {
4036
- contents.resourceId = __expectString(data.resourceId);
4037
- }
4038
- if (data.resourceType != null) {
4039
- contents.resourceType = __expectString(data.resourceType);
4040
- }
4041
- if (data.serviceCode != null) {
4042
- contents.serviceCode = __expectString(data.serviceCode);
4043
- }
3664
+ const doc = take(data, {
3665
+ message: __expectString,
3666
+ quotaCode: __expectString,
3667
+ resourceId: __expectString,
3668
+ resourceType: __expectString,
3669
+ serviceCode: __expectString,
3670
+ });
3671
+ Object.assign(contents, doc);
4044
3672
  const exception = new ServiceQuotaExceededException({
4045
3673
  $metadata: deserializeMetadata(parsedOutput),
4046
3674
  ...contents,
@@ -4055,15 +3683,12 @@ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
4055
3683
  ],
4056
3684
  });
4057
3685
  const data = parsedOutput.body;
4058
- if (data.message != null) {
4059
- contents.message = __expectString(data.message);
4060
- }
4061
- if (data.quotaCode != null) {
4062
- contents.quotaCode = __expectString(data.quotaCode);
4063
- }
4064
- if (data.serviceCode != null) {
4065
- contents.serviceCode = __expectString(data.serviceCode);
4066
- }
3686
+ const doc = take(data, {
3687
+ message: __expectString,
3688
+ quotaCode: __expectString,
3689
+ serviceCode: __expectString,
3690
+ });
3691
+ Object.assign(contents, doc);
4067
3692
  const exception = new ThrottlingException({
4068
3693
  $metadata: deserializeMetadata(parsedOutput),
4069
3694
  ...contents,
@@ -4073,423 +3698,79 @@ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
4073
3698
  const de_ValidationExceptionRes = async (parsedOutput, context) => {
4074
3699
  const contents = map({});
4075
3700
  const data = parsedOutput.body;
4076
- if (data.fieldList != null) {
4077
- contents.fieldList = de_ValidationExceptionFieldList(data.fieldList, context);
4078
- }
4079
- if (data.message != null) {
4080
- contents.message = __expectString(data.message);
4081
- }
4082
- if (data.reason != null) {
4083
- contents.reason = __expectString(data.reason);
4084
- }
3701
+ const doc = take(data, {
3702
+ fieldList: _json,
3703
+ message: __expectString,
3704
+ reason: __expectString,
3705
+ });
3706
+ Object.assign(contents, doc);
4085
3707
  const exception = new ValidationException({
4086
3708
  $metadata: deserializeMetadata(parsedOutput),
4087
3709
  ...contents,
4088
3710
  });
4089
3711
  return __decorateServiceException(exception, parsedOutput.body);
4090
3712
  };
4091
- const se_FixedResponseAction = (input, context) => {
4092
- return {
4093
- ...(input.statusCode != null && { statusCode: input.statusCode }),
4094
- };
4095
- };
4096
- const se_ForwardAction = (input, context) => {
4097
- return {
4098
- ...(input.targetGroups != null && { targetGroups: se_WeightedTargetGroupList(input.targetGroups, context) }),
4099
- };
4100
- };
4101
- const se_HeaderMatch = (input, context) => {
4102
- return {
4103
- ...(input.caseSensitive != null && { caseSensitive: input.caseSensitive }),
4104
- ...(input.match != null && { match: se_HeaderMatchType(input.match, context) }),
4105
- ...(input.name != null && { name: input.name }),
4106
- };
4107
- };
4108
- const se_HeaderMatchList = (input, context) => {
4109
- return input
4110
- .filter((e) => e != null)
4111
- .map((entry) => {
4112
- return se_HeaderMatch(entry, context);
4113
- });
4114
- };
4115
- const se_HeaderMatchType = (input, context) => {
4116
- return HeaderMatchType.visit(input, {
4117
- contains: (value) => ({ contains: value }),
4118
- exact: (value) => ({ exact: value }),
4119
- prefix: (value) => ({ prefix: value }),
4120
- _: (name, value) => ({ name: value }),
4121
- });
4122
- };
4123
- const se_HealthCheckConfig = (input, context) => {
4124
- return {
4125
- ...(input.enabled != null && { enabled: input.enabled }),
4126
- ...(input.healthCheckIntervalSeconds != null && { healthCheckIntervalSeconds: input.healthCheckIntervalSeconds }),
4127
- ...(input.healthCheckTimeoutSeconds != null && { healthCheckTimeoutSeconds: input.healthCheckTimeoutSeconds }),
4128
- ...(input.healthyThresholdCount != null && { healthyThresholdCount: input.healthyThresholdCount }),
4129
- ...(input.matcher != null && { matcher: se_Matcher(input.matcher, context) }),
4130
- ...(input.path != null && { path: input.path }),
4131
- ...(input.port != null && { port: input.port }),
4132
- ...(input.protocol != null && { protocol: input.protocol }),
4133
- ...(input.protocolVersion != null && { protocolVersion: input.protocolVersion }),
4134
- ...(input.unhealthyThresholdCount != null && { unhealthyThresholdCount: input.unhealthyThresholdCount }),
4135
- };
4136
- };
4137
- const se_HttpMatch = (input, context) => {
4138
- return {
4139
- ...(input.headerMatches != null && { headerMatches: se_HeaderMatchList(input.headerMatches, context) }),
4140
- ...(input.method != null && { method: input.method }),
4141
- ...(input.pathMatch != null && { pathMatch: se_PathMatch(input.pathMatch, context) }),
4142
- };
4143
- };
4144
- const se_Matcher = (input, context) => {
4145
- return Matcher.visit(input, {
4146
- httpCode: (value) => ({ httpCode: value }),
4147
- _: (name, value) => ({ name: value }),
4148
- });
4149
- };
4150
- const se_PathMatch = (input, context) => {
4151
- return {
4152
- ...(input.caseSensitive != null && { caseSensitive: input.caseSensitive }),
4153
- ...(input.match != null && { match: se_PathMatchType(input.match, context) }),
4154
- };
4155
- };
4156
- const se_PathMatchType = (input, context) => {
4157
- return PathMatchType.visit(input, {
4158
- exact: (value) => ({ exact: value }),
4159
- prefix: (value) => ({ prefix: value }),
4160
- _: (name, value) => ({ name: value }),
4161
- });
4162
- };
4163
- const se_RuleAction = (input, context) => {
4164
- return RuleAction.visit(input, {
4165
- fixedResponse: (value) => ({ fixedResponse: se_FixedResponseAction(value, context) }),
4166
- forward: (value) => ({ forward: se_ForwardAction(value, context) }),
4167
- _: (name, value) => ({ name: value }),
4168
- });
4169
- };
4170
- const se_RuleMatch = (input, context) => {
4171
- return RuleMatch.visit(input, {
4172
- httpMatch: (value) => ({ httpMatch: se_HttpMatch(value, context) }),
4173
- _: (name, value) => ({ name: value }),
4174
- });
4175
- };
4176
- const se_RuleUpdate = (input, context) => {
4177
- return {
4178
- ...(input.action != null && { action: se_RuleAction(input.action, context) }),
4179
- ...(input.match != null && { match: se_RuleMatch(input.match, context) }),
4180
- ...(input.priority != null && { priority: input.priority }),
4181
- ...(input.ruleIdentifier != null && { ruleIdentifier: input.ruleIdentifier }),
4182
- };
4183
- };
4184
- const se_RuleUpdateList = (input, context) => {
4185
- return input
4186
- .filter((e) => e != null)
4187
- .map((entry) => {
4188
- return se_RuleUpdate(entry, context);
4189
- });
4190
- };
4191
- const se_SecurityGroupList = (input, context) => {
4192
- return input
4193
- .filter((e) => e != null)
4194
- .map((entry) => {
4195
- return entry;
4196
- });
4197
- };
4198
- const se_TagMap = (input, context) => {
4199
- return Object.entries(input).reduce((acc, [key, value]) => {
4200
- if (value === null) {
4201
- return acc;
4202
- }
4203
- acc[key] = value;
4204
- return acc;
4205
- }, {});
4206
- };
4207
- const se_Target = (input, context) => {
4208
- return {
4209
- ...(input.id != null && { id: input.id }),
4210
- ...(input.port != null && { port: input.port }),
4211
- };
4212
- };
4213
- const se_TargetGroupConfig = (input, context) => {
4214
- return {
4215
- ...(input.healthCheck != null && { healthCheck: se_HealthCheckConfig(input.healthCheck, context) }),
4216
- ...(input.ipAddressType != null && { ipAddressType: input.ipAddressType }),
4217
- ...(input.port != null && { port: input.port }),
4218
- ...(input.protocol != null && { protocol: input.protocol }),
4219
- ...(input.protocolVersion != null && { protocolVersion: input.protocolVersion }),
4220
- ...(input.vpcIdentifier != null && { vpcIdentifier: input.vpcIdentifier }),
4221
- };
4222
- };
4223
- const se_TargetList = (input, context) => {
4224
- return input
4225
- .filter((e) => e != null)
4226
- .map((entry) => {
4227
- return se_Target(entry, context);
4228
- });
4229
- };
4230
- const se_WeightedTargetGroup = (input, context) => {
4231
- return {
4232
- ...(input.targetGroupIdentifier != null && { targetGroupIdentifier: input.targetGroupIdentifier }),
4233
- ...(input.weight != null && { weight: input.weight }),
4234
- };
4235
- };
4236
- const se_WeightedTargetGroupList = (input, context) => {
4237
- return input
4238
- .filter((e) => e != null)
4239
- .map((entry) => {
4240
- return se_WeightedTargetGroup(entry, context);
4241
- });
4242
- };
4243
3713
  const de_AccessLogSubscriptionList = (output, context) => {
4244
3714
  const retVal = (output || [])
4245
3715
  .filter((e) => e != null)
4246
3716
  .map((entry) => {
4247
- if (entry === null) {
4248
- return null;
4249
- }
4250
3717
  return de_AccessLogSubscriptionSummary(entry, context);
4251
3718
  });
4252
3719
  return retVal;
4253
3720
  };
4254
3721
  const de_AccessLogSubscriptionSummary = (output, context) => {
4255
- return {
4256
- arn: __expectString(output.arn),
4257
- createdAt: output.createdAt != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.createdAt)) : undefined,
4258
- destinationArn: __expectString(output.destinationArn),
4259
- id: __expectString(output.id),
4260
- lastUpdatedAt: output.lastUpdatedAt != null
4261
- ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.lastUpdatedAt))
4262
- : undefined,
4263
- resourceArn: __expectString(output.resourceArn),
4264
- resourceId: __expectString(output.resourceId),
4265
- };
4266
- };
4267
- const de_DnsEntry = (output, context) => {
4268
- return {
4269
- domainName: __expectString(output.domainName),
4270
- hostedZoneId: __expectString(output.hostedZoneId),
4271
- };
4272
- };
4273
- const de_FixedResponseAction = (output, context) => {
4274
- return {
4275
- statusCode: __expectInt32(output.statusCode),
4276
- };
4277
- };
4278
- const de_ForwardAction = (output, context) => {
4279
- return {
4280
- targetGroups: output.targetGroups != null ? de_WeightedTargetGroupList(output.targetGroups, context) : undefined,
4281
- };
4282
- };
4283
- const de_HeaderMatch = (output, context) => {
4284
- return {
4285
- caseSensitive: __expectBoolean(output.caseSensitive),
4286
- match: output.match != null ? de_HeaderMatchType(__expectUnion(output.match), context) : undefined,
4287
- name: __expectString(output.name),
4288
- };
4289
- };
4290
- const de_HeaderMatchList = (output, context) => {
4291
- const retVal = (output || [])
4292
- .filter((e) => e != null)
4293
- .map((entry) => {
4294
- if (entry === null) {
4295
- return null;
4296
- }
4297
- return de_HeaderMatch(entry, context);
3722
+ return take(output, {
3723
+ arn: __expectString,
3724
+ createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
3725
+ destinationArn: __expectString,
3726
+ id: __expectString,
3727
+ lastUpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
3728
+ resourceArn: __expectString,
3729
+ resourceId: __expectString,
4298
3730
  });
4299
- return retVal;
4300
- };
4301
- const de_HeaderMatchType = (output, context) => {
4302
- if (__expectString(output.contains) !== undefined) {
4303
- return { contains: __expectString(output.contains) };
4304
- }
4305
- if (__expectString(output.exact) !== undefined) {
4306
- return { exact: __expectString(output.exact) };
4307
- }
4308
- if (__expectString(output.prefix) !== undefined) {
4309
- return { prefix: __expectString(output.prefix) };
4310
- }
4311
- return { $unknown: Object.entries(output)[0] };
4312
- };
4313
- const de_HealthCheckConfig = (output, context) => {
4314
- return {
4315
- enabled: __expectBoolean(output.enabled),
4316
- healthCheckIntervalSeconds: __expectInt32(output.healthCheckIntervalSeconds),
4317
- healthCheckTimeoutSeconds: __expectInt32(output.healthCheckTimeoutSeconds),
4318
- healthyThresholdCount: __expectInt32(output.healthyThresholdCount),
4319
- matcher: output.matcher != null ? de_Matcher(__expectUnion(output.matcher), context) : undefined,
4320
- path: __expectString(output.path),
4321
- port: __expectInt32(output.port),
4322
- protocol: __expectString(output.protocol),
4323
- protocolVersion: __expectString(output.protocolVersion),
4324
- unhealthyThresholdCount: __expectInt32(output.unhealthyThresholdCount),
4325
- };
4326
- };
4327
- const de_HttpMatch = (output, context) => {
4328
- return {
4329
- headerMatches: output.headerMatches != null ? de_HeaderMatchList(output.headerMatches, context) : undefined,
4330
- method: __expectString(output.method),
4331
- pathMatch: output.pathMatch != null ? de_PathMatch(output.pathMatch, context) : undefined,
4332
- };
4333
3731
  };
4334
3732
  const de_ListenerSummary = (output, context) => {
4335
- return {
4336
- arn: __expectString(output.arn),
4337
- createdAt: output.createdAt != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.createdAt)) : undefined,
4338
- id: __expectString(output.id),
4339
- lastUpdatedAt: output.lastUpdatedAt != null
4340
- ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.lastUpdatedAt))
4341
- : undefined,
4342
- name: __expectString(output.name),
4343
- port: __expectInt32(output.port),
4344
- protocol: __expectString(output.protocol),
4345
- };
3733
+ return take(output, {
3734
+ arn: __expectString,
3735
+ createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
3736
+ id: __expectString,
3737
+ lastUpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
3738
+ name: __expectString,
3739
+ port: __expectInt32,
3740
+ protocol: __expectString,
3741
+ });
4346
3742
  };
4347
3743
  const de_ListenerSummaryList = (output, context) => {
4348
3744
  const retVal = (output || [])
4349
3745
  .filter((e) => e != null)
4350
3746
  .map((entry) => {
4351
- if (entry === null) {
4352
- return null;
4353
- }
4354
3747
  return de_ListenerSummary(entry, context);
4355
3748
  });
4356
3749
  return retVal;
4357
3750
  };
4358
- const de_Matcher = (output, context) => {
4359
- if (__expectString(output.httpCode) !== undefined) {
4360
- return { httpCode: __expectString(output.httpCode) };
4361
- }
4362
- return { $unknown: Object.entries(output)[0] };
4363
- };
4364
- const de_PathMatch = (output, context) => {
4365
- return {
4366
- caseSensitive: __expectBoolean(output.caseSensitive),
4367
- match: output.match != null ? de_PathMatchType(__expectUnion(output.match), context) : undefined,
4368
- };
4369
- };
4370
- const de_PathMatchType = (output, context) => {
4371
- if (__expectString(output.exact) !== undefined) {
4372
- return { exact: __expectString(output.exact) };
4373
- }
4374
- if (__expectString(output.prefix) !== undefined) {
4375
- return { prefix: __expectString(output.prefix) };
4376
- }
4377
- return { $unknown: Object.entries(output)[0] };
4378
- };
4379
- const de_RuleAction = (output, context) => {
4380
- if (output.fixedResponse != null) {
4381
- return {
4382
- fixedResponse: de_FixedResponseAction(output.fixedResponse, context),
4383
- };
4384
- }
4385
- if (output.forward != null) {
4386
- return {
4387
- forward: de_ForwardAction(output.forward, context),
4388
- };
4389
- }
4390
- return { $unknown: Object.entries(output)[0] };
4391
- };
4392
- const de_RuleMatch = (output, context) => {
4393
- if (output.httpMatch != null) {
4394
- return {
4395
- httpMatch: de_HttpMatch(output.httpMatch, context),
4396
- };
4397
- }
4398
- return { $unknown: Object.entries(output)[0] };
4399
- };
4400
3751
  const de_RuleSummary = (output, context) => {
4401
- return {
4402
- arn: __expectString(output.arn),
4403
- createdAt: output.createdAt != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.createdAt)) : undefined,
4404
- id: __expectString(output.id),
4405
- isDefault: __expectBoolean(output.isDefault),
4406
- lastUpdatedAt: output.lastUpdatedAt != null
4407
- ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.lastUpdatedAt))
4408
- : undefined,
4409
- name: __expectString(output.name),
4410
- priority: __expectInt32(output.priority),
4411
- };
3752
+ return take(output, {
3753
+ arn: __expectString,
3754
+ createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
3755
+ id: __expectString,
3756
+ isDefault: __expectBoolean,
3757
+ lastUpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
3758
+ name: __expectString,
3759
+ priority: __expectInt32,
3760
+ });
4412
3761
  };
4413
3762
  const de_RuleSummaryList = (output, context) => {
4414
3763
  const retVal = (output || [])
4415
3764
  .filter((e) => e != null)
4416
3765
  .map((entry) => {
4417
- if (entry === null) {
4418
- return null;
4419
- }
4420
3766
  return de_RuleSummary(entry, context);
4421
3767
  });
4422
3768
  return retVal;
4423
3769
  };
4424
- const de_RuleUpdateFailure = (output, context) => {
4425
- return {
4426
- failureCode: __expectString(output.failureCode),
4427
- failureMessage: __expectString(output.failureMessage),
4428
- ruleIdentifier: __expectString(output.ruleIdentifier),
4429
- };
4430
- };
4431
- const de_RuleUpdateFailureList = (output, context) => {
4432
- const retVal = (output || [])
4433
- .filter((e) => e != null)
4434
- .map((entry) => {
4435
- if (entry === null) {
4436
- return null;
4437
- }
4438
- return de_RuleUpdateFailure(entry, context);
4439
- });
4440
- return retVal;
4441
- };
4442
- const de_RuleUpdateSuccess = (output, context) => {
4443
- return {
4444
- action: output.action != null ? de_RuleAction(__expectUnion(output.action), context) : undefined,
4445
- arn: __expectString(output.arn),
4446
- id: __expectString(output.id),
4447
- isDefault: __expectBoolean(output.isDefault),
4448
- match: output.match != null ? de_RuleMatch(__expectUnion(output.match), context) : undefined,
4449
- name: __expectString(output.name),
4450
- priority: __expectInt32(output.priority),
4451
- };
4452
- };
4453
- const de_RuleUpdateSuccessList = (output, context) => {
4454
- const retVal = (output || [])
4455
- .filter((e) => e != null)
4456
- .map((entry) => {
4457
- if (entry === null) {
4458
- return null;
4459
- }
4460
- return de_RuleUpdateSuccess(entry, context);
4461
- });
4462
- return retVal;
4463
- };
4464
- const de_SecurityGroupList = (output, context) => {
4465
- const retVal = (output || [])
4466
- .filter((e) => e != null)
4467
- .map((entry) => {
4468
- if (entry === null) {
4469
- return null;
4470
- }
4471
- return __expectString(entry);
4472
- });
4473
- return retVal;
4474
- };
4475
- const de_ServiceArnList = (output, context) => {
4476
- const retVal = (output || [])
4477
- .filter((e) => e != null)
4478
- .map((entry) => {
4479
- if (entry === null) {
4480
- return null;
4481
- }
4482
- return __expectString(entry);
4483
- });
4484
- return retVal;
4485
- };
4486
3770
  const de_ServiceList = (output, context) => {
4487
3771
  const retVal = (output || [])
4488
3772
  .filter((e) => e != null)
4489
3773
  .map((entry) => {
4490
- if (entry === null) {
4491
- return null;
4492
- }
4493
3774
  return de_ServiceSummary(entry, context);
4494
3775
  });
4495
3776
  return retVal;
@@ -4498,9 +3779,6 @@ const de_ServiceNetworkList = (output, context) => {
4498
3779
  const retVal = (output || [])
4499
3780
  .filter((e) => e != null)
4500
3781
  .map((entry) => {
4501
- if (entry === null) {
4502
- return null;
4503
- }
4504
3782
  return de_ServiceNetworkSummary(entry, context);
4505
3783
  });
4506
3784
  return retVal;
@@ -4509,220 +3787,95 @@ const de_ServiceNetworkServiceAssociationList = (output, context) => {
4509
3787
  const retVal = (output || [])
4510
3788
  .filter((e) => e != null)
4511
3789
  .map((entry) => {
4512
- if (entry === null) {
4513
- return null;
4514
- }
4515
3790
  return de_ServiceNetworkServiceAssociationSummary(entry, context);
4516
3791
  });
4517
3792
  return retVal;
4518
3793
  };
4519
3794
  const de_ServiceNetworkServiceAssociationSummary = (output, context) => {
4520
- return {
4521
- arn: __expectString(output.arn),
4522
- createdAt: output.createdAt != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.createdAt)) : undefined,
4523
- createdBy: __expectString(output.createdBy),
4524
- customDomainName: __expectString(output.customDomainName),
4525
- dnsEntry: output.dnsEntry != null ? de_DnsEntry(output.dnsEntry, context) : undefined,
4526
- id: __expectString(output.id),
4527
- serviceArn: __expectString(output.serviceArn),
4528
- serviceId: __expectString(output.serviceId),
4529
- serviceName: __expectString(output.serviceName),
4530
- serviceNetworkArn: __expectString(output.serviceNetworkArn),
4531
- serviceNetworkId: __expectString(output.serviceNetworkId),
4532
- serviceNetworkName: __expectString(output.serviceNetworkName),
4533
- status: __expectString(output.status),
4534
- };
3795
+ return take(output, {
3796
+ arn: __expectString,
3797
+ createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
3798
+ createdBy: __expectString,
3799
+ customDomainName: __expectString,
3800
+ dnsEntry: _json,
3801
+ id: __expectString,
3802
+ serviceArn: __expectString,
3803
+ serviceId: __expectString,
3804
+ serviceName: __expectString,
3805
+ serviceNetworkArn: __expectString,
3806
+ serviceNetworkId: __expectString,
3807
+ serviceNetworkName: __expectString,
3808
+ status: __expectString,
3809
+ });
4535
3810
  };
4536
3811
  const de_ServiceNetworkSummary = (output, context) => {
4537
- return {
4538
- arn: __expectString(output.arn),
4539
- createdAt: output.createdAt != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.createdAt)) : undefined,
4540
- id: __expectString(output.id),
4541
- lastUpdatedAt: output.lastUpdatedAt != null
4542
- ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.lastUpdatedAt))
4543
- : undefined,
4544
- name: __expectString(output.name),
4545
- numberOfAssociatedServices: __expectLong(output.numberOfAssociatedServices),
4546
- numberOfAssociatedVPCs: __expectLong(output.numberOfAssociatedVPCs),
4547
- };
3812
+ return take(output, {
3813
+ arn: __expectString,
3814
+ createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
3815
+ id: __expectString,
3816
+ lastUpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
3817
+ name: __expectString,
3818
+ numberOfAssociatedServices: __expectLong,
3819
+ numberOfAssociatedVPCs: __expectLong,
3820
+ });
4548
3821
  };
4549
3822
  const de_ServiceNetworkVpcAssociationList = (output, context) => {
4550
3823
  const retVal = (output || [])
4551
3824
  .filter((e) => e != null)
4552
3825
  .map((entry) => {
4553
- if (entry === null) {
4554
- return null;
4555
- }
4556
3826
  return de_ServiceNetworkVpcAssociationSummary(entry, context);
4557
3827
  });
4558
3828
  return retVal;
4559
3829
  };
4560
3830
  const de_ServiceNetworkVpcAssociationSummary = (output, context) => {
4561
- return {
4562
- arn: __expectString(output.arn),
4563
- createdAt: output.createdAt != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.createdAt)) : undefined,
4564
- createdBy: __expectString(output.createdBy),
4565
- id: __expectString(output.id),
4566
- lastUpdatedAt: output.lastUpdatedAt != null
4567
- ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.lastUpdatedAt))
4568
- : undefined,
4569
- serviceNetworkArn: __expectString(output.serviceNetworkArn),
4570
- serviceNetworkId: __expectString(output.serviceNetworkId),
4571
- serviceNetworkName: __expectString(output.serviceNetworkName),
4572
- status: __expectString(output.status),
4573
- vpcId: __expectString(output.vpcId),
4574
- };
3831
+ return take(output, {
3832
+ arn: __expectString,
3833
+ createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
3834
+ createdBy: __expectString,
3835
+ id: __expectString,
3836
+ lastUpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
3837
+ serviceNetworkArn: __expectString,
3838
+ serviceNetworkId: __expectString,
3839
+ serviceNetworkName: __expectString,
3840
+ status: __expectString,
3841
+ vpcId: __expectString,
3842
+ });
4575
3843
  };
4576
3844
  const de_ServiceSummary = (output, context) => {
4577
- return {
4578
- arn: __expectString(output.arn),
4579
- createdAt: output.createdAt != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.createdAt)) : undefined,
4580
- customDomainName: __expectString(output.customDomainName),
4581
- dnsEntry: output.dnsEntry != null ? de_DnsEntry(output.dnsEntry, context) : undefined,
4582
- id: __expectString(output.id),
4583
- lastUpdatedAt: output.lastUpdatedAt != null
4584
- ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.lastUpdatedAt))
4585
- : undefined,
4586
- name: __expectString(output.name),
4587
- status: __expectString(output.status),
4588
- };
4589
- };
4590
- const de_TagMap = (output, context) => {
4591
- return Object.entries(output).reduce((acc, [key, value]) => {
4592
- if (value === null) {
4593
- return acc;
4594
- }
4595
- acc[key] = __expectString(value);
4596
- return acc;
4597
- }, {});
4598
- };
4599
- const de_Target = (output, context) => {
4600
- return {
4601
- id: __expectString(output.id),
4602
- port: __expectInt32(output.port),
4603
- };
4604
- };
4605
- const de_TargetFailure = (output, context) => {
4606
- return {
4607
- failureCode: __expectString(output.failureCode),
4608
- failureMessage: __expectString(output.failureMessage),
4609
- id: __expectString(output.id),
4610
- port: __expectInt32(output.port),
4611
- };
4612
- };
4613
- const de_TargetFailureList = (output, context) => {
4614
- const retVal = (output || [])
4615
- .filter((e) => e != null)
4616
- .map((entry) => {
4617
- if (entry === null) {
4618
- return null;
4619
- }
4620
- return de_TargetFailure(entry, context);
3845
+ return take(output, {
3846
+ arn: __expectString,
3847
+ createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
3848
+ customDomainName: __expectString,
3849
+ dnsEntry: _json,
3850
+ id: __expectString,
3851
+ lastUpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
3852
+ name: __expectString,
3853
+ status: __expectString,
4621
3854
  });
4622
- return retVal;
4623
- };
4624
- const de_TargetGroupConfig = (output, context) => {
4625
- return {
4626
- healthCheck: output.healthCheck != null ? de_HealthCheckConfig(output.healthCheck, context) : undefined,
4627
- ipAddressType: __expectString(output.ipAddressType),
4628
- port: __expectInt32(output.port),
4629
- protocol: __expectString(output.protocol),
4630
- protocolVersion: __expectString(output.protocolVersion),
4631
- vpcIdentifier: __expectString(output.vpcIdentifier),
4632
- };
4633
3855
  };
4634
3856
  const de_TargetGroupList = (output, context) => {
4635
3857
  const retVal = (output || [])
4636
3858
  .filter((e) => e != null)
4637
3859
  .map((entry) => {
4638
- if (entry === null) {
4639
- return null;
4640
- }
4641
3860
  return de_TargetGroupSummary(entry, context);
4642
3861
  });
4643
3862
  return retVal;
4644
3863
  };
4645
3864
  const de_TargetGroupSummary = (output, context) => {
4646
- return {
4647
- arn: __expectString(output.arn),
4648
- createdAt: output.createdAt != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.createdAt)) : undefined,
4649
- id: __expectString(output.id),
4650
- ipAddressType: __expectString(output.ipAddressType),
4651
- lastUpdatedAt: output.lastUpdatedAt != null
4652
- ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.lastUpdatedAt))
4653
- : undefined,
4654
- name: __expectString(output.name),
4655
- port: __expectInt32(output.port),
4656
- protocol: __expectString(output.protocol),
4657
- serviceArns: output.serviceArns != null ? de_ServiceArnList(output.serviceArns, context) : undefined,
4658
- status: __expectString(output.status),
4659
- type: __expectString(output.type),
4660
- vpcIdentifier: __expectString(output.vpcIdentifier),
4661
- };
4662
- };
4663
- const de_TargetList = (output, context) => {
4664
- const retVal = (output || [])
4665
- .filter((e) => e != null)
4666
- .map((entry) => {
4667
- if (entry === null) {
4668
- return null;
4669
- }
4670
- return de_Target(entry, context);
3865
+ return take(output, {
3866
+ arn: __expectString,
3867
+ createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
3868
+ id: __expectString,
3869
+ ipAddressType: __expectString,
3870
+ lastUpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
3871
+ name: __expectString,
3872
+ port: __expectInt32,
3873
+ protocol: __expectString,
3874
+ serviceArns: _json,
3875
+ status: __expectString,
3876
+ type: __expectString,
3877
+ vpcIdentifier: __expectString,
4671
3878
  });
4672
- return retVal;
4673
- };
4674
- const de_TargetSummary = (output, context) => {
4675
- return {
4676
- id: __expectString(output.id),
4677
- port: __expectInt32(output.port),
4678
- reasonCode: __expectString(output.reasonCode),
4679
- status: __expectString(output.status),
4680
- };
4681
- };
4682
- const de_TargetSummaryList = (output, context) => {
4683
- const retVal = (output || [])
4684
- .filter((e) => e != null)
4685
- .map((entry) => {
4686
- if (entry === null) {
4687
- return null;
4688
- }
4689
- return de_TargetSummary(entry, context);
4690
- });
4691
- return retVal;
4692
- };
4693
- const de_ValidationExceptionField = (output, context) => {
4694
- return {
4695
- message: __expectString(output.message),
4696
- name: __expectString(output.name),
4697
- };
4698
- };
4699
- const de_ValidationExceptionFieldList = (output, context) => {
4700
- const retVal = (output || [])
4701
- .filter((e) => e != null)
4702
- .map((entry) => {
4703
- if (entry === null) {
4704
- return null;
4705
- }
4706
- return de_ValidationExceptionField(entry, context);
4707
- });
4708
- return retVal;
4709
- };
4710
- const de_WeightedTargetGroup = (output, context) => {
4711
- return {
4712
- targetGroupIdentifier: __expectString(output.targetGroupIdentifier),
4713
- weight: __expectInt32(output.weight),
4714
- };
4715
- };
4716
- const de_WeightedTargetGroupList = (output, context) => {
4717
- const retVal = (output || [])
4718
- .filter((e) => e != null)
4719
- .map((entry) => {
4720
- if (entry === null) {
4721
- return null;
4722
- }
4723
- return de_WeightedTargetGroup(entry, context);
4724
- });
4725
- return retVal;
4726
3879
  };
4727
3880
  const deserializeMetadata = (output) => ({
4728
3881
  httpStatusCode: output.statusCode,