@aws-sdk/client-app-mesh 3.137.0 → 3.145.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,11 +1,11 @@
1
1
  import { __assign, __awaiter, __generator } from "tslib";
2
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
- import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, expectUnion as __expectUnion, extendedEncodeURIComponent as __extendedEncodeURIComponent, parseEpochTimestamp as __parseEpochTimestamp, } from "@aws-sdk/smithy-client";
3
+ import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, expectUnion as __expectUnion, map as __map, parseEpochTimestamp as __parseEpochTimestamp, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
4
4
  import { v4 as generateIdempotencyToken } from "uuid";
5
5
  import { AppMeshServiceException as __BaseException } from "../models/AppMeshServiceException";
6
6
  import { AccessLog, Backend, BadRequestException, ClientTlsCertificate, ConflictException, ForbiddenException, GrpcMetadataMatchMethod, GrpcRouteMetadataMatchMethod, HeaderMatchMethod, InternalServerErrorException, LimitExceededException, ListenerTimeout, ListenerTlsCertificate, ListenerTlsValidationContextTrust, NotFoundException, ResourceInUseException, ServiceDiscovery, ServiceUnavailableException, TlsValidationContextTrust, TooManyRequestsException, TooManyTagsException, VirtualGatewayAccessLog, VirtualGatewayClientTlsCertificate, VirtualGatewayConnectionPool, VirtualGatewayListenerTlsCertificate, VirtualGatewayListenerTlsValidationContextTrust, VirtualGatewayTlsValidationContextTrust, VirtualNodeConnectionPool, VirtualServiceProvider, } from "../models/models_0";
7
7
  export var serializeAws_restJson1CreateGatewayRouteCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
8
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, query, body;
8
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
9
9
  var _c;
10
10
  return __generator(this, function (_d) {
11
11
  switch (_d.label) {
@@ -17,27 +17,11 @@ export var serializeAws_restJson1CreateGatewayRouteCommand = function (input, co
17
17
  };
18
18
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
19
19
  "/v20190125/meshes/{meshName}/virtualGateway/{virtualGatewayName}/gatewayRoutes";
20
- if (input.meshName !== undefined) {
21
- labelValue = input.meshName;
22
- if (labelValue.length <= 0) {
23
- throw new Error("Empty value provided for input HTTP label: meshName.");
24
- }
25
- resolvedPath = resolvedPath.replace("{meshName}", __extendedEncodeURIComponent(labelValue));
26
- }
27
- else {
28
- throw new Error("No value provided for input HTTP label: meshName.");
29
- }
30
- if (input.virtualGatewayName !== undefined) {
31
- labelValue = input.virtualGatewayName;
32
- if (labelValue.length <= 0) {
33
- throw new Error("Empty value provided for input HTTP label: virtualGatewayName.");
34
- }
35
- resolvedPath = resolvedPath.replace("{virtualGatewayName}", __extendedEncodeURIComponent(labelValue));
36
- }
37
- else {
38
- throw new Error("No value provided for input HTTP label: virtualGatewayName.");
39
- }
40
- query = __assign({}, (input.meshOwner !== undefined && { meshOwner: input.meshOwner }));
20
+ resolvedPath = __resolvedPath(resolvedPath, input, "meshName", function () { return input.meshName; }, "{meshName}", false);
21
+ resolvedPath = __resolvedPath(resolvedPath, input, "virtualGatewayName", function () { return input.virtualGatewayName; }, "{virtualGatewayName}", false);
22
+ query = map({
23
+ meshOwner: [, input.meshOwner],
24
+ });
41
25
  body = JSON.stringify(__assign(__assign(__assign({ clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.gatewayRouteName != null && { gatewayRouteName: input.gatewayRouteName })), (input.spec != null && { spec: serializeAws_restJson1GatewayRouteSpec(input.spec, context) })), (input.tags != null && { tags: serializeAws_restJson1TagList(input.tags, context) })));
42
26
  return [2, new __HttpRequest({
43
27
  protocol: protocol,
@@ -78,7 +62,7 @@ export var serializeAws_restJson1CreateMeshCommand = function (input, context) {
78
62
  });
79
63
  }); };
80
64
  export var serializeAws_restJson1CreateRouteCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
81
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, query, body;
65
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
82
66
  var _c;
83
67
  return __generator(this, function (_d) {
84
68
  switch (_d.label) {
@@ -90,27 +74,11 @@ export var serializeAws_restJson1CreateRouteCommand = function (input, context)
90
74
  };
91
75
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
92
76
  "/v20190125/meshes/{meshName}/virtualRouter/{virtualRouterName}/routes";
93
- if (input.meshName !== undefined) {
94
- labelValue = input.meshName;
95
- if (labelValue.length <= 0) {
96
- throw new Error("Empty value provided for input HTTP label: meshName.");
97
- }
98
- resolvedPath = resolvedPath.replace("{meshName}", __extendedEncodeURIComponent(labelValue));
99
- }
100
- else {
101
- throw new Error("No value provided for input HTTP label: meshName.");
102
- }
103
- if (input.virtualRouterName !== undefined) {
104
- labelValue = input.virtualRouterName;
105
- if (labelValue.length <= 0) {
106
- throw new Error("Empty value provided for input HTTP label: virtualRouterName.");
107
- }
108
- resolvedPath = resolvedPath.replace("{virtualRouterName}", __extendedEncodeURIComponent(labelValue));
109
- }
110
- else {
111
- throw new Error("No value provided for input HTTP label: virtualRouterName.");
112
- }
113
- query = __assign({}, (input.meshOwner !== undefined && { meshOwner: input.meshOwner }));
77
+ resolvedPath = __resolvedPath(resolvedPath, input, "meshName", function () { return input.meshName; }, "{meshName}", false);
78
+ resolvedPath = __resolvedPath(resolvedPath, input, "virtualRouterName", function () { return input.virtualRouterName; }, "{virtualRouterName}", false);
79
+ query = map({
80
+ meshOwner: [, input.meshOwner],
81
+ });
114
82
  body = JSON.stringify(__assign(__assign(__assign({ clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.routeName != null && { routeName: input.routeName })), (input.spec != null && { spec: serializeAws_restJson1RouteSpec(input.spec, context) })), (input.tags != null && { tags: serializeAws_restJson1TagList(input.tags, context) })));
115
83
  return [2, new __HttpRequest({
116
84
  protocol: protocol,
@@ -126,7 +94,7 @@ export var serializeAws_restJson1CreateRouteCommand = function (input, context)
126
94
  });
127
95
  }); };
128
96
  export var serializeAws_restJson1CreateVirtualGatewayCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
129
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
97
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
130
98
  var _c;
131
99
  return __generator(this, function (_d) {
132
100
  switch (_d.label) {
@@ -138,17 +106,10 @@ export var serializeAws_restJson1CreateVirtualGatewayCommand = function (input,
138
106
  };
139
107
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
140
108
  "/v20190125/meshes/{meshName}/virtualGateways";
141
- if (input.meshName !== undefined) {
142
- labelValue = input.meshName;
143
- if (labelValue.length <= 0) {
144
- throw new Error("Empty value provided for input HTTP label: meshName.");
145
- }
146
- resolvedPath = resolvedPath.replace("{meshName}", __extendedEncodeURIComponent(labelValue));
147
- }
148
- else {
149
- throw new Error("No value provided for input HTTP label: meshName.");
150
- }
151
- query = __assign({}, (input.meshOwner !== undefined && { meshOwner: input.meshOwner }));
109
+ resolvedPath = __resolvedPath(resolvedPath, input, "meshName", function () { return input.meshName; }, "{meshName}", false);
110
+ query = map({
111
+ meshOwner: [, input.meshOwner],
112
+ });
152
113
  body = JSON.stringify(__assign(__assign(__assign({ clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.spec != null && { spec: serializeAws_restJson1VirtualGatewaySpec(input.spec, context) })), (input.tags != null && { tags: serializeAws_restJson1TagList(input.tags, context) })), (input.virtualGatewayName != null && { virtualGatewayName: input.virtualGatewayName })));
153
114
  return [2, new __HttpRequest({
154
115
  protocol: protocol,
@@ -164,7 +125,7 @@ export var serializeAws_restJson1CreateVirtualGatewayCommand = function (input,
164
125
  });
165
126
  }); };
166
127
  export var serializeAws_restJson1CreateVirtualNodeCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
167
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
128
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
168
129
  var _c;
169
130
  return __generator(this, function (_d) {
170
131
  switch (_d.label) {
@@ -175,17 +136,10 @@ export var serializeAws_restJson1CreateVirtualNodeCommand = function (input, con
175
136
  "content-type": "application/json",
176
137
  };
177
138
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v20190125/meshes/{meshName}/virtualNodes";
178
- if (input.meshName !== undefined) {
179
- labelValue = input.meshName;
180
- if (labelValue.length <= 0) {
181
- throw new Error("Empty value provided for input HTTP label: meshName.");
182
- }
183
- resolvedPath = resolvedPath.replace("{meshName}", __extendedEncodeURIComponent(labelValue));
184
- }
185
- else {
186
- throw new Error("No value provided for input HTTP label: meshName.");
187
- }
188
- query = __assign({}, (input.meshOwner !== undefined && { meshOwner: input.meshOwner }));
139
+ resolvedPath = __resolvedPath(resolvedPath, input, "meshName", function () { return input.meshName; }, "{meshName}", false);
140
+ query = map({
141
+ meshOwner: [, input.meshOwner],
142
+ });
189
143
  body = JSON.stringify(__assign(__assign(__assign({ clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.spec != null && { spec: serializeAws_restJson1VirtualNodeSpec(input.spec, context) })), (input.tags != null && { tags: serializeAws_restJson1TagList(input.tags, context) })), (input.virtualNodeName != null && { virtualNodeName: input.virtualNodeName })));
190
144
  return [2, new __HttpRequest({
191
145
  protocol: protocol,
@@ -201,7 +155,7 @@ export var serializeAws_restJson1CreateVirtualNodeCommand = function (input, con
201
155
  });
202
156
  }); };
203
157
  export var serializeAws_restJson1CreateVirtualRouterCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
204
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
158
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
205
159
  var _c;
206
160
  return __generator(this, function (_d) {
207
161
  switch (_d.label) {
@@ -213,17 +167,10 @@ export var serializeAws_restJson1CreateVirtualRouterCommand = function (input, c
213
167
  };
214
168
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
215
169
  "/v20190125/meshes/{meshName}/virtualRouters";
216
- if (input.meshName !== undefined) {
217
- labelValue = input.meshName;
218
- if (labelValue.length <= 0) {
219
- throw new Error("Empty value provided for input HTTP label: meshName.");
220
- }
221
- resolvedPath = resolvedPath.replace("{meshName}", __extendedEncodeURIComponent(labelValue));
222
- }
223
- else {
224
- throw new Error("No value provided for input HTTP label: meshName.");
225
- }
226
- query = __assign({}, (input.meshOwner !== undefined && { meshOwner: input.meshOwner }));
170
+ resolvedPath = __resolvedPath(resolvedPath, input, "meshName", function () { return input.meshName; }, "{meshName}", false);
171
+ query = map({
172
+ meshOwner: [, input.meshOwner],
173
+ });
227
174
  body = JSON.stringify(__assign(__assign(__assign({ clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.spec != null && { spec: serializeAws_restJson1VirtualRouterSpec(input.spec, context) })), (input.tags != null && { tags: serializeAws_restJson1TagList(input.tags, context) })), (input.virtualRouterName != null && { virtualRouterName: input.virtualRouterName })));
228
175
  return [2, new __HttpRequest({
229
176
  protocol: protocol,
@@ -239,7 +186,7 @@ export var serializeAws_restJson1CreateVirtualRouterCommand = function (input, c
239
186
  });
240
187
  }); };
241
188
  export var serializeAws_restJson1CreateVirtualServiceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
242
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
189
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
243
190
  var _c;
244
191
  return __generator(this, function (_d) {
245
192
  switch (_d.label) {
@@ -251,17 +198,10 @@ export var serializeAws_restJson1CreateVirtualServiceCommand = function (input,
251
198
  };
252
199
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
253
200
  "/v20190125/meshes/{meshName}/virtualServices";
254
- if (input.meshName !== undefined) {
255
- labelValue = input.meshName;
256
- if (labelValue.length <= 0) {
257
- throw new Error("Empty value provided for input HTTP label: meshName.");
258
- }
259
- resolvedPath = resolvedPath.replace("{meshName}", __extendedEncodeURIComponent(labelValue));
260
- }
261
- else {
262
- throw new Error("No value provided for input HTTP label: meshName.");
263
- }
264
- query = __assign({}, (input.meshOwner !== undefined && { meshOwner: input.meshOwner }));
201
+ resolvedPath = __resolvedPath(resolvedPath, input, "meshName", function () { return input.meshName; }, "{meshName}", false);
202
+ query = map({
203
+ meshOwner: [, input.meshOwner],
204
+ });
265
205
  body = JSON.stringify(__assign(__assign(__assign({ clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.spec != null && { spec: serializeAws_restJson1VirtualServiceSpec(input.spec, context) })), (input.tags != null && { tags: serializeAws_restJson1TagList(input.tags, context) })), (input.virtualServiceName != null && { virtualServiceName: input.virtualServiceName })));
266
206
  return [2, new __HttpRequest({
267
207
  protocol: protocol,
@@ -277,7 +217,7 @@ export var serializeAws_restJson1CreateVirtualServiceCommand = function (input,
277
217
  });
278
218
  }); };
279
219
  export var serializeAws_restJson1DeleteGatewayRouteCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
280
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, labelValue, query, body;
220
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
281
221
  return __generator(this, function (_c) {
282
222
  switch (_c.label) {
283
223
  case 0: return [4, context.endpoint()];
@@ -286,37 +226,12 @@ export var serializeAws_restJson1DeleteGatewayRouteCommand = function (input, co
286
226
  headers = {};
287
227
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
288
228
  "/v20190125/meshes/{meshName}/virtualGateway/{virtualGatewayName}/gatewayRoutes/{gatewayRouteName}";
289
- if (input.gatewayRouteName !== undefined) {
290
- labelValue = input.gatewayRouteName;
291
- if (labelValue.length <= 0) {
292
- throw new Error("Empty value provided for input HTTP label: gatewayRouteName.");
293
- }
294
- resolvedPath = resolvedPath.replace("{gatewayRouteName}", __extendedEncodeURIComponent(labelValue));
295
- }
296
- else {
297
- throw new Error("No value provided for input HTTP label: gatewayRouteName.");
298
- }
299
- if (input.meshName !== undefined) {
300
- labelValue = input.meshName;
301
- if (labelValue.length <= 0) {
302
- throw new Error("Empty value provided for input HTTP label: meshName.");
303
- }
304
- resolvedPath = resolvedPath.replace("{meshName}", __extendedEncodeURIComponent(labelValue));
305
- }
306
- else {
307
- throw new Error("No value provided for input HTTP label: meshName.");
308
- }
309
- if (input.virtualGatewayName !== undefined) {
310
- labelValue = input.virtualGatewayName;
311
- if (labelValue.length <= 0) {
312
- throw new Error("Empty value provided for input HTTP label: virtualGatewayName.");
313
- }
314
- resolvedPath = resolvedPath.replace("{virtualGatewayName}", __extendedEncodeURIComponent(labelValue));
315
- }
316
- else {
317
- throw new Error("No value provided for input HTTP label: virtualGatewayName.");
318
- }
319
- query = __assign({}, (input.meshOwner !== undefined && { meshOwner: input.meshOwner }));
229
+ resolvedPath = __resolvedPath(resolvedPath, input, "gatewayRouteName", function () { return input.gatewayRouteName; }, "{gatewayRouteName}", false);
230
+ resolvedPath = __resolvedPath(resolvedPath, input, "meshName", function () { return input.meshName; }, "{meshName}", false);
231
+ resolvedPath = __resolvedPath(resolvedPath, input, "virtualGatewayName", function () { return input.virtualGatewayName; }, "{virtualGatewayName}", false);
232
+ query = map({
233
+ meshOwner: [, input.meshOwner],
234
+ });
320
235
  return [2, new __HttpRequest({
321
236
  protocol: protocol,
322
237
  hostname: hostname,
@@ -331,7 +246,7 @@ export var serializeAws_restJson1DeleteGatewayRouteCommand = function (input, co
331
246
  });
332
247
  }); };
333
248
  export var serializeAws_restJson1DeleteMeshCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
334
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
249
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
335
250
  return __generator(this, function (_c) {
336
251
  switch (_c.label) {
337
252
  case 0: return [4, context.endpoint()];
@@ -339,16 +254,7 @@ export var serializeAws_restJson1DeleteMeshCommand = function (input, context) {
339
254
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
340
255
  headers = {};
341
256
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v20190125/meshes/{meshName}";
342
- if (input.meshName !== undefined) {
343
- labelValue = input.meshName;
344
- if (labelValue.length <= 0) {
345
- throw new Error("Empty value provided for input HTTP label: meshName.");
346
- }
347
- resolvedPath = resolvedPath.replace("{meshName}", __extendedEncodeURIComponent(labelValue));
348
- }
349
- else {
350
- throw new Error("No value provided for input HTTP label: meshName.");
351
- }
257
+ resolvedPath = __resolvedPath(resolvedPath, input, "meshName", function () { return input.meshName; }, "{meshName}", false);
352
258
  return [2, new __HttpRequest({
353
259
  protocol: protocol,
354
260
  hostname: hostname,
@@ -362,7 +268,7 @@ export var serializeAws_restJson1DeleteMeshCommand = function (input, context) {
362
268
  });
363
269
  }); };
364
270
  export var serializeAws_restJson1DeleteRouteCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
365
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, labelValue, query, body;
271
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
366
272
  return __generator(this, function (_c) {
367
273
  switch (_c.label) {
368
274
  case 0: return [4, context.endpoint()];
@@ -371,37 +277,12 @@ export var serializeAws_restJson1DeleteRouteCommand = function (input, context)
371
277
  headers = {};
372
278
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
373
279
  "/v20190125/meshes/{meshName}/virtualRouter/{virtualRouterName}/routes/{routeName}";
374
- if (input.routeName !== undefined) {
375
- labelValue = input.routeName;
376
- if (labelValue.length <= 0) {
377
- throw new Error("Empty value provided for input HTTP label: routeName.");
378
- }
379
- resolvedPath = resolvedPath.replace("{routeName}", __extendedEncodeURIComponent(labelValue));
380
- }
381
- else {
382
- throw new Error("No value provided for input HTTP label: routeName.");
383
- }
384
- if (input.meshName !== undefined) {
385
- labelValue = input.meshName;
386
- if (labelValue.length <= 0) {
387
- throw new Error("Empty value provided for input HTTP label: meshName.");
388
- }
389
- resolvedPath = resolvedPath.replace("{meshName}", __extendedEncodeURIComponent(labelValue));
390
- }
391
- else {
392
- throw new Error("No value provided for input HTTP label: meshName.");
393
- }
394
- if (input.virtualRouterName !== undefined) {
395
- labelValue = input.virtualRouterName;
396
- if (labelValue.length <= 0) {
397
- throw new Error("Empty value provided for input HTTP label: virtualRouterName.");
398
- }
399
- resolvedPath = resolvedPath.replace("{virtualRouterName}", __extendedEncodeURIComponent(labelValue));
400
- }
401
- else {
402
- throw new Error("No value provided for input HTTP label: virtualRouterName.");
403
- }
404
- query = __assign({}, (input.meshOwner !== undefined && { meshOwner: input.meshOwner }));
280
+ resolvedPath = __resolvedPath(resolvedPath, input, "routeName", function () { return input.routeName; }, "{routeName}", false);
281
+ resolvedPath = __resolvedPath(resolvedPath, input, "meshName", function () { return input.meshName; }, "{meshName}", false);
282
+ resolvedPath = __resolvedPath(resolvedPath, input, "virtualRouterName", function () { return input.virtualRouterName; }, "{virtualRouterName}", false);
283
+ query = map({
284
+ meshOwner: [, input.meshOwner],
285
+ });
405
286
  return [2, new __HttpRequest({
406
287
  protocol: protocol,
407
288
  hostname: hostname,
@@ -416,7 +297,7 @@ export var serializeAws_restJson1DeleteRouteCommand = function (input, context)
416
297
  });
417
298
  }); };
418
299
  export var serializeAws_restJson1DeleteVirtualGatewayCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
419
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, query, body;
300
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
420
301
  return __generator(this, function (_c) {
421
302
  switch (_c.label) {
422
303
  case 0: return [4, context.endpoint()];
@@ -425,27 +306,11 @@ export var serializeAws_restJson1DeleteVirtualGatewayCommand = function (input,
425
306
  headers = {};
426
307
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
427
308
  "/v20190125/meshes/{meshName}/virtualGateways/{virtualGatewayName}";
428
- if (input.virtualGatewayName !== undefined) {
429
- labelValue = input.virtualGatewayName;
430
- if (labelValue.length <= 0) {
431
- throw new Error("Empty value provided for input HTTP label: virtualGatewayName.");
432
- }
433
- resolvedPath = resolvedPath.replace("{virtualGatewayName}", __extendedEncodeURIComponent(labelValue));
434
- }
435
- else {
436
- throw new Error("No value provided for input HTTP label: virtualGatewayName.");
437
- }
438
- if (input.meshName !== undefined) {
439
- labelValue = input.meshName;
440
- if (labelValue.length <= 0) {
441
- throw new Error("Empty value provided for input HTTP label: meshName.");
442
- }
443
- resolvedPath = resolvedPath.replace("{meshName}", __extendedEncodeURIComponent(labelValue));
444
- }
445
- else {
446
- throw new Error("No value provided for input HTTP label: meshName.");
447
- }
448
- query = __assign({}, (input.meshOwner !== undefined && { meshOwner: input.meshOwner }));
309
+ resolvedPath = __resolvedPath(resolvedPath, input, "virtualGatewayName", function () { return input.virtualGatewayName; }, "{virtualGatewayName}", false);
310
+ resolvedPath = __resolvedPath(resolvedPath, input, "meshName", function () { return input.meshName; }, "{meshName}", false);
311
+ query = map({
312
+ meshOwner: [, input.meshOwner],
313
+ });
449
314
  return [2, new __HttpRequest({
450
315
  protocol: protocol,
451
316
  hostname: hostname,
@@ -460,7 +325,7 @@ export var serializeAws_restJson1DeleteVirtualGatewayCommand = function (input,
460
325
  });
461
326
  }); };
462
327
  export var serializeAws_restJson1DeleteVirtualNodeCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
463
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, query, body;
328
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
464
329
  return __generator(this, function (_c) {
465
330
  switch (_c.label) {
466
331
  case 0: return [4, context.endpoint()];
@@ -469,27 +334,11 @@ export var serializeAws_restJson1DeleteVirtualNodeCommand = function (input, con
469
334
  headers = {};
470
335
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
471
336
  "/v20190125/meshes/{meshName}/virtualNodes/{virtualNodeName}";
472
- if (input.virtualNodeName !== undefined) {
473
- labelValue = input.virtualNodeName;
474
- if (labelValue.length <= 0) {
475
- throw new Error("Empty value provided for input HTTP label: virtualNodeName.");
476
- }
477
- resolvedPath = resolvedPath.replace("{virtualNodeName}", __extendedEncodeURIComponent(labelValue));
478
- }
479
- else {
480
- throw new Error("No value provided for input HTTP label: virtualNodeName.");
481
- }
482
- if (input.meshName !== undefined) {
483
- labelValue = input.meshName;
484
- if (labelValue.length <= 0) {
485
- throw new Error("Empty value provided for input HTTP label: meshName.");
486
- }
487
- resolvedPath = resolvedPath.replace("{meshName}", __extendedEncodeURIComponent(labelValue));
488
- }
489
- else {
490
- throw new Error("No value provided for input HTTP label: meshName.");
491
- }
492
- query = __assign({}, (input.meshOwner !== undefined && { meshOwner: input.meshOwner }));
337
+ resolvedPath = __resolvedPath(resolvedPath, input, "virtualNodeName", function () { return input.virtualNodeName; }, "{virtualNodeName}", false);
338
+ resolvedPath = __resolvedPath(resolvedPath, input, "meshName", function () { return input.meshName; }, "{meshName}", false);
339
+ query = map({
340
+ meshOwner: [, input.meshOwner],
341
+ });
493
342
  return [2, new __HttpRequest({
494
343
  protocol: protocol,
495
344
  hostname: hostname,
@@ -504,7 +353,7 @@ export var serializeAws_restJson1DeleteVirtualNodeCommand = function (input, con
504
353
  });
505
354
  }); };
506
355
  export var serializeAws_restJson1DeleteVirtualRouterCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
507
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, query, body;
356
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
508
357
  return __generator(this, function (_c) {
509
358
  switch (_c.label) {
510
359
  case 0: return [4, context.endpoint()];
@@ -513,27 +362,11 @@ export var serializeAws_restJson1DeleteVirtualRouterCommand = function (input, c
513
362
  headers = {};
514
363
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
515
364
  "/v20190125/meshes/{meshName}/virtualRouters/{virtualRouterName}";
516
- if (input.virtualRouterName !== undefined) {
517
- labelValue = input.virtualRouterName;
518
- if (labelValue.length <= 0) {
519
- throw new Error("Empty value provided for input HTTP label: virtualRouterName.");
520
- }
521
- resolvedPath = resolvedPath.replace("{virtualRouterName}", __extendedEncodeURIComponent(labelValue));
522
- }
523
- else {
524
- throw new Error("No value provided for input HTTP label: virtualRouterName.");
525
- }
526
- if (input.meshName !== undefined) {
527
- labelValue = input.meshName;
528
- if (labelValue.length <= 0) {
529
- throw new Error("Empty value provided for input HTTP label: meshName.");
530
- }
531
- resolvedPath = resolvedPath.replace("{meshName}", __extendedEncodeURIComponent(labelValue));
532
- }
533
- else {
534
- throw new Error("No value provided for input HTTP label: meshName.");
535
- }
536
- query = __assign({}, (input.meshOwner !== undefined && { meshOwner: input.meshOwner }));
365
+ resolvedPath = __resolvedPath(resolvedPath, input, "virtualRouterName", function () { return input.virtualRouterName; }, "{virtualRouterName}", false);
366
+ resolvedPath = __resolvedPath(resolvedPath, input, "meshName", function () { return input.meshName; }, "{meshName}", false);
367
+ query = map({
368
+ meshOwner: [, input.meshOwner],
369
+ });
537
370
  return [2, new __HttpRequest({
538
371
  protocol: protocol,
539
372
  hostname: hostname,
@@ -548,7 +381,7 @@ export var serializeAws_restJson1DeleteVirtualRouterCommand = function (input, c
548
381
  });
549
382
  }); };
550
383
  export var serializeAws_restJson1DeleteVirtualServiceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
551
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, query, body;
384
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
552
385
  return __generator(this, function (_c) {
553
386
  switch (_c.label) {
554
387
  case 0: return [4, context.endpoint()];
@@ -557,27 +390,11 @@ export var serializeAws_restJson1DeleteVirtualServiceCommand = function (input,
557
390
  headers = {};
558
391
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
559
392
  "/v20190125/meshes/{meshName}/virtualServices/{virtualServiceName}";
560
- if (input.virtualServiceName !== undefined) {
561
- labelValue = input.virtualServiceName;
562
- if (labelValue.length <= 0) {
563
- throw new Error("Empty value provided for input HTTP label: virtualServiceName.");
564
- }
565
- resolvedPath = resolvedPath.replace("{virtualServiceName}", __extendedEncodeURIComponent(labelValue));
566
- }
567
- else {
568
- throw new Error("No value provided for input HTTP label: virtualServiceName.");
569
- }
570
- if (input.meshName !== undefined) {
571
- labelValue = input.meshName;
572
- if (labelValue.length <= 0) {
573
- throw new Error("Empty value provided for input HTTP label: meshName.");
574
- }
575
- resolvedPath = resolvedPath.replace("{meshName}", __extendedEncodeURIComponent(labelValue));
576
- }
577
- else {
578
- throw new Error("No value provided for input HTTP label: meshName.");
579
- }
580
- query = __assign({}, (input.meshOwner !== undefined && { meshOwner: input.meshOwner }));
393
+ resolvedPath = __resolvedPath(resolvedPath, input, "virtualServiceName", function () { return input.virtualServiceName; }, "{virtualServiceName}", false);
394
+ resolvedPath = __resolvedPath(resolvedPath, input, "meshName", function () { return input.meshName; }, "{meshName}", false);
395
+ query = map({
396
+ meshOwner: [, input.meshOwner],
397
+ });
581
398
  return [2, new __HttpRequest({
582
399
  protocol: protocol,
583
400
  hostname: hostname,
@@ -592,7 +409,7 @@ export var serializeAws_restJson1DeleteVirtualServiceCommand = function (input,
592
409
  });
593
410
  }); };
594
411
  export var serializeAws_restJson1DescribeGatewayRouteCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
595
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, labelValue, query, body;
412
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
596
413
  return __generator(this, function (_c) {
597
414
  switch (_c.label) {
598
415
  case 0: return [4, context.endpoint()];
@@ -601,37 +418,12 @@ export var serializeAws_restJson1DescribeGatewayRouteCommand = function (input,
601
418
  headers = {};
602
419
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
603
420
  "/v20190125/meshes/{meshName}/virtualGateway/{virtualGatewayName}/gatewayRoutes/{gatewayRouteName}";
604
- if (input.gatewayRouteName !== undefined) {
605
- labelValue = input.gatewayRouteName;
606
- if (labelValue.length <= 0) {
607
- throw new Error("Empty value provided for input HTTP label: gatewayRouteName.");
608
- }
609
- resolvedPath = resolvedPath.replace("{gatewayRouteName}", __extendedEncodeURIComponent(labelValue));
610
- }
611
- else {
612
- throw new Error("No value provided for input HTTP label: gatewayRouteName.");
613
- }
614
- if (input.meshName !== undefined) {
615
- labelValue = input.meshName;
616
- if (labelValue.length <= 0) {
617
- throw new Error("Empty value provided for input HTTP label: meshName.");
618
- }
619
- resolvedPath = resolvedPath.replace("{meshName}", __extendedEncodeURIComponent(labelValue));
620
- }
621
- else {
622
- throw new Error("No value provided for input HTTP label: meshName.");
623
- }
624
- if (input.virtualGatewayName !== undefined) {
625
- labelValue = input.virtualGatewayName;
626
- if (labelValue.length <= 0) {
627
- throw new Error("Empty value provided for input HTTP label: virtualGatewayName.");
628
- }
629
- resolvedPath = resolvedPath.replace("{virtualGatewayName}", __extendedEncodeURIComponent(labelValue));
630
- }
631
- else {
632
- throw new Error("No value provided for input HTTP label: virtualGatewayName.");
633
- }
634
- query = __assign({}, (input.meshOwner !== undefined && { meshOwner: input.meshOwner }));
421
+ resolvedPath = __resolvedPath(resolvedPath, input, "gatewayRouteName", function () { return input.gatewayRouteName; }, "{gatewayRouteName}", false);
422
+ resolvedPath = __resolvedPath(resolvedPath, input, "meshName", function () { return input.meshName; }, "{meshName}", false);
423
+ resolvedPath = __resolvedPath(resolvedPath, input, "virtualGatewayName", function () { return input.virtualGatewayName; }, "{virtualGatewayName}", false);
424
+ query = map({
425
+ meshOwner: [, input.meshOwner],
426
+ });
635
427
  return [2, new __HttpRequest({
636
428
  protocol: protocol,
637
429
  hostname: hostname,
@@ -646,7 +438,7 @@ export var serializeAws_restJson1DescribeGatewayRouteCommand = function (input,
646
438
  });
647
439
  }); };
648
440
  export var serializeAws_restJson1DescribeMeshCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
649
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
441
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
650
442
  return __generator(this, function (_c) {
651
443
  switch (_c.label) {
652
444
  case 0: return [4, context.endpoint()];
@@ -654,17 +446,10 @@ export var serializeAws_restJson1DescribeMeshCommand = function (input, context)
654
446
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
655
447
  headers = {};
656
448
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v20190125/meshes/{meshName}";
657
- if (input.meshName !== undefined) {
658
- labelValue = input.meshName;
659
- if (labelValue.length <= 0) {
660
- throw new Error("Empty value provided for input HTTP label: meshName.");
661
- }
662
- resolvedPath = resolvedPath.replace("{meshName}", __extendedEncodeURIComponent(labelValue));
663
- }
664
- else {
665
- throw new Error("No value provided for input HTTP label: meshName.");
666
- }
667
- query = __assign({}, (input.meshOwner !== undefined && { meshOwner: input.meshOwner }));
449
+ resolvedPath = __resolvedPath(resolvedPath, input, "meshName", function () { return input.meshName; }, "{meshName}", false);
450
+ query = map({
451
+ meshOwner: [, input.meshOwner],
452
+ });
668
453
  return [2, new __HttpRequest({
669
454
  protocol: protocol,
670
455
  hostname: hostname,
@@ -679,7 +464,7 @@ export var serializeAws_restJson1DescribeMeshCommand = function (input, context)
679
464
  });
680
465
  }); };
681
466
  export var serializeAws_restJson1DescribeRouteCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
682
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, labelValue, query, body;
467
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
683
468
  return __generator(this, function (_c) {
684
469
  switch (_c.label) {
685
470
  case 0: return [4, context.endpoint()];
@@ -688,37 +473,12 @@ export var serializeAws_restJson1DescribeRouteCommand = function (input, context
688
473
  headers = {};
689
474
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
690
475
  "/v20190125/meshes/{meshName}/virtualRouter/{virtualRouterName}/routes/{routeName}";
691
- if (input.routeName !== undefined) {
692
- labelValue = input.routeName;
693
- if (labelValue.length <= 0) {
694
- throw new Error("Empty value provided for input HTTP label: routeName.");
695
- }
696
- resolvedPath = resolvedPath.replace("{routeName}", __extendedEncodeURIComponent(labelValue));
697
- }
698
- else {
699
- throw new Error("No value provided for input HTTP label: routeName.");
700
- }
701
- if (input.meshName !== undefined) {
702
- labelValue = input.meshName;
703
- if (labelValue.length <= 0) {
704
- throw new Error("Empty value provided for input HTTP label: meshName.");
705
- }
706
- resolvedPath = resolvedPath.replace("{meshName}", __extendedEncodeURIComponent(labelValue));
707
- }
708
- else {
709
- throw new Error("No value provided for input HTTP label: meshName.");
710
- }
711
- if (input.virtualRouterName !== undefined) {
712
- labelValue = input.virtualRouterName;
713
- if (labelValue.length <= 0) {
714
- throw new Error("Empty value provided for input HTTP label: virtualRouterName.");
715
- }
716
- resolvedPath = resolvedPath.replace("{virtualRouterName}", __extendedEncodeURIComponent(labelValue));
717
- }
718
- else {
719
- throw new Error("No value provided for input HTTP label: virtualRouterName.");
720
- }
721
- query = __assign({}, (input.meshOwner !== undefined && { meshOwner: input.meshOwner }));
476
+ resolvedPath = __resolvedPath(resolvedPath, input, "routeName", function () { return input.routeName; }, "{routeName}", false);
477
+ resolvedPath = __resolvedPath(resolvedPath, input, "meshName", function () { return input.meshName; }, "{meshName}", false);
478
+ resolvedPath = __resolvedPath(resolvedPath, input, "virtualRouterName", function () { return input.virtualRouterName; }, "{virtualRouterName}", false);
479
+ query = map({
480
+ meshOwner: [, input.meshOwner],
481
+ });
722
482
  return [2, new __HttpRequest({
723
483
  protocol: protocol,
724
484
  hostname: hostname,
@@ -733,7 +493,7 @@ export var serializeAws_restJson1DescribeRouteCommand = function (input, context
733
493
  });
734
494
  }); };
735
495
  export var serializeAws_restJson1DescribeVirtualGatewayCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
736
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, query, body;
496
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
737
497
  return __generator(this, function (_c) {
738
498
  switch (_c.label) {
739
499
  case 0: return [4, context.endpoint()];
@@ -742,27 +502,11 @@ export var serializeAws_restJson1DescribeVirtualGatewayCommand = function (input
742
502
  headers = {};
743
503
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
744
504
  "/v20190125/meshes/{meshName}/virtualGateways/{virtualGatewayName}";
745
- if (input.virtualGatewayName !== undefined) {
746
- labelValue = input.virtualGatewayName;
747
- if (labelValue.length <= 0) {
748
- throw new Error("Empty value provided for input HTTP label: virtualGatewayName.");
749
- }
750
- resolvedPath = resolvedPath.replace("{virtualGatewayName}", __extendedEncodeURIComponent(labelValue));
751
- }
752
- else {
753
- throw new Error("No value provided for input HTTP label: virtualGatewayName.");
754
- }
755
- if (input.meshName !== undefined) {
756
- labelValue = input.meshName;
757
- if (labelValue.length <= 0) {
758
- throw new Error("Empty value provided for input HTTP label: meshName.");
759
- }
760
- resolvedPath = resolvedPath.replace("{meshName}", __extendedEncodeURIComponent(labelValue));
761
- }
762
- else {
763
- throw new Error("No value provided for input HTTP label: meshName.");
764
- }
765
- query = __assign({}, (input.meshOwner !== undefined && { meshOwner: input.meshOwner }));
505
+ resolvedPath = __resolvedPath(resolvedPath, input, "virtualGatewayName", function () { return input.virtualGatewayName; }, "{virtualGatewayName}", false);
506
+ resolvedPath = __resolvedPath(resolvedPath, input, "meshName", function () { return input.meshName; }, "{meshName}", false);
507
+ query = map({
508
+ meshOwner: [, input.meshOwner],
509
+ });
766
510
  return [2, new __HttpRequest({
767
511
  protocol: protocol,
768
512
  hostname: hostname,
@@ -777,7 +521,7 @@ export var serializeAws_restJson1DescribeVirtualGatewayCommand = function (input
777
521
  });
778
522
  }); };
779
523
  export var serializeAws_restJson1DescribeVirtualNodeCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
780
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, query, body;
524
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
781
525
  return __generator(this, function (_c) {
782
526
  switch (_c.label) {
783
527
  case 0: return [4, context.endpoint()];
@@ -786,27 +530,11 @@ export var serializeAws_restJson1DescribeVirtualNodeCommand = function (input, c
786
530
  headers = {};
787
531
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
788
532
  "/v20190125/meshes/{meshName}/virtualNodes/{virtualNodeName}";
789
- if (input.virtualNodeName !== undefined) {
790
- labelValue = input.virtualNodeName;
791
- if (labelValue.length <= 0) {
792
- throw new Error("Empty value provided for input HTTP label: virtualNodeName.");
793
- }
794
- resolvedPath = resolvedPath.replace("{virtualNodeName}", __extendedEncodeURIComponent(labelValue));
795
- }
796
- else {
797
- throw new Error("No value provided for input HTTP label: virtualNodeName.");
798
- }
799
- if (input.meshName !== undefined) {
800
- labelValue = input.meshName;
801
- if (labelValue.length <= 0) {
802
- throw new Error("Empty value provided for input HTTP label: meshName.");
803
- }
804
- resolvedPath = resolvedPath.replace("{meshName}", __extendedEncodeURIComponent(labelValue));
805
- }
806
- else {
807
- throw new Error("No value provided for input HTTP label: meshName.");
808
- }
809
- query = __assign({}, (input.meshOwner !== undefined && { meshOwner: input.meshOwner }));
533
+ resolvedPath = __resolvedPath(resolvedPath, input, "virtualNodeName", function () { return input.virtualNodeName; }, "{virtualNodeName}", false);
534
+ resolvedPath = __resolvedPath(resolvedPath, input, "meshName", function () { return input.meshName; }, "{meshName}", false);
535
+ query = map({
536
+ meshOwner: [, input.meshOwner],
537
+ });
810
538
  return [2, new __HttpRequest({
811
539
  protocol: protocol,
812
540
  hostname: hostname,
@@ -821,7 +549,7 @@ export var serializeAws_restJson1DescribeVirtualNodeCommand = function (input, c
821
549
  });
822
550
  }); };
823
551
  export var serializeAws_restJson1DescribeVirtualRouterCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
824
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, query, body;
552
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
825
553
  return __generator(this, function (_c) {
826
554
  switch (_c.label) {
827
555
  case 0: return [4, context.endpoint()];
@@ -830,27 +558,11 @@ export var serializeAws_restJson1DescribeVirtualRouterCommand = function (input,
830
558
  headers = {};
831
559
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
832
560
  "/v20190125/meshes/{meshName}/virtualRouters/{virtualRouterName}";
833
- if (input.virtualRouterName !== undefined) {
834
- labelValue = input.virtualRouterName;
835
- if (labelValue.length <= 0) {
836
- throw new Error("Empty value provided for input HTTP label: virtualRouterName.");
837
- }
838
- resolvedPath = resolvedPath.replace("{virtualRouterName}", __extendedEncodeURIComponent(labelValue));
839
- }
840
- else {
841
- throw new Error("No value provided for input HTTP label: virtualRouterName.");
842
- }
843
- if (input.meshName !== undefined) {
844
- labelValue = input.meshName;
845
- if (labelValue.length <= 0) {
846
- throw new Error("Empty value provided for input HTTP label: meshName.");
847
- }
848
- resolvedPath = resolvedPath.replace("{meshName}", __extendedEncodeURIComponent(labelValue));
849
- }
850
- else {
851
- throw new Error("No value provided for input HTTP label: meshName.");
852
- }
853
- query = __assign({}, (input.meshOwner !== undefined && { meshOwner: input.meshOwner }));
561
+ resolvedPath = __resolvedPath(resolvedPath, input, "virtualRouterName", function () { return input.virtualRouterName; }, "{virtualRouterName}", false);
562
+ resolvedPath = __resolvedPath(resolvedPath, input, "meshName", function () { return input.meshName; }, "{meshName}", false);
563
+ query = map({
564
+ meshOwner: [, input.meshOwner],
565
+ });
854
566
  return [2, new __HttpRequest({
855
567
  protocol: protocol,
856
568
  hostname: hostname,
@@ -865,7 +577,7 @@ export var serializeAws_restJson1DescribeVirtualRouterCommand = function (input,
865
577
  });
866
578
  }); };
867
579
  export var serializeAws_restJson1DescribeVirtualServiceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
868
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, query, body;
580
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
869
581
  return __generator(this, function (_c) {
870
582
  switch (_c.label) {
871
583
  case 0: return [4, context.endpoint()];
@@ -874,27 +586,11 @@ export var serializeAws_restJson1DescribeVirtualServiceCommand = function (input
874
586
  headers = {};
875
587
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
876
588
  "/v20190125/meshes/{meshName}/virtualServices/{virtualServiceName}";
877
- if (input.virtualServiceName !== undefined) {
878
- labelValue = input.virtualServiceName;
879
- if (labelValue.length <= 0) {
880
- throw new Error("Empty value provided for input HTTP label: virtualServiceName.");
881
- }
882
- resolvedPath = resolvedPath.replace("{virtualServiceName}", __extendedEncodeURIComponent(labelValue));
883
- }
884
- else {
885
- throw new Error("No value provided for input HTTP label: virtualServiceName.");
886
- }
887
- if (input.meshName !== undefined) {
888
- labelValue = input.meshName;
889
- if (labelValue.length <= 0) {
890
- throw new Error("Empty value provided for input HTTP label: meshName.");
891
- }
892
- resolvedPath = resolvedPath.replace("{meshName}", __extendedEncodeURIComponent(labelValue));
893
- }
894
- else {
895
- throw new Error("No value provided for input HTTP label: meshName.");
896
- }
897
- query = __assign({}, (input.meshOwner !== undefined && { meshOwner: input.meshOwner }));
589
+ resolvedPath = __resolvedPath(resolvedPath, input, "virtualServiceName", function () { return input.virtualServiceName; }, "{virtualServiceName}", false);
590
+ resolvedPath = __resolvedPath(resolvedPath, input, "meshName", function () { return input.meshName; }, "{meshName}", false);
591
+ query = map({
592
+ meshOwner: [, input.meshOwner],
593
+ });
898
594
  return [2, new __HttpRequest({
899
595
  protocol: protocol,
900
596
  hostname: hostname,
@@ -909,7 +605,7 @@ export var serializeAws_restJson1DescribeVirtualServiceCommand = function (input
909
605
  });
910
606
  }); };
911
607
  export var serializeAws_restJson1ListGatewayRoutesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
912
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, query, body;
608
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
913
609
  return __generator(this, function (_c) {
914
610
  switch (_c.label) {
915
611
  case 0: return [4, context.endpoint()];
@@ -918,27 +614,13 @@ export var serializeAws_restJson1ListGatewayRoutesCommand = function (input, con
918
614
  headers = {};
919
615
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
920
616
  "/v20190125/meshes/{meshName}/virtualGateway/{virtualGatewayName}/gatewayRoutes";
921
- if (input.meshName !== undefined) {
922
- labelValue = input.meshName;
923
- if (labelValue.length <= 0) {
924
- throw new Error("Empty value provided for input HTTP label: meshName.");
925
- }
926
- resolvedPath = resolvedPath.replace("{meshName}", __extendedEncodeURIComponent(labelValue));
927
- }
928
- else {
929
- throw new Error("No value provided for input HTTP label: meshName.");
930
- }
931
- if (input.virtualGatewayName !== undefined) {
932
- labelValue = input.virtualGatewayName;
933
- if (labelValue.length <= 0) {
934
- throw new Error("Empty value provided for input HTTP label: virtualGatewayName.");
935
- }
936
- resolvedPath = resolvedPath.replace("{virtualGatewayName}", __extendedEncodeURIComponent(labelValue));
937
- }
938
- else {
939
- throw new Error("No value provided for input HTTP label: virtualGatewayName.");
940
- }
941
- query = __assign(__assign(__assign({}, (input.nextToken !== undefined && { nextToken: input.nextToken })), (input.limit !== undefined && { limit: input.limit.toString() })), (input.meshOwner !== undefined && { meshOwner: input.meshOwner }));
617
+ resolvedPath = __resolvedPath(resolvedPath, input, "meshName", function () { return input.meshName; }, "{meshName}", false);
618
+ resolvedPath = __resolvedPath(resolvedPath, input, "virtualGatewayName", function () { return input.virtualGatewayName; }, "{virtualGatewayName}", false);
619
+ query = map({
620
+ nextToken: [, input.nextToken],
621
+ limit: [function () { return input.limit !== void 0; }, function () { return input.limit.toString(); }],
622
+ meshOwner: [, input.meshOwner],
623
+ });
942
624
  return [2, new __HttpRequest({
943
625
  protocol: protocol,
944
626
  hostname: hostname,
@@ -961,7 +643,10 @@ export var serializeAws_restJson1ListMeshesCommand = function (input, context) {
961
643
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
962
644
  headers = {};
963
645
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v20190125/meshes";
964
- query = __assign(__assign({}, (input.nextToken !== undefined && { nextToken: input.nextToken })), (input.limit !== undefined && { limit: input.limit.toString() }));
646
+ query = map({
647
+ nextToken: [, input.nextToken],
648
+ limit: [function () { return input.limit !== void 0; }, function () { return input.limit.toString(); }],
649
+ });
965
650
  return [2, new __HttpRequest({
966
651
  protocol: protocol,
967
652
  hostname: hostname,
@@ -976,7 +661,7 @@ export var serializeAws_restJson1ListMeshesCommand = function (input, context) {
976
661
  });
977
662
  }); };
978
663
  export var serializeAws_restJson1ListRoutesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
979
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, query, body;
664
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
980
665
  return __generator(this, function (_c) {
981
666
  switch (_c.label) {
982
667
  case 0: return [4, context.endpoint()];
@@ -985,27 +670,13 @@ export var serializeAws_restJson1ListRoutesCommand = function (input, context) {
985
670
  headers = {};
986
671
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
987
672
  "/v20190125/meshes/{meshName}/virtualRouter/{virtualRouterName}/routes";
988
- if (input.meshName !== undefined) {
989
- labelValue = input.meshName;
990
- if (labelValue.length <= 0) {
991
- throw new Error("Empty value provided for input HTTP label: meshName.");
992
- }
993
- resolvedPath = resolvedPath.replace("{meshName}", __extendedEncodeURIComponent(labelValue));
994
- }
995
- else {
996
- throw new Error("No value provided for input HTTP label: meshName.");
997
- }
998
- if (input.virtualRouterName !== undefined) {
999
- labelValue = input.virtualRouterName;
1000
- if (labelValue.length <= 0) {
1001
- throw new Error("Empty value provided for input HTTP label: virtualRouterName.");
1002
- }
1003
- resolvedPath = resolvedPath.replace("{virtualRouterName}", __extendedEncodeURIComponent(labelValue));
1004
- }
1005
- else {
1006
- throw new Error("No value provided for input HTTP label: virtualRouterName.");
1007
- }
1008
- query = __assign(__assign(__assign({}, (input.nextToken !== undefined && { nextToken: input.nextToken })), (input.limit !== undefined && { limit: input.limit.toString() })), (input.meshOwner !== undefined && { meshOwner: input.meshOwner }));
673
+ resolvedPath = __resolvedPath(resolvedPath, input, "meshName", function () { return input.meshName; }, "{meshName}", false);
674
+ resolvedPath = __resolvedPath(resolvedPath, input, "virtualRouterName", function () { return input.virtualRouterName; }, "{virtualRouterName}", false);
675
+ query = map({
676
+ nextToken: [, input.nextToken],
677
+ limit: [function () { return input.limit !== void 0; }, function () { return input.limit.toString(); }],
678
+ meshOwner: [, input.meshOwner],
679
+ });
1009
680
  return [2, new __HttpRequest({
1010
681
  protocol: protocol,
1011
682
  hostname: hostname,
@@ -1028,7 +699,11 @@ export var serializeAws_restJson1ListTagsForResourceCommand = function (input, c
1028
699
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
1029
700
  headers = {};
1030
701
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v20190125/tags";
1031
- query = __assign(__assign(__assign({}, (input.resourceArn !== undefined && { resourceArn: input.resourceArn })), (input.nextToken !== undefined && { nextToken: input.nextToken })), (input.limit !== undefined && { limit: input.limit.toString() }));
702
+ query = map({
703
+ resourceArn: [, input.resourceArn],
704
+ nextToken: [, input.nextToken],
705
+ limit: [function () { return input.limit !== void 0; }, function () { return input.limit.toString(); }],
706
+ });
1032
707
  return [2, new __HttpRequest({
1033
708
  protocol: protocol,
1034
709
  hostname: hostname,
@@ -1043,7 +718,7 @@ export var serializeAws_restJson1ListTagsForResourceCommand = function (input, c
1043
718
  });
1044
719
  }); };
1045
720
  export var serializeAws_restJson1ListVirtualGatewaysCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1046
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
721
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
1047
722
  return __generator(this, function (_c) {
1048
723
  switch (_c.label) {
1049
724
  case 0: return [4, context.endpoint()];
@@ -1052,17 +727,12 @@ export var serializeAws_restJson1ListVirtualGatewaysCommand = function (input, c
1052
727
  headers = {};
1053
728
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
1054
729
  "/v20190125/meshes/{meshName}/virtualGateways";
1055
- if (input.meshName !== undefined) {
1056
- labelValue = input.meshName;
1057
- if (labelValue.length <= 0) {
1058
- throw new Error("Empty value provided for input HTTP label: meshName.");
1059
- }
1060
- resolvedPath = resolvedPath.replace("{meshName}", __extendedEncodeURIComponent(labelValue));
1061
- }
1062
- else {
1063
- throw new Error("No value provided for input HTTP label: meshName.");
1064
- }
1065
- query = __assign(__assign(__assign({}, (input.nextToken !== undefined && { nextToken: input.nextToken })), (input.limit !== undefined && { limit: input.limit.toString() })), (input.meshOwner !== undefined && { meshOwner: input.meshOwner }));
730
+ resolvedPath = __resolvedPath(resolvedPath, input, "meshName", function () { return input.meshName; }, "{meshName}", false);
731
+ query = map({
732
+ nextToken: [, input.nextToken],
733
+ limit: [function () { return input.limit !== void 0; }, function () { return input.limit.toString(); }],
734
+ meshOwner: [, input.meshOwner],
735
+ });
1066
736
  return [2, new __HttpRequest({
1067
737
  protocol: protocol,
1068
738
  hostname: hostname,
@@ -1077,7 +747,7 @@ export var serializeAws_restJson1ListVirtualGatewaysCommand = function (input, c
1077
747
  });
1078
748
  }); };
1079
749
  export var serializeAws_restJson1ListVirtualNodesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1080
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
750
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
1081
751
  return __generator(this, function (_c) {
1082
752
  switch (_c.label) {
1083
753
  case 0: return [4, context.endpoint()];
@@ -1085,17 +755,12 @@ export var serializeAws_restJson1ListVirtualNodesCommand = function (input, cont
1085
755
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
1086
756
  headers = {};
1087
757
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v20190125/meshes/{meshName}/virtualNodes";
1088
- if (input.meshName !== undefined) {
1089
- labelValue = input.meshName;
1090
- if (labelValue.length <= 0) {
1091
- throw new Error("Empty value provided for input HTTP label: meshName.");
1092
- }
1093
- resolvedPath = resolvedPath.replace("{meshName}", __extendedEncodeURIComponent(labelValue));
1094
- }
1095
- else {
1096
- throw new Error("No value provided for input HTTP label: meshName.");
1097
- }
1098
- query = __assign(__assign(__assign({}, (input.nextToken !== undefined && { nextToken: input.nextToken })), (input.limit !== undefined && { limit: input.limit.toString() })), (input.meshOwner !== undefined && { meshOwner: input.meshOwner }));
758
+ resolvedPath = __resolvedPath(resolvedPath, input, "meshName", function () { return input.meshName; }, "{meshName}", false);
759
+ query = map({
760
+ nextToken: [, input.nextToken],
761
+ limit: [function () { return input.limit !== void 0; }, function () { return input.limit.toString(); }],
762
+ meshOwner: [, input.meshOwner],
763
+ });
1099
764
  return [2, new __HttpRequest({
1100
765
  protocol: protocol,
1101
766
  hostname: hostname,
@@ -1110,7 +775,7 @@ export var serializeAws_restJson1ListVirtualNodesCommand = function (input, cont
1110
775
  });
1111
776
  }); };
1112
777
  export var serializeAws_restJson1ListVirtualRoutersCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1113
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
778
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
1114
779
  return __generator(this, function (_c) {
1115
780
  switch (_c.label) {
1116
781
  case 0: return [4, context.endpoint()];
@@ -1119,17 +784,12 @@ export var serializeAws_restJson1ListVirtualRoutersCommand = function (input, co
1119
784
  headers = {};
1120
785
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
1121
786
  "/v20190125/meshes/{meshName}/virtualRouters";
1122
- if (input.meshName !== undefined) {
1123
- labelValue = input.meshName;
1124
- if (labelValue.length <= 0) {
1125
- throw new Error("Empty value provided for input HTTP label: meshName.");
1126
- }
1127
- resolvedPath = resolvedPath.replace("{meshName}", __extendedEncodeURIComponent(labelValue));
1128
- }
1129
- else {
1130
- throw new Error("No value provided for input HTTP label: meshName.");
1131
- }
1132
- query = __assign(__assign(__assign({}, (input.nextToken !== undefined && { nextToken: input.nextToken })), (input.limit !== undefined && { limit: input.limit.toString() })), (input.meshOwner !== undefined && { meshOwner: input.meshOwner }));
787
+ resolvedPath = __resolvedPath(resolvedPath, input, "meshName", function () { return input.meshName; }, "{meshName}", false);
788
+ query = map({
789
+ nextToken: [, input.nextToken],
790
+ limit: [function () { return input.limit !== void 0; }, function () { return input.limit.toString(); }],
791
+ meshOwner: [, input.meshOwner],
792
+ });
1133
793
  return [2, new __HttpRequest({
1134
794
  protocol: protocol,
1135
795
  hostname: hostname,
@@ -1144,7 +804,7 @@ export var serializeAws_restJson1ListVirtualRoutersCommand = function (input, co
1144
804
  });
1145
805
  }); };
1146
806
  export var serializeAws_restJson1ListVirtualServicesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1147
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
807
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
1148
808
  return __generator(this, function (_c) {
1149
809
  switch (_c.label) {
1150
810
  case 0: return [4, context.endpoint()];
@@ -1153,17 +813,12 @@ export var serializeAws_restJson1ListVirtualServicesCommand = function (input, c
1153
813
  headers = {};
1154
814
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
1155
815
  "/v20190125/meshes/{meshName}/virtualServices";
1156
- if (input.meshName !== undefined) {
1157
- labelValue = input.meshName;
1158
- if (labelValue.length <= 0) {
1159
- throw new Error("Empty value provided for input HTTP label: meshName.");
1160
- }
1161
- resolvedPath = resolvedPath.replace("{meshName}", __extendedEncodeURIComponent(labelValue));
1162
- }
1163
- else {
1164
- throw new Error("No value provided for input HTTP label: meshName.");
1165
- }
1166
- query = __assign(__assign(__assign({}, (input.nextToken !== undefined && { nextToken: input.nextToken })), (input.limit !== undefined && { limit: input.limit.toString() })), (input.meshOwner !== undefined && { meshOwner: input.meshOwner }));
816
+ resolvedPath = __resolvedPath(resolvedPath, input, "meshName", function () { return input.meshName; }, "{meshName}", false);
817
+ query = map({
818
+ nextToken: [, input.nextToken],
819
+ limit: [function () { return input.limit !== void 0; }, function () { return input.limit.toString(); }],
820
+ meshOwner: [, input.meshOwner],
821
+ });
1167
822
  return [2, new __HttpRequest({
1168
823
  protocol: protocol,
1169
824
  hostname: hostname,
@@ -1188,7 +843,9 @@ export var serializeAws_restJson1TagResourceCommand = function (input, context)
1188
843
  "content-type": "application/json",
1189
844
  };
1190
845
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v20190125/tag";
1191
- query = __assign({}, (input.resourceArn !== undefined && { resourceArn: input.resourceArn }));
846
+ query = map({
847
+ resourceArn: [, input.resourceArn],
848
+ });
1192
849
  body = JSON.stringify(__assign({}, (input.tags != null && { tags: serializeAws_restJson1TagList(input.tags, context) })));
1193
850
  return [2, new __HttpRequest({
1194
851
  protocol: protocol,
@@ -1214,7 +871,9 @@ export var serializeAws_restJson1UntagResourceCommand = function (input, context
1214
871
  "content-type": "application/json",
1215
872
  };
1216
873
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v20190125/untag";
1217
- query = __assign({}, (input.resourceArn !== undefined && { resourceArn: input.resourceArn }));
874
+ query = map({
875
+ resourceArn: [, input.resourceArn],
876
+ });
1218
877
  body = JSON.stringify(__assign({}, (input.tagKeys != null && { tagKeys: serializeAws_restJson1TagKeyList(input.tagKeys, context) })));
1219
878
  return [2, new __HttpRequest({
1220
879
  protocol: protocol,
@@ -1230,7 +889,7 @@ export var serializeAws_restJson1UntagResourceCommand = function (input, context
1230
889
  });
1231
890
  }); };
1232
891
  export var serializeAws_restJson1UpdateGatewayRouteCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1233
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, labelValue, query, body;
892
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
1234
893
  var _c;
1235
894
  return __generator(this, function (_d) {
1236
895
  switch (_d.label) {
@@ -1242,37 +901,12 @@ export var serializeAws_restJson1UpdateGatewayRouteCommand = function (input, co
1242
901
  };
1243
902
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
1244
903
  "/v20190125/meshes/{meshName}/virtualGateway/{virtualGatewayName}/gatewayRoutes/{gatewayRouteName}";
1245
- if (input.gatewayRouteName !== undefined) {
1246
- labelValue = input.gatewayRouteName;
1247
- if (labelValue.length <= 0) {
1248
- throw new Error("Empty value provided for input HTTP label: gatewayRouteName.");
1249
- }
1250
- resolvedPath = resolvedPath.replace("{gatewayRouteName}", __extendedEncodeURIComponent(labelValue));
1251
- }
1252
- else {
1253
- throw new Error("No value provided for input HTTP label: gatewayRouteName.");
1254
- }
1255
- if (input.meshName !== undefined) {
1256
- labelValue = input.meshName;
1257
- if (labelValue.length <= 0) {
1258
- throw new Error("Empty value provided for input HTTP label: meshName.");
1259
- }
1260
- resolvedPath = resolvedPath.replace("{meshName}", __extendedEncodeURIComponent(labelValue));
1261
- }
1262
- else {
1263
- throw new Error("No value provided for input HTTP label: meshName.");
1264
- }
1265
- if (input.virtualGatewayName !== undefined) {
1266
- labelValue = input.virtualGatewayName;
1267
- if (labelValue.length <= 0) {
1268
- throw new Error("Empty value provided for input HTTP label: virtualGatewayName.");
1269
- }
1270
- resolvedPath = resolvedPath.replace("{virtualGatewayName}", __extendedEncodeURIComponent(labelValue));
1271
- }
1272
- else {
1273
- throw new Error("No value provided for input HTTP label: virtualGatewayName.");
1274
- }
1275
- query = __assign({}, (input.meshOwner !== undefined && { meshOwner: input.meshOwner }));
904
+ resolvedPath = __resolvedPath(resolvedPath, input, "gatewayRouteName", function () { return input.gatewayRouteName; }, "{gatewayRouteName}", false);
905
+ resolvedPath = __resolvedPath(resolvedPath, input, "meshName", function () { return input.meshName; }, "{meshName}", false);
906
+ resolvedPath = __resolvedPath(resolvedPath, input, "virtualGatewayName", function () { return input.virtualGatewayName; }, "{virtualGatewayName}", false);
907
+ query = map({
908
+ meshOwner: [, input.meshOwner],
909
+ });
1276
910
  body = JSON.stringify(__assign({ clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.spec != null && { spec: serializeAws_restJson1GatewayRouteSpec(input.spec, context) })));
1277
911
  return [2, new __HttpRequest({
1278
912
  protocol: protocol,
@@ -1288,7 +922,7 @@ export var serializeAws_restJson1UpdateGatewayRouteCommand = function (input, co
1288
922
  });
1289
923
  }); };
1290
924
  export var serializeAws_restJson1UpdateMeshCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1291
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
925
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
1292
926
  var _c;
1293
927
  return __generator(this, function (_d) {
1294
928
  switch (_d.label) {
@@ -1299,16 +933,7 @@ export var serializeAws_restJson1UpdateMeshCommand = function (input, context) {
1299
933
  "content-type": "application/json",
1300
934
  };
1301
935
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v20190125/meshes/{meshName}";
1302
- if (input.meshName !== undefined) {
1303
- labelValue = input.meshName;
1304
- if (labelValue.length <= 0) {
1305
- throw new Error("Empty value provided for input HTTP label: meshName.");
1306
- }
1307
- resolvedPath = resolvedPath.replace("{meshName}", __extendedEncodeURIComponent(labelValue));
1308
- }
1309
- else {
1310
- throw new Error("No value provided for input HTTP label: meshName.");
1311
- }
936
+ resolvedPath = __resolvedPath(resolvedPath, input, "meshName", function () { return input.meshName; }, "{meshName}", false);
1312
937
  body = JSON.stringify(__assign({ clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.spec != null && { spec: serializeAws_restJson1MeshSpec(input.spec, context) })));
1313
938
  return [2, new __HttpRequest({
1314
939
  protocol: protocol,
@@ -1323,7 +948,7 @@ export var serializeAws_restJson1UpdateMeshCommand = function (input, context) {
1323
948
  });
1324
949
  }); };
1325
950
  export var serializeAws_restJson1UpdateRouteCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1326
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, labelValue, query, body;
951
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
1327
952
  var _c;
1328
953
  return __generator(this, function (_d) {
1329
954
  switch (_d.label) {
@@ -1335,37 +960,12 @@ export var serializeAws_restJson1UpdateRouteCommand = function (input, context)
1335
960
  };
1336
961
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
1337
962
  "/v20190125/meshes/{meshName}/virtualRouter/{virtualRouterName}/routes/{routeName}";
1338
- if (input.routeName !== undefined) {
1339
- labelValue = input.routeName;
1340
- if (labelValue.length <= 0) {
1341
- throw new Error("Empty value provided for input HTTP label: routeName.");
1342
- }
1343
- resolvedPath = resolvedPath.replace("{routeName}", __extendedEncodeURIComponent(labelValue));
1344
- }
1345
- else {
1346
- throw new Error("No value provided for input HTTP label: routeName.");
1347
- }
1348
- if (input.meshName !== undefined) {
1349
- labelValue = input.meshName;
1350
- if (labelValue.length <= 0) {
1351
- throw new Error("Empty value provided for input HTTP label: meshName.");
1352
- }
1353
- resolvedPath = resolvedPath.replace("{meshName}", __extendedEncodeURIComponent(labelValue));
1354
- }
1355
- else {
1356
- throw new Error("No value provided for input HTTP label: meshName.");
1357
- }
1358
- if (input.virtualRouterName !== undefined) {
1359
- labelValue = input.virtualRouterName;
1360
- if (labelValue.length <= 0) {
1361
- throw new Error("Empty value provided for input HTTP label: virtualRouterName.");
1362
- }
1363
- resolvedPath = resolvedPath.replace("{virtualRouterName}", __extendedEncodeURIComponent(labelValue));
1364
- }
1365
- else {
1366
- throw new Error("No value provided for input HTTP label: virtualRouterName.");
1367
- }
1368
- query = __assign({}, (input.meshOwner !== undefined && { meshOwner: input.meshOwner }));
963
+ resolvedPath = __resolvedPath(resolvedPath, input, "routeName", function () { return input.routeName; }, "{routeName}", false);
964
+ resolvedPath = __resolvedPath(resolvedPath, input, "meshName", function () { return input.meshName; }, "{meshName}", false);
965
+ resolvedPath = __resolvedPath(resolvedPath, input, "virtualRouterName", function () { return input.virtualRouterName; }, "{virtualRouterName}", false);
966
+ query = map({
967
+ meshOwner: [, input.meshOwner],
968
+ });
1369
969
  body = JSON.stringify(__assign({ clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.spec != null && { spec: serializeAws_restJson1RouteSpec(input.spec, context) })));
1370
970
  return [2, new __HttpRequest({
1371
971
  protocol: protocol,
@@ -1381,7 +981,7 @@ export var serializeAws_restJson1UpdateRouteCommand = function (input, context)
1381
981
  });
1382
982
  }); };
1383
983
  export var serializeAws_restJson1UpdateVirtualGatewayCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1384
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, query, body;
984
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
1385
985
  var _c;
1386
986
  return __generator(this, function (_d) {
1387
987
  switch (_d.label) {
@@ -1393,27 +993,11 @@ export var serializeAws_restJson1UpdateVirtualGatewayCommand = function (input,
1393
993
  };
1394
994
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
1395
995
  "/v20190125/meshes/{meshName}/virtualGateways/{virtualGatewayName}";
1396
- if (input.virtualGatewayName !== undefined) {
1397
- labelValue = input.virtualGatewayName;
1398
- if (labelValue.length <= 0) {
1399
- throw new Error("Empty value provided for input HTTP label: virtualGatewayName.");
1400
- }
1401
- resolvedPath = resolvedPath.replace("{virtualGatewayName}", __extendedEncodeURIComponent(labelValue));
1402
- }
1403
- else {
1404
- throw new Error("No value provided for input HTTP label: virtualGatewayName.");
1405
- }
1406
- if (input.meshName !== undefined) {
1407
- labelValue = input.meshName;
1408
- if (labelValue.length <= 0) {
1409
- throw new Error("Empty value provided for input HTTP label: meshName.");
1410
- }
1411
- resolvedPath = resolvedPath.replace("{meshName}", __extendedEncodeURIComponent(labelValue));
1412
- }
1413
- else {
1414
- throw new Error("No value provided for input HTTP label: meshName.");
1415
- }
1416
- query = __assign({}, (input.meshOwner !== undefined && { meshOwner: input.meshOwner }));
996
+ resolvedPath = __resolvedPath(resolvedPath, input, "virtualGatewayName", function () { return input.virtualGatewayName; }, "{virtualGatewayName}", false);
997
+ resolvedPath = __resolvedPath(resolvedPath, input, "meshName", function () { return input.meshName; }, "{meshName}", false);
998
+ query = map({
999
+ meshOwner: [, input.meshOwner],
1000
+ });
1417
1001
  body = JSON.stringify(__assign({ clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.spec != null && { spec: serializeAws_restJson1VirtualGatewaySpec(input.spec, context) })));
1418
1002
  return [2, new __HttpRequest({
1419
1003
  protocol: protocol,
@@ -1429,7 +1013,7 @@ export var serializeAws_restJson1UpdateVirtualGatewayCommand = function (input,
1429
1013
  });
1430
1014
  }); };
1431
1015
  export var serializeAws_restJson1UpdateVirtualNodeCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1432
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, query, body;
1016
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
1433
1017
  var _c;
1434
1018
  return __generator(this, function (_d) {
1435
1019
  switch (_d.label) {
@@ -1441,27 +1025,11 @@ export var serializeAws_restJson1UpdateVirtualNodeCommand = function (input, con
1441
1025
  };
1442
1026
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
1443
1027
  "/v20190125/meshes/{meshName}/virtualNodes/{virtualNodeName}";
1444
- if (input.virtualNodeName !== undefined) {
1445
- labelValue = input.virtualNodeName;
1446
- if (labelValue.length <= 0) {
1447
- throw new Error("Empty value provided for input HTTP label: virtualNodeName.");
1448
- }
1449
- resolvedPath = resolvedPath.replace("{virtualNodeName}", __extendedEncodeURIComponent(labelValue));
1450
- }
1451
- else {
1452
- throw new Error("No value provided for input HTTP label: virtualNodeName.");
1453
- }
1454
- if (input.meshName !== undefined) {
1455
- labelValue = input.meshName;
1456
- if (labelValue.length <= 0) {
1457
- throw new Error("Empty value provided for input HTTP label: meshName.");
1458
- }
1459
- resolvedPath = resolvedPath.replace("{meshName}", __extendedEncodeURIComponent(labelValue));
1460
- }
1461
- else {
1462
- throw new Error("No value provided for input HTTP label: meshName.");
1463
- }
1464
- query = __assign({}, (input.meshOwner !== undefined && { meshOwner: input.meshOwner }));
1028
+ resolvedPath = __resolvedPath(resolvedPath, input, "virtualNodeName", function () { return input.virtualNodeName; }, "{virtualNodeName}", false);
1029
+ resolvedPath = __resolvedPath(resolvedPath, input, "meshName", function () { return input.meshName; }, "{meshName}", false);
1030
+ query = map({
1031
+ meshOwner: [, input.meshOwner],
1032
+ });
1465
1033
  body = JSON.stringify(__assign({ clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.spec != null && { spec: serializeAws_restJson1VirtualNodeSpec(input.spec, context) })));
1466
1034
  return [2, new __HttpRequest({
1467
1035
  protocol: protocol,
@@ -1477,7 +1045,7 @@ export var serializeAws_restJson1UpdateVirtualNodeCommand = function (input, con
1477
1045
  });
1478
1046
  }); };
1479
1047
  export var serializeAws_restJson1UpdateVirtualRouterCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1480
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, query, body;
1048
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
1481
1049
  var _c;
1482
1050
  return __generator(this, function (_d) {
1483
1051
  switch (_d.label) {
@@ -1489,27 +1057,11 @@ export var serializeAws_restJson1UpdateVirtualRouterCommand = function (input, c
1489
1057
  };
1490
1058
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
1491
1059
  "/v20190125/meshes/{meshName}/virtualRouters/{virtualRouterName}";
1492
- if (input.virtualRouterName !== undefined) {
1493
- labelValue = input.virtualRouterName;
1494
- if (labelValue.length <= 0) {
1495
- throw new Error("Empty value provided for input HTTP label: virtualRouterName.");
1496
- }
1497
- resolvedPath = resolvedPath.replace("{virtualRouterName}", __extendedEncodeURIComponent(labelValue));
1498
- }
1499
- else {
1500
- throw new Error("No value provided for input HTTP label: virtualRouterName.");
1501
- }
1502
- if (input.meshName !== undefined) {
1503
- labelValue = input.meshName;
1504
- if (labelValue.length <= 0) {
1505
- throw new Error("Empty value provided for input HTTP label: meshName.");
1506
- }
1507
- resolvedPath = resolvedPath.replace("{meshName}", __extendedEncodeURIComponent(labelValue));
1508
- }
1509
- else {
1510
- throw new Error("No value provided for input HTTP label: meshName.");
1511
- }
1512
- query = __assign({}, (input.meshOwner !== undefined && { meshOwner: input.meshOwner }));
1060
+ resolvedPath = __resolvedPath(resolvedPath, input, "virtualRouterName", function () { return input.virtualRouterName; }, "{virtualRouterName}", false);
1061
+ resolvedPath = __resolvedPath(resolvedPath, input, "meshName", function () { return input.meshName; }, "{meshName}", false);
1062
+ query = map({
1063
+ meshOwner: [, input.meshOwner],
1064
+ });
1513
1065
  body = JSON.stringify(__assign({ clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.spec != null && { spec: serializeAws_restJson1VirtualRouterSpec(input.spec, context) })));
1514
1066
  return [2, new __HttpRequest({
1515
1067
  protocol: protocol,
@@ -1525,7 +1077,7 @@ export var serializeAws_restJson1UpdateVirtualRouterCommand = function (input, c
1525
1077
  });
1526
1078
  }); };
1527
1079
  export var serializeAws_restJson1UpdateVirtualServiceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
1528
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, query, body;
1080
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
1529
1081
  var _c;
1530
1082
  return __generator(this, function (_d) {
1531
1083
  switch (_d.label) {
@@ -1537,27 +1089,11 @@ export var serializeAws_restJson1UpdateVirtualServiceCommand = function (input,
1537
1089
  };
1538
1090
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
1539
1091
  "/v20190125/meshes/{meshName}/virtualServices/{virtualServiceName}";
1540
- if (input.virtualServiceName !== undefined) {
1541
- labelValue = input.virtualServiceName;
1542
- if (labelValue.length <= 0) {
1543
- throw new Error("Empty value provided for input HTTP label: virtualServiceName.");
1544
- }
1545
- resolvedPath = resolvedPath.replace("{virtualServiceName}", __extendedEncodeURIComponent(labelValue));
1546
- }
1547
- else {
1548
- throw new Error("No value provided for input HTTP label: virtualServiceName.");
1549
- }
1550
- if (input.meshName !== undefined) {
1551
- labelValue = input.meshName;
1552
- if (labelValue.length <= 0) {
1553
- throw new Error("Empty value provided for input HTTP label: meshName.");
1554
- }
1555
- resolvedPath = resolvedPath.replace("{meshName}", __extendedEncodeURIComponent(labelValue));
1556
- }
1557
- else {
1558
- throw new Error("No value provided for input HTTP label: meshName.");
1559
- }
1560
- query = __assign({}, (input.meshOwner !== undefined && { meshOwner: input.meshOwner }));
1092
+ resolvedPath = __resolvedPath(resolvedPath, input, "virtualServiceName", function () { return input.virtualServiceName; }, "{virtualServiceName}", false);
1093
+ resolvedPath = __resolvedPath(resolvedPath, input, "meshName", function () { return input.meshName; }, "{meshName}", false);
1094
+ query = map({
1095
+ meshOwner: [, input.meshOwner],
1096
+ });
1561
1097
  body = JSON.stringify(__assign({ clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.spec != null && { spec: serializeAws_restJson1VirtualServiceSpec(input.spec, context) })));
1562
1098
  return [2, new __HttpRequest({
1563
1099
  protocol: protocol,
@@ -1580,21 +1116,20 @@ export var deserializeAws_restJson1CreateGatewayRouteCommand = function (output,
1580
1116
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1581
1117
  return [2, deserializeAws_restJson1CreateGatewayRouteCommandError(output, context)];
1582
1118
  }
1583
- contents = {
1119
+ contents = map({
1584
1120
  $metadata: deserializeMetadata(output),
1585
- gatewayRoute: undefined,
1586
- };
1121
+ });
1587
1122
  _a = __expectObject;
1588
1123
  return [4, parseBody(output.body, context)];
1589
1124
  case 1:
1590
1125
  data = _a.apply(void 0, [_b.sent()]);
1591
1126
  contents.gatewayRoute = deserializeAws_restJson1GatewayRouteData(data, context);
1592
- return [2, Promise.resolve(contents)];
1127
+ return [2, contents];
1593
1128
  }
1594
1129
  });
1595
1130
  }); };
1596
1131
  var deserializeAws_restJson1CreateGatewayRouteCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1597
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1132
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1598
1133
  var _c;
1599
1134
  return __generator(this, function (_d) {
1600
1135
  switch (_d.label) {
@@ -1643,14 +1178,14 @@ var deserializeAws_restJson1CreateGatewayRouteCommandError = function (output, c
1643
1178
  case 17: throw _d.sent();
1644
1179
  case 18:
1645
1180
  parsedBody = parsedOutput.body;
1646
- $metadata = deserializeMetadata(output);
1647
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1648
- response = new __BaseException({
1649
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1650
- $fault: "client",
1651
- $metadata: $metadata,
1181
+ throwDefaultError({
1182
+ output: output,
1183
+ parsedBody: parsedBody,
1184
+ exceptionCtor: __BaseException,
1185
+ errorCode: errorCode,
1652
1186
  });
1653
- throw __decorateServiceException(response, parsedBody);
1187
+ _d.label = 19;
1188
+ case 19: return [2];
1654
1189
  }
1655
1190
  });
1656
1191
  }); };
@@ -1662,21 +1197,20 @@ export var deserializeAws_restJson1CreateMeshCommand = function (output, context
1662
1197
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1663
1198
  return [2, deserializeAws_restJson1CreateMeshCommandError(output, context)];
1664
1199
  }
1665
- contents = {
1200
+ contents = map({
1666
1201
  $metadata: deserializeMetadata(output),
1667
- mesh: undefined,
1668
- };
1202
+ });
1669
1203
  _a = __expectObject;
1670
1204
  return [4, parseBody(output.body, context)];
1671
1205
  case 1:
1672
1206
  data = _a.apply(void 0, [_b.sent()]);
1673
1207
  contents.mesh = deserializeAws_restJson1MeshData(data, context);
1674
- return [2, Promise.resolve(contents)];
1208
+ return [2, contents];
1675
1209
  }
1676
1210
  });
1677
1211
  }); };
1678
1212
  var deserializeAws_restJson1CreateMeshCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1679
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1213
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1680
1214
  var _c;
1681
1215
  return __generator(this, function (_d) {
1682
1216
  switch (_d.label) {
@@ -1725,14 +1259,14 @@ var deserializeAws_restJson1CreateMeshCommandError = function (output, context)
1725
1259
  case 17: throw _d.sent();
1726
1260
  case 18:
1727
1261
  parsedBody = parsedOutput.body;
1728
- $metadata = deserializeMetadata(output);
1729
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1730
- response = new __BaseException({
1731
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1732
- $fault: "client",
1733
- $metadata: $metadata,
1262
+ throwDefaultError({
1263
+ output: output,
1264
+ parsedBody: parsedBody,
1265
+ exceptionCtor: __BaseException,
1266
+ errorCode: errorCode,
1734
1267
  });
1735
- throw __decorateServiceException(response, parsedBody);
1268
+ _d.label = 19;
1269
+ case 19: return [2];
1736
1270
  }
1737
1271
  });
1738
1272
  }); };
@@ -1744,21 +1278,20 @@ export var deserializeAws_restJson1CreateRouteCommand = function (output, contex
1744
1278
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1745
1279
  return [2, deserializeAws_restJson1CreateRouteCommandError(output, context)];
1746
1280
  }
1747
- contents = {
1281
+ contents = map({
1748
1282
  $metadata: deserializeMetadata(output),
1749
- route: undefined,
1750
- };
1283
+ });
1751
1284
  _a = __expectObject;
1752
1285
  return [4, parseBody(output.body, context)];
1753
1286
  case 1:
1754
1287
  data = _a.apply(void 0, [_b.sent()]);
1755
1288
  contents.route = deserializeAws_restJson1RouteData(data, context);
1756
- return [2, Promise.resolve(contents)];
1289
+ return [2, contents];
1757
1290
  }
1758
1291
  });
1759
1292
  }); };
1760
1293
  var deserializeAws_restJson1CreateRouteCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1761
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1294
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1762
1295
  var _c;
1763
1296
  return __generator(this, function (_d) {
1764
1297
  switch (_d.label) {
@@ -1807,14 +1340,14 @@ var deserializeAws_restJson1CreateRouteCommandError = function (output, context)
1807
1340
  case 17: throw _d.sent();
1808
1341
  case 18:
1809
1342
  parsedBody = parsedOutput.body;
1810
- $metadata = deserializeMetadata(output);
1811
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1812
- response = new __BaseException({
1813
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1814
- $fault: "client",
1815
- $metadata: $metadata,
1343
+ throwDefaultError({
1344
+ output: output,
1345
+ parsedBody: parsedBody,
1346
+ exceptionCtor: __BaseException,
1347
+ errorCode: errorCode,
1816
1348
  });
1817
- throw __decorateServiceException(response, parsedBody);
1349
+ _d.label = 19;
1350
+ case 19: return [2];
1818
1351
  }
1819
1352
  });
1820
1353
  }); };
@@ -1826,21 +1359,20 @@ export var deserializeAws_restJson1CreateVirtualGatewayCommand = function (outpu
1826
1359
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1827
1360
  return [2, deserializeAws_restJson1CreateVirtualGatewayCommandError(output, context)];
1828
1361
  }
1829
- contents = {
1362
+ contents = map({
1830
1363
  $metadata: deserializeMetadata(output),
1831
- virtualGateway: undefined,
1832
- };
1364
+ });
1833
1365
  _a = __expectObject;
1834
1366
  return [4, parseBody(output.body, context)];
1835
1367
  case 1:
1836
1368
  data = _a.apply(void 0, [_b.sent()]);
1837
1369
  contents.virtualGateway = deserializeAws_restJson1VirtualGatewayData(data, context);
1838
- return [2, Promise.resolve(contents)];
1370
+ return [2, contents];
1839
1371
  }
1840
1372
  });
1841
1373
  }); };
1842
1374
  var deserializeAws_restJson1CreateVirtualGatewayCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1843
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1375
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1844
1376
  var _c;
1845
1377
  return __generator(this, function (_d) {
1846
1378
  switch (_d.label) {
@@ -1889,14 +1421,14 @@ var deserializeAws_restJson1CreateVirtualGatewayCommandError = function (output,
1889
1421
  case 17: throw _d.sent();
1890
1422
  case 18:
1891
1423
  parsedBody = parsedOutput.body;
1892
- $metadata = deserializeMetadata(output);
1893
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1894
- response = new __BaseException({
1895
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1896
- $fault: "client",
1897
- $metadata: $metadata,
1424
+ throwDefaultError({
1425
+ output: output,
1426
+ parsedBody: parsedBody,
1427
+ exceptionCtor: __BaseException,
1428
+ errorCode: errorCode,
1898
1429
  });
1899
- throw __decorateServiceException(response, parsedBody);
1430
+ _d.label = 19;
1431
+ case 19: return [2];
1900
1432
  }
1901
1433
  });
1902
1434
  }); };
@@ -1908,21 +1440,20 @@ export var deserializeAws_restJson1CreateVirtualNodeCommand = function (output,
1908
1440
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1909
1441
  return [2, deserializeAws_restJson1CreateVirtualNodeCommandError(output, context)];
1910
1442
  }
1911
- contents = {
1443
+ contents = map({
1912
1444
  $metadata: deserializeMetadata(output),
1913
- virtualNode: undefined,
1914
- };
1445
+ });
1915
1446
  _a = __expectObject;
1916
1447
  return [4, parseBody(output.body, context)];
1917
1448
  case 1:
1918
1449
  data = _a.apply(void 0, [_b.sent()]);
1919
1450
  contents.virtualNode = deserializeAws_restJson1VirtualNodeData(data, context);
1920
- return [2, Promise.resolve(contents)];
1451
+ return [2, contents];
1921
1452
  }
1922
1453
  });
1923
1454
  }); };
1924
1455
  var deserializeAws_restJson1CreateVirtualNodeCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1925
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1456
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1926
1457
  var _c;
1927
1458
  return __generator(this, function (_d) {
1928
1459
  switch (_d.label) {
@@ -1971,14 +1502,14 @@ var deserializeAws_restJson1CreateVirtualNodeCommandError = function (output, co
1971
1502
  case 17: throw _d.sent();
1972
1503
  case 18:
1973
1504
  parsedBody = parsedOutput.body;
1974
- $metadata = deserializeMetadata(output);
1975
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1976
- response = new __BaseException({
1977
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1978
- $fault: "client",
1979
- $metadata: $metadata,
1505
+ throwDefaultError({
1506
+ output: output,
1507
+ parsedBody: parsedBody,
1508
+ exceptionCtor: __BaseException,
1509
+ errorCode: errorCode,
1980
1510
  });
1981
- throw __decorateServiceException(response, parsedBody);
1511
+ _d.label = 19;
1512
+ case 19: return [2];
1982
1513
  }
1983
1514
  });
1984
1515
  }); };
@@ -1990,21 +1521,20 @@ export var deserializeAws_restJson1CreateVirtualRouterCommand = function (output
1990
1521
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1991
1522
  return [2, deserializeAws_restJson1CreateVirtualRouterCommandError(output, context)];
1992
1523
  }
1993
- contents = {
1524
+ contents = map({
1994
1525
  $metadata: deserializeMetadata(output),
1995
- virtualRouter: undefined,
1996
- };
1526
+ });
1997
1527
  _a = __expectObject;
1998
1528
  return [4, parseBody(output.body, context)];
1999
1529
  case 1:
2000
1530
  data = _a.apply(void 0, [_b.sent()]);
2001
1531
  contents.virtualRouter = deserializeAws_restJson1VirtualRouterData(data, context);
2002
- return [2, Promise.resolve(contents)];
1532
+ return [2, contents];
2003
1533
  }
2004
1534
  });
2005
1535
  }); };
2006
1536
  var deserializeAws_restJson1CreateVirtualRouterCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2007
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1537
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2008
1538
  var _c;
2009
1539
  return __generator(this, function (_d) {
2010
1540
  switch (_d.label) {
@@ -2053,14 +1583,14 @@ var deserializeAws_restJson1CreateVirtualRouterCommandError = function (output,
2053
1583
  case 17: throw _d.sent();
2054
1584
  case 18:
2055
1585
  parsedBody = parsedOutput.body;
2056
- $metadata = deserializeMetadata(output);
2057
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2058
- response = new __BaseException({
2059
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2060
- $fault: "client",
2061
- $metadata: $metadata,
1586
+ throwDefaultError({
1587
+ output: output,
1588
+ parsedBody: parsedBody,
1589
+ exceptionCtor: __BaseException,
1590
+ errorCode: errorCode,
2062
1591
  });
2063
- throw __decorateServiceException(response, parsedBody);
1592
+ _d.label = 19;
1593
+ case 19: return [2];
2064
1594
  }
2065
1595
  });
2066
1596
  }); };
@@ -2072,21 +1602,20 @@ export var deserializeAws_restJson1CreateVirtualServiceCommand = function (outpu
2072
1602
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2073
1603
  return [2, deserializeAws_restJson1CreateVirtualServiceCommandError(output, context)];
2074
1604
  }
2075
- contents = {
1605
+ contents = map({
2076
1606
  $metadata: deserializeMetadata(output),
2077
- virtualService: undefined,
2078
- };
1607
+ });
2079
1608
  _a = __expectObject;
2080
1609
  return [4, parseBody(output.body, context)];
2081
1610
  case 1:
2082
1611
  data = _a.apply(void 0, [_b.sent()]);
2083
1612
  contents.virtualService = deserializeAws_restJson1VirtualServiceData(data, context);
2084
- return [2, Promise.resolve(contents)];
1613
+ return [2, contents];
2085
1614
  }
2086
1615
  });
2087
1616
  }); };
2088
1617
  var deserializeAws_restJson1CreateVirtualServiceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2089
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1618
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2090
1619
  var _c;
2091
1620
  return __generator(this, function (_d) {
2092
1621
  switch (_d.label) {
@@ -2135,14 +1664,14 @@ var deserializeAws_restJson1CreateVirtualServiceCommandError = function (output,
2135
1664
  case 17: throw _d.sent();
2136
1665
  case 18:
2137
1666
  parsedBody = parsedOutput.body;
2138
- $metadata = deserializeMetadata(output);
2139
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2140
- response = new __BaseException({
2141
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2142
- $fault: "client",
2143
- $metadata: $metadata,
1667
+ throwDefaultError({
1668
+ output: output,
1669
+ parsedBody: parsedBody,
1670
+ exceptionCtor: __BaseException,
1671
+ errorCode: errorCode,
2144
1672
  });
2145
- throw __decorateServiceException(response, parsedBody);
1673
+ _d.label = 19;
1674
+ case 19: return [2];
2146
1675
  }
2147
1676
  });
2148
1677
  }); };
@@ -2154,21 +1683,20 @@ export var deserializeAws_restJson1DeleteGatewayRouteCommand = function (output,
2154
1683
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2155
1684
  return [2, deserializeAws_restJson1DeleteGatewayRouteCommandError(output, context)];
2156
1685
  }
2157
- contents = {
1686
+ contents = map({
2158
1687
  $metadata: deserializeMetadata(output),
2159
- gatewayRoute: undefined,
2160
- };
1688
+ });
2161
1689
  _a = __expectObject;
2162
1690
  return [4, parseBody(output.body, context)];
2163
1691
  case 1:
2164
1692
  data = _a.apply(void 0, [_b.sent()]);
2165
1693
  contents.gatewayRoute = deserializeAws_restJson1GatewayRouteData(data, context);
2166
- return [2, Promise.resolve(contents)];
1694
+ return [2, contents];
2167
1695
  }
2168
1696
  });
2169
1697
  }); };
2170
1698
  var deserializeAws_restJson1DeleteGatewayRouteCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2171
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1699
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2172
1700
  var _c;
2173
1701
  return __generator(this, function (_d) {
2174
1702
  switch (_d.label) {
@@ -2213,14 +1741,14 @@ var deserializeAws_restJson1DeleteGatewayRouteCommandError = function (output, c
2213
1741
  case 15: throw _d.sent();
2214
1742
  case 16:
2215
1743
  parsedBody = parsedOutput.body;
2216
- $metadata = deserializeMetadata(output);
2217
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2218
- response = new __BaseException({
2219
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2220
- $fault: "client",
2221
- $metadata: $metadata,
1744
+ throwDefaultError({
1745
+ output: output,
1746
+ parsedBody: parsedBody,
1747
+ exceptionCtor: __BaseException,
1748
+ errorCode: errorCode,
2222
1749
  });
2223
- throw __decorateServiceException(response, parsedBody);
1750
+ _d.label = 17;
1751
+ case 17: return [2];
2224
1752
  }
2225
1753
  });
2226
1754
  }); };
@@ -2232,21 +1760,20 @@ export var deserializeAws_restJson1DeleteMeshCommand = function (output, context
2232
1760
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2233
1761
  return [2, deserializeAws_restJson1DeleteMeshCommandError(output, context)];
2234
1762
  }
2235
- contents = {
1763
+ contents = map({
2236
1764
  $metadata: deserializeMetadata(output),
2237
- mesh: undefined,
2238
- };
1765
+ });
2239
1766
  _a = __expectObject;
2240
1767
  return [4, parseBody(output.body, context)];
2241
1768
  case 1:
2242
1769
  data = _a.apply(void 0, [_b.sent()]);
2243
1770
  contents.mesh = deserializeAws_restJson1MeshData(data, context);
2244
- return [2, Promise.resolve(contents)];
1771
+ return [2, contents];
2245
1772
  }
2246
1773
  });
2247
1774
  }); };
2248
1775
  var deserializeAws_restJson1DeleteMeshCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2249
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1776
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2250
1777
  var _c;
2251
1778
  return __generator(this, function (_d) {
2252
1779
  switch (_d.label) {
@@ -2291,14 +1818,14 @@ var deserializeAws_restJson1DeleteMeshCommandError = function (output, context)
2291
1818
  case 15: throw _d.sent();
2292
1819
  case 16:
2293
1820
  parsedBody = parsedOutput.body;
2294
- $metadata = deserializeMetadata(output);
2295
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2296
- response = new __BaseException({
2297
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2298
- $fault: "client",
2299
- $metadata: $metadata,
1821
+ throwDefaultError({
1822
+ output: output,
1823
+ parsedBody: parsedBody,
1824
+ exceptionCtor: __BaseException,
1825
+ errorCode: errorCode,
2300
1826
  });
2301
- throw __decorateServiceException(response, parsedBody);
1827
+ _d.label = 17;
1828
+ case 17: return [2];
2302
1829
  }
2303
1830
  });
2304
1831
  }); };
@@ -2310,21 +1837,20 @@ export var deserializeAws_restJson1DeleteRouteCommand = function (output, contex
2310
1837
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2311
1838
  return [2, deserializeAws_restJson1DeleteRouteCommandError(output, context)];
2312
1839
  }
2313
- contents = {
1840
+ contents = map({
2314
1841
  $metadata: deserializeMetadata(output),
2315
- route: undefined,
2316
- };
1842
+ });
2317
1843
  _a = __expectObject;
2318
1844
  return [4, parseBody(output.body, context)];
2319
1845
  case 1:
2320
1846
  data = _a.apply(void 0, [_b.sent()]);
2321
1847
  contents.route = deserializeAws_restJson1RouteData(data, context);
2322
- return [2, Promise.resolve(contents)];
1848
+ return [2, contents];
2323
1849
  }
2324
1850
  });
2325
1851
  }); };
2326
1852
  var deserializeAws_restJson1DeleteRouteCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2327
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1853
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2328
1854
  var _c;
2329
1855
  return __generator(this, function (_d) {
2330
1856
  switch (_d.label) {
@@ -2369,14 +1895,14 @@ var deserializeAws_restJson1DeleteRouteCommandError = function (output, context)
2369
1895
  case 15: throw _d.sent();
2370
1896
  case 16:
2371
1897
  parsedBody = parsedOutput.body;
2372
- $metadata = deserializeMetadata(output);
2373
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2374
- response = new __BaseException({
2375
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2376
- $fault: "client",
2377
- $metadata: $metadata,
1898
+ throwDefaultError({
1899
+ output: output,
1900
+ parsedBody: parsedBody,
1901
+ exceptionCtor: __BaseException,
1902
+ errorCode: errorCode,
2378
1903
  });
2379
- throw __decorateServiceException(response, parsedBody);
1904
+ _d.label = 17;
1905
+ case 17: return [2];
2380
1906
  }
2381
1907
  });
2382
1908
  }); };
@@ -2388,21 +1914,20 @@ export var deserializeAws_restJson1DeleteVirtualGatewayCommand = function (outpu
2388
1914
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2389
1915
  return [2, deserializeAws_restJson1DeleteVirtualGatewayCommandError(output, context)];
2390
1916
  }
2391
- contents = {
1917
+ contents = map({
2392
1918
  $metadata: deserializeMetadata(output),
2393
- virtualGateway: undefined,
2394
- };
1919
+ });
2395
1920
  _a = __expectObject;
2396
1921
  return [4, parseBody(output.body, context)];
2397
1922
  case 1:
2398
1923
  data = _a.apply(void 0, [_b.sent()]);
2399
1924
  contents.virtualGateway = deserializeAws_restJson1VirtualGatewayData(data, context);
2400
- return [2, Promise.resolve(contents)];
1925
+ return [2, contents];
2401
1926
  }
2402
1927
  });
2403
1928
  }); };
2404
1929
  var deserializeAws_restJson1DeleteVirtualGatewayCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2405
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1930
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2406
1931
  var _c;
2407
1932
  return __generator(this, function (_d) {
2408
1933
  switch (_d.label) {
@@ -2447,14 +1972,14 @@ var deserializeAws_restJson1DeleteVirtualGatewayCommandError = function (output,
2447
1972
  case 15: throw _d.sent();
2448
1973
  case 16:
2449
1974
  parsedBody = parsedOutput.body;
2450
- $metadata = deserializeMetadata(output);
2451
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2452
- response = new __BaseException({
2453
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2454
- $fault: "client",
2455
- $metadata: $metadata,
1975
+ throwDefaultError({
1976
+ output: output,
1977
+ parsedBody: parsedBody,
1978
+ exceptionCtor: __BaseException,
1979
+ errorCode: errorCode,
2456
1980
  });
2457
- throw __decorateServiceException(response, parsedBody);
1981
+ _d.label = 17;
1982
+ case 17: return [2];
2458
1983
  }
2459
1984
  });
2460
1985
  }); };
@@ -2466,21 +1991,20 @@ export var deserializeAws_restJson1DeleteVirtualNodeCommand = function (output,
2466
1991
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2467
1992
  return [2, deserializeAws_restJson1DeleteVirtualNodeCommandError(output, context)];
2468
1993
  }
2469
- contents = {
1994
+ contents = map({
2470
1995
  $metadata: deserializeMetadata(output),
2471
- virtualNode: undefined,
2472
- };
1996
+ });
2473
1997
  _a = __expectObject;
2474
1998
  return [4, parseBody(output.body, context)];
2475
1999
  case 1:
2476
2000
  data = _a.apply(void 0, [_b.sent()]);
2477
2001
  contents.virtualNode = deserializeAws_restJson1VirtualNodeData(data, context);
2478
- return [2, Promise.resolve(contents)];
2002
+ return [2, contents];
2479
2003
  }
2480
2004
  });
2481
2005
  }); };
2482
2006
  var deserializeAws_restJson1DeleteVirtualNodeCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2483
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2007
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2484
2008
  var _c;
2485
2009
  return __generator(this, function (_d) {
2486
2010
  switch (_d.label) {
@@ -2525,14 +2049,14 @@ var deserializeAws_restJson1DeleteVirtualNodeCommandError = function (output, co
2525
2049
  case 15: throw _d.sent();
2526
2050
  case 16:
2527
2051
  parsedBody = parsedOutput.body;
2528
- $metadata = deserializeMetadata(output);
2529
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2530
- response = new __BaseException({
2531
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2532
- $fault: "client",
2533
- $metadata: $metadata,
2052
+ throwDefaultError({
2053
+ output: output,
2054
+ parsedBody: parsedBody,
2055
+ exceptionCtor: __BaseException,
2056
+ errorCode: errorCode,
2534
2057
  });
2535
- throw __decorateServiceException(response, parsedBody);
2058
+ _d.label = 17;
2059
+ case 17: return [2];
2536
2060
  }
2537
2061
  });
2538
2062
  }); };
@@ -2544,21 +2068,20 @@ export var deserializeAws_restJson1DeleteVirtualRouterCommand = function (output
2544
2068
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2545
2069
  return [2, deserializeAws_restJson1DeleteVirtualRouterCommandError(output, context)];
2546
2070
  }
2547
- contents = {
2071
+ contents = map({
2548
2072
  $metadata: deserializeMetadata(output),
2549
- virtualRouter: undefined,
2550
- };
2073
+ });
2551
2074
  _a = __expectObject;
2552
2075
  return [4, parseBody(output.body, context)];
2553
2076
  case 1:
2554
2077
  data = _a.apply(void 0, [_b.sent()]);
2555
2078
  contents.virtualRouter = deserializeAws_restJson1VirtualRouterData(data, context);
2556
- return [2, Promise.resolve(contents)];
2079
+ return [2, contents];
2557
2080
  }
2558
2081
  });
2559
2082
  }); };
2560
2083
  var deserializeAws_restJson1DeleteVirtualRouterCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2561
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2084
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2562
2085
  var _c;
2563
2086
  return __generator(this, function (_d) {
2564
2087
  switch (_d.label) {
@@ -2603,14 +2126,14 @@ var deserializeAws_restJson1DeleteVirtualRouterCommandError = function (output,
2603
2126
  case 15: throw _d.sent();
2604
2127
  case 16:
2605
2128
  parsedBody = parsedOutput.body;
2606
- $metadata = deserializeMetadata(output);
2607
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2608
- response = new __BaseException({
2609
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2610
- $fault: "client",
2611
- $metadata: $metadata,
2129
+ throwDefaultError({
2130
+ output: output,
2131
+ parsedBody: parsedBody,
2132
+ exceptionCtor: __BaseException,
2133
+ errorCode: errorCode,
2612
2134
  });
2613
- throw __decorateServiceException(response, parsedBody);
2135
+ _d.label = 17;
2136
+ case 17: return [2];
2614
2137
  }
2615
2138
  });
2616
2139
  }); };
@@ -2622,21 +2145,20 @@ export var deserializeAws_restJson1DeleteVirtualServiceCommand = function (outpu
2622
2145
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2623
2146
  return [2, deserializeAws_restJson1DeleteVirtualServiceCommandError(output, context)];
2624
2147
  }
2625
- contents = {
2148
+ contents = map({
2626
2149
  $metadata: deserializeMetadata(output),
2627
- virtualService: undefined,
2628
- };
2150
+ });
2629
2151
  _a = __expectObject;
2630
2152
  return [4, parseBody(output.body, context)];
2631
2153
  case 1:
2632
2154
  data = _a.apply(void 0, [_b.sent()]);
2633
2155
  contents.virtualService = deserializeAws_restJson1VirtualServiceData(data, context);
2634
- return [2, Promise.resolve(contents)];
2156
+ return [2, contents];
2635
2157
  }
2636
2158
  });
2637
2159
  }); };
2638
2160
  var deserializeAws_restJson1DeleteVirtualServiceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2639
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2161
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2640
2162
  var _c;
2641
2163
  return __generator(this, function (_d) {
2642
2164
  switch (_d.label) {
@@ -2681,14 +2203,14 @@ var deserializeAws_restJson1DeleteVirtualServiceCommandError = function (output,
2681
2203
  case 15: throw _d.sent();
2682
2204
  case 16:
2683
2205
  parsedBody = parsedOutput.body;
2684
- $metadata = deserializeMetadata(output);
2685
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2686
- response = new __BaseException({
2687
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2688
- $fault: "client",
2689
- $metadata: $metadata,
2206
+ throwDefaultError({
2207
+ output: output,
2208
+ parsedBody: parsedBody,
2209
+ exceptionCtor: __BaseException,
2210
+ errorCode: errorCode,
2690
2211
  });
2691
- throw __decorateServiceException(response, parsedBody);
2212
+ _d.label = 17;
2213
+ case 17: return [2];
2692
2214
  }
2693
2215
  });
2694
2216
  }); };
@@ -2700,21 +2222,20 @@ export var deserializeAws_restJson1DescribeGatewayRouteCommand = function (outpu
2700
2222
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2701
2223
  return [2, deserializeAws_restJson1DescribeGatewayRouteCommandError(output, context)];
2702
2224
  }
2703
- contents = {
2225
+ contents = map({
2704
2226
  $metadata: deserializeMetadata(output),
2705
- gatewayRoute: undefined,
2706
- };
2227
+ });
2707
2228
  _a = __expectObject;
2708
2229
  return [4, parseBody(output.body, context)];
2709
2230
  case 1:
2710
2231
  data = _a.apply(void 0, [_b.sent()]);
2711
2232
  contents.gatewayRoute = deserializeAws_restJson1GatewayRouteData(data, context);
2712
- return [2, Promise.resolve(contents)];
2233
+ return [2, contents];
2713
2234
  }
2714
2235
  });
2715
2236
  }); };
2716
2237
  var deserializeAws_restJson1DescribeGatewayRouteCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2717
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2238
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2718
2239
  var _c;
2719
2240
  return __generator(this, function (_d) {
2720
2241
  switch (_d.label) {
@@ -2755,14 +2276,14 @@ var deserializeAws_restJson1DescribeGatewayRouteCommandError = function (output,
2755
2276
  case 13: throw _d.sent();
2756
2277
  case 14:
2757
2278
  parsedBody = parsedOutput.body;
2758
- $metadata = deserializeMetadata(output);
2759
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2760
- response = new __BaseException({
2761
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2762
- $fault: "client",
2763
- $metadata: $metadata,
2279
+ throwDefaultError({
2280
+ output: output,
2281
+ parsedBody: parsedBody,
2282
+ exceptionCtor: __BaseException,
2283
+ errorCode: errorCode,
2764
2284
  });
2765
- throw __decorateServiceException(response, parsedBody);
2285
+ _d.label = 15;
2286
+ case 15: return [2];
2766
2287
  }
2767
2288
  });
2768
2289
  }); };
@@ -2774,21 +2295,20 @@ export var deserializeAws_restJson1DescribeMeshCommand = function (output, conte
2774
2295
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2775
2296
  return [2, deserializeAws_restJson1DescribeMeshCommandError(output, context)];
2776
2297
  }
2777
- contents = {
2298
+ contents = map({
2778
2299
  $metadata: deserializeMetadata(output),
2779
- mesh: undefined,
2780
- };
2300
+ });
2781
2301
  _a = __expectObject;
2782
2302
  return [4, parseBody(output.body, context)];
2783
2303
  case 1:
2784
2304
  data = _a.apply(void 0, [_b.sent()]);
2785
2305
  contents.mesh = deserializeAws_restJson1MeshData(data, context);
2786
- return [2, Promise.resolve(contents)];
2306
+ return [2, contents];
2787
2307
  }
2788
2308
  });
2789
2309
  }); };
2790
2310
  var deserializeAws_restJson1DescribeMeshCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2791
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2311
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2792
2312
  var _c;
2793
2313
  return __generator(this, function (_d) {
2794
2314
  switch (_d.label) {
@@ -2829,14 +2349,14 @@ var deserializeAws_restJson1DescribeMeshCommandError = function (output, context
2829
2349
  case 13: throw _d.sent();
2830
2350
  case 14:
2831
2351
  parsedBody = parsedOutput.body;
2832
- $metadata = deserializeMetadata(output);
2833
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2834
- response = new __BaseException({
2835
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2836
- $fault: "client",
2837
- $metadata: $metadata,
2352
+ throwDefaultError({
2353
+ output: output,
2354
+ parsedBody: parsedBody,
2355
+ exceptionCtor: __BaseException,
2356
+ errorCode: errorCode,
2838
2357
  });
2839
- throw __decorateServiceException(response, parsedBody);
2358
+ _d.label = 15;
2359
+ case 15: return [2];
2840
2360
  }
2841
2361
  });
2842
2362
  }); };
@@ -2848,21 +2368,20 @@ export var deserializeAws_restJson1DescribeRouteCommand = function (output, cont
2848
2368
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2849
2369
  return [2, deserializeAws_restJson1DescribeRouteCommandError(output, context)];
2850
2370
  }
2851
- contents = {
2371
+ contents = map({
2852
2372
  $metadata: deserializeMetadata(output),
2853
- route: undefined,
2854
- };
2373
+ });
2855
2374
  _a = __expectObject;
2856
2375
  return [4, parseBody(output.body, context)];
2857
2376
  case 1:
2858
2377
  data = _a.apply(void 0, [_b.sent()]);
2859
2378
  contents.route = deserializeAws_restJson1RouteData(data, context);
2860
- return [2, Promise.resolve(contents)];
2379
+ return [2, contents];
2861
2380
  }
2862
2381
  });
2863
2382
  }); };
2864
2383
  var deserializeAws_restJson1DescribeRouteCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2865
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2384
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2866
2385
  var _c;
2867
2386
  return __generator(this, function (_d) {
2868
2387
  switch (_d.label) {
@@ -2903,14 +2422,14 @@ var deserializeAws_restJson1DescribeRouteCommandError = function (output, contex
2903
2422
  case 13: throw _d.sent();
2904
2423
  case 14:
2905
2424
  parsedBody = parsedOutput.body;
2906
- $metadata = deserializeMetadata(output);
2907
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2908
- response = new __BaseException({
2909
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2910
- $fault: "client",
2911
- $metadata: $metadata,
2425
+ throwDefaultError({
2426
+ output: output,
2427
+ parsedBody: parsedBody,
2428
+ exceptionCtor: __BaseException,
2429
+ errorCode: errorCode,
2912
2430
  });
2913
- throw __decorateServiceException(response, parsedBody);
2431
+ _d.label = 15;
2432
+ case 15: return [2];
2914
2433
  }
2915
2434
  });
2916
2435
  }); };
@@ -2922,21 +2441,20 @@ export var deserializeAws_restJson1DescribeVirtualGatewayCommand = function (out
2922
2441
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2923
2442
  return [2, deserializeAws_restJson1DescribeVirtualGatewayCommandError(output, context)];
2924
2443
  }
2925
- contents = {
2444
+ contents = map({
2926
2445
  $metadata: deserializeMetadata(output),
2927
- virtualGateway: undefined,
2928
- };
2446
+ });
2929
2447
  _a = __expectObject;
2930
2448
  return [4, parseBody(output.body, context)];
2931
2449
  case 1:
2932
2450
  data = _a.apply(void 0, [_b.sent()]);
2933
2451
  contents.virtualGateway = deserializeAws_restJson1VirtualGatewayData(data, context);
2934
- return [2, Promise.resolve(contents)];
2452
+ return [2, contents];
2935
2453
  }
2936
2454
  });
2937
2455
  }); };
2938
2456
  var deserializeAws_restJson1DescribeVirtualGatewayCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
2939
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2457
+ var parsedOutput, _a, errorCode, _b, parsedBody;
2940
2458
  var _c;
2941
2459
  return __generator(this, function (_d) {
2942
2460
  switch (_d.label) {
@@ -2977,14 +2495,14 @@ var deserializeAws_restJson1DescribeVirtualGatewayCommandError = function (outpu
2977
2495
  case 13: throw _d.sent();
2978
2496
  case 14:
2979
2497
  parsedBody = parsedOutput.body;
2980
- $metadata = deserializeMetadata(output);
2981
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2982
- response = new __BaseException({
2983
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2984
- $fault: "client",
2985
- $metadata: $metadata,
2498
+ throwDefaultError({
2499
+ output: output,
2500
+ parsedBody: parsedBody,
2501
+ exceptionCtor: __BaseException,
2502
+ errorCode: errorCode,
2986
2503
  });
2987
- throw __decorateServiceException(response, parsedBody);
2504
+ _d.label = 15;
2505
+ case 15: return [2];
2988
2506
  }
2989
2507
  });
2990
2508
  }); };
@@ -2996,21 +2514,20 @@ export var deserializeAws_restJson1DescribeVirtualNodeCommand = function (output
2996
2514
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2997
2515
  return [2, deserializeAws_restJson1DescribeVirtualNodeCommandError(output, context)];
2998
2516
  }
2999
- contents = {
2517
+ contents = map({
3000
2518
  $metadata: deserializeMetadata(output),
3001
- virtualNode: undefined,
3002
- };
2519
+ });
3003
2520
  _a = __expectObject;
3004
2521
  return [4, parseBody(output.body, context)];
3005
2522
  case 1:
3006
2523
  data = _a.apply(void 0, [_b.sent()]);
3007
2524
  contents.virtualNode = deserializeAws_restJson1VirtualNodeData(data, context);
3008
- return [2, Promise.resolve(contents)];
2525
+ return [2, contents];
3009
2526
  }
3010
2527
  });
3011
2528
  }); };
3012
2529
  var deserializeAws_restJson1DescribeVirtualNodeCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3013
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2530
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3014
2531
  var _c;
3015
2532
  return __generator(this, function (_d) {
3016
2533
  switch (_d.label) {
@@ -3051,14 +2568,14 @@ var deserializeAws_restJson1DescribeVirtualNodeCommandError = function (output,
3051
2568
  case 13: throw _d.sent();
3052
2569
  case 14:
3053
2570
  parsedBody = parsedOutput.body;
3054
- $metadata = deserializeMetadata(output);
3055
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3056
- response = new __BaseException({
3057
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3058
- $fault: "client",
3059
- $metadata: $metadata,
2571
+ throwDefaultError({
2572
+ output: output,
2573
+ parsedBody: parsedBody,
2574
+ exceptionCtor: __BaseException,
2575
+ errorCode: errorCode,
3060
2576
  });
3061
- throw __decorateServiceException(response, parsedBody);
2577
+ _d.label = 15;
2578
+ case 15: return [2];
3062
2579
  }
3063
2580
  });
3064
2581
  }); };
@@ -3070,21 +2587,20 @@ export var deserializeAws_restJson1DescribeVirtualRouterCommand = function (outp
3070
2587
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3071
2588
  return [2, deserializeAws_restJson1DescribeVirtualRouterCommandError(output, context)];
3072
2589
  }
3073
- contents = {
2590
+ contents = map({
3074
2591
  $metadata: deserializeMetadata(output),
3075
- virtualRouter: undefined,
3076
- };
2592
+ });
3077
2593
  _a = __expectObject;
3078
2594
  return [4, parseBody(output.body, context)];
3079
2595
  case 1:
3080
2596
  data = _a.apply(void 0, [_b.sent()]);
3081
2597
  contents.virtualRouter = deserializeAws_restJson1VirtualRouterData(data, context);
3082
- return [2, Promise.resolve(contents)];
2598
+ return [2, contents];
3083
2599
  }
3084
2600
  });
3085
2601
  }); };
3086
2602
  var deserializeAws_restJson1DescribeVirtualRouterCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3087
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2603
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3088
2604
  var _c;
3089
2605
  return __generator(this, function (_d) {
3090
2606
  switch (_d.label) {
@@ -3125,14 +2641,14 @@ var deserializeAws_restJson1DescribeVirtualRouterCommandError = function (output
3125
2641
  case 13: throw _d.sent();
3126
2642
  case 14:
3127
2643
  parsedBody = parsedOutput.body;
3128
- $metadata = deserializeMetadata(output);
3129
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3130
- response = new __BaseException({
3131
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3132
- $fault: "client",
3133
- $metadata: $metadata,
2644
+ throwDefaultError({
2645
+ output: output,
2646
+ parsedBody: parsedBody,
2647
+ exceptionCtor: __BaseException,
2648
+ errorCode: errorCode,
3134
2649
  });
3135
- throw __decorateServiceException(response, parsedBody);
2650
+ _d.label = 15;
2651
+ case 15: return [2];
3136
2652
  }
3137
2653
  });
3138
2654
  }); };
@@ -3144,21 +2660,20 @@ export var deserializeAws_restJson1DescribeVirtualServiceCommand = function (out
3144
2660
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3145
2661
  return [2, deserializeAws_restJson1DescribeVirtualServiceCommandError(output, context)];
3146
2662
  }
3147
- contents = {
2663
+ contents = map({
3148
2664
  $metadata: deserializeMetadata(output),
3149
- virtualService: undefined,
3150
- };
2665
+ });
3151
2666
  _a = __expectObject;
3152
2667
  return [4, parseBody(output.body, context)];
3153
2668
  case 1:
3154
2669
  data = _a.apply(void 0, [_b.sent()]);
3155
2670
  contents.virtualService = deserializeAws_restJson1VirtualServiceData(data, context);
3156
- return [2, Promise.resolve(contents)];
2671
+ return [2, contents];
3157
2672
  }
3158
2673
  });
3159
2674
  }); };
3160
2675
  var deserializeAws_restJson1DescribeVirtualServiceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3161
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2676
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3162
2677
  var _c;
3163
2678
  return __generator(this, function (_d) {
3164
2679
  switch (_d.label) {
@@ -3199,14 +2714,14 @@ var deserializeAws_restJson1DescribeVirtualServiceCommandError = function (outpu
3199
2714
  case 13: throw _d.sent();
3200
2715
  case 14:
3201
2716
  parsedBody = parsedOutput.body;
3202
- $metadata = deserializeMetadata(output);
3203
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3204
- response = new __BaseException({
3205
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3206
- $fault: "client",
3207
- $metadata: $metadata,
2717
+ throwDefaultError({
2718
+ output: output,
2719
+ parsedBody: parsedBody,
2720
+ exceptionCtor: __BaseException,
2721
+ errorCode: errorCode,
3208
2722
  });
3209
- throw __decorateServiceException(response, parsedBody);
2723
+ _d.label = 15;
2724
+ case 15: return [2];
3210
2725
  }
3211
2726
  });
3212
2727
  }); };
@@ -3218,28 +2733,26 @@ export var deserializeAws_restJson1ListGatewayRoutesCommand = function (output,
3218
2733
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3219
2734
  return [2, deserializeAws_restJson1ListGatewayRoutesCommandError(output, context)];
3220
2735
  }
3221
- contents = {
2736
+ contents = map({
3222
2737
  $metadata: deserializeMetadata(output),
3223
- gatewayRoutes: undefined,
3224
- nextToken: undefined,
3225
- };
2738
+ });
3226
2739
  _a = __expectNonNull;
3227
2740
  _b = __expectObject;
3228
2741
  return [4, parseBody(output.body, context)];
3229
2742
  case 1:
3230
2743
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3231
- if (data.gatewayRoutes !== undefined && data.gatewayRoutes !== null) {
2744
+ if (data.gatewayRoutes != null) {
3232
2745
  contents.gatewayRoutes = deserializeAws_restJson1GatewayRouteList(data.gatewayRoutes, context);
3233
2746
  }
3234
- if (data.nextToken !== undefined && data.nextToken !== null) {
2747
+ if (data.nextToken != null) {
3235
2748
  contents.nextToken = __expectString(data.nextToken);
3236
2749
  }
3237
- return [2, Promise.resolve(contents)];
2750
+ return [2, contents];
3238
2751
  }
3239
2752
  });
3240
2753
  }); };
3241
2754
  var deserializeAws_restJson1ListGatewayRoutesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3242
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2755
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3243
2756
  var _c;
3244
2757
  return __generator(this, function (_d) {
3245
2758
  switch (_d.label) {
@@ -3280,14 +2793,14 @@ var deserializeAws_restJson1ListGatewayRoutesCommandError = function (output, co
3280
2793
  case 13: throw _d.sent();
3281
2794
  case 14:
3282
2795
  parsedBody = parsedOutput.body;
3283
- $metadata = deserializeMetadata(output);
3284
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3285
- response = new __BaseException({
3286
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3287
- $fault: "client",
3288
- $metadata: $metadata,
2796
+ throwDefaultError({
2797
+ output: output,
2798
+ parsedBody: parsedBody,
2799
+ exceptionCtor: __BaseException,
2800
+ errorCode: errorCode,
3289
2801
  });
3290
- throw __decorateServiceException(response, parsedBody);
2802
+ _d.label = 15;
2803
+ case 15: return [2];
3291
2804
  }
3292
2805
  });
3293
2806
  }); };
@@ -3299,28 +2812,26 @@ export var deserializeAws_restJson1ListMeshesCommand = function (output, context
3299
2812
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3300
2813
  return [2, deserializeAws_restJson1ListMeshesCommandError(output, context)];
3301
2814
  }
3302
- contents = {
2815
+ contents = map({
3303
2816
  $metadata: deserializeMetadata(output),
3304
- meshes: undefined,
3305
- nextToken: undefined,
3306
- };
2817
+ });
3307
2818
  _a = __expectNonNull;
3308
2819
  _b = __expectObject;
3309
2820
  return [4, parseBody(output.body, context)];
3310
2821
  case 1:
3311
2822
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3312
- if (data.meshes !== undefined && data.meshes !== null) {
2823
+ if (data.meshes != null) {
3313
2824
  contents.meshes = deserializeAws_restJson1MeshList(data.meshes, context);
3314
2825
  }
3315
- if (data.nextToken !== undefined && data.nextToken !== null) {
2826
+ if (data.nextToken != null) {
3316
2827
  contents.nextToken = __expectString(data.nextToken);
3317
2828
  }
3318
- return [2, Promise.resolve(contents)];
2829
+ return [2, contents];
3319
2830
  }
3320
2831
  });
3321
2832
  }); };
3322
2833
  var deserializeAws_restJson1ListMeshesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3323
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2834
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3324
2835
  var _c;
3325
2836
  return __generator(this, function (_d) {
3326
2837
  switch (_d.label) {
@@ -3361,14 +2872,14 @@ var deserializeAws_restJson1ListMeshesCommandError = function (output, context)
3361
2872
  case 13: throw _d.sent();
3362
2873
  case 14:
3363
2874
  parsedBody = parsedOutput.body;
3364
- $metadata = deserializeMetadata(output);
3365
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3366
- response = new __BaseException({
3367
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3368
- $fault: "client",
3369
- $metadata: $metadata,
2875
+ throwDefaultError({
2876
+ output: output,
2877
+ parsedBody: parsedBody,
2878
+ exceptionCtor: __BaseException,
2879
+ errorCode: errorCode,
3370
2880
  });
3371
- throw __decorateServiceException(response, parsedBody);
2881
+ _d.label = 15;
2882
+ case 15: return [2];
3372
2883
  }
3373
2884
  });
3374
2885
  }); };
@@ -3380,28 +2891,26 @@ export var deserializeAws_restJson1ListRoutesCommand = function (output, context
3380
2891
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3381
2892
  return [2, deserializeAws_restJson1ListRoutesCommandError(output, context)];
3382
2893
  }
3383
- contents = {
2894
+ contents = map({
3384
2895
  $metadata: deserializeMetadata(output),
3385
- nextToken: undefined,
3386
- routes: undefined,
3387
- };
2896
+ });
3388
2897
  _a = __expectNonNull;
3389
2898
  _b = __expectObject;
3390
2899
  return [4, parseBody(output.body, context)];
3391
2900
  case 1:
3392
2901
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3393
- if (data.nextToken !== undefined && data.nextToken !== null) {
2902
+ if (data.nextToken != null) {
3394
2903
  contents.nextToken = __expectString(data.nextToken);
3395
2904
  }
3396
- if (data.routes !== undefined && data.routes !== null) {
2905
+ if (data.routes != null) {
3397
2906
  contents.routes = deserializeAws_restJson1RouteList(data.routes, context);
3398
2907
  }
3399
- return [2, Promise.resolve(contents)];
2908
+ return [2, contents];
3400
2909
  }
3401
2910
  });
3402
2911
  }); };
3403
2912
  var deserializeAws_restJson1ListRoutesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3404
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2913
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3405
2914
  var _c;
3406
2915
  return __generator(this, function (_d) {
3407
2916
  switch (_d.label) {
@@ -3442,14 +2951,14 @@ var deserializeAws_restJson1ListRoutesCommandError = function (output, context)
3442
2951
  case 13: throw _d.sent();
3443
2952
  case 14:
3444
2953
  parsedBody = parsedOutput.body;
3445
- $metadata = deserializeMetadata(output);
3446
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3447
- response = new __BaseException({
3448
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3449
- $fault: "client",
3450
- $metadata: $metadata,
2954
+ throwDefaultError({
2955
+ output: output,
2956
+ parsedBody: parsedBody,
2957
+ exceptionCtor: __BaseException,
2958
+ errorCode: errorCode,
3451
2959
  });
3452
- throw __decorateServiceException(response, parsedBody);
2960
+ _d.label = 15;
2961
+ case 15: return [2];
3453
2962
  }
3454
2963
  });
3455
2964
  }); };
@@ -3461,28 +2970,26 @@ export var deserializeAws_restJson1ListTagsForResourceCommand = function (output
3461
2970
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3462
2971
  return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
3463
2972
  }
3464
- contents = {
2973
+ contents = map({
3465
2974
  $metadata: deserializeMetadata(output),
3466
- nextToken: undefined,
3467
- tags: undefined,
3468
- };
2975
+ });
3469
2976
  _a = __expectNonNull;
3470
2977
  _b = __expectObject;
3471
2978
  return [4, parseBody(output.body, context)];
3472
2979
  case 1:
3473
2980
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3474
- if (data.nextToken !== undefined && data.nextToken !== null) {
2981
+ if (data.nextToken != null) {
3475
2982
  contents.nextToken = __expectString(data.nextToken);
3476
2983
  }
3477
- if (data.tags !== undefined && data.tags !== null) {
2984
+ if (data.tags != null) {
3478
2985
  contents.tags = deserializeAws_restJson1TagList(data.tags, context);
3479
2986
  }
3480
- return [2, Promise.resolve(contents)];
2987
+ return [2, contents];
3481
2988
  }
3482
2989
  });
3483
2990
  }); };
3484
2991
  var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3485
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2992
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3486
2993
  var _c;
3487
2994
  return __generator(this, function (_d) {
3488
2995
  switch (_d.label) {
@@ -3523,14 +3030,14 @@ var deserializeAws_restJson1ListTagsForResourceCommandError = function (output,
3523
3030
  case 13: throw _d.sent();
3524
3031
  case 14:
3525
3032
  parsedBody = parsedOutput.body;
3526
- $metadata = deserializeMetadata(output);
3527
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3528
- response = new __BaseException({
3529
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3530
- $fault: "client",
3531
- $metadata: $metadata,
3033
+ throwDefaultError({
3034
+ output: output,
3035
+ parsedBody: parsedBody,
3036
+ exceptionCtor: __BaseException,
3037
+ errorCode: errorCode,
3532
3038
  });
3533
- throw __decorateServiceException(response, parsedBody);
3039
+ _d.label = 15;
3040
+ case 15: return [2];
3534
3041
  }
3535
3042
  });
3536
3043
  }); };
@@ -3542,28 +3049,26 @@ export var deserializeAws_restJson1ListVirtualGatewaysCommand = function (output
3542
3049
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3543
3050
  return [2, deserializeAws_restJson1ListVirtualGatewaysCommandError(output, context)];
3544
3051
  }
3545
- contents = {
3052
+ contents = map({
3546
3053
  $metadata: deserializeMetadata(output),
3547
- nextToken: undefined,
3548
- virtualGateways: undefined,
3549
- };
3054
+ });
3550
3055
  _a = __expectNonNull;
3551
3056
  _b = __expectObject;
3552
3057
  return [4, parseBody(output.body, context)];
3553
3058
  case 1:
3554
3059
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3555
- if (data.nextToken !== undefined && data.nextToken !== null) {
3060
+ if (data.nextToken != null) {
3556
3061
  contents.nextToken = __expectString(data.nextToken);
3557
3062
  }
3558
- if (data.virtualGateways !== undefined && data.virtualGateways !== null) {
3063
+ if (data.virtualGateways != null) {
3559
3064
  contents.virtualGateways = deserializeAws_restJson1VirtualGatewayList(data.virtualGateways, context);
3560
3065
  }
3561
- return [2, Promise.resolve(contents)];
3066
+ return [2, contents];
3562
3067
  }
3563
3068
  });
3564
3069
  }); };
3565
3070
  var deserializeAws_restJson1ListVirtualGatewaysCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3566
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3071
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3567
3072
  var _c;
3568
3073
  return __generator(this, function (_d) {
3569
3074
  switch (_d.label) {
@@ -3604,14 +3109,14 @@ var deserializeAws_restJson1ListVirtualGatewaysCommandError = function (output,
3604
3109
  case 13: throw _d.sent();
3605
3110
  case 14:
3606
3111
  parsedBody = parsedOutput.body;
3607
- $metadata = deserializeMetadata(output);
3608
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3609
- response = new __BaseException({
3610
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3611
- $fault: "client",
3612
- $metadata: $metadata,
3112
+ throwDefaultError({
3113
+ output: output,
3114
+ parsedBody: parsedBody,
3115
+ exceptionCtor: __BaseException,
3116
+ errorCode: errorCode,
3613
3117
  });
3614
- throw __decorateServiceException(response, parsedBody);
3118
+ _d.label = 15;
3119
+ case 15: return [2];
3615
3120
  }
3616
3121
  });
3617
3122
  }); };
@@ -3623,28 +3128,26 @@ export var deserializeAws_restJson1ListVirtualNodesCommand = function (output, c
3623
3128
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3624
3129
  return [2, deserializeAws_restJson1ListVirtualNodesCommandError(output, context)];
3625
3130
  }
3626
- contents = {
3131
+ contents = map({
3627
3132
  $metadata: deserializeMetadata(output),
3628
- nextToken: undefined,
3629
- virtualNodes: undefined,
3630
- };
3133
+ });
3631
3134
  _a = __expectNonNull;
3632
3135
  _b = __expectObject;
3633
3136
  return [4, parseBody(output.body, context)];
3634
3137
  case 1:
3635
3138
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3636
- if (data.nextToken !== undefined && data.nextToken !== null) {
3139
+ if (data.nextToken != null) {
3637
3140
  contents.nextToken = __expectString(data.nextToken);
3638
3141
  }
3639
- if (data.virtualNodes !== undefined && data.virtualNodes !== null) {
3142
+ if (data.virtualNodes != null) {
3640
3143
  contents.virtualNodes = deserializeAws_restJson1VirtualNodeList(data.virtualNodes, context);
3641
3144
  }
3642
- return [2, Promise.resolve(contents)];
3145
+ return [2, contents];
3643
3146
  }
3644
3147
  });
3645
3148
  }); };
3646
3149
  var deserializeAws_restJson1ListVirtualNodesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3647
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3150
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3648
3151
  var _c;
3649
3152
  return __generator(this, function (_d) {
3650
3153
  switch (_d.label) {
@@ -3685,14 +3188,14 @@ var deserializeAws_restJson1ListVirtualNodesCommandError = function (output, con
3685
3188
  case 13: throw _d.sent();
3686
3189
  case 14:
3687
3190
  parsedBody = parsedOutput.body;
3688
- $metadata = deserializeMetadata(output);
3689
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3690
- response = new __BaseException({
3691
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3692
- $fault: "client",
3693
- $metadata: $metadata,
3191
+ throwDefaultError({
3192
+ output: output,
3193
+ parsedBody: parsedBody,
3194
+ exceptionCtor: __BaseException,
3195
+ errorCode: errorCode,
3694
3196
  });
3695
- throw __decorateServiceException(response, parsedBody);
3197
+ _d.label = 15;
3198
+ case 15: return [2];
3696
3199
  }
3697
3200
  });
3698
3201
  }); };
@@ -3704,28 +3207,26 @@ export var deserializeAws_restJson1ListVirtualRoutersCommand = function (output,
3704
3207
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3705
3208
  return [2, deserializeAws_restJson1ListVirtualRoutersCommandError(output, context)];
3706
3209
  }
3707
- contents = {
3210
+ contents = map({
3708
3211
  $metadata: deserializeMetadata(output),
3709
- nextToken: undefined,
3710
- virtualRouters: undefined,
3711
- };
3212
+ });
3712
3213
  _a = __expectNonNull;
3713
3214
  _b = __expectObject;
3714
3215
  return [4, parseBody(output.body, context)];
3715
3216
  case 1:
3716
3217
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3717
- if (data.nextToken !== undefined && data.nextToken !== null) {
3218
+ if (data.nextToken != null) {
3718
3219
  contents.nextToken = __expectString(data.nextToken);
3719
3220
  }
3720
- if (data.virtualRouters !== undefined && data.virtualRouters !== null) {
3221
+ if (data.virtualRouters != null) {
3721
3222
  contents.virtualRouters = deserializeAws_restJson1VirtualRouterList(data.virtualRouters, context);
3722
3223
  }
3723
- return [2, Promise.resolve(contents)];
3224
+ return [2, contents];
3724
3225
  }
3725
3226
  });
3726
3227
  }); };
3727
3228
  var deserializeAws_restJson1ListVirtualRoutersCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3728
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3229
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3729
3230
  var _c;
3730
3231
  return __generator(this, function (_d) {
3731
3232
  switch (_d.label) {
@@ -3766,14 +3267,14 @@ var deserializeAws_restJson1ListVirtualRoutersCommandError = function (output, c
3766
3267
  case 13: throw _d.sent();
3767
3268
  case 14:
3768
3269
  parsedBody = parsedOutput.body;
3769
- $metadata = deserializeMetadata(output);
3770
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3771
- response = new __BaseException({
3772
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3773
- $fault: "client",
3774
- $metadata: $metadata,
3270
+ throwDefaultError({
3271
+ output: output,
3272
+ parsedBody: parsedBody,
3273
+ exceptionCtor: __BaseException,
3274
+ errorCode: errorCode,
3775
3275
  });
3776
- throw __decorateServiceException(response, parsedBody);
3276
+ _d.label = 15;
3277
+ case 15: return [2];
3777
3278
  }
3778
3279
  });
3779
3280
  }); };
@@ -3785,28 +3286,26 @@ export var deserializeAws_restJson1ListVirtualServicesCommand = function (output
3785
3286
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3786
3287
  return [2, deserializeAws_restJson1ListVirtualServicesCommandError(output, context)];
3787
3288
  }
3788
- contents = {
3289
+ contents = map({
3789
3290
  $metadata: deserializeMetadata(output),
3790
- nextToken: undefined,
3791
- virtualServices: undefined,
3792
- };
3291
+ });
3793
3292
  _a = __expectNonNull;
3794
3293
  _b = __expectObject;
3795
3294
  return [4, parseBody(output.body, context)];
3796
3295
  case 1:
3797
3296
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
3798
- if (data.nextToken !== undefined && data.nextToken !== null) {
3297
+ if (data.nextToken != null) {
3799
3298
  contents.nextToken = __expectString(data.nextToken);
3800
3299
  }
3801
- if (data.virtualServices !== undefined && data.virtualServices !== null) {
3300
+ if (data.virtualServices != null) {
3802
3301
  contents.virtualServices = deserializeAws_restJson1VirtualServiceList(data.virtualServices, context);
3803
3302
  }
3804
- return [2, Promise.resolve(contents)];
3303
+ return [2, contents];
3805
3304
  }
3806
3305
  });
3807
3306
  }); };
3808
3307
  var deserializeAws_restJson1ListVirtualServicesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3809
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3308
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3810
3309
  var _c;
3811
3310
  return __generator(this, function (_d) {
3812
3311
  switch (_d.label) {
@@ -3847,14 +3346,14 @@ var deserializeAws_restJson1ListVirtualServicesCommandError = function (output,
3847
3346
  case 13: throw _d.sent();
3848
3347
  case 14:
3849
3348
  parsedBody = parsedOutput.body;
3850
- $metadata = deserializeMetadata(output);
3851
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3852
- response = new __BaseException({
3853
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3854
- $fault: "client",
3855
- $metadata: $metadata,
3349
+ throwDefaultError({
3350
+ output: output,
3351
+ parsedBody: parsedBody,
3352
+ exceptionCtor: __BaseException,
3353
+ errorCode: errorCode,
3856
3354
  });
3857
- throw __decorateServiceException(response, parsedBody);
3355
+ _d.label = 15;
3356
+ case 15: return [2];
3858
3357
  }
3859
3358
  });
3860
3359
  }); };
@@ -3866,18 +3365,18 @@ export var deserializeAws_restJson1TagResourceCommand = function (output, contex
3866
3365
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3867
3366
  return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
3868
3367
  }
3869
- contents = {
3368
+ contents = map({
3870
3369
  $metadata: deserializeMetadata(output),
3871
- };
3370
+ });
3872
3371
  return [4, collectBody(output.body, context)];
3873
3372
  case 1:
3874
3373
  _a.sent();
3875
- return [2, Promise.resolve(contents)];
3374
+ return [2, contents];
3876
3375
  }
3877
3376
  });
3878
3377
  }); };
3879
3378
  var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3880
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3379
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3881
3380
  var _c;
3882
3381
  return __generator(this, function (_d) {
3883
3382
  switch (_d.label) {
@@ -3922,14 +3421,14 @@ var deserializeAws_restJson1TagResourceCommandError = function (output, context)
3922
3421
  case 15: throw _d.sent();
3923
3422
  case 16:
3924
3423
  parsedBody = parsedOutput.body;
3925
- $metadata = deserializeMetadata(output);
3926
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3927
- response = new __BaseException({
3928
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
3929
- $fault: "client",
3930
- $metadata: $metadata,
3424
+ throwDefaultError({
3425
+ output: output,
3426
+ parsedBody: parsedBody,
3427
+ exceptionCtor: __BaseException,
3428
+ errorCode: errorCode,
3931
3429
  });
3932
- throw __decorateServiceException(response, parsedBody);
3430
+ _d.label = 17;
3431
+ case 17: return [2];
3933
3432
  }
3934
3433
  });
3935
3434
  }); };
@@ -3941,18 +3440,18 @@ export var deserializeAws_restJson1UntagResourceCommand = function (output, cont
3941
3440
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3942
3441
  return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
3943
3442
  }
3944
- contents = {
3443
+ contents = map({
3945
3444
  $metadata: deserializeMetadata(output),
3946
- };
3445
+ });
3947
3446
  return [4, collectBody(output.body, context)];
3948
3447
  case 1:
3949
3448
  _a.sent();
3950
- return [2, Promise.resolve(contents)];
3449
+ return [2, contents];
3951
3450
  }
3952
3451
  });
3953
3452
  }); };
3954
3453
  var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
3955
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3454
+ var parsedOutput, _a, errorCode, _b, parsedBody;
3956
3455
  var _c;
3957
3456
  return __generator(this, function (_d) {
3958
3457
  switch (_d.label) {
@@ -3993,14 +3492,14 @@ var deserializeAws_restJson1UntagResourceCommandError = function (output, contex
3993
3492
  case 13: throw _d.sent();
3994
3493
  case 14:
3995
3494
  parsedBody = parsedOutput.body;
3996
- $metadata = deserializeMetadata(output);
3997
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
3998
- response = new __BaseException({
3999
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4000
- $fault: "client",
4001
- $metadata: $metadata,
3495
+ throwDefaultError({
3496
+ output: output,
3497
+ parsedBody: parsedBody,
3498
+ exceptionCtor: __BaseException,
3499
+ errorCode: errorCode,
4002
3500
  });
4003
- throw __decorateServiceException(response, parsedBody);
3501
+ _d.label = 15;
3502
+ case 15: return [2];
4004
3503
  }
4005
3504
  });
4006
3505
  }); };
@@ -4012,21 +3511,20 @@ export var deserializeAws_restJson1UpdateGatewayRouteCommand = function (output,
4012
3511
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4013
3512
  return [2, deserializeAws_restJson1UpdateGatewayRouteCommandError(output, context)];
4014
3513
  }
4015
- contents = {
3514
+ contents = map({
4016
3515
  $metadata: deserializeMetadata(output),
4017
- gatewayRoute: undefined,
4018
- };
3516
+ });
4019
3517
  _a = __expectObject;
4020
3518
  return [4, parseBody(output.body, context)];
4021
3519
  case 1:
4022
3520
  data = _a.apply(void 0, [_b.sent()]);
4023
3521
  contents.gatewayRoute = deserializeAws_restJson1GatewayRouteData(data, context);
4024
- return [2, Promise.resolve(contents)];
3522
+ return [2, contents];
4025
3523
  }
4026
3524
  });
4027
3525
  }); };
4028
3526
  var deserializeAws_restJson1UpdateGatewayRouteCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
4029
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3527
+ var parsedOutput, _a, errorCode, _b, parsedBody;
4030
3528
  var _c;
4031
3529
  return __generator(this, function (_d) {
4032
3530
  switch (_d.label) {
@@ -4075,14 +3573,14 @@ var deserializeAws_restJson1UpdateGatewayRouteCommandError = function (output, c
4075
3573
  case 17: throw _d.sent();
4076
3574
  case 18:
4077
3575
  parsedBody = parsedOutput.body;
4078
- $metadata = deserializeMetadata(output);
4079
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4080
- response = new __BaseException({
4081
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4082
- $fault: "client",
4083
- $metadata: $metadata,
3576
+ throwDefaultError({
3577
+ output: output,
3578
+ parsedBody: parsedBody,
3579
+ exceptionCtor: __BaseException,
3580
+ errorCode: errorCode,
4084
3581
  });
4085
- throw __decorateServiceException(response, parsedBody);
3582
+ _d.label = 19;
3583
+ case 19: return [2];
4086
3584
  }
4087
3585
  });
4088
3586
  }); };
@@ -4094,21 +3592,20 @@ export var deserializeAws_restJson1UpdateMeshCommand = function (output, context
4094
3592
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4095
3593
  return [2, deserializeAws_restJson1UpdateMeshCommandError(output, context)];
4096
3594
  }
4097
- contents = {
3595
+ contents = map({
4098
3596
  $metadata: deserializeMetadata(output),
4099
- mesh: undefined,
4100
- };
3597
+ });
4101
3598
  _a = __expectObject;
4102
3599
  return [4, parseBody(output.body, context)];
4103
3600
  case 1:
4104
3601
  data = _a.apply(void 0, [_b.sent()]);
4105
3602
  contents.mesh = deserializeAws_restJson1MeshData(data, context);
4106
- return [2, Promise.resolve(contents)];
3603
+ return [2, contents];
4107
3604
  }
4108
3605
  });
4109
3606
  }); };
4110
3607
  var deserializeAws_restJson1UpdateMeshCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
4111
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3608
+ var parsedOutput, _a, errorCode, _b, parsedBody;
4112
3609
  var _c;
4113
3610
  return __generator(this, function (_d) {
4114
3611
  switch (_d.label) {
@@ -4153,14 +3650,14 @@ var deserializeAws_restJson1UpdateMeshCommandError = function (output, context)
4153
3650
  case 15: throw _d.sent();
4154
3651
  case 16:
4155
3652
  parsedBody = parsedOutput.body;
4156
- $metadata = deserializeMetadata(output);
4157
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4158
- response = new __BaseException({
4159
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4160
- $fault: "client",
4161
- $metadata: $metadata,
3653
+ throwDefaultError({
3654
+ output: output,
3655
+ parsedBody: parsedBody,
3656
+ exceptionCtor: __BaseException,
3657
+ errorCode: errorCode,
4162
3658
  });
4163
- throw __decorateServiceException(response, parsedBody);
3659
+ _d.label = 17;
3660
+ case 17: return [2];
4164
3661
  }
4165
3662
  });
4166
3663
  }); };
@@ -4172,21 +3669,20 @@ export var deserializeAws_restJson1UpdateRouteCommand = function (output, contex
4172
3669
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4173
3670
  return [2, deserializeAws_restJson1UpdateRouteCommandError(output, context)];
4174
3671
  }
4175
- contents = {
3672
+ contents = map({
4176
3673
  $metadata: deserializeMetadata(output),
4177
- route: undefined,
4178
- };
3674
+ });
4179
3675
  _a = __expectObject;
4180
3676
  return [4, parseBody(output.body, context)];
4181
3677
  case 1:
4182
3678
  data = _a.apply(void 0, [_b.sent()]);
4183
3679
  contents.route = deserializeAws_restJson1RouteData(data, context);
4184
- return [2, Promise.resolve(contents)];
3680
+ return [2, contents];
4185
3681
  }
4186
3682
  });
4187
3683
  }); };
4188
3684
  var deserializeAws_restJson1UpdateRouteCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
4189
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3685
+ var parsedOutput, _a, errorCode, _b, parsedBody;
4190
3686
  var _c;
4191
3687
  return __generator(this, function (_d) {
4192
3688
  switch (_d.label) {
@@ -4235,14 +3731,14 @@ var deserializeAws_restJson1UpdateRouteCommandError = function (output, context)
4235
3731
  case 17: throw _d.sent();
4236
3732
  case 18:
4237
3733
  parsedBody = parsedOutput.body;
4238
- $metadata = deserializeMetadata(output);
4239
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4240
- response = new __BaseException({
4241
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4242
- $fault: "client",
4243
- $metadata: $metadata,
3734
+ throwDefaultError({
3735
+ output: output,
3736
+ parsedBody: parsedBody,
3737
+ exceptionCtor: __BaseException,
3738
+ errorCode: errorCode,
4244
3739
  });
4245
- throw __decorateServiceException(response, parsedBody);
3740
+ _d.label = 19;
3741
+ case 19: return [2];
4246
3742
  }
4247
3743
  });
4248
3744
  }); };
@@ -4254,21 +3750,20 @@ export var deserializeAws_restJson1UpdateVirtualGatewayCommand = function (outpu
4254
3750
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4255
3751
  return [2, deserializeAws_restJson1UpdateVirtualGatewayCommandError(output, context)];
4256
3752
  }
4257
- contents = {
3753
+ contents = map({
4258
3754
  $metadata: deserializeMetadata(output),
4259
- virtualGateway: undefined,
4260
- };
3755
+ });
4261
3756
  _a = __expectObject;
4262
3757
  return [4, parseBody(output.body, context)];
4263
3758
  case 1:
4264
3759
  data = _a.apply(void 0, [_b.sent()]);
4265
3760
  contents.virtualGateway = deserializeAws_restJson1VirtualGatewayData(data, context);
4266
- return [2, Promise.resolve(contents)];
3761
+ return [2, contents];
4267
3762
  }
4268
3763
  });
4269
3764
  }); };
4270
3765
  var deserializeAws_restJson1UpdateVirtualGatewayCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
4271
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3766
+ var parsedOutput, _a, errorCode, _b, parsedBody;
4272
3767
  var _c;
4273
3768
  return __generator(this, function (_d) {
4274
3769
  switch (_d.label) {
@@ -4317,14 +3812,14 @@ var deserializeAws_restJson1UpdateVirtualGatewayCommandError = function (output,
4317
3812
  case 17: throw _d.sent();
4318
3813
  case 18:
4319
3814
  parsedBody = parsedOutput.body;
4320
- $metadata = deserializeMetadata(output);
4321
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4322
- response = new __BaseException({
4323
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4324
- $fault: "client",
4325
- $metadata: $metadata,
3815
+ throwDefaultError({
3816
+ output: output,
3817
+ parsedBody: parsedBody,
3818
+ exceptionCtor: __BaseException,
3819
+ errorCode: errorCode,
4326
3820
  });
4327
- throw __decorateServiceException(response, parsedBody);
3821
+ _d.label = 19;
3822
+ case 19: return [2];
4328
3823
  }
4329
3824
  });
4330
3825
  }); };
@@ -4336,21 +3831,20 @@ export var deserializeAws_restJson1UpdateVirtualNodeCommand = function (output,
4336
3831
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4337
3832
  return [2, deserializeAws_restJson1UpdateVirtualNodeCommandError(output, context)];
4338
3833
  }
4339
- contents = {
3834
+ contents = map({
4340
3835
  $metadata: deserializeMetadata(output),
4341
- virtualNode: undefined,
4342
- };
3836
+ });
4343
3837
  _a = __expectObject;
4344
3838
  return [4, parseBody(output.body, context)];
4345
3839
  case 1:
4346
3840
  data = _a.apply(void 0, [_b.sent()]);
4347
3841
  contents.virtualNode = deserializeAws_restJson1VirtualNodeData(data, context);
4348
- return [2, Promise.resolve(contents)];
3842
+ return [2, contents];
4349
3843
  }
4350
3844
  });
4351
3845
  }); };
4352
3846
  var deserializeAws_restJson1UpdateVirtualNodeCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
4353
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3847
+ var parsedOutput, _a, errorCode, _b, parsedBody;
4354
3848
  var _c;
4355
3849
  return __generator(this, function (_d) {
4356
3850
  switch (_d.label) {
@@ -4399,14 +3893,14 @@ var deserializeAws_restJson1UpdateVirtualNodeCommandError = function (output, co
4399
3893
  case 17: throw _d.sent();
4400
3894
  case 18:
4401
3895
  parsedBody = parsedOutput.body;
4402
- $metadata = deserializeMetadata(output);
4403
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4404
- response = new __BaseException({
4405
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4406
- $fault: "client",
4407
- $metadata: $metadata,
3896
+ throwDefaultError({
3897
+ output: output,
3898
+ parsedBody: parsedBody,
3899
+ exceptionCtor: __BaseException,
3900
+ errorCode: errorCode,
4408
3901
  });
4409
- throw __decorateServiceException(response, parsedBody);
3902
+ _d.label = 19;
3903
+ case 19: return [2];
4410
3904
  }
4411
3905
  });
4412
3906
  }); };
@@ -4418,21 +3912,20 @@ export var deserializeAws_restJson1UpdateVirtualRouterCommand = function (output
4418
3912
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4419
3913
  return [2, deserializeAws_restJson1UpdateVirtualRouterCommandError(output, context)];
4420
3914
  }
4421
- contents = {
3915
+ contents = map({
4422
3916
  $metadata: deserializeMetadata(output),
4423
- virtualRouter: undefined,
4424
- };
3917
+ });
4425
3918
  _a = __expectObject;
4426
3919
  return [4, parseBody(output.body, context)];
4427
3920
  case 1:
4428
3921
  data = _a.apply(void 0, [_b.sent()]);
4429
3922
  contents.virtualRouter = deserializeAws_restJson1VirtualRouterData(data, context);
4430
- return [2, Promise.resolve(contents)];
3923
+ return [2, contents];
4431
3924
  }
4432
3925
  });
4433
3926
  }); };
4434
3927
  var deserializeAws_restJson1UpdateVirtualRouterCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
4435
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
3928
+ var parsedOutput, _a, errorCode, _b, parsedBody;
4436
3929
  var _c;
4437
3930
  return __generator(this, function (_d) {
4438
3931
  switch (_d.label) {
@@ -4481,14 +3974,14 @@ var deserializeAws_restJson1UpdateVirtualRouterCommandError = function (output,
4481
3974
  case 17: throw _d.sent();
4482
3975
  case 18:
4483
3976
  parsedBody = parsedOutput.body;
4484
- $metadata = deserializeMetadata(output);
4485
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4486
- response = new __BaseException({
4487
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4488
- $fault: "client",
4489
- $metadata: $metadata,
3977
+ throwDefaultError({
3978
+ output: output,
3979
+ parsedBody: parsedBody,
3980
+ exceptionCtor: __BaseException,
3981
+ errorCode: errorCode,
4490
3982
  });
4491
- throw __decorateServiceException(response, parsedBody);
3983
+ _d.label = 19;
3984
+ case 19: return [2];
4492
3985
  }
4493
3986
  });
4494
3987
  }); };
@@ -4500,21 +3993,20 @@ export var deserializeAws_restJson1UpdateVirtualServiceCommand = function (outpu
4500
3993
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4501
3994
  return [2, deserializeAws_restJson1UpdateVirtualServiceCommandError(output, context)];
4502
3995
  }
4503
- contents = {
3996
+ contents = map({
4504
3997
  $metadata: deserializeMetadata(output),
4505
- virtualService: undefined,
4506
- };
3998
+ });
4507
3999
  _a = __expectObject;
4508
4000
  return [4, parseBody(output.body, context)];
4509
4001
  case 1:
4510
4002
  data = _a.apply(void 0, [_b.sent()]);
4511
4003
  contents.virtualService = deserializeAws_restJson1VirtualServiceData(data, context);
4512
- return [2, Promise.resolve(contents)];
4004
+ return [2, contents];
4513
4005
  }
4514
4006
  });
4515
4007
  }); };
4516
4008
  var deserializeAws_restJson1UpdateVirtualServiceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
4517
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
4009
+ var parsedOutput, _a, errorCode, _b, parsedBody;
4518
4010
  var _c;
4519
4011
  return __generator(this, function (_d) {
4520
4012
  switch (_d.label) {
@@ -4563,23 +4055,24 @@ var deserializeAws_restJson1UpdateVirtualServiceCommandError = function (output,
4563
4055
  case 17: throw _d.sent();
4564
4056
  case 18:
4565
4057
  parsedBody = parsedOutput.body;
4566
- $metadata = deserializeMetadata(output);
4567
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
4568
- response = new __BaseException({
4569
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
4570
- $fault: "client",
4571
- $metadata: $metadata,
4058
+ throwDefaultError({
4059
+ output: output,
4060
+ parsedBody: parsedBody,
4061
+ exceptionCtor: __BaseException,
4062
+ errorCode: errorCode,
4572
4063
  });
4573
- throw __decorateServiceException(response, parsedBody);
4064
+ _d.label = 19;
4065
+ case 19: return [2];
4574
4066
  }
4575
4067
  });
4576
4068
  }); };
4069
+ var map = __map;
4577
4070
  var deserializeAws_restJson1BadRequestExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
4578
4071
  var contents, data, exception;
4579
4072
  return __generator(this, function (_a) {
4580
- contents = {};
4073
+ contents = map({});
4581
4074
  data = parsedOutput.body;
4582
- if (data.message !== undefined && data.message !== null) {
4075
+ if (data.message != null) {
4583
4076
  contents.message = __expectString(data.message);
4584
4077
  }
4585
4078
  exception = new BadRequestException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -4589,9 +4082,9 @@ var deserializeAws_restJson1BadRequestExceptionResponse = function (parsedOutput
4589
4082
  var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
4590
4083
  var contents, data, exception;
4591
4084
  return __generator(this, function (_a) {
4592
- contents = {};
4085
+ contents = map({});
4593
4086
  data = parsedOutput.body;
4594
- if (data.message !== undefined && data.message !== null) {
4087
+ if (data.message != null) {
4595
4088
  contents.message = __expectString(data.message);
4596
4089
  }
4597
4090
  exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -4601,9 +4094,9 @@ var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput,
4601
4094
  var deserializeAws_restJson1ForbiddenExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
4602
4095
  var contents, data, exception;
4603
4096
  return __generator(this, function (_a) {
4604
- contents = {};
4097
+ contents = map({});
4605
4098
  data = parsedOutput.body;
4606
- if (data.message !== undefined && data.message !== null) {
4099
+ if (data.message != null) {
4607
4100
  contents.message = __expectString(data.message);
4608
4101
  }
4609
4102
  exception = new ForbiddenException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -4613,9 +4106,9 @@ var deserializeAws_restJson1ForbiddenExceptionResponse = function (parsedOutput,
4613
4106
  var deserializeAws_restJson1InternalServerErrorExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
4614
4107
  var contents, data, exception;
4615
4108
  return __generator(this, function (_a) {
4616
- contents = {};
4109
+ contents = map({});
4617
4110
  data = parsedOutput.body;
4618
- if (data.message !== undefined && data.message !== null) {
4111
+ if (data.message != null) {
4619
4112
  contents.message = __expectString(data.message);
4620
4113
  }
4621
4114
  exception = new InternalServerErrorException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -4625,9 +4118,9 @@ var deserializeAws_restJson1InternalServerErrorExceptionResponse = function (par
4625
4118
  var deserializeAws_restJson1LimitExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
4626
4119
  var contents, data, exception;
4627
4120
  return __generator(this, function (_a) {
4628
- contents = {};
4121
+ contents = map({});
4629
4122
  data = parsedOutput.body;
4630
- if (data.message !== undefined && data.message !== null) {
4123
+ if (data.message != null) {
4631
4124
  contents.message = __expectString(data.message);
4632
4125
  }
4633
4126
  exception = new LimitExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -4637,9 +4130,9 @@ var deserializeAws_restJson1LimitExceededExceptionResponse = function (parsedOut
4637
4130
  var deserializeAws_restJson1NotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
4638
4131
  var contents, data, exception;
4639
4132
  return __generator(this, function (_a) {
4640
- contents = {};
4133
+ contents = map({});
4641
4134
  data = parsedOutput.body;
4642
- if (data.message !== undefined && data.message !== null) {
4135
+ if (data.message != null) {
4643
4136
  contents.message = __expectString(data.message);
4644
4137
  }
4645
4138
  exception = new NotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -4649,9 +4142,9 @@ var deserializeAws_restJson1NotFoundExceptionResponse = function (parsedOutput,
4649
4142
  var deserializeAws_restJson1ResourceInUseExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
4650
4143
  var contents, data, exception;
4651
4144
  return __generator(this, function (_a) {
4652
- contents = {};
4145
+ contents = map({});
4653
4146
  data = parsedOutput.body;
4654
- if (data.message !== undefined && data.message !== null) {
4147
+ if (data.message != null) {
4655
4148
  contents.message = __expectString(data.message);
4656
4149
  }
4657
4150
  exception = new ResourceInUseException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -4661,9 +4154,9 @@ var deserializeAws_restJson1ResourceInUseExceptionResponse = function (parsedOut
4661
4154
  var deserializeAws_restJson1ServiceUnavailableExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
4662
4155
  var contents, data, exception;
4663
4156
  return __generator(this, function (_a) {
4664
- contents = {};
4157
+ contents = map({});
4665
4158
  data = parsedOutput.body;
4666
- if (data.message !== undefined && data.message !== null) {
4159
+ if (data.message != null) {
4667
4160
  contents.message = __expectString(data.message);
4668
4161
  }
4669
4162
  exception = new ServiceUnavailableException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -4673,9 +4166,9 @@ var deserializeAws_restJson1ServiceUnavailableExceptionResponse = function (pars
4673
4166
  var deserializeAws_restJson1TooManyRequestsExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
4674
4167
  var contents, data, exception;
4675
4168
  return __generator(this, function (_a) {
4676
- contents = {};
4169
+ contents = map({});
4677
4170
  data = parsedOutput.body;
4678
- if (data.message !== undefined && data.message !== null) {
4171
+ if (data.message != null) {
4679
4172
  contents.message = __expectString(data.message);
4680
4173
  }
4681
4174
  exception = new TooManyRequestsException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -4685,9 +4178,9 @@ var deserializeAws_restJson1TooManyRequestsExceptionResponse = function (parsedO
4685
4178
  var deserializeAws_restJson1TooManyTagsExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
4686
4179
  var contents, data, exception;
4687
4180
  return __generator(this, function (_a) {
4688
- contents = {};
4181
+ contents = map({});
4689
4182
  data = parsedOutput.body;
4690
- if (data.message !== undefined && data.message !== null) {
4183
+ if (data.message != null) {
4691
4184
  contents.message = __expectString(data.message);
4692
4185
  }
4693
4186
  exception = new TooManyTagsException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -4707,9 +4200,6 @@ var serializeAws_restJson1AwsCloudMapInstanceAttributes = function (input, conte
4707
4200
  return input
4708
4201
  .filter(function (e) { return e != null; })
4709
4202
  .map(function (entry) {
4710
- if (entry === null) {
4711
- return null;
4712
- }
4713
4203
  return serializeAws_restJson1AwsCloudMapInstanceAttribute(entry, context);
4714
4204
  });
4715
4205
  };
@@ -4733,9 +4223,6 @@ var serializeAws_restJson1Backends = function (input, context) {
4733
4223
  return input
4734
4224
  .filter(function (e) { return e != null; })
4735
4225
  .map(function (entry) {
4736
- if (entry === null) {
4737
- return null;
4738
- }
4739
4226
  return serializeAws_restJson1Backend(entry, context);
4740
4227
  });
4741
4228
  };
@@ -4743,9 +4230,6 @@ var serializeAws_restJson1CertificateAuthorityArns = function (input, context) {
4743
4230
  return input
4744
4231
  .filter(function (e) { return e != null; })
4745
4232
  .map(function (entry) {
4746
- if (entry === null) {
4747
- return null;
4748
- }
4749
4233
  return entry;
4750
4234
  });
4751
4235
  };
@@ -4815,9 +4299,6 @@ var serializeAws_restJson1GrpcGatewayRouteMetadataList = function (input, contex
4815
4299
  return input
4816
4300
  .filter(function (e) { return e != null; })
4817
4301
  .map(function (entry) {
4818
- if (entry === null) {
4819
- return null;
4820
- }
4821
4302
  return serializeAws_restJson1GrpcGatewayRouteMetadata(entry, context);
4822
4303
  });
4823
4304
  };
@@ -4851,9 +4332,6 @@ var serializeAws_restJson1GrpcRetryPolicyEvents = function (input, context) {
4851
4332
  return input
4852
4333
  .filter(function (e) { return e != null; })
4853
4334
  .map(function (entry) {
4854
- if (entry === null) {
4855
- return null;
4856
- }
4857
4335
  return entry;
4858
4336
  });
4859
4337
  };
@@ -4877,9 +4355,6 @@ var serializeAws_restJson1GrpcRouteMetadataList = function (input, context) {
4877
4355
  return input
4878
4356
  .filter(function (e) { return e != null; })
4879
4357
  .map(function (entry) {
4880
- if (entry === null) {
4881
- return null;
4882
- }
4883
4358
  return serializeAws_restJson1GrpcRouteMetadata(entry, context);
4884
4359
  });
4885
4360
  };
@@ -4922,9 +4397,6 @@ var serializeAws_restJson1HttpGatewayRouteHeaders = function (input, context) {
4922
4397
  return input
4923
4398
  .filter(function (e) { return e != null; })
4924
4399
  .map(function (entry) {
4925
- if (entry === null) {
4926
- return null;
4927
- }
4928
4400
  return serializeAws_restJson1HttpGatewayRouteHeader(entry, context);
4929
4401
  });
4930
4402
  };
@@ -4956,9 +4428,6 @@ var serializeAws_restJson1HttpQueryParameters = function (input, context) {
4956
4428
  return input
4957
4429
  .filter(function (e) { return e != null; })
4958
4430
  .map(function (entry) {
4959
- if (entry === null) {
4960
- return null;
4961
- }
4962
4431
  return serializeAws_restJson1HttpQueryParameter(entry, context);
4963
4432
  });
4964
4433
  };
@@ -4975,9 +4444,6 @@ var serializeAws_restJson1HttpRetryPolicyEvents = function (input, context) {
4975
4444
  return input
4976
4445
  .filter(function (e) { return e != null; })
4977
4446
  .map(function (entry) {
4978
- if (entry === null) {
4979
- return null;
4980
- }
4981
4447
  return entry;
4982
4448
  });
4983
4449
  };
@@ -4998,9 +4464,6 @@ var serializeAws_restJson1HttpRouteHeaders = function (input, context) {
4998
4464
  return input
4999
4465
  .filter(function (e) { return e != null; })
5000
4466
  .map(function (entry) {
5001
- if (entry === null) {
5002
- return null;
5003
- }
5004
4467
  return serializeAws_restJson1HttpRouteHeader(entry, context);
5005
4468
  });
5006
4469
  };
@@ -5025,9 +4488,6 @@ var serializeAws_restJson1Listeners = function (input, context) {
5025
4488
  return input
5026
4489
  .filter(function (e) { return e != null; })
5027
4490
  .map(function (entry) {
5028
- if (entry === null) {
5029
- return null;
5030
- }
5031
4491
  return serializeAws_restJson1Listener(entry, context);
5032
4492
  });
5033
4493
  };
@@ -5106,9 +4566,6 @@ var serializeAws_restJson1PortSet = function (input, context) {
5106
4566
  return input
5107
4567
  .filter(function (e) { return e != null; })
5108
4568
  .map(function (entry) {
5109
- if (entry === null) {
5110
- return null;
5111
- }
5112
4569
  return entry;
5113
4570
  });
5114
4571
  };
@@ -5129,9 +4586,6 @@ var serializeAws_restJson1SubjectAlternativeNameList = function (input, context)
5129
4586
  return input
5130
4587
  .filter(function (e) { return e != null; })
5131
4588
  .map(function (entry) {
5132
- if (entry === null) {
5133
- return null;
5134
- }
5135
4589
  return entry;
5136
4590
  });
5137
4591
  };
@@ -5145,9 +4599,6 @@ var serializeAws_restJson1TagKeyList = function (input, context) {
5145
4599
  return input
5146
4600
  .filter(function (e) { return e != null; })
5147
4601
  .map(function (entry) {
5148
- if (entry === null) {
5149
- return null;
5150
- }
5151
4602
  return entry;
5152
4603
  });
5153
4604
  };
@@ -5155,9 +4606,6 @@ var serializeAws_restJson1TagList = function (input, context) {
5155
4606
  return input
5156
4607
  .filter(function (e) { return e != null; })
5157
4608
  .map(function (entry) {
5158
- if (entry === null) {
5159
- return null;
5160
- }
5161
4609
  return serializeAws_restJson1TagRef(entry, context);
5162
4610
  });
5163
4611
  };
@@ -5168,9 +4616,6 @@ var serializeAws_restJson1TcpRetryPolicyEvents = function (input, context) {
5168
4616
  return input
5169
4617
  .filter(function (e) { return e != null; })
5170
4618
  .map(function (entry) {
5171
- if (entry === null) {
5172
- return null;
5173
- }
5174
4619
  return entry;
5175
4620
  });
5176
4621
  };
@@ -5224,9 +4669,6 @@ var serializeAws_restJson1VirtualGatewayCertificateAuthorityArns = function (inp
5224
4669
  return input
5225
4670
  .filter(function (e) { return e != null; })
5226
4671
  .map(function (entry) {
5227
- if (entry === null) {
5228
- return null;
5229
- }
5230
4672
  return entry;
5231
4673
  });
5232
4674
  };
@@ -5283,9 +4725,6 @@ var serializeAws_restJson1VirtualGatewayListeners = function (input, context) {
5283
4725
  return input
5284
4726
  .filter(function (e) { return e != null; })
5285
4727
  .map(function (entry) {
5286
- if (entry === null) {
5287
- return null;
5288
- }
5289
4728
  return serializeAws_restJson1VirtualGatewayListener(entry, context);
5290
4729
  });
5291
4730
  };
@@ -5406,9 +4845,6 @@ var serializeAws_restJson1VirtualRouterListeners = function (input, context) {
5406
4845
  return input
5407
4846
  .filter(function (e) { return e != null; })
5408
4847
  .map(function (entry) {
5409
- if (entry === null) {
5410
- return null;
5411
- }
5412
4848
  return serializeAws_restJson1VirtualRouterListener(entry, context);
5413
4849
  });
5414
4850
  };
@@ -5442,14 +4878,11 @@ var serializeAws_restJson1WeightedTargets = function (input, context) {
5442
4878
  return input
5443
4879
  .filter(function (e) { return e != null; })
5444
4880
  .map(function (entry) {
5445
- if (entry === null) {
5446
- return null;
5447
- }
5448
4881
  return serializeAws_restJson1WeightedTarget(entry, context);
5449
4882
  });
5450
4883
  };
5451
4884
  var deserializeAws_restJson1AccessLog = function (output, context) {
5452
- if (output.file !== undefined && output.file !== null) {
4885
+ if (output.file != null) {
5453
4886
  return {
5454
4887
  file: deserializeAws_restJson1FileAccessLog(output.file, context),
5455
4888
  };
@@ -5484,7 +4917,7 @@ var deserializeAws_restJson1AwsCloudMapServiceDiscovery = function (output, cont
5484
4917
  };
5485
4918
  };
5486
4919
  var deserializeAws_restJson1Backend = function (output, context) {
5487
- if (output.virtualService !== undefined && output.virtualService !== null) {
4920
+ if (output.virtualService != null) {
5488
4921
  return {
5489
4922
  virtualService: deserializeAws_restJson1VirtualServiceBackend(output.virtualService, context),
5490
4923
  };
@@ -5534,12 +4967,12 @@ var deserializeAws_restJson1ClientPolicyTls = function (output, context) {
5534
4967
  };
5535
4968
  };
5536
4969
  var deserializeAws_restJson1ClientTlsCertificate = function (output, context) {
5537
- if (output.file !== undefined && output.file !== null) {
4970
+ if (output.file != null) {
5538
4971
  return {
5539
4972
  file: deserializeAws_restJson1ListenerTlsFileCertificate(output.file, context),
5540
4973
  };
5541
4974
  }
5542
- if (output.sds !== undefined && output.sds !== null) {
4975
+ if (output.sds != null) {
5543
4976
  return {
5544
4977
  sds: deserializeAws_restJson1ListenerTlsSdsCertificate(output.sds, context),
5545
4978
  };
@@ -5696,7 +5129,7 @@ var deserializeAws_restJson1GrpcMetadataMatchMethod = function (output, context)
5696
5129
  if (__expectString(output.prefix) !== undefined) {
5697
5130
  return { prefix: __expectString(output.prefix) };
5698
5131
  }
5699
- if (output.range !== undefined && output.range !== null) {
5132
+ if (output.range != null) {
5700
5133
  return {
5701
5134
  range: deserializeAws_restJson1MatchRange(output.range, context),
5702
5135
  };
@@ -5784,7 +5217,7 @@ var deserializeAws_restJson1GrpcRouteMetadataMatchMethod = function (output, con
5784
5217
  if (__expectString(output.prefix) !== undefined) {
5785
5218
  return { prefix: __expectString(output.prefix) };
5786
5219
  }
5787
- if (output.range !== undefined && output.range !== null) {
5220
+ if (output.range != null) {
5788
5221
  return {
5789
5222
  range: deserializeAws_restJson1MatchRange(output.range, context),
5790
5223
  };
@@ -5810,7 +5243,7 @@ var deserializeAws_restJson1HeaderMatchMethod = function (output, context) {
5810
5243
  if (__expectString(output.prefix) !== undefined) {
5811
5244
  return { prefix: __expectString(output.prefix) };
5812
5245
  }
5813
- if (output.range !== undefined && output.range !== null) {
5246
+ if (output.range != null) {
5814
5247
  return {
5815
5248
  range: deserializeAws_restJson1MatchRange(output.range, context),
5816
5249
  };
@@ -6025,22 +5458,22 @@ var deserializeAws_restJson1Listeners = function (output, context) {
6025
5458
  return retVal;
6026
5459
  };
6027
5460
  var deserializeAws_restJson1ListenerTimeout = function (output, context) {
6028
- if (output.grpc !== undefined && output.grpc !== null) {
5461
+ if (output.grpc != null) {
6029
5462
  return {
6030
5463
  grpc: deserializeAws_restJson1GrpcTimeout(output.grpc, context),
6031
5464
  };
6032
5465
  }
6033
- if (output.http !== undefined && output.http !== null) {
5466
+ if (output.http != null) {
6034
5467
  return {
6035
5468
  http: deserializeAws_restJson1HttpTimeout(output.http, context),
6036
5469
  };
6037
5470
  }
6038
- if (output.http2 !== undefined && output.http2 !== null) {
5471
+ if (output.http2 != null) {
6039
5472
  return {
6040
5473
  http2: deserializeAws_restJson1HttpTimeout(output.http2, context),
6041
5474
  };
6042
5475
  }
6043
- if (output.tcp !== undefined && output.tcp !== null) {
5476
+ if (output.tcp != null) {
6044
5477
  return {
6045
5478
  tcp: deserializeAws_restJson1TcpTimeout(output.tcp, context),
6046
5479
  };
@@ -6064,17 +5497,17 @@ var deserializeAws_restJson1ListenerTlsAcmCertificate = function (output, contex
6064
5497
  };
6065
5498
  };
6066
5499
  var deserializeAws_restJson1ListenerTlsCertificate = function (output, context) {
6067
- if (output.acm !== undefined && output.acm !== null) {
5500
+ if (output.acm != null) {
6068
5501
  return {
6069
5502
  acm: deserializeAws_restJson1ListenerTlsAcmCertificate(output.acm, context),
6070
5503
  };
6071
5504
  }
6072
- if (output.file !== undefined && output.file !== null) {
5505
+ if (output.file != null) {
6073
5506
  return {
6074
5507
  file: deserializeAws_restJson1ListenerTlsFileCertificate(output.file, context),
6075
5508
  };
6076
5509
  }
6077
- if (output.sds !== undefined && output.sds !== null) {
5510
+ if (output.sds != null) {
6078
5511
  return {
6079
5512
  sds: deserializeAws_restJson1ListenerTlsSdsCertificate(output.sds, context),
6080
5513
  };
@@ -6103,12 +5536,12 @@ var deserializeAws_restJson1ListenerTlsValidationContext = function (output, con
6103
5536
  };
6104
5537
  };
6105
5538
  var deserializeAws_restJson1ListenerTlsValidationContextTrust = function (output, context) {
6106
- if (output.file !== undefined && output.file !== null) {
5539
+ if (output.file != null) {
6107
5540
  return {
6108
5541
  file: deserializeAws_restJson1TlsValidationContextFileTrust(output.file, context),
6109
5542
  };
6110
5543
  }
6111
- if (output.sds !== undefined && output.sds !== null) {
5544
+ if (output.sds != null) {
6112
5545
  return {
6113
5546
  sds: deserializeAws_restJson1TlsValidationContextSdsTrust(output.sds, context),
6114
5547
  };
@@ -6274,12 +5707,12 @@ var deserializeAws_restJson1RouteStatus = function (output, context) {
6274
5707
  };
6275
5708
  };
6276
5709
  var deserializeAws_restJson1ServiceDiscovery = function (output, context) {
6277
- if (output.awsCloudMap !== undefined && output.awsCloudMap !== null) {
5710
+ if (output.awsCloudMap != null) {
6278
5711
  return {
6279
5712
  awsCloudMap: deserializeAws_restJson1AwsCloudMapServiceDiscovery(output.awsCloudMap, context),
6280
5713
  };
6281
5714
  }
6282
- if (output.dns !== undefined && output.dns !== null) {
5715
+ if (output.dns != null) {
6283
5716
  return {
6284
5717
  dns: deserializeAws_restJson1DnsServiceDiscovery(output.dns, context),
6285
5718
  };
@@ -6381,17 +5814,17 @@ var deserializeAws_restJson1TlsValidationContextSdsTrust = function (output, con
6381
5814
  };
6382
5815
  };
6383
5816
  var deserializeAws_restJson1TlsValidationContextTrust = function (output, context) {
6384
- if (output.acm !== undefined && output.acm !== null) {
5817
+ if (output.acm != null) {
6385
5818
  return {
6386
5819
  acm: deserializeAws_restJson1TlsValidationContextAcmTrust(output.acm, context),
6387
5820
  };
6388
5821
  }
6389
- if (output.file !== undefined && output.file !== null) {
5822
+ if (output.file != null) {
6390
5823
  return {
6391
5824
  file: deserializeAws_restJson1TlsValidationContextFileTrust(output.file, context),
6392
5825
  };
6393
5826
  }
6394
- if (output.sds !== undefined && output.sds !== null) {
5827
+ if (output.sds != null) {
6395
5828
  return {
6396
5829
  sds: deserializeAws_restJson1TlsValidationContextSdsTrust(output.sds, context),
6397
5830
  };
@@ -6399,7 +5832,7 @@ var deserializeAws_restJson1TlsValidationContextTrust = function (output, contex
6399
5832
  return { $unknown: Object.entries(output)[0] };
6400
5833
  };
6401
5834
  var deserializeAws_restJson1VirtualGatewayAccessLog = function (output, context) {
6402
- if (output.file !== undefined && output.file !== null) {
5835
+ if (output.file != null) {
6403
5836
  return {
6404
5837
  file: deserializeAws_restJson1VirtualGatewayFileAccessLog(output.file, context),
6405
5838
  };
@@ -6442,12 +5875,12 @@ var deserializeAws_restJson1VirtualGatewayClientPolicyTls = function (output, co
6442
5875
  };
6443
5876
  };
6444
5877
  var deserializeAws_restJson1VirtualGatewayClientTlsCertificate = function (output, context) {
6445
- if (output.file !== undefined && output.file !== null) {
5878
+ if (output.file != null) {
6446
5879
  return {
6447
5880
  file: deserializeAws_restJson1VirtualGatewayListenerTlsFileCertificate(output.file, context),
6448
5881
  };
6449
5882
  }
6450
- if (output.sds !== undefined && output.sds !== null) {
5883
+ if (output.sds != null) {
6451
5884
  return {
6452
5885
  sds: deserializeAws_restJson1VirtualGatewayListenerTlsSdsCertificate(output.sds, context),
6453
5886
  };
@@ -6455,17 +5888,17 @@ var deserializeAws_restJson1VirtualGatewayClientTlsCertificate = function (outpu
6455
5888
  return { $unknown: Object.entries(output)[0] };
6456
5889
  };
6457
5890
  var deserializeAws_restJson1VirtualGatewayConnectionPool = function (output, context) {
6458
- if (output.grpc !== undefined && output.grpc !== null) {
5891
+ if (output.grpc != null) {
6459
5892
  return {
6460
5893
  grpc: deserializeAws_restJson1VirtualGatewayGrpcConnectionPool(output.grpc, context),
6461
5894
  };
6462
5895
  }
6463
- if (output.http !== undefined && output.http !== null) {
5896
+ if (output.http != null) {
6464
5897
  return {
6465
5898
  http: deserializeAws_restJson1VirtualGatewayHttpConnectionPool(output.http, context),
6466
5899
  };
6467
5900
  }
6468
- if (output.http2 !== undefined && output.http2 !== null) {
5901
+ if (output.http2 != null) {
6469
5902
  return {
6470
5903
  http2: deserializeAws_restJson1VirtualGatewayHttp2ConnectionPool(output.http2, context),
6471
5904
  };
@@ -6566,17 +5999,17 @@ var deserializeAws_restJson1VirtualGatewayListenerTlsAcmCertificate = function (
6566
5999
  };
6567
6000
  };
6568
6001
  var deserializeAws_restJson1VirtualGatewayListenerTlsCertificate = function (output, context) {
6569
- if (output.acm !== undefined && output.acm !== null) {
6002
+ if (output.acm != null) {
6570
6003
  return {
6571
6004
  acm: deserializeAws_restJson1VirtualGatewayListenerTlsAcmCertificate(output.acm, context),
6572
6005
  };
6573
6006
  }
6574
- if (output.file !== undefined && output.file !== null) {
6007
+ if (output.file != null) {
6575
6008
  return {
6576
6009
  file: deserializeAws_restJson1VirtualGatewayListenerTlsFileCertificate(output.file, context),
6577
6010
  };
6578
6011
  }
6579
- if (output.sds !== undefined && output.sds !== null) {
6012
+ if (output.sds != null) {
6580
6013
  return {
6581
6014
  sds: deserializeAws_restJson1VirtualGatewayListenerTlsSdsCertificate(output.sds, context),
6582
6015
  };
@@ -6605,12 +6038,12 @@ var deserializeAws_restJson1VirtualGatewayListenerTlsValidationContext = functio
6605
6038
  };
6606
6039
  };
6607
6040
  var deserializeAws_restJson1VirtualGatewayListenerTlsValidationContextTrust = function (output, context) {
6608
- if (output.file !== undefined && output.file !== null) {
6041
+ if (output.file != null) {
6609
6042
  return {
6610
6043
  file: deserializeAws_restJson1VirtualGatewayTlsValidationContextFileTrust(output.file, context),
6611
6044
  };
6612
6045
  }
6613
- if (output.sds !== undefined && output.sds !== null) {
6046
+ if (output.sds != null) {
6614
6047
  return {
6615
6048
  sds: deserializeAws_restJson1VirtualGatewayTlsValidationContextSdsTrust(output.sds, context),
6616
6049
  };
@@ -6686,17 +6119,17 @@ var deserializeAws_restJson1VirtualGatewayTlsValidationContextSdsTrust = functio
6686
6119
  };
6687
6120
  };
6688
6121
  var deserializeAws_restJson1VirtualGatewayTlsValidationContextTrust = function (output, context) {
6689
- if (output.acm !== undefined && output.acm !== null) {
6122
+ if (output.acm != null) {
6690
6123
  return {
6691
6124
  acm: deserializeAws_restJson1VirtualGatewayTlsValidationContextAcmTrust(output.acm, context),
6692
6125
  };
6693
6126
  }
6694
- if (output.file !== undefined && output.file !== null) {
6127
+ if (output.file != null) {
6695
6128
  return {
6696
6129
  file: deserializeAws_restJson1VirtualGatewayTlsValidationContextFileTrust(output.file, context),
6697
6130
  };
6698
6131
  }
6699
- if (output.sds !== undefined && output.sds !== null) {
6132
+ if (output.sds != null) {
6700
6133
  return {
6701
6134
  sds: deserializeAws_restJson1VirtualGatewayTlsValidationContextSdsTrust(output.sds, context),
6702
6135
  };
@@ -6704,22 +6137,22 @@ var deserializeAws_restJson1VirtualGatewayTlsValidationContextTrust = function (
6704
6137
  return { $unknown: Object.entries(output)[0] };
6705
6138
  };
6706
6139
  var deserializeAws_restJson1VirtualNodeConnectionPool = function (output, context) {
6707
- if (output.grpc !== undefined && output.grpc !== null) {
6140
+ if (output.grpc != null) {
6708
6141
  return {
6709
6142
  grpc: deserializeAws_restJson1VirtualNodeGrpcConnectionPool(output.grpc, context),
6710
6143
  };
6711
6144
  }
6712
- if (output.http !== undefined && output.http !== null) {
6145
+ if (output.http != null) {
6713
6146
  return {
6714
6147
  http: deserializeAws_restJson1VirtualNodeHttpConnectionPool(output.http, context),
6715
6148
  };
6716
6149
  }
6717
- if (output.http2 !== undefined && output.http2 !== null) {
6150
+ if (output.http2 != null) {
6718
6151
  return {
6719
6152
  http2: deserializeAws_restJson1VirtualNodeHttp2ConnectionPool(output.http2, context),
6720
6153
  };
6721
6154
  }
6722
- if (output.tcp !== undefined && output.tcp !== null) {
6155
+ if (output.tcp != null) {
6723
6156
  return {
6724
6157
  tcp: deserializeAws_restJson1VirtualNodeTcpConnectionPool(output.tcp, context),
6725
6158
  };
@@ -6896,12 +6329,12 @@ var deserializeAws_restJson1VirtualServiceList = function (output, context) {
6896
6329
  return retVal;
6897
6330
  };
6898
6331
  var deserializeAws_restJson1VirtualServiceProvider = function (output, context) {
6899
- if (output.virtualNode !== undefined && output.virtualNode !== null) {
6332
+ if (output.virtualNode != null) {
6900
6333
  return {
6901
6334
  virtualNode: deserializeAws_restJson1VirtualNodeServiceProvider(output.virtualNode, context),
6902
6335
  };
6903
6336
  }
6904
- if (output.virtualRouter !== undefined && output.virtualRouter !== null) {
6337
+ if (output.virtualRouter != null) {
6905
6338
  return {
6906
6339
  virtualRouter: deserializeAws_restJson1VirtualRouterServiceProvider(output.virtualRouter, context),
6907
6340
  };