@aws-sdk/client-migration-hub-refactor-spaces 3.141.0 → 3.142.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,16 +14,7 @@ const serializeAws_restJson1CreateApplicationCommand = async (input, context) =>
14
14
  };
15
15
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
16
16
  "/environments/{EnvironmentIdentifier}/applications";
17
- if (input.EnvironmentIdentifier !== undefined) {
18
- const labelValue = input.EnvironmentIdentifier;
19
- if (labelValue.length <= 0) {
20
- throw new Error("Empty value provided for input HTTP label: EnvironmentIdentifier.");
21
- }
22
- resolvedPath = resolvedPath.replace("{EnvironmentIdentifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
23
- }
24
- else {
25
- throw new Error("No value provided for input HTTP label: EnvironmentIdentifier.");
26
- }
17
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "EnvironmentIdentifier", () => input.EnvironmentIdentifier, "{EnvironmentIdentifier}", false);
27
18
  let body;
28
19
  body = JSON.stringify({
29
20
  ...(input.ApiGatewayProxy != null && {
@@ -80,26 +71,8 @@ const serializeAws_restJson1CreateRouteCommand = async (input, context) => {
80
71
  };
81
72
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
82
73
  "/environments/{EnvironmentIdentifier}/applications/{ApplicationIdentifier}/routes";
83
- if (input.EnvironmentIdentifier !== undefined) {
84
- const labelValue = input.EnvironmentIdentifier;
85
- if (labelValue.length <= 0) {
86
- throw new Error("Empty value provided for input HTTP label: EnvironmentIdentifier.");
87
- }
88
- resolvedPath = resolvedPath.replace("{EnvironmentIdentifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
89
- }
90
- else {
91
- throw new Error("No value provided for input HTTP label: EnvironmentIdentifier.");
92
- }
93
- if (input.ApplicationIdentifier !== undefined) {
94
- const labelValue = input.ApplicationIdentifier;
95
- if (labelValue.length <= 0) {
96
- throw new Error("Empty value provided for input HTTP label: ApplicationIdentifier.");
97
- }
98
- resolvedPath = resolvedPath.replace("{ApplicationIdentifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
99
- }
100
- else {
101
- throw new Error("No value provided for input HTTP label: ApplicationIdentifier.");
102
- }
74
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "EnvironmentIdentifier", () => input.EnvironmentIdentifier, "{EnvironmentIdentifier}", false);
75
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ApplicationIdentifier", () => input.ApplicationIdentifier, "{ApplicationIdentifier}", false);
103
76
  let body;
104
77
  body = JSON.stringify({
105
78
  ClientToken: (_a = input.ClientToken) !== null && _a !== void 0 ? _a : (0, uuid_1.v4)(),
@@ -132,26 +105,8 @@ const serializeAws_restJson1CreateServiceCommand = async (input, context) => {
132
105
  };
133
106
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
134
107
  "/environments/{EnvironmentIdentifier}/applications/{ApplicationIdentifier}/services";
135
- if (input.EnvironmentIdentifier !== undefined) {
136
- const labelValue = input.EnvironmentIdentifier;
137
- if (labelValue.length <= 0) {
138
- throw new Error("Empty value provided for input HTTP label: EnvironmentIdentifier.");
139
- }
140
- resolvedPath = resolvedPath.replace("{EnvironmentIdentifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
141
- }
142
- else {
143
- throw new Error("No value provided for input HTTP label: EnvironmentIdentifier.");
144
- }
145
- if (input.ApplicationIdentifier !== undefined) {
146
- const labelValue = input.ApplicationIdentifier;
147
- if (labelValue.length <= 0) {
148
- throw new Error("Empty value provided for input HTTP label: ApplicationIdentifier.");
149
- }
150
- resolvedPath = resolvedPath.replace("{ApplicationIdentifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
151
- }
152
- else {
153
- throw new Error("No value provided for input HTTP label: ApplicationIdentifier.");
154
- }
108
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "EnvironmentIdentifier", () => input.EnvironmentIdentifier, "{EnvironmentIdentifier}", false);
109
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ApplicationIdentifier", () => input.ApplicationIdentifier, "{ApplicationIdentifier}", false);
155
110
  let body;
156
111
  body = JSON.stringify({
157
112
  ClientToken: (_a = input.ClientToken) !== null && _a !== void 0 ? _a : (0, uuid_1.v4)(),
@@ -183,26 +138,8 @@ const serializeAws_restJson1DeleteApplicationCommand = async (input, context) =>
183
138
  const headers = {};
184
139
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
185
140
  "/environments/{EnvironmentIdentifier}/applications/{ApplicationIdentifier}";
186
- if (input.EnvironmentIdentifier !== undefined) {
187
- const labelValue = input.EnvironmentIdentifier;
188
- if (labelValue.length <= 0) {
189
- throw new Error("Empty value provided for input HTTP label: EnvironmentIdentifier.");
190
- }
191
- resolvedPath = resolvedPath.replace("{EnvironmentIdentifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
192
- }
193
- else {
194
- throw new Error("No value provided for input HTTP label: EnvironmentIdentifier.");
195
- }
196
- if (input.ApplicationIdentifier !== undefined) {
197
- const labelValue = input.ApplicationIdentifier;
198
- if (labelValue.length <= 0) {
199
- throw new Error("Empty value provided for input HTTP label: ApplicationIdentifier.");
200
- }
201
- resolvedPath = resolvedPath.replace("{ApplicationIdentifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
202
- }
203
- else {
204
- throw new Error("No value provided for input HTTP label: ApplicationIdentifier.");
205
- }
141
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "EnvironmentIdentifier", () => input.EnvironmentIdentifier, "{EnvironmentIdentifier}", false);
142
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ApplicationIdentifier", () => input.ApplicationIdentifier, "{ApplicationIdentifier}", false);
206
143
  let body;
207
144
  return new protocol_http_1.HttpRequest({
208
145
  protocol,
@@ -219,16 +156,7 @@ const serializeAws_restJson1DeleteEnvironmentCommand = async (input, context) =>
219
156
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
220
157
  const headers = {};
221
158
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/environments/{EnvironmentIdentifier}";
222
- if (input.EnvironmentIdentifier !== undefined) {
223
- const labelValue = input.EnvironmentIdentifier;
224
- if (labelValue.length <= 0) {
225
- throw new Error("Empty value provided for input HTTP label: EnvironmentIdentifier.");
226
- }
227
- resolvedPath = resolvedPath.replace("{EnvironmentIdentifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
228
- }
229
- else {
230
- throw new Error("No value provided for input HTTP label: EnvironmentIdentifier.");
231
- }
159
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "EnvironmentIdentifier", () => input.EnvironmentIdentifier, "{EnvironmentIdentifier}", false);
232
160
  let body;
233
161
  return new protocol_http_1.HttpRequest({
234
162
  protocol,
@@ -245,16 +173,7 @@ const serializeAws_restJson1DeleteResourcePolicyCommand = async (input, context)
245
173
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
246
174
  const headers = {};
247
175
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/resourcepolicy/{Identifier}";
248
- if (input.Identifier !== undefined) {
249
- const labelValue = input.Identifier;
250
- if (labelValue.length <= 0) {
251
- throw new Error("Empty value provided for input HTTP label: Identifier.");
252
- }
253
- resolvedPath = resolvedPath.replace("{Identifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
254
- }
255
- else {
256
- throw new Error("No value provided for input HTTP label: Identifier.");
257
- }
176
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Identifier", () => input.Identifier, "{Identifier}", false);
258
177
  let body;
259
178
  return new protocol_http_1.HttpRequest({
260
179
  protocol,
@@ -272,36 +191,9 @@ const serializeAws_restJson1DeleteRouteCommand = async (input, context) => {
272
191
  const headers = {};
273
192
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
274
193
  "/environments/{EnvironmentIdentifier}/applications/{ApplicationIdentifier}/routes/{RouteIdentifier}";
275
- if (input.EnvironmentIdentifier !== undefined) {
276
- const labelValue = input.EnvironmentIdentifier;
277
- if (labelValue.length <= 0) {
278
- throw new Error("Empty value provided for input HTTP label: EnvironmentIdentifier.");
279
- }
280
- resolvedPath = resolvedPath.replace("{EnvironmentIdentifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
281
- }
282
- else {
283
- throw new Error("No value provided for input HTTP label: EnvironmentIdentifier.");
284
- }
285
- if (input.ApplicationIdentifier !== undefined) {
286
- const labelValue = input.ApplicationIdentifier;
287
- if (labelValue.length <= 0) {
288
- throw new Error("Empty value provided for input HTTP label: ApplicationIdentifier.");
289
- }
290
- resolvedPath = resolvedPath.replace("{ApplicationIdentifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
291
- }
292
- else {
293
- throw new Error("No value provided for input HTTP label: ApplicationIdentifier.");
294
- }
295
- if (input.RouteIdentifier !== undefined) {
296
- const labelValue = input.RouteIdentifier;
297
- if (labelValue.length <= 0) {
298
- throw new Error("Empty value provided for input HTTP label: RouteIdentifier.");
299
- }
300
- resolvedPath = resolvedPath.replace("{RouteIdentifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
301
- }
302
- else {
303
- throw new Error("No value provided for input HTTP label: RouteIdentifier.");
304
- }
194
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "EnvironmentIdentifier", () => input.EnvironmentIdentifier, "{EnvironmentIdentifier}", false);
195
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ApplicationIdentifier", () => input.ApplicationIdentifier, "{ApplicationIdentifier}", false);
196
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "RouteIdentifier", () => input.RouteIdentifier, "{RouteIdentifier}", false);
305
197
  let body;
306
198
  return new protocol_http_1.HttpRequest({
307
199
  protocol,
@@ -319,36 +211,9 @@ const serializeAws_restJson1DeleteServiceCommand = async (input, context) => {
319
211
  const headers = {};
320
212
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
321
213
  "/environments/{EnvironmentIdentifier}/applications/{ApplicationIdentifier}/services/{ServiceIdentifier}";
322
- if (input.EnvironmentIdentifier !== undefined) {
323
- const labelValue = input.EnvironmentIdentifier;
324
- if (labelValue.length <= 0) {
325
- throw new Error("Empty value provided for input HTTP label: EnvironmentIdentifier.");
326
- }
327
- resolvedPath = resolvedPath.replace("{EnvironmentIdentifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
328
- }
329
- else {
330
- throw new Error("No value provided for input HTTP label: EnvironmentIdentifier.");
331
- }
332
- if (input.ApplicationIdentifier !== undefined) {
333
- const labelValue = input.ApplicationIdentifier;
334
- if (labelValue.length <= 0) {
335
- throw new Error("Empty value provided for input HTTP label: ApplicationIdentifier.");
336
- }
337
- resolvedPath = resolvedPath.replace("{ApplicationIdentifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
338
- }
339
- else {
340
- throw new Error("No value provided for input HTTP label: ApplicationIdentifier.");
341
- }
342
- if (input.ServiceIdentifier !== undefined) {
343
- const labelValue = input.ServiceIdentifier;
344
- if (labelValue.length <= 0) {
345
- throw new Error("Empty value provided for input HTTP label: ServiceIdentifier.");
346
- }
347
- resolvedPath = resolvedPath.replace("{ServiceIdentifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
348
- }
349
- else {
350
- throw new Error("No value provided for input HTTP label: ServiceIdentifier.");
351
- }
214
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "EnvironmentIdentifier", () => input.EnvironmentIdentifier, "{EnvironmentIdentifier}", false);
215
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ApplicationIdentifier", () => input.ApplicationIdentifier, "{ApplicationIdentifier}", false);
216
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ServiceIdentifier", () => input.ServiceIdentifier, "{ServiceIdentifier}", false);
352
217
  let body;
353
218
  return new protocol_http_1.HttpRequest({
354
219
  protocol,
@@ -366,26 +231,8 @@ const serializeAws_restJson1GetApplicationCommand = async (input, context) => {
366
231
  const headers = {};
367
232
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
368
233
  "/environments/{EnvironmentIdentifier}/applications/{ApplicationIdentifier}";
369
- if (input.EnvironmentIdentifier !== undefined) {
370
- const labelValue = input.EnvironmentIdentifier;
371
- if (labelValue.length <= 0) {
372
- throw new Error("Empty value provided for input HTTP label: EnvironmentIdentifier.");
373
- }
374
- resolvedPath = resolvedPath.replace("{EnvironmentIdentifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
375
- }
376
- else {
377
- throw new Error("No value provided for input HTTP label: EnvironmentIdentifier.");
378
- }
379
- if (input.ApplicationIdentifier !== undefined) {
380
- const labelValue = input.ApplicationIdentifier;
381
- if (labelValue.length <= 0) {
382
- throw new Error("Empty value provided for input HTTP label: ApplicationIdentifier.");
383
- }
384
- resolvedPath = resolvedPath.replace("{ApplicationIdentifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
385
- }
386
- else {
387
- throw new Error("No value provided for input HTTP label: ApplicationIdentifier.");
388
- }
234
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "EnvironmentIdentifier", () => input.EnvironmentIdentifier, "{EnvironmentIdentifier}", false);
235
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ApplicationIdentifier", () => input.ApplicationIdentifier, "{ApplicationIdentifier}", false);
389
236
  let body;
390
237
  return new protocol_http_1.HttpRequest({
391
238
  protocol,
@@ -402,16 +249,7 @@ const serializeAws_restJson1GetEnvironmentCommand = async (input, context) => {
402
249
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
403
250
  const headers = {};
404
251
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/environments/{EnvironmentIdentifier}";
405
- if (input.EnvironmentIdentifier !== undefined) {
406
- const labelValue = input.EnvironmentIdentifier;
407
- if (labelValue.length <= 0) {
408
- throw new Error("Empty value provided for input HTTP label: EnvironmentIdentifier.");
409
- }
410
- resolvedPath = resolvedPath.replace("{EnvironmentIdentifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
411
- }
412
- else {
413
- throw new Error("No value provided for input HTTP label: EnvironmentIdentifier.");
414
- }
252
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "EnvironmentIdentifier", () => input.EnvironmentIdentifier, "{EnvironmentIdentifier}", false);
415
253
  let body;
416
254
  return new protocol_http_1.HttpRequest({
417
255
  protocol,
@@ -428,16 +266,7 @@ const serializeAws_restJson1GetResourcePolicyCommand = async (input, context) =>
428
266
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
429
267
  const headers = {};
430
268
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/resourcepolicy/{Identifier}";
431
- if (input.Identifier !== undefined) {
432
- const labelValue = input.Identifier;
433
- if (labelValue.length <= 0) {
434
- throw new Error("Empty value provided for input HTTP label: Identifier.");
435
- }
436
- resolvedPath = resolvedPath.replace("{Identifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
437
- }
438
- else {
439
- throw new Error("No value provided for input HTTP label: Identifier.");
440
- }
269
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Identifier", () => input.Identifier, "{Identifier}", false);
441
270
  let body;
442
271
  return new protocol_http_1.HttpRequest({
443
272
  protocol,
@@ -455,36 +284,9 @@ const serializeAws_restJson1GetRouteCommand = async (input, context) => {
455
284
  const headers = {};
456
285
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
457
286
  "/environments/{EnvironmentIdentifier}/applications/{ApplicationIdentifier}/routes/{RouteIdentifier}";
458
- if (input.EnvironmentIdentifier !== undefined) {
459
- const labelValue = input.EnvironmentIdentifier;
460
- if (labelValue.length <= 0) {
461
- throw new Error("Empty value provided for input HTTP label: EnvironmentIdentifier.");
462
- }
463
- resolvedPath = resolvedPath.replace("{EnvironmentIdentifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
464
- }
465
- else {
466
- throw new Error("No value provided for input HTTP label: EnvironmentIdentifier.");
467
- }
468
- if (input.ApplicationIdentifier !== undefined) {
469
- const labelValue = input.ApplicationIdentifier;
470
- if (labelValue.length <= 0) {
471
- throw new Error("Empty value provided for input HTTP label: ApplicationIdentifier.");
472
- }
473
- resolvedPath = resolvedPath.replace("{ApplicationIdentifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
474
- }
475
- else {
476
- throw new Error("No value provided for input HTTP label: ApplicationIdentifier.");
477
- }
478
- if (input.RouteIdentifier !== undefined) {
479
- const labelValue = input.RouteIdentifier;
480
- if (labelValue.length <= 0) {
481
- throw new Error("Empty value provided for input HTTP label: RouteIdentifier.");
482
- }
483
- resolvedPath = resolvedPath.replace("{RouteIdentifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
484
- }
485
- else {
486
- throw new Error("No value provided for input HTTP label: RouteIdentifier.");
487
- }
287
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "EnvironmentIdentifier", () => input.EnvironmentIdentifier, "{EnvironmentIdentifier}", false);
288
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ApplicationIdentifier", () => input.ApplicationIdentifier, "{ApplicationIdentifier}", false);
289
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "RouteIdentifier", () => input.RouteIdentifier, "{RouteIdentifier}", false);
488
290
  let body;
489
291
  return new protocol_http_1.HttpRequest({
490
292
  protocol,
@@ -502,36 +304,9 @@ const serializeAws_restJson1GetServiceCommand = async (input, context) => {
502
304
  const headers = {};
503
305
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
504
306
  "/environments/{EnvironmentIdentifier}/applications/{ApplicationIdentifier}/services/{ServiceIdentifier}";
505
- if (input.EnvironmentIdentifier !== undefined) {
506
- const labelValue = input.EnvironmentIdentifier;
507
- if (labelValue.length <= 0) {
508
- throw new Error("Empty value provided for input HTTP label: EnvironmentIdentifier.");
509
- }
510
- resolvedPath = resolvedPath.replace("{EnvironmentIdentifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
511
- }
512
- else {
513
- throw new Error("No value provided for input HTTP label: EnvironmentIdentifier.");
514
- }
515
- if (input.ApplicationIdentifier !== undefined) {
516
- const labelValue = input.ApplicationIdentifier;
517
- if (labelValue.length <= 0) {
518
- throw new Error("Empty value provided for input HTTP label: ApplicationIdentifier.");
519
- }
520
- resolvedPath = resolvedPath.replace("{ApplicationIdentifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
521
- }
522
- else {
523
- throw new Error("No value provided for input HTTP label: ApplicationIdentifier.");
524
- }
525
- if (input.ServiceIdentifier !== undefined) {
526
- const labelValue = input.ServiceIdentifier;
527
- if (labelValue.length <= 0) {
528
- throw new Error("Empty value provided for input HTTP label: ServiceIdentifier.");
529
- }
530
- resolvedPath = resolvedPath.replace("{ServiceIdentifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
531
- }
532
- else {
533
- throw new Error("No value provided for input HTTP label: ServiceIdentifier.");
534
- }
307
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "EnvironmentIdentifier", () => input.EnvironmentIdentifier, "{EnvironmentIdentifier}", false);
308
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ApplicationIdentifier", () => input.ApplicationIdentifier, "{ApplicationIdentifier}", false);
309
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ServiceIdentifier", () => input.ServiceIdentifier, "{ServiceIdentifier}", false);
535
310
  let body;
536
311
  return new protocol_http_1.HttpRequest({
537
312
  protocol,
@@ -549,20 +324,11 @@ const serializeAws_restJson1ListApplicationsCommand = async (input, context) =>
549
324
  const headers = {};
550
325
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
551
326
  "/environments/{EnvironmentIdentifier}/applications";
552
- if (input.EnvironmentIdentifier !== undefined) {
553
- const labelValue = input.EnvironmentIdentifier;
554
- if (labelValue.length <= 0) {
555
- throw new Error("Empty value provided for input HTTP label: EnvironmentIdentifier.");
556
- }
557
- resolvedPath = resolvedPath.replace("{EnvironmentIdentifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
558
- }
559
- else {
560
- throw new Error("No value provided for input HTTP label: EnvironmentIdentifier.");
561
- }
562
- const query = {
563
- ...(input.NextToken !== undefined && { nextToken: input.NextToken }),
564
- ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }),
565
- };
327
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "EnvironmentIdentifier", () => input.EnvironmentIdentifier, "{EnvironmentIdentifier}", false);
328
+ const query = map({
329
+ nextToken: [, input.NextToken],
330
+ maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
331
+ });
566
332
  let body;
567
333
  return new protocol_http_1.HttpRequest({
568
334
  protocol,
@@ -580,10 +346,10 @@ const serializeAws_restJson1ListEnvironmentsCommand = async (input, context) =>
580
346
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
581
347
  const headers = {};
582
348
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/environments";
583
- const query = {
584
- ...(input.NextToken !== undefined && { nextToken: input.NextToken }),
585
- ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }),
586
- };
349
+ const query = map({
350
+ nextToken: [, input.NextToken],
351
+ maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
352
+ });
587
353
  let body;
588
354
  return new protocol_http_1.HttpRequest({
589
355
  protocol,
@@ -602,20 +368,11 @@ const serializeAws_restJson1ListEnvironmentVpcsCommand = async (input, context)
602
368
  const headers = {};
603
369
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
604
370
  "/environments/{EnvironmentIdentifier}/vpcs";
605
- if (input.EnvironmentIdentifier !== undefined) {
606
- const labelValue = input.EnvironmentIdentifier;
607
- if (labelValue.length <= 0) {
608
- throw new Error("Empty value provided for input HTTP label: EnvironmentIdentifier.");
609
- }
610
- resolvedPath = resolvedPath.replace("{EnvironmentIdentifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
611
- }
612
- else {
613
- throw new Error("No value provided for input HTTP label: EnvironmentIdentifier.");
614
- }
615
- const query = {
616
- ...(input.NextToken !== undefined && { nextToken: input.NextToken }),
617
- ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }),
618
- };
371
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "EnvironmentIdentifier", () => input.EnvironmentIdentifier, "{EnvironmentIdentifier}", false);
372
+ const query = map({
373
+ nextToken: [, input.NextToken],
374
+ maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
375
+ });
619
376
  let body;
620
377
  return new protocol_http_1.HttpRequest({
621
378
  protocol,
@@ -634,30 +391,12 @@ const serializeAws_restJson1ListRoutesCommand = async (input, context) => {
634
391
  const headers = {};
635
392
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
636
393
  "/environments/{EnvironmentIdentifier}/applications/{ApplicationIdentifier}/routes";
637
- if (input.EnvironmentIdentifier !== undefined) {
638
- const labelValue = input.EnvironmentIdentifier;
639
- if (labelValue.length <= 0) {
640
- throw new Error("Empty value provided for input HTTP label: EnvironmentIdentifier.");
641
- }
642
- resolvedPath = resolvedPath.replace("{EnvironmentIdentifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
643
- }
644
- else {
645
- throw new Error("No value provided for input HTTP label: EnvironmentIdentifier.");
646
- }
647
- if (input.ApplicationIdentifier !== undefined) {
648
- const labelValue = input.ApplicationIdentifier;
649
- if (labelValue.length <= 0) {
650
- throw new Error("Empty value provided for input HTTP label: ApplicationIdentifier.");
651
- }
652
- resolvedPath = resolvedPath.replace("{ApplicationIdentifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
653
- }
654
- else {
655
- throw new Error("No value provided for input HTTP label: ApplicationIdentifier.");
656
- }
657
- const query = {
658
- ...(input.NextToken !== undefined && { nextToken: input.NextToken }),
659
- ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }),
660
- };
394
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "EnvironmentIdentifier", () => input.EnvironmentIdentifier, "{EnvironmentIdentifier}", false);
395
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ApplicationIdentifier", () => input.ApplicationIdentifier, "{ApplicationIdentifier}", false);
396
+ const query = map({
397
+ nextToken: [, input.NextToken],
398
+ maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
399
+ });
661
400
  let body;
662
401
  return new protocol_http_1.HttpRequest({
663
402
  protocol,
@@ -676,30 +415,12 @@ const serializeAws_restJson1ListServicesCommand = async (input, context) => {
676
415
  const headers = {};
677
416
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
678
417
  "/environments/{EnvironmentIdentifier}/applications/{ApplicationIdentifier}/services";
679
- if (input.EnvironmentIdentifier !== undefined) {
680
- const labelValue = input.EnvironmentIdentifier;
681
- if (labelValue.length <= 0) {
682
- throw new Error("Empty value provided for input HTTP label: EnvironmentIdentifier.");
683
- }
684
- resolvedPath = resolvedPath.replace("{EnvironmentIdentifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
685
- }
686
- else {
687
- throw new Error("No value provided for input HTTP label: EnvironmentIdentifier.");
688
- }
689
- if (input.ApplicationIdentifier !== undefined) {
690
- const labelValue = input.ApplicationIdentifier;
691
- if (labelValue.length <= 0) {
692
- throw new Error("Empty value provided for input HTTP label: ApplicationIdentifier.");
693
- }
694
- resolvedPath = resolvedPath.replace("{ApplicationIdentifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
695
- }
696
- else {
697
- throw new Error("No value provided for input HTTP label: ApplicationIdentifier.");
698
- }
699
- const query = {
700
- ...(input.NextToken !== undefined && { nextToken: input.NextToken }),
701
- ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }),
702
- };
418
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "EnvironmentIdentifier", () => input.EnvironmentIdentifier, "{EnvironmentIdentifier}", false);
419
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ApplicationIdentifier", () => input.ApplicationIdentifier, "{ApplicationIdentifier}", false);
420
+ const query = map({
421
+ nextToken: [, input.NextToken],
422
+ maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
423
+ });
703
424
  let body;
704
425
  return new protocol_http_1.HttpRequest({
705
426
  protocol,
@@ -717,16 +438,7 @@ const serializeAws_restJson1ListTagsForResourceCommand = async (input, context)
717
438
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
718
439
  const headers = {};
719
440
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
720
- if (input.ResourceArn !== undefined) {
721
- const labelValue = input.ResourceArn;
722
- if (labelValue.length <= 0) {
723
- throw new Error("Empty value provided for input HTTP label: ResourceArn.");
724
- }
725
- resolvedPath = resolvedPath.replace("{ResourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
726
- }
727
- else {
728
- throw new Error("No value provided for input HTTP label: ResourceArn.");
729
- }
441
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
730
442
  let body;
731
443
  return new protocol_http_1.HttpRequest({
732
444
  protocol,
@@ -767,16 +479,7 @@ const serializeAws_restJson1TagResourceCommand = async (input, context) => {
767
479
  "content-type": "application/json",
768
480
  };
769
481
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
770
- if (input.ResourceArn !== undefined) {
771
- const labelValue = input.ResourceArn;
772
- if (labelValue.length <= 0) {
773
- throw new Error("Empty value provided for input HTTP label: ResourceArn.");
774
- }
775
- resolvedPath = resolvedPath.replace("{ResourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
776
- }
777
- else {
778
- throw new Error("No value provided for input HTTP label: ResourceArn.");
779
- }
482
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
780
483
  let body;
781
484
  body = JSON.stringify({
782
485
  ...(input.Tags != null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }),
@@ -796,19 +499,10 @@ const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
796
499
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
797
500
  const headers = {};
798
501
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
799
- if (input.ResourceArn !== undefined) {
800
- const labelValue = input.ResourceArn;
801
- if (labelValue.length <= 0) {
802
- throw new Error("Empty value provided for input HTTP label: ResourceArn.");
803
- }
804
- resolvedPath = resolvedPath.replace("{ResourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
805
- }
806
- else {
807
- throw new Error("No value provided for input HTTP label: ResourceArn.");
808
- }
809
- const query = {
810
- ...(input.TagKeys !== undefined && { tagKeys: (input.TagKeys || []).map((_entry) => _entry) }),
811
- };
502
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
503
+ const query = map({
504
+ tagKeys: [() => input.TagKeys !== void 0, () => (input.TagKeys || []).map((_entry) => _entry)],
505
+ });
812
506
  let body;
813
507
  return new protocol_http_1.HttpRequest({
814
508
  protocol,
@@ -829,36 +523,9 @@ const serializeAws_restJson1UpdateRouteCommand = async (input, context) => {
829
523
  };
830
524
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
831
525
  "/environments/{EnvironmentIdentifier}/applications/{ApplicationIdentifier}/routes/{RouteIdentifier}";
832
- if (input.EnvironmentIdentifier !== undefined) {
833
- const labelValue = input.EnvironmentIdentifier;
834
- if (labelValue.length <= 0) {
835
- throw new Error("Empty value provided for input HTTP label: EnvironmentIdentifier.");
836
- }
837
- resolvedPath = resolvedPath.replace("{EnvironmentIdentifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
838
- }
839
- else {
840
- throw new Error("No value provided for input HTTP label: EnvironmentIdentifier.");
841
- }
842
- if (input.ApplicationIdentifier !== undefined) {
843
- const labelValue = input.ApplicationIdentifier;
844
- if (labelValue.length <= 0) {
845
- throw new Error("Empty value provided for input HTTP label: ApplicationIdentifier.");
846
- }
847
- resolvedPath = resolvedPath.replace("{ApplicationIdentifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
848
- }
849
- else {
850
- throw new Error("No value provided for input HTTP label: ApplicationIdentifier.");
851
- }
852
- if (input.RouteIdentifier !== undefined) {
853
- const labelValue = input.RouteIdentifier;
854
- if (labelValue.length <= 0) {
855
- throw new Error("Empty value provided for input HTTP label: RouteIdentifier.");
856
- }
857
- resolvedPath = resolvedPath.replace("{RouteIdentifier}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
858
- }
859
- else {
860
- throw new Error("No value provided for input HTTP label: RouteIdentifier.");
861
- }
526
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "EnvironmentIdentifier", () => input.EnvironmentIdentifier, "{EnvironmentIdentifier}", false);
527
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ApplicationIdentifier", () => input.ApplicationIdentifier, "{ApplicationIdentifier}", false);
528
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "RouteIdentifier", () => input.RouteIdentifier, "{RouteIdentifier}", false);
862
529
  let body;
863
530
  body = JSON.stringify({
864
531
  ...(input.ActivationState != null && { ActivationState: input.ActivationState }),
@@ -878,63 +545,50 @@ const deserializeAws_restJson1CreateApplicationCommand = async (output, context)
878
545
  if (output.statusCode !== 200 && output.statusCode >= 300) {
879
546
  return deserializeAws_restJson1CreateApplicationCommandError(output, context);
880
547
  }
881
- const contents = {
548
+ const contents = map({
882
549
  $metadata: deserializeMetadata(output),
883
- ApiGatewayProxy: undefined,
884
- ApplicationId: undefined,
885
- Arn: undefined,
886
- CreatedByAccountId: undefined,
887
- CreatedTime: undefined,
888
- EnvironmentId: undefined,
889
- LastUpdatedTime: undefined,
890
- Name: undefined,
891
- OwnerAccountId: undefined,
892
- ProxyType: undefined,
893
- State: undefined,
894
- Tags: undefined,
895
- VpcId: undefined,
896
- };
550
+ });
897
551
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
898
- if (data.ApiGatewayProxy !== undefined && data.ApiGatewayProxy !== null) {
552
+ if (data.ApiGatewayProxy != null) {
899
553
  contents.ApiGatewayProxy = deserializeAws_restJson1ApiGatewayProxyInput(data.ApiGatewayProxy, context);
900
554
  }
901
- if (data.ApplicationId !== undefined && data.ApplicationId !== null) {
555
+ if (data.ApplicationId != null) {
902
556
  contents.ApplicationId = (0, smithy_client_1.expectString)(data.ApplicationId);
903
557
  }
904
- if (data.Arn !== undefined && data.Arn !== null) {
558
+ if (data.Arn != null) {
905
559
  contents.Arn = (0, smithy_client_1.expectString)(data.Arn);
906
560
  }
907
- if (data.CreatedByAccountId !== undefined && data.CreatedByAccountId !== null) {
561
+ if (data.CreatedByAccountId != null) {
908
562
  contents.CreatedByAccountId = (0, smithy_client_1.expectString)(data.CreatedByAccountId);
909
563
  }
910
- if (data.CreatedTime !== undefined && data.CreatedTime !== null) {
564
+ if (data.CreatedTime != null) {
911
565
  contents.CreatedTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.CreatedTime)));
912
566
  }
913
- if (data.EnvironmentId !== undefined && data.EnvironmentId !== null) {
567
+ if (data.EnvironmentId != null) {
914
568
  contents.EnvironmentId = (0, smithy_client_1.expectString)(data.EnvironmentId);
915
569
  }
916
- if (data.LastUpdatedTime !== undefined && data.LastUpdatedTime !== null) {
570
+ if (data.LastUpdatedTime != null) {
917
571
  contents.LastUpdatedTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.LastUpdatedTime)));
918
572
  }
919
- if (data.Name !== undefined && data.Name !== null) {
573
+ if (data.Name != null) {
920
574
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
921
575
  }
922
- if (data.OwnerAccountId !== undefined && data.OwnerAccountId !== null) {
576
+ if (data.OwnerAccountId != null) {
923
577
  contents.OwnerAccountId = (0, smithy_client_1.expectString)(data.OwnerAccountId);
924
578
  }
925
- if (data.ProxyType !== undefined && data.ProxyType !== null) {
579
+ if (data.ProxyType != null) {
926
580
  contents.ProxyType = (0, smithy_client_1.expectString)(data.ProxyType);
927
581
  }
928
- if (data.State !== undefined && data.State !== null) {
582
+ if (data.State != null) {
929
583
  contents.State = (0, smithy_client_1.expectString)(data.State);
930
584
  }
931
- if (data.Tags !== undefined && data.Tags !== null) {
585
+ if (data.Tags != null) {
932
586
  contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
933
587
  }
934
- if (data.VpcId !== undefined && data.VpcId !== null) {
588
+ if (data.VpcId != null) {
935
589
  contents.VpcId = (0, smithy_client_1.expectString)(data.VpcId);
936
590
  }
937
- return Promise.resolve(contents);
591
+ return contents;
938
592
  };
939
593
  exports.deserializeAws_restJson1CreateApplicationCommand = deserializeAws_restJson1CreateApplicationCommand;
940
594
  const deserializeAws_restJson1CreateApplicationCommandError = async (output, context) => {
@@ -942,7 +596,6 @@ const deserializeAws_restJson1CreateApplicationCommandError = async (output, con
942
596
  ...output,
943
597
  body: await parseBody(output.body, context),
944
598
  };
945
- let response;
946
599
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
947
600
  switch (errorCode) {
948
601
  case "AccessDeniedException":
@@ -968,65 +621,53 @@ const deserializeAws_restJson1CreateApplicationCommandError = async (output, con
968
621
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
969
622
  default:
970
623
  const parsedBody = parsedOutput.body;
971
- const $metadata = deserializeMetadata(output);
972
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
973
- response = new MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException({
974
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
975
- $fault: "client",
976
- $metadata,
624
+ (0, smithy_client_1.throwDefaultError)({
625
+ output,
626
+ parsedBody,
627
+ exceptionCtor: MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException,
628
+ errorCode,
977
629
  });
978
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
979
630
  }
980
631
  };
981
632
  const deserializeAws_restJson1CreateEnvironmentCommand = async (output, context) => {
982
633
  if (output.statusCode !== 200 && output.statusCode >= 300) {
983
634
  return deserializeAws_restJson1CreateEnvironmentCommandError(output, context);
984
635
  }
985
- const contents = {
636
+ const contents = map({
986
637
  $metadata: deserializeMetadata(output),
987
- Arn: undefined,
988
- CreatedTime: undefined,
989
- Description: undefined,
990
- EnvironmentId: undefined,
991
- LastUpdatedTime: undefined,
992
- Name: undefined,
993
- NetworkFabricType: undefined,
994
- OwnerAccountId: undefined,
995
- State: undefined,
996
- Tags: undefined,
997
- };
638
+ });
998
639
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
999
- if (data.Arn !== undefined && data.Arn !== null) {
640
+ if (data.Arn != null) {
1000
641
  contents.Arn = (0, smithy_client_1.expectString)(data.Arn);
1001
642
  }
1002
- if (data.CreatedTime !== undefined && data.CreatedTime !== null) {
643
+ if (data.CreatedTime != null) {
1003
644
  contents.CreatedTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.CreatedTime)));
1004
645
  }
1005
- if (data.Description !== undefined && data.Description !== null) {
646
+ if (data.Description != null) {
1006
647
  contents.Description = (0, smithy_client_1.expectString)(data.Description);
1007
648
  }
1008
- if (data.EnvironmentId !== undefined && data.EnvironmentId !== null) {
649
+ if (data.EnvironmentId != null) {
1009
650
  contents.EnvironmentId = (0, smithy_client_1.expectString)(data.EnvironmentId);
1010
651
  }
1011
- if (data.LastUpdatedTime !== undefined && data.LastUpdatedTime !== null) {
652
+ if (data.LastUpdatedTime != null) {
1012
653
  contents.LastUpdatedTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.LastUpdatedTime)));
1013
654
  }
1014
- if (data.Name !== undefined && data.Name !== null) {
655
+ if (data.Name != null) {
1015
656
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
1016
657
  }
1017
- if (data.NetworkFabricType !== undefined && data.NetworkFabricType !== null) {
658
+ if (data.NetworkFabricType != null) {
1018
659
  contents.NetworkFabricType = (0, smithy_client_1.expectString)(data.NetworkFabricType);
1019
660
  }
1020
- if (data.OwnerAccountId !== undefined && data.OwnerAccountId !== null) {
661
+ if (data.OwnerAccountId != null) {
1021
662
  contents.OwnerAccountId = (0, smithy_client_1.expectString)(data.OwnerAccountId);
1022
663
  }
1023
- if (data.State !== undefined && data.State !== null) {
664
+ if (data.State != null) {
1024
665
  contents.State = (0, smithy_client_1.expectString)(data.State);
1025
666
  }
1026
- if (data.Tags !== undefined && data.Tags !== null) {
667
+ if (data.Tags != null) {
1027
668
  contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
1028
669
  }
1029
- return Promise.resolve(contents);
670
+ return contents;
1030
671
  };
1031
672
  exports.deserializeAws_restJson1CreateEnvironmentCommand = deserializeAws_restJson1CreateEnvironmentCommand;
1032
673
  const deserializeAws_restJson1CreateEnvironmentCommandError = async (output, context) => {
@@ -1034,7 +675,6 @@ const deserializeAws_restJson1CreateEnvironmentCommandError = async (output, con
1034
675
  ...output,
1035
676
  body: await parseBody(output.body, context),
1036
677
  };
1037
- let response;
1038
678
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1039
679
  switch (errorCode) {
1040
680
  case "AccessDeniedException":
@@ -1060,73 +700,59 @@ const deserializeAws_restJson1CreateEnvironmentCommandError = async (output, con
1060
700
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1061
701
  default:
1062
702
  const parsedBody = parsedOutput.body;
1063
- const $metadata = deserializeMetadata(output);
1064
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1065
- response = new MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException({
1066
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1067
- $fault: "client",
1068
- $metadata,
703
+ (0, smithy_client_1.throwDefaultError)({
704
+ output,
705
+ parsedBody,
706
+ exceptionCtor: MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException,
707
+ errorCode,
1069
708
  });
1070
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1071
709
  }
1072
710
  };
1073
711
  const deserializeAws_restJson1CreateRouteCommand = async (output, context) => {
1074
712
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1075
713
  return deserializeAws_restJson1CreateRouteCommandError(output, context);
1076
714
  }
1077
- const contents = {
715
+ const contents = map({
1078
716
  $metadata: deserializeMetadata(output),
1079
- ApplicationId: undefined,
1080
- Arn: undefined,
1081
- CreatedByAccountId: undefined,
1082
- CreatedTime: undefined,
1083
- LastUpdatedTime: undefined,
1084
- OwnerAccountId: undefined,
1085
- RouteId: undefined,
1086
- RouteType: undefined,
1087
- ServiceId: undefined,
1088
- State: undefined,
1089
- Tags: undefined,
1090
- UriPathRoute: undefined,
1091
- };
717
+ });
1092
718
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1093
- if (data.ApplicationId !== undefined && data.ApplicationId !== null) {
719
+ if (data.ApplicationId != null) {
1094
720
  contents.ApplicationId = (0, smithy_client_1.expectString)(data.ApplicationId);
1095
721
  }
1096
- if (data.Arn !== undefined && data.Arn !== null) {
722
+ if (data.Arn != null) {
1097
723
  contents.Arn = (0, smithy_client_1.expectString)(data.Arn);
1098
724
  }
1099
- if (data.CreatedByAccountId !== undefined && data.CreatedByAccountId !== null) {
725
+ if (data.CreatedByAccountId != null) {
1100
726
  contents.CreatedByAccountId = (0, smithy_client_1.expectString)(data.CreatedByAccountId);
1101
727
  }
1102
- if (data.CreatedTime !== undefined && data.CreatedTime !== null) {
728
+ if (data.CreatedTime != null) {
1103
729
  contents.CreatedTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.CreatedTime)));
1104
730
  }
1105
- if (data.LastUpdatedTime !== undefined && data.LastUpdatedTime !== null) {
731
+ if (data.LastUpdatedTime != null) {
1106
732
  contents.LastUpdatedTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.LastUpdatedTime)));
1107
733
  }
1108
- if (data.OwnerAccountId !== undefined && data.OwnerAccountId !== null) {
734
+ if (data.OwnerAccountId != null) {
1109
735
  contents.OwnerAccountId = (0, smithy_client_1.expectString)(data.OwnerAccountId);
1110
736
  }
1111
- if (data.RouteId !== undefined && data.RouteId !== null) {
737
+ if (data.RouteId != null) {
1112
738
  contents.RouteId = (0, smithy_client_1.expectString)(data.RouteId);
1113
739
  }
1114
- if (data.RouteType !== undefined && data.RouteType !== null) {
740
+ if (data.RouteType != null) {
1115
741
  contents.RouteType = (0, smithy_client_1.expectString)(data.RouteType);
1116
742
  }
1117
- if (data.ServiceId !== undefined && data.ServiceId !== null) {
743
+ if (data.ServiceId != null) {
1118
744
  contents.ServiceId = (0, smithy_client_1.expectString)(data.ServiceId);
1119
745
  }
1120
- if (data.State !== undefined && data.State !== null) {
746
+ if (data.State != null) {
1121
747
  contents.State = (0, smithy_client_1.expectString)(data.State);
1122
748
  }
1123
- if (data.Tags !== undefined && data.Tags !== null) {
749
+ if (data.Tags != null) {
1124
750
  contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
1125
751
  }
1126
- if (data.UriPathRoute !== undefined && data.UriPathRoute !== null) {
752
+ if (data.UriPathRoute != null) {
1127
753
  contents.UriPathRoute = deserializeAws_restJson1UriPathRouteInput(data.UriPathRoute, context);
1128
754
  }
1129
- return Promise.resolve(contents);
755
+ return contents;
1130
756
  };
1131
757
  exports.deserializeAws_restJson1CreateRouteCommand = deserializeAws_restJson1CreateRouteCommand;
1132
758
  const deserializeAws_restJson1CreateRouteCommandError = async (output, context) => {
@@ -1134,7 +760,6 @@ const deserializeAws_restJson1CreateRouteCommandError = async (output, context)
1134
760
  ...output,
1135
761
  body: await parseBody(output.body, context),
1136
762
  };
1137
- let response;
1138
763
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1139
764
  switch (errorCode) {
1140
765
  case "AccessDeniedException":
@@ -1160,89 +785,71 @@ const deserializeAws_restJson1CreateRouteCommandError = async (output, context)
1160
785
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1161
786
  default:
1162
787
  const parsedBody = parsedOutput.body;
1163
- const $metadata = deserializeMetadata(output);
1164
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1165
- response = new MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException({
1166
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1167
- $fault: "client",
1168
- $metadata,
788
+ (0, smithy_client_1.throwDefaultError)({
789
+ output,
790
+ parsedBody,
791
+ exceptionCtor: MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException,
792
+ errorCode,
1169
793
  });
1170
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1171
794
  }
1172
795
  };
1173
796
  const deserializeAws_restJson1CreateServiceCommand = async (output, context) => {
1174
797
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1175
798
  return deserializeAws_restJson1CreateServiceCommandError(output, context);
1176
799
  }
1177
- const contents = {
800
+ const contents = map({
1178
801
  $metadata: deserializeMetadata(output),
1179
- ApplicationId: undefined,
1180
- Arn: undefined,
1181
- CreatedByAccountId: undefined,
1182
- CreatedTime: undefined,
1183
- Description: undefined,
1184
- EndpointType: undefined,
1185
- EnvironmentId: undefined,
1186
- LambdaEndpoint: undefined,
1187
- LastUpdatedTime: undefined,
1188
- Name: undefined,
1189
- OwnerAccountId: undefined,
1190
- ServiceId: undefined,
1191
- State: undefined,
1192
- Tags: undefined,
1193
- UrlEndpoint: undefined,
1194
- VpcId: undefined,
1195
- };
802
+ });
1196
803
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1197
- if (data.ApplicationId !== undefined && data.ApplicationId !== null) {
804
+ if (data.ApplicationId != null) {
1198
805
  contents.ApplicationId = (0, smithy_client_1.expectString)(data.ApplicationId);
1199
806
  }
1200
- if (data.Arn !== undefined && data.Arn !== null) {
807
+ if (data.Arn != null) {
1201
808
  contents.Arn = (0, smithy_client_1.expectString)(data.Arn);
1202
809
  }
1203
- if (data.CreatedByAccountId !== undefined && data.CreatedByAccountId !== null) {
810
+ if (data.CreatedByAccountId != null) {
1204
811
  contents.CreatedByAccountId = (0, smithy_client_1.expectString)(data.CreatedByAccountId);
1205
812
  }
1206
- if (data.CreatedTime !== undefined && data.CreatedTime !== null) {
813
+ if (data.CreatedTime != null) {
1207
814
  contents.CreatedTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.CreatedTime)));
1208
815
  }
1209
- if (data.Description !== undefined && data.Description !== null) {
816
+ if (data.Description != null) {
1210
817
  contents.Description = (0, smithy_client_1.expectString)(data.Description);
1211
818
  }
1212
- if (data.EndpointType !== undefined && data.EndpointType !== null) {
819
+ if (data.EndpointType != null) {
1213
820
  contents.EndpointType = (0, smithy_client_1.expectString)(data.EndpointType);
1214
821
  }
1215
- if (data.EnvironmentId !== undefined && data.EnvironmentId !== null) {
822
+ if (data.EnvironmentId != null) {
1216
823
  contents.EnvironmentId = (0, smithy_client_1.expectString)(data.EnvironmentId);
1217
824
  }
1218
- if (data.LambdaEndpoint !== undefined && data.LambdaEndpoint !== null) {
825
+ if (data.LambdaEndpoint != null) {
1219
826
  contents.LambdaEndpoint = deserializeAws_restJson1LambdaEndpointInput(data.LambdaEndpoint, context);
1220
827
  }
1221
- if (data.LastUpdatedTime !== undefined && data.LastUpdatedTime !== null) {
828
+ if (data.LastUpdatedTime != null) {
1222
829
  contents.LastUpdatedTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.LastUpdatedTime)));
1223
830
  }
1224
- if (data.Name !== undefined && data.Name !== null) {
831
+ if (data.Name != null) {
1225
832
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
1226
833
  }
1227
- if (data.OwnerAccountId !== undefined && data.OwnerAccountId !== null) {
834
+ if (data.OwnerAccountId != null) {
1228
835
  contents.OwnerAccountId = (0, smithy_client_1.expectString)(data.OwnerAccountId);
1229
836
  }
1230
- if (data.ServiceId !== undefined && data.ServiceId !== null) {
837
+ if (data.ServiceId != null) {
1231
838
  contents.ServiceId = (0, smithy_client_1.expectString)(data.ServiceId);
1232
839
  }
1233
- if (data.State !== undefined && data.State !== null) {
840
+ if (data.State != null) {
1234
841
  contents.State = (0, smithy_client_1.expectString)(data.State);
1235
842
  }
1236
- if (data.Tags !== undefined && data.Tags !== null) {
843
+ if (data.Tags != null) {
1237
844
  contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
1238
845
  }
1239
- if (data.UrlEndpoint !== undefined && data.UrlEndpoint !== null) {
846
+ if (data.UrlEndpoint != null) {
1240
847
  contents.UrlEndpoint = deserializeAws_restJson1UrlEndpointInput(data.UrlEndpoint, context);
1241
848
  }
1242
- if (data.VpcId !== undefined && data.VpcId !== null) {
849
+ if (data.VpcId != null) {
1243
850
  contents.VpcId = (0, smithy_client_1.expectString)(data.VpcId);
1244
851
  }
1245
- return Promise.resolve(contents);
852
+ return contents;
1246
853
  };
1247
854
  exports.deserializeAws_restJson1CreateServiceCommand = deserializeAws_restJson1CreateServiceCommand;
1248
855
  const deserializeAws_restJson1CreateServiceCommandError = async (output, context) => {
@@ -1250,7 +857,6 @@ const deserializeAws_restJson1CreateServiceCommandError = async (output, context
1250
857
  ...output,
1251
858
  body: await parseBody(output.body, context),
1252
859
  };
1253
- let response;
1254
860
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1255
861
  switch (errorCode) {
1256
862
  case "AccessDeniedException":
@@ -1276,49 +882,41 @@ const deserializeAws_restJson1CreateServiceCommandError = async (output, context
1276
882
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1277
883
  default:
1278
884
  const parsedBody = parsedOutput.body;
1279
- const $metadata = deserializeMetadata(output);
1280
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1281
- response = new MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException({
1282
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1283
- $fault: "client",
1284
- $metadata,
885
+ (0, smithy_client_1.throwDefaultError)({
886
+ output,
887
+ parsedBody,
888
+ exceptionCtor: MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException,
889
+ errorCode,
1285
890
  });
1286
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1287
891
  }
1288
892
  };
1289
893
  const deserializeAws_restJson1DeleteApplicationCommand = async (output, context) => {
1290
894
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1291
895
  return deserializeAws_restJson1DeleteApplicationCommandError(output, context);
1292
896
  }
1293
- const contents = {
897
+ const contents = map({
1294
898
  $metadata: deserializeMetadata(output),
1295
- ApplicationId: undefined,
1296
- Arn: undefined,
1297
- EnvironmentId: undefined,
1298
- LastUpdatedTime: undefined,
1299
- Name: undefined,
1300
- State: undefined,
1301
- };
899
+ });
1302
900
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1303
- if (data.ApplicationId !== undefined && data.ApplicationId !== null) {
901
+ if (data.ApplicationId != null) {
1304
902
  contents.ApplicationId = (0, smithy_client_1.expectString)(data.ApplicationId);
1305
903
  }
1306
- if (data.Arn !== undefined && data.Arn !== null) {
904
+ if (data.Arn != null) {
1307
905
  contents.Arn = (0, smithy_client_1.expectString)(data.Arn);
1308
906
  }
1309
- if (data.EnvironmentId !== undefined && data.EnvironmentId !== null) {
907
+ if (data.EnvironmentId != null) {
1310
908
  contents.EnvironmentId = (0, smithy_client_1.expectString)(data.EnvironmentId);
1311
909
  }
1312
- if (data.LastUpdatedTime !== undefined && data.LastUpdatedTime !== null) {
910
+ if (data.LastUpdatedTime != null) {
1313
911
  contents.LastUpdatedTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.LastUpdatedTime)));
1314
912
  }
1315
- if (data.Name !== undefined && data.Name !== null) {
913
+ if (data.Name != null) {
1316
914
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
1317
915
  }
1318
- if (data.State !== undefined && data.State !== null) {
916
+ if (data.State != null) {
1319
917
  contents.State = (0, smithy_client_1.expectString)(data.State);
1320
918
  }
1321
- return Promise.resolve(contents);
919
+ return contents;
1322
920
  };
1323
921
  exports.deserializeAws_restJson1DeleteApplicationCommand = deserializeAws_restJson1DeleteApplicationCommand;
1324
922
  const deserializeAws_restJson1DeleteApplicationCommandError = async (output, context) => {
@@ -1326,7 +924,6 @@ const deserializeAws_restJson1DeleteApplicationCommandError = async (output, con
1326
924
  ...output,
1327
925
  body: await parseBody(output.body, context),
1328
926
  };
1329
- let response;
1330
927
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1331
928
  switch (errorCode) {
1332
929
  case "AccessDeniedException":
@@ -1349,45 +946,38 @@ const deserializeAws_restJson1DeleteApplicationCommandError = async (output, con
1349
946
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1350
947
  default:
1351
948
  const parsedBody = parsedOutput.body;
1352
- const $metadata = deserializeMetadata(output);
1353
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1354
- response = new MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException({
1355
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1356
- $fault: "client",
1357
- $metadata,
949
+ (0, smithy_client_1.throwDefaultError)({
950
+ output,
951
+ parsedBody,
952
+ exceptionCtor: MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException,
953
+ errorCode,
1358
954
  });
1359
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1360
955
  }
1361
956
  };
1362
957
  const deserializeAws_restJson1DeleteEnvironmentCommand = async (output, context) => {
1363
958
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1364
959
  return deserializeAws_restJson1DeleteEnvironmentCommandError(output, context);
1365
960
  }
1366
- const contents = {
961
+ const contents = map({
1367
962
  $metadata: deserializeMetadata(output),
1368
- Arn: undefined,
1369
- EnvironmentId: undefined,
1370
- LastUpdatedTime: undefined,
1371
- Name: undefined,
1372
- State: undefined,
1373
- };
963
+ });
1374
964
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1375
- if (data.Arn !== undefined && data.Arn !== null) {
965
+ if (data.Arn != null) {
1376
966
  contents.Arn = (0, smithy_client_1.expectString)(data.Arn);
1377
967
  }
1378
- if (data.EnvironmentId !== undefined && data.EnvironmentId !== null) {
968
+ if (data.EnvironmentId != null) {
1379
969
  contents.EnvironmentId = (0, smithy_client_1.expectString)(data.EnvironmentId);
1380
970
  }
1381
- if (data.LastUpdatedTime !== undefined && data.LastUpdatedTime !== null) {
971
+ if (data.LastUpdatedTime != null) {
1382
972
  contents.LastUpdatedTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.LastUpdatedTime)));
1383
973
  }
1384
- if (data.Name !== undefined && data.Name !== null) {
974
+ if (data.Name != null) {
1385
975
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
1386
976
  }
1387
- if (data.State !== undefined && data.State !== null) {
977
+ if (data.State != null) {
1388
978
  contents.State = (0, smithy_client_1.expectString)(data.State);
1389
979
  }
1390
- return Promise.resolve(contents);
980
+ return contents;
1391
981
  };
1392
982
  exports.deserializeAws_restJson1DeleteEnvironmentCommand = deserializeAws_restJson1DeleteEnvironmentCommand;
1393
983
  const deserializeAws_restJson1DeleteEnvironmentCommandError = async (output, context) => {
@@ -1395,7 +985,6 @@ const deserializeAws_restJson1DeleteEnvironmentCommandError = async (output, con
1395
985
  ...output,
1396
986
  body: await parseBody(output.body, context),
1397
987
  };
1398
- let response;
1399
988
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1400
989
  switch (errorCode) {
1401
990
  case "AccessDeniedException":
@@ -1418,25 +1007,23 @@ const deserializeAws_restJson1DeleteEnvironmentCommandError = async (output, con
1418
1007
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1419
1008
  default:
1420
1009
  const parsedBody = parsedOutput.body;
1421
- const $metadata = deserializeMetadata(output);
1422
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1423
- response = new MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException({
1424
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1425
- $fault: "client",
1426
- $metadata,
1010
+ (0, smithy_client_1.throwDefaultError)({
1011
+ output,
1012
+ parsedBody,
1013
+ exceptionCtor: MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException,
1014
+ errorCode,
1427
1015
  });
1428
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1429
1016
  }
1430
1017
  };
1431
1018
  const deserializeAws_restJson1DeleteResourcePolicyCommand = async (output, context) => {
1432
1019
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1433
1020
  return deserializeAws_restJson1DeleteResourcePolicyCommandError(output, context);
1434
1021
  }
1435
- const contents = {
1022
+ const contents = map({
1436
1023
  $metadata: deserializeMetadata(output),
1437
- };
1024
+ });
1438
1025
  await collectBody(output.body, context);
1439
- return Promise.resolve(contents);
1026
+ return contents;
1440
1027
  };
1441
1028
  exports.deserializeAws_restJson1DeleteResourcePolicyCommand = deserializeAws_restJson1DeleteResourcePolicyCommand;
1442
1029
  const deserializeAws_restJson1DeleteResourcePolicyCommandError = async (output, context) => {
@@ -1444,7 +1031,6 @@ const deserializeAws_restJson1DeleteResourcePolicyCommandError = async (output,
1444
1031
  ...output,
1445
1032
  body: await parseBody(output.body, context),
1446
1033
  };
1447
- let response;
1448
1034
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1449
1035
  switch (errorCode) {
1450
1036
  case "AccessDeniedException":
@@ -1464,49 +1050,41 @@ const deserializeAws_restJson1DeleteResourcePolicyCommandError = async (output,
1464
1050
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1465
1051
  default:
1466
1052
  const parsedBody = parsedOutput.body;
1467
- const $metadata = deserializeMetadata(output);
1468
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1469
- response = new MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException({
1470
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1471
- $fault: "client",
1472
- $metadata,
1053
+ (0, smithy_client_1.throwDefaultError)({
1054
+ output,
1055
+ parsedBody,
1056
+ exceptionCtor: MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException,
1057
+ errorCode,
1473
1058
  });
1474
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1475
1059
  }
1476
1060
  };
1477
1061
  const deserializeAws_restJson1DeleteRouteCommand = async (output, context) => {
1478
1062
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1479
1063
  return deserializeAws_restJson1DeleteRouteCommandError(output, context);
1480
1064
  }
1481
- const contents = {
1065
+ const contents = map({
1482
1066
  $metadata: deserializeMetadata(output),
1483
- ApplicationId: undefined,
1484
- Arn: undefined,
1485
- LastUpdatedTime: undefined,
1486
- RouteId: undefined,
1487
- ServiceId: undefined,
1488
- State: undefined,
1489
- };
1067
+ });
1490
1068
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1491
- if (data.ApplicationId !== undefined && data.ApplicationId !== null) {
1069
+ if (data.ApplicationId != null) {
1492
1070
  contents.ApplicationId = (0, smithy_client_1.expectString)(data.ApplicationId);
1493
1071
  }
1494
- if (data.Arn !== undefined && data.Arn !== null) {
1072
+ if (data.Arn != null) {
1495
1073
  contents.Arn = (0, smithy_client_1.expectString)(data.Arn);
1496
1074
  }
1497
- if (data.LastUpdatedTime !== undefined && data.LastUpdatedTime !== null) {
1075
+ if (data.LastUpdatedTime != null) {
1498
1076
  contents.LastUpdatedTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.LastUpdatedTime)));
1499
1077
  }
1500
- if (data.RouteId !== undefined && data.RouteId !== null) {
1078
+ if (data.RouteId != null) {
1501
1079
  contents.RouteId = (0, smithy_client_1.expectString)(data.RouteId);
1502
1080
  }
1503
- if (data.ServiceId !== undefined && data.ServiceId !== null) {
1081
+ if (data.ServiceId != null) {
1504
1082
  contents.ServiceId = (0, smithy_client_1.expectString)(data.ServiceId);
1505
1083
  }
1506
- if (data.State !== undefined && data.State !== null) {
1084
+ if (data.State != null) {
1507
1085
  contents.State = (0, smithy_client_1.expectString)(data.State);
1508
1086
  }
1509
- return Promise.resolve(contents);
1087
+ return contents;
1510
1088
  };
1511
1089
  exports.deserializeAws_restJson1DeleteRouteCommand = deserializeAws_restJson1DeleteRouteCommand;
1512
1090
  const deserializeAws_restJson1DeleteRouteCommandError = async (output, context) => {
@@ -1514,7 +1092,6 @@ const deserializeAws_restJson1DeleteRouteCommandError = async (output, context)
1514
1092
  ...output,
1515
1093
  body: await parseBody(output.body, context),
1516
1094
  };
1517
- let response;
1518
1095
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1519
1096
  switch (errorCode) {
1520
1097
  case "AccessDeniedException":
@@ -1537,53 +1114,44 @@ const deserializeAws_restJson1DeleteRouteCommandError = async (output, context)
1537
1114
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1538
1115
  default:
1539
1116
  const parsedBody = parsedOutput.body;
1540
- const $metadata = deserializeMetadata(output);
1541
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1542
- response = new MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException({
1543
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1544
- $fault: "client",
1545
- $metadata,
1117
+ (0, smithy_client_1.throwDefaultError)({
1118
+ output,
1119
+ parsedBody,
1120
+ exceptionCtor: MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException,
1121
+ errorCode,
1546
1122
  });
1547
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1548
1123
  }
1549
1124
  };
1550
1125
  const deserializeAws_restJson1DeleteServiceCommand = async (output, context) => {
1551
1126
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1552
1127
  return deserializeAws_restJson1DeleteServiceCommandError(output, context);
1553
1128
  }
1554
- const contents = {
1129
+ const contents = map({
1555
1130
  $metadata: deserializeMetadata(output),
1556
- ApplicationId: undefined,
1557
- Arn: undefined,
1558
- EnvironmentId: undefined,
1559
- LastUpdatedTime: undefined,
1560
- Name: undefined,
1561
- ServiceId: undefined,
1562
- State: undefined,
1563
- };
1131
+ });
1564
1132
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1565
- if (data.ApplicationId !== undefined && data.ApplicationId !== null) {
1133
+ if (data.ApplicationId != null) {
1566
1134
  contents.ApplicationId = (0, smithy_client_1.expectString)(data.ApplicationId);
1567
1135
  }
1568
- if (data.Arn !== undefined && data.Arn !== null) {
1136
+ if (data.Arn != null) {
1569
1137
  contents.Arn = (0, smithy_client_1.expectString)(data.Arn);
1570
1138
  }
1571
- if (data.EnvironmentId !== undefined && data.EnvironmentId !== null) {
1139
+ if (data.EnvironmentId != null) {
1572
1140
  contents.EnvironmentId = (0, smithy_client_1.expectString)(data.EnvironmentId);
1573
1141
  }
1574
- if (data.LastUpdatedTime !== undefined && data.LastUpdatedTime !== null) {
1142
+ if (data.LastUpdatedTime != null) {
1575
1143
  contents.LastUpdatedTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.LastUpdatedTime)));
1576
1144
  }
1577
- if (data.Name !== undefined && data.Name !== null) {
1145
+ if (data.Name != null) {
1578
1146
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
1579
1147
  }
1580
- if (data.ServiceId !== undefined && data.ServiceId !== null) {
1148
+ if (data.ServiceId != null) {
1581
1149
  contents.ServiceId = (0, smithy_client_1.expectString)(data.ServiceId);
1582
1150
  }
1583
- if (data.State !== undefined && data.State !== null) {
1151
+ if (data.State != null) {
1584
1152
  contents.State = (0, smithy_client_1.expectString)(data.State);
1585
1153
  }
1586
- return Promise.resolve(contents);
1154
+ return contents;
1587
1155
  };
1588
1156
  exports.deserializeAws_restJson1DeleteServiceCommand = deserializeAws_restJson1DeleteServiceCommand;
1589
1157
  const deserializeAws_restJson1DeleteServiceCommandError = async (output, context) => {
@@ -1591,7 +1159,6 @@ const deserializeAws_restJson1DeleteServiceCommandError = async (output, context
1591
1159
  ...output,
1592
1160
  body: await parseBody(output.body, context),
1593
1161
  };
1594
- let response;
1595
1162
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1596
1163
  switch (errorCode) {
1597
1164
  case "AccessDeniedException":
@@ -1614,81 +1181,65 @@ const deserializeAws_restJson1DeleteServiceCommandError = async (output, context
1614
1181
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1615
1182
  default:
1616
1183
  const parsedBody = parsedOutput.body;
1617
- const $metadata = deserializeMetadata(output);
1618
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1619
- response = new MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException({
1620
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1621
- $fault: "client",
1622
- $metadata,
1184
+ (0, smithy_client_1.throwDefaultError)({
1185
+ output,
1186
+ parsedBody,
1187
+ exceptionCtor: MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException,
1188
+ errorCode,
1623
1189
  });
1624
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1625
1190
  }
1626
1191
  };
1627
1192
  const deserializeAws_restJson1GetApplicationCommand = async (output, context) => {
1628
1193
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1629
1194
  return deserializeAws_restJson1GetApplicationCommandError(output, context);
1630
1195
  }
1631
- const contents = {
1196
+ const contents = map({
1632
1197
  $metadata: deserializeMetadata(output),
1633
- ApiGatewayProxy: undefined,
1634
- ApplicationId: undefined,
1635
- Arn: undefined,
1636
- CreatedByAccountId: undefined,
1637
- CreatedTime: undefined,
1638
- EnvironmentId: undefined,
1639
- Error: undefined,
1640
- LastUpdatedTime: undefined,
1641
- Name: undefined,
1642
- OwnerAccountId: undefined,
1643
- ProxyType: undefined,
1644
- State: undefined,
1645
- Tags: undefined,
1646
- VpcId: undefined,
1647
- };
1198
+ });
1648
1199
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1649
- if (data.ApiGatewayProxy !== undefined && data.ApiGatewayProxy !== null) {
1200
+ if (data.ApiGatewayProxy != null) {
1650
1201
  contents.ApiGatewayProxy = deserializeAws_restJson1ApiGatewayProxyConfig(data.ApiGatewayProxy, context);
1651
1202
  }
1652
- if (data.ApplicationId !== undefined && data.ApplicationId !== null) {
1203
+ if (data.ApplicationId != null) {
1653
1204
  contents.ApplicationId = (0, smithy_client_1.expectString)(data.ApplicationId);
1654
1205
  }
1655
- if (data.Arn !== undefined && data.Arn !== null) {
1206
+ if (data.Arn != null) {
1656
1207
  contents.Arn = (0, smithy_client_1.expectString)(data.Arn);
1657
1208
  }
1658
- if (data.CreatedByAccountId !== undefined && data.CreatedByAccountId !== null) {
1209
+ if (data.CreatedByAccountId != null) {
1659
1210
  contents.CreatedByAccountId = (0, smithy_client_1.expectString)(data.CreatedByAccountId);
1660
1211
  }
1661
- if (data.CreatedTime !== undefined && data.CreatedTime !== null) {
1212
+ if (data.CreatedTime != null) {
1662
1213
  contents.CreatedTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.CreatedTime)));
1663
1214
  }
1664
- if (data.EnvironmentId !== undefined && data.EnvironmentId !== null) {
1215
+ if (data.EnvironmentId != null) {
1665
1216
  contents.EnvironmentId = (0, smithy_client_1.expectString)(data.EnvironmentId);
1666
1217
  }
1667
- if (data.Error !== undefined && data.Error !== null) {
1218
+ if (data.Error != null) {
1668
1219
  contents.Error = deserializeAws_restJson1ErrorResponse(data.Error, context);
1669
1220
  }
1670
- if (data.LastUpdatedTime !== undefined && data.LastUpdatedTime !== null) {
1221
+ if (data.LastUpdatedTime != null) {
1671
1222
  contents.LastUpdatedTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.LastUpdatedTime)));
1672
1223
  }
1673
- if (data.Name !== undefined && data.Name !== null) {
1224
+ if (data.Name != null) {
1674
1225
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
1675
1226
  }
1676
- if (data.OwnerAccountId !== undefined && data.OwnerAccountId !== null) {
1227
+ if (data.OwnerAccountId != null) {
1677
1228
  contents.OwnerAccountId = (0, smithy_client_1.expectString)(data.OwnerAccountId);
1678
1229
  }
1679
- if (data.ProxyType !== undefined && data.ProxyType !== null) {
1230
+ if (data.ProxyType != null) {
1680
1231
  contents.ProxyType = (0, smithy_client_1.expectString)(data.ProxyType);
1681
1232
  }
1682
- if (data.State !== undefined && data.State !== null) {
1233
+ if (data.State != null) {
1683
1234
  contents.State = (0, smithy_client_1.expectString)(data.State);
1684
1235
  }
1685
- if (data.Tags !== undefined && data.Tags !== null) {
1236
+ if (data.Tags != null) {
1686
1237
  contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
1687
1238
  }
1688
- if (data.VpcId !== undefined && data.VpcId !== null) {
1239
+ if (data.VpcId != null) {
1689
1240
  contents.VpcId = (0, smithy_client_1.expectString)(data.VpcId);
1690
1241
  }
1691
- return Promise.resolve(contents);
1242
+ return contents;
1692
1243
  };
1693
1244
  exports.deserializeAws_restJson1GetApplicationCommand = deserializeAws_restJson1GetApplicationCommand;
1694
1245
  const deserializeAws_restJson1GetApplicationCommandError = async (output, context) => {
@@ -1696,7 +1247,6 @@ const deserializeAws_restJson1GetApplicationCommandError = async (output, contex
1696
1247
  ...output,
1697
1248
  body: await parseBody(output.body, context),
1698
1249
  };
1699
- let response;
1700
1250
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1701
1251
  switch (errorCode) {
1702
1252
  case "AccessDeniedException":
@@ -1716,73 +1266,59 @@ const deserializeAws_restJson1GetApplicationCommandError = async (output, contex
1716
1266
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1717
1267
  default:
1718
1268
  const parsedBody = parsedOutput.body;
1719
- const $metadata = deserializeMetadata(output);
1720
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1721
- response = new MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException({
1722
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1723
- $fault: "client",
1724
- $metadata,
1269
+ (0, smithy_client_1.throwDefaultError)({
1270
+ output,
1271
+ parsedBody,
1272
+ exceptionCtor: MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException,
1273
+ errorCode,
1725
1274
  });
1726
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1727
1275
  }
1728
1276
  };
1729
1277
  const deserializeAws_restJson1GetEnvironmentCommand = async (output, context) => {
1730
1278
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1731
1279
  return deserializeAws_restJson1GetEnvironmentCommandError(output, context);
1732
1280
  }
1733
- const contents = {
1281
+ const contents = map({
1734
1282
  $metadata: deserializeMetadata(output),
1735
- Arn: undefined,
1736
- CreatedTime: undefined,
1737
- Description: undefined,
1738
- EnvironmentId: undefined,
1739
- Error: undefined,
1740
- LastUpdatedTime: undefined,
1741
- Name: undefined,
1742
- NetworkFabricType: undefined,
1743
- OwnerAccountId: undefined,
1744
- State: undefined,
1745
- Tags: undefined,
1746
- TransitGatewayId: undefined,
1747
- };
1283
+ });
1748
1284
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1749
- if (data.Arn !== undefined && data.Arn !== null) {
1285
+ if (data.Arn != null) {
1750
1286
  contents.Arn = (0, smithy_client_1.expectString)(data.Arn);
1751
1287
  }
1752
- if (data.CreatedTime !== undefined && data.CreatedTime !== null) {
1288
+ if (data.CreatedTime != null) {
1753
1289
  contents.CreatedTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.CreatedTime)));
1754
1290
  }
1755
- if (data.Description !== undefined && data.Description !== null) {
1291
+ if (data.Description != null) {
1756
1292
  contents.Description = (0, smithy_client_1.expectString)(data.Description);
1757
1293
  }
1758
- if (data.EnvironmentId !== undefined && data.EnvironmentId !== null) {
1294
+ if (data.EnvironmentId != null) {
1759
1295
  contents.EnvironmentId = (0, smithy_client_1.expectString)(data.EnvironmentId);
1760
1296
  }
1761
- if (data.Error !== undefined && data.Error !== null) {
1297
+ if (data.Error != null) {
1762
1298
  contents.Error = deserializeAws_restJson1ErrorResponse(data.Error, context);
1763
1299
  }
1764
- if (data.LastUpdatedTime !== undefined && data.LastUpdatedTime !== null) {
1300
+ if (data.LastUpdatedTime != null) {
1765
1301
  contents.LastUpdatedTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.LastUpdatedTime)));
1766
1302
  }
1767
- if (data.Name !== undefined && data.Name !== null) {
1303
+ if (data.Name != null) {
1768
1304
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
1769
1305
  }
1770
- if (data.NetworkFabricType !== undefined && data.NetworkFabricType !== null) {
1306
+ if (data.NetworkFabricType != null) {
1771
1307
  contents.NetworkFabricType = (0, smithy_client_1.expectString)(data.NetworkFabricType);
1772
1308
  }
1773
- if (data.OwnerAccountId !== undefined && data.OwnerAccountId !== null) {
1309
+ if (data.OwnerAccountId != null) {
1774
1310
  contents.OwnerAccountId = (0, smithy_client_1.expectString)(data.OwnerAccountId);
1775
1311
  }
1776
- if (data.State !== undefined && data.State !== null) {
1312
+ if (data.State != null) {
1777
1313
  contents.State = (0, smithy_client_1.expectString)(data.State);
1778
1314
  }
1779
- if (data.Tags !== undefined && data.Tags !== null) {
1315
+ if (data.Tags != null) {
1780
1316
  contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
1781
1317
  }
1782
- if (data.TransitGatewayId !== undefined && data.TransitGatewayId !== null) {
1318
+ if (data.TransitGatewayId != null) {
1783
1319
  contents.TransitGatewayId = (0, smithy_client_1.expectString)(data.TransitGatewayId);
1784
1320
  }
1785
- return Promise.resolve(contents);
1321
+ return contents;
1786
1322
  };
1787
1323
  exports.deserializeAws_restJson1GetEnvironmentCommand = deserializeAws_restJson1GetEnvironmentCommand;
1788
1324
  const deserializeAws_restJson1GetEnvironmentCommandError = async (output, context) => {
@@ -1790,7 +1326,6 @@ const deserializeAws_restJson1GetEnvironmentCommandError = async (output, contex
1790
1326
  ...output,
1791
1327
  body: await parseBody(output.body, context),
1792
1328
  };
1793
- let response;
1794
1329
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1795
1330
  switch (errorCode) {
1796
1331
  case "AccessDeniedException":
@@ -1810,29 +1345,26 @@ const deserializeAws_restJson1GetEnvironmentCommandError = async (output, contex
1810
1345
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1811
1346
  default:
1812
1347
  const parsedBody = parsedOutput.body;
1813
- const $metadata = deserializeMetadata(output);
1814
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1815
- response = new MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException({
1816
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1817
- $fault: "client",
1818
- $metadata,
1348
+ (0, smithy_client_1.throwDefaultError)({
1349
+ output,
1350
+ parsedBody,
1351
+ exceptionCtor: MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException,
1352
+ errorCode,
1819
1353
  });
1820
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1821
1354
  }
1822
1355
  };
1823
1356
  const deserializeAws_restJson1GetResourcePolicyCommand = async (output, context) => {
1824
1357
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1825
1358
  return deserializeAws_restJson1GetResourcePolicyCommandError(output, context);
1826
1359
  }
1827
- const contents = {
1360
+ const contents = map({
1828
1361
  $metadata: deserializeMetadata(output),
1829
- Policy: undefined,
1830
- };
1362
+ });
1831
1363
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1832
- if (data.Policy !== undefined && data.Policy !== null) {
1364
+ if (data.Policy != null) {
1833
1365
  contents.Policy = (0, smithy_client_1.expectString)(data.Policy);
1834
1366
  }
1835
- return Promise.resolve(contents);
1367
+ return contents;
1836
1368
  };
1837
1369
  exports.deserializeAws_restJson1GetResourcePolicyCommand = deserializeAws_restJson1GetResourcePolicyCommand;
1838
1370
  const deserializeAws_restJson1GetResourcePolicyCommandError = async (output, context) => {
@@ -1840,7 +1372,6 @@ const deserializeAws_restJson1GetResourcePolicyCommandError = async (output, con
1840
1372
  ...output,
1841
1373
  body: await parseBody(output.body, context),
1842
1374
  };
1843
- let response;
1844
1375
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1845
1376
  switch (errorCode) {
1846
1377
  case "AccessDeniedException":
@@ -1860,93 +1391,74 @@ const deserializeAws_restJson1GetResourcePolicyCommandError = async (output, con
1860
1391
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1861
1392
  default:
1862
1393
  const parsedBody = parsedOutput.body;
1863
- const $metadata = deserializeMetadata(output);
1864
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1865
- response = new MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException({
1866
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1867
- $fault: "client",
1868
- $metadata,
1394
+ (0, smithy_client_1.throwDefaultError)({
1395
+ output,
1396
+ parsedBody,
1397
+ exceptionCtor: MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException,
1398
+ errorCode,
1869
1399
  });
1870
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1871
1400
  }
1872
1401
  };
1873
1402
  const deserializeAws_restJson1GetRouteCommand = async (output, context) => {
1874
1403
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1875
1404
  return deserializeAws_restJson1GetRouteCommandError(output, context);
1876
1405
  }
1877
- const contents = {
1406
+ const contents = map({
1878
1407
  $metadata: deserializeMetadata(output),
1879
- ApplicationId: undefined,
1880
- Arn: undefined,
1881
- CreatedByAccountId: undefined,
1882
- CreatedTime: undefined,
1883
- EnvironmentId: undefined,
1884
- Error: undefined,
1885
- IncludeChildPaths: undefined,
1886
- LastUpdatedTime: undefined,
1887
- Methods: undefined,
1888
- OwnerAccountId: undefined,
1889
- PathResourceToId: undefined,
1890
- RouteId: undefined,
1891
- RouteType: undefined,
1892
- ServiceId: undefined,
1893
- SourcePath: undefined,
1894
- State: undefined,
1895
- Tags: undefined,
1896
- };
1408
+ });
1897
1409
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1898
- if (data.ApplicationId !== undefined && data.ApplicationId !== null) {
1410
+ if (data.ApplicationId != null) {
1899
1411
  contents.ApplicationId = (0, smithy_client_1.expectString)(data.ApplicationId);
1900
1412
  }
1901
- if (data.Arn !== undefined && data.Arn !== null) {
1413
+ if (data.Arn != null) {
1902
1414
  contents.Arn = (0, smithy_client_1.expectString)(data.Arn);
1903
1415
  }
1904
- if (data.CreatedByAccountId !== undefined && data.CreatedByAccountId !== null) {
1416
+ if (data.CreatedByAccountId != null) {
1905
1417
  contents.CreatedByAccountId = (0, smithy_client_1.expectString)(data.CreatedByAccountId);
1906
1418
  }
1907
- if (data.CreatedTime !== undefined && data.CreatedTime !== null) {
1419
+ if (data.CreatedTime != null) {
1908
1420
  contents.CreatedTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.CreatedTime)));
1909
1421
  }
1910
- if (data.EnvironmentId !== undefined && data.EnvironmentId !== null) {
1422
+ if (data.EnvironmentId != null) {
1911
1423
  contents.EnvironmentId = (0, smithy_client_1.expectString)(data.EnvironmentId);
1912
1424
  }
1913
- if (data.Error !== undefined && data.Error !== null) {
1425
+ if (data.Error != null) {
1914
1426
  contents.Error = deserializeAws_restJson1ErrorResponse(data.Error, context);
1915
1427
  }
1916
- if (data.IncludeChildPaths !== undefined && data.IncludeChildPaths !== null) {
1428
+ if (data.IncludeChildPaths != null) {
1917
1429
  contents.IncludeChildPaths = (0, smithy_client_1.expectBoolean)(data.IncludeChildPaths);
1918
1430
  }
1919
- if (data.LastUpdatedTime !== undefined && data.LastUpdatedTime !== null) {
1431
+ if (data.LastUpdatedTime != null) {
1920
1432
  contents.LastUpdatedTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.LastUpdatedTime)));
1921
1433
  }
1922
- if (data.Methods !== undefined && data.Methods !== null) {
1434
+ if (data.Methods != null) {
1923
1435
  contents.Methods = deserializeAws_restJson1HttpMethods(data.Methods, context);
1924
1436
  }
1925
- if (data.OwnerAccountId !== undefined && data.OwnerAccountId !== null) {
1437
+ if (data.OwnerAccountId != null) {
1926
1438
  contents.OwnerAccountId = (0, smithy_client_1.expectString)(data.OwnerAccountId);
1927
1439
  }
1928
- if (data.PathResourceToId !== undefined && data.PathResourceToId !== null) {
1440
+ if (data.PathResourceToId != null) {
1929
1441
  contents.PathResourceToId = deserializeAws_restJson1PathResourceToId(data.PathResourceToId, context);
1930
1442
  }
1931
- if (data.RouteId !== undefined && data.RouteId !== null) {
1443
+ if (data.RouteId != null) {
1932
1444
  contents.RouteId = (0, smithy_client_1.expectString)(data.RouteId);
1933
1445
  }
1934
- if (data.RouteType !== undefined && data.RouteType !== null) {
1446
+ if (data.RouteType != null) {
1935
1447
  contents.RouteType = (0, smithy_client_1.expectString)(data.RouteType);
1936
1448
  }
1937
- if (data.ServiceId !== undefined && data.ServiceId !== null) {
1449
+ if (data.ServiceId != null) {
1938
1450
  contents.ServiceId = (0, smithy_client_1.expectString)(data.ServiceId);
1939
1451
  }
1940
- if (data.SourcePath !== undefined && data.SourcePath !== null) {
1452
+ if (data.SourcePath != null) {
1941
1453
  contents.SourcePath = (0, smithy_client_1.expectString)(data.SourcePath);
1942
1454
  }
1943
- if (data.State !== undefined && data.State !== null) {
1455
+ if (data.State != null) {
1944
1456
  contents.State = (0, smithy_client_1.expectString)(data.State);
1945
1457
  }
1946
- if (data.Tags !== undefined && data.Tags !== null) {
1458
+ if (data.Tags != null) {
1947
1459
  contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
1948
1460
  }
1949
- return Promise.resolve(contents);
1461
+ return contents;
1950
1462
  };
1951
1463
  exports.deserializeAws_restJson1GetRouteCommand = deserializeAws_restJson1GetRouteCommand;
1952
1464
  const deserializeAws_restJson1GetRouteCommandError = async (output, context) => {
@@ -1954,7 +1466,6 @@ const deserializeAws_restJson1GetRouteCommandError = async (output, context) =>
1954
1466
  ...output,
1955
1467
  body: await parseBody(output.body, context),
1956
1468
  };
1957
- let response;
1958
1469
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1959
1470
  switch (errorCode) {
1960
1471
  case "AccessDeniedException":
@@ -1974,93 +1485,74 @@ const deserializeAws_restJson1GetRouteCommandError = async (output, context) =>
1974
1485
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1975
1486
  default:
1976
1487
  const parsedBody = parsedOutput.body;
1977
- const $metadata = deserializeMetadata(output);
1978
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1979
- response = new MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException({
1980
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1981
- $fault: "client",
1982
- $metadata,
1488
+ (0, smithy_client_1.throwDefaultError)({
1489
+ output,
1490
+ parsedBody,
1491
+ exceptionCtor: MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException,
1492
+ errorCode,
1983
1493
  });
1984
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1985
1494
  }
1986
1495
  };
1987
1496
  const deserializeAws_restJson1GetServiceCommand = async (output, context) => {
1988
1497
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1989
1498
  return deserializeAws_restJson1GetServiceCommandError(output, context);
1990
1499
  }
1991
- const contents = {
1500
+ const contents = map({
1992
1501
  $metadata: deserializeMetadata(output),
1993
- ApplicationId: undefined,
1994
- Arn: undefined,
1995
- CreatedByAccountId: undefined,
1996
- CreatedTime: undefined,
1997
- Description: undefined,
1998
- EndpointType: undefined,
1999
- EnvironmentId: undefined,
2000
- Error: undefined,
2001
- LambdaEndpoint: undefined,
2002
- LastUpdatedTime: undefined,
2003
- Name: undefined,
2004
- OwnerAccountId: undefined,
2005
- ServiceId: undefined,
2006
- State: undefined,
2007
- Tags: undefined,
2008
- UrlEndpoint: undefined,
2009
- VpcId: undefined,
2010
- };
1502
+ });
2011
1503
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2012
- if (data.ApplicationId !== undefined && data.ApplicationId !== null) {
1504
+ if (data.ApplicationId != null) {
2013
1505
  contents.ApplicationId = (0, smithy_client_1.expectString)(data.ApplicationId);
2014
1506
  }
2015
- if (data.Arn !== undefined && data.Arn !== null) {
1507
+ if (data.Arn != null) {
2016
1508
  contents.Arn = (0, smithy_client_1.expectString)(data.Arn);
2017
1509
  }
2018
- if (data.CreatedByAccountId !== undefined && data.CreatedByAccountId !== null) {
1510
+ if (data.CreatedByAccountId != null) {
2019
1511
  contents.CreatedByAccountId = (0, smithy_client_1.expectString)(data.CreatedByAccountId);
2020
1512
  }
2021
- if (data.CreatedTime !== undefined && data.CreatedTime !== null) {
1513
+ if (data.CreatedTime != null) {
2022
1514
  contents.CreatedTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.CreatedTime)));
2023
1515
  }
2024
- if (data.Description !== undefined && data.Description !== null) {
1516
+ if (data.Description != null) {
2025
1517
  contents.Description = (0, smithy_client_1.expectString)(data.Description);
2026
1518
  }
2027
- if (data.EndpointType !== undefined && data.EndpointType !== null) {
1519
+ if (data.EndpointType != null) {
2028
1520
  contents.EndpointType = (0, smithy_client_1.expectString)(data.EndpointType);
2029
1521
  }
2030
- if (data.EnvironmentId !== undefined && data.EnvironmentId !== null) {
1522
+ if (data.EnvironmentId != null) {
2031
1523
  contents.EnvironmentId = (0, smithy_client_1.expectString)(data.EnvironmentId);
2032
1524
  }
2033
- if (data.Error !== undefined && data.Error !== null) {
1525
+ if (data.Error != null) {
2034
1526
  contents.Error = deserializeAws_restJson1ErrorResponse(data.Error, context);
2035
1527
  }
2036
- if (data.LambdaEndpoint !== undefined && data.LambdaEndpoint !== null) {
1528
+ if (data.LambdaEndpoint != null) {
2037
1529
  contents.LambdaEndpoint = deserializeAws_restJson1LambdaEndpointConfig(data.LambdaEndpoint, context);
2038
1530
  }
2039
- if (data.LastUpdatedTime !== undefined && data.LastUpdatedTime !== null) {
1531
+ if (data.LastUpdatedTime != null) {
2040
1532
  contents.LastUpdatedTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.LastUpdatedTime)));
2041
1533
  }
2042
- if (data.Name !== undefined && data.Name !== null) {
1534
+ if (data.Name != null) {
2043
1535
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
2044
1536
  }
2045
- if (data.OwnerAccountId !== undefined && data.OwnerAccountId !== null) {
1537
+ if (data.OwnerAccountId != null) {
2046
1538
  contents.OwnerAccountId = (0, smithy_client_1.expectString)(data.OwnerAccountId);
2047
1539
  }
2048
- if (data.ServiceId !== undefined && data.ServiceId !== null) {
1540
+ if (data.ServiceId != null) {
2049
1541
  contents.ServiceId = (0, smithy_client_1.expectString)(data.ServiceId);
2050
1542
  }
2051
- if (data.State !== undefined && data.State !== null) {
1543
+ if (data.State != null) {
2052
1544
  contents.State = (0, smithy_client_1.expectString)(data.State);
2053
1545
  }
2054
- if (data.Tags !== undefined && data.Tags !== null) {
1546
+ if (data.Tags != null) {
2055
1547
  contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
2056
1548
  }
2057
- if (data.UrlEndpoint !== undefined && data.UrlEndpoint !== null) {
1549
+ if (data.UrlEndpoint != null) {
2058
1550
  contents.UrlEndpoint = deserializeAws_restJson1UrlEndpointConfig(data.UrlEndpoint, context);
2059
1551
  }
2060
- if (data.VpcId !== undefined && data.VpcId !== null) {
1552
+ if (data.VpcId != null) {
2061
1553
  contents.VpcId = (0, smithy_client_1.expectString)(data.VpcId);
2062
1554
  }
2063
- return Promise.resolve(contents);
1555
+ return contents;
2064
1556
  };
2065
1557
  exports.deserializeAws_restJson1GetServiceCommand = deserializeAws_restJson1GetServiceCommand;
2066
1558
  const deserializeAws_restJson1GetServiceCommandError = async (output, context) => {
@@ -2068,7 +1560,6 @@ const deserializeAws_restJson1GetServiceCommandError = async (output, context) =
2068
1560
  ...output,
2069
1561
  body: await parseBody(output.body, context),
2070
1562
  };
2071
- let response;
2072
1563
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2073
1564
  switch (errorCode) {
2074
1565
  case "AccessDeniedException":
@@ -2088,33 +1579,29 @@ const deserializeAws_restJson1GetServiceCommandError = async (output, context) =
2088
1579
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2089
1580
  default:
2090
1581
  const parsedBody = parsedOutput.body;
2091
- const $metadata = deserializeMetadata(output);
2092
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2093
- response = new MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException({
2094
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2095
- $fault: "client",
2096
- $metadata,
1582
+ (0, smithy_client_1.throwDefaultError)({
1583
+ output,
1584
+ parsedBody,
1585
+ exceptionCtor: MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException,
1586
+ errorCode,
2097
1587
  });
2098
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2099
1588
  }
2100
1589
  };
2101
1590
  const deserializeAws_restJson1ListApplicationsCommand = async (output, context) => {
2102
1591
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2103
1592
  return deserializeAws_restJson1ListApplicationsCommandError(output, context);
2104
1593
  }
2105
- const contents = {
1594
+ const contents = map({
2106
1595
  $metadata: deserializeMetadata(output),
2107
- ApplicationSummaryList: undefined,
2108
- NextToken: undefined,
2109
- };
1596
+ });
2110
1597
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2111
- if (data.ApplicationSummaryList !== undefined && data.ApplicationSummaryList !== null) {
1598
+ if (data.ApplicationSummaryList != null) {
2112
1599
  contents.ApplicationSummaryList = deserializeAws_restJson1ApplicationSummaries(data.ApplicationSummaryList, context);
2113
1600
  }
2114
- if (data.NextToken !== undefined && data.NextToken !== null) {
1601
+ if (data.NextToken != null) {
2115
1602
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
2116
1603
  }
2117
- return Promise.resolve(contents);
1604
+ return contents;
2118
1605
  };
2119
1606
  exports.deserializeAws_restJson1ListApplicationsCommand = deserializeAws_restJson1ListApplicationsCommand;
2120
1607
  const deserializeAws_restJson1ListApplicationsCommandError = async (output, context) => {
@@ -2122,7 +1609,6 @@ const deserializeAws_restJson1ListApplicationsCommandError = async (output, cont
2122
1609
  ...output,
2123
1610
  body: await parseBody(output.body, context),
2124
1611
  };
2125
- let response;
2126
1612
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2127
1613
  switch (errorCode) {
2128
1614
  case "AccessDeniedException":
@@ -2148,33 +1634,29 @@ const deserializeAws_restJson1ListApplicationsCommandError = async (output, cont
2148
1634
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2149
1635
  default:
2150
1636
  const parsedBody = parsedOutput.body;
2151
- const $metadata = deserializeMetadata(output);
2152
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2153
- response = new MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException({
2154
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2155
- $fault: "client",
2156
- $metadata,
1637
+ (0, smithy_client_1.throwDefaultError)({
1638
+ output,
1639
+ parsedBody,
1640
+ exceptionCtor: MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException,
1641
+ errorCode,
2157
1642
  });
2158
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2159
1643
  }
2160
1644
  };
2161
1645
  const deserializeAws_restJson1ListEnvironmentsCommand = async (output, context) => {
2162
1646
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2163
1647
  return deserializeAws_restJson1ListEnvironmentsCommandError(output, context);
2164
1648
  }
2165
- const contents = {
1649
+ const contents = map({
2166
1650
  $metadata: deserializeMetadata(output),
2167
- EnvironmentSummaryList: undefined,
2168
- NextToken: undefined,
2169
- };
1651
+ });
2170
1652
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2171
- if (data.EnvironmentSummaryList !== undefined && data.EnvironmentSummaryList !== null) {
1653
+ if (data.EnvironmentSummaryList != null) {
2172
1654
  contents.EnvironmentSummaryList = deserializeAws_restJson1EnvironmentSummaries(data.EnvironmentSummaryList, context);
2173
1655
  }
2174
- if (data.NextToken !== undefined && data.NextToken !== null) {
1656
+ if (data.NextToken != null) {
2175
1657
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
2176
1658
  }
2177
- return Promise.resolve(contents);
1659
+ return contents;
2178
1660
  };
2179
1661
  exports.deserializeAws_restJson1ListEnvironmentsCommand = deserializeAws_restJson1ListEnvironmentsCommand;
2180
1662
  const deserializeAws_restJson1ListEnvironmentsCommandError = async (output, context) => {
@@ -2182,7 +1664,6 @@ const deserializeAws_restJson1ListEnvironmentsCommandError = async (output, cont
2182
1664
  ...output,
2183
1665
  body: await parseBody(output.body, context),
2184
1666
  };
2185
- let response;
2186
1667
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2187
1668
  switch (errorCode) {
2188
1669
  case "AccessDeniedException":
@@ -2202,33 +1683,29 @@ const deserializeAws_restJson1ListEnvironmentsCommandError = async (output, cont
2202
1683
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2203
1684
  default:
2204
1685
  const parsedBody = parsedOutput.body;
2205
- const $metadata = deserializeMetadata(output);
2206
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2207
- response = new MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException({
2208
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2209
- $fault: "client",
2210
- $metadata,
1686
+ (0, smithy_client_1.throwDefaultError)({
1687
+ output,
1688
+ parsedBody,
1689
+ exceptionCtor: MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException,
1690
+ errorCode,
2211
1691
  });
2212
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2213
1692
  }
2214
1693
  };
2215
1694
  const deserializeAws_restJson1ListEnvironmentVpcsCommand = async (output, context) => {
2216
1695
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2217
1696
  return deserializeAws_restJson1ListEnvironmentVpcsCommandError(output, context);
2218
1697
  }
2219
- const contents = {
1698
+ const contents = map({
2220
1699
  $metadata: deserializeMetadata(output),
2221
- EnvironmentVpcList: undefined,
2222
- NextToken: undefined,
2223
- };
1700
+ });
2224
1701
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2225
- if (data.EnvironmentVpcList !== undefined && data.EnvironmentVpcList !== null) {
1702
+ if (data.EnvironmentVpcList != null) {
2226
1703
  contents.EnvironmentVpcList = deserializeAws_restJson1EnvironmentVpcs(data.EnvironmentVpcList, context);
2227
1704
  }
2228
- if (data.NextToken !== undefined && data.NextToken !== null) {
1705
+ if (data.NextToken != null) {
2229
1706
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
2230
1707
  }
2231
- return Promise.resolve(contents);
1708
+ return contents;
2232
1709
  };
2233
1710
  exports.deserializeAws_restJson1ListEnvironmentVpcsCommand = deserializeAws_restJson1ListEnvironmentVpcsCommand;
2234
1711
  const deserializeAws_restJson1ListEnvironmentVpcsCommandError = async (output, context) => {
@@ -2236,7 +1713,6 @@ const deserializeAws_restJson1ListEnvironmentVpcsCommandError = async (output, c
2236
1713
  ...output,
2237
1714
  body: await parseBody(output.body, context),
2238
1715
  };
2239
- let response;
2240
1716
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2241
1717
  switch (errorCode) {
2242
1718
  case "AccessDeniedException":
@@ -2256,33 +1732,29 @@ const deserializeAws_restJson1ListEnvironmentVpcsCommandError = async (output, c
2256
1732
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2257
1733
  default:
2258
1734
  const parsedBody = parsedOutput.body;
2259
- const $metadata = deserializeMetadata(output);
2260
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2261
- response = new MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException({
2262
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2263
- $fault: "client",
2264
- $metadata,
1735
+ (0, smithy_client_1.throwDefaultError)({
1736
+ output,
1737
+ parsedBody,
1738
+ exceptionCtor: MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException,
1739
+ errorCode,
2265
1740
  });
2266
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2267
1741
  }
2268
1742
  };
2269
1743
  const deserializeAws_restJson1ListRoutesCommand = async (output, context) => {
2270
1744
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2271
1745
  return deserializeAws_restJson1ListRoutesCommandError(output, context);
2272
1746
  }
2273
- const contents = {
1747
+ const contents = map({
2274
1748
  $metadata: deserializeMetadata(output),
2275
- NextToken: undefined,
2276
- RouteSummaryList: undefined,
2277
- };
1749
+ });
2278
1750
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2279
- if (data.NextToken !== undefined && data.NextToken !== null) {
1751
+ if (data.NextToken != null) {
2280
1752
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
2281
1753
  }
2282
- if (data.RouteSummaryList !== undefined && data.RouteSummaryList !== null) {
1754
+ if (data.RouteSummaryList != null) {
2283
1755
  contents.RouteSummaryList = deserializeAws_restJson1RouteSummaries(data.RouteSummaryList, context);
2284
1756
  }
2285
- return Promise.resolve(contents);
1757
+ return contents;
2286
1758
  };
2287
1759
  exports.deserializeAws_restJson1ListRoutesCommand = deserializeAws_restJson1ListRoutesCommand;
2288
1760
  const deserializeAws_restJson1ListRoutesCommandError = async (output, context) => {
@@ -2290,7 +1762,6 @@ const deserializeAws_restJson1ListRoutesCommandError = async (output, context) =
2290
1762
  ...output,
2291
1763
  body: await parseBody(output.body, context),
2292
1764
  };
2293
- let response;
2294
1765
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2295
1766
  switch (errorCode) {
2296
1767
  case "AccessDeniedException":
@@ -2316,33 +1787,29 @@ const deserializeAws_restJson1ListRoutesCommandError = async (output, context) =
2316
1787
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2317
1788
  default:
2318
1789
  const parsedBody = parsedOutput.body;
2319
- const $metadata = deserializeMetadata(output);
2320
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2321
- response = new MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException({
2322
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2323
- $fault: "client",
2324
- $metadata,
1790
+ (0, smithy_client_1.throwDefaultError)({
1791
+ output,
1792
+ parsedBody,
1793
+ exceptionCtor: MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException,
1794
+ errorCode,
2325
1795
  });
2326
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2327
1796
  }
2328
1797
  };
2329
1798
  const deserializeAws_restJson1ListServicesCommand = async (output, context) => {
2330
1799
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2331
1800
  return deserializeAws_restJson1ListServicesCommandError(output, context);
2332
1801
  }
2333
- const contents = {
1802
+ const contents = map({
2334
1803
  $metadata: deserializeMetadata(output),
2335
- NextToken: undefined,
2336
- ServiceSummaryList: undefined,
2337
- };
1804
+ });
2338
1805
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2339
- if (data.NextToken !== undefined && data.NextToken !== null) {
1806
+ if (data.NextToken != null) {
2340
1807
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
2341
1808
  }
2342
- if (data.ServiceSummaryList !== undefined && data.ServiceSummaryList !== null) {
1809
+ if (data.ServiceSummaryList != null) {
2343
1810
  contents.ServiceSummaryList = deserializeAws_restJson1ServiceSummaries(data.ServiceSummaryList, context);
2344
1811
  }
2345
- return Promise.resolve(contents);
1812
+ return contents;
2346
1813
  };
2347
1814
  exports.deserializeAws_restJson1ListServicesCommand = deserializeAws_restJson1ListServicesCommand;
2348
1815
  const deserializeAws_restJson1ListServicesCommandError = async (output, context) => {
@@ -2350,7 +1817,6 @@ const deserializeAws_restJson1ListServicesCommandError = async (output, context)
2350
1817
  ...output,
2351
1818
  body: await parseBody(output.body, context),
2352
1819
  };
2353
- let response;
2354
1820
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2355
1821
  switch (errorCode) {
2356
1822
  case "AccessDeniedException":
@@ -2376,29 +1842,26 @@ const deserializeAws_restJson1ListServicesCommandError = async (output, context)
2376
1842
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2377
1843
  default:
2378
1844
  const parsedBody = parsedOutput.body;
2379
- const $metadata = deserializeMetadata(output);
2380
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2381
- response = new MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException({
2382
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2383
- $fault: "client",
2384
- $metadata,
1845
+ (0, smithy_client_1.throwDefaultError)({
1846
+ output,
1847
+ parsedBody,
1848
+ exceptionCtor: MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException,
1849
+ errorCode,
2385
1850
  });
2386
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2387
1851
  }
2388
1852
  };
2389
1853
  const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
2390
1854
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2391
1855
  return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
2392
1856
  }
2393
- const contents = {
1857
+ const contents = map({
2394
1858
  $metadata: deserializeMetadata(output),
2395
- Tags: undefined,
2396
- };
1859
+ });
2397
1860
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2398
- if (data.Tags !== undefined && data.Tags !== null) {
1861
+ if (data.Tags != null) {
2399
1862
  contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
2400
1863
  }
2401
- return Promise.resolve(contents);
1864
+ return contents;
2402
1865
  };
2403
1866
  exports.deserializeAws_restJson1ListTagsForResourceCommand = deserializeAws_restJson1ListTagsForResourceCommand;
2404
1867
  const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
@@ -2406,7 +1869,6 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
2406
1869
  ...output,
2407
1870
  body: await parseBody(output.body, context),
2408
1871
  };
2409
- let response;
2410
1872
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2411
1873
  switch (errorCode) {
2412
1874
  case "InternalServerException":
@@ -2420,25 +1882,23 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
2420
1882
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2421
1883
  default:
2422
1884
  const parsedBody = parsedOutput.body;
2423
- const $metadata = deserializeMetadata(output);
2424
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2425
- response = new MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException({
2426
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2427
- $fault: "client",
2428
- $metadata,
1885
+ (0, smithy_client_1.throwDefaultError)({
1886
+ output,
1887
+ parsedBody,
1888
+ exceptionCtor: MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException,
1889
+ errorCode,
2429
1890
  });
2430
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2431
1891
  }
2432
1892
  };
2433
1893
  const deserializeAws_restJson1PutResourcePolicyCommand = async (output, context) => {
2434
1894
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2435
1895
  return deserializeAws_restJson1PutResourcePolicyCommandError(output, context);
2436
1896
  }
2437
- const contents = {
1897
+ const contents = map({
2438
1898
  $metadata: deserializeMetadata(output),
2439
- };
1899
+ });
2440
1900
  await collectBody(output.body, context);
2441
- return Promise.resolve(contents);
1901
+ return contents;
2442
1902
  };
2443
1903
  exports.deserializeAws_restJson1PutResourcePolicyCommand = deserializeAws_restJson1PutResourcePolicyCommand;
2444
1904
  const deserializeAws_restJson1PutResourcePolicyCommandError = async (output, context) => {
@@ -2446,7 +1906,6 @@ const deserializeAws_restJson1PutResourcePolicyCommandError = async (output, con
2446
1906
  ...output,
2447
1907
  body: await parseBody(output.body, context),
2448
1908
  };
2449
- let response;
2450
1909
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2451
1910
  switch (errorCode) {
2452
1911
  case "AccessDeniedException":
@@ -2469,25 +1928,23 @@ const deserializeAws_restJson1PutResourcePolicyCommandError = async (output, con
2469
1928
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2470
1929
  default:
2471
1930
  const parsedBody = parsedOutput.body;
2472
- const $metadata = deserializeMetadata(output);
2473
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2474
- response = new MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException({
2475
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2476
- $fault: "client",
2477
- $metadata,
1931
+ (0, smithy_client_1.throwDefaultError)({
1932
+ output,
1933
+ parsedBody,
1934
+ exceptionCtor: MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException,
1935
+ errorCode,
2478
1936
  });
2479
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2480
1937
  }
2481
1938
  };
2482
1939
  const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
2483
1940
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2484
1941
  return deserializeAws_restJson1TagResourceCommandError(output, context);
2485
1942
  }
2486
- const contents = {
1943
+ const contents = map({
2487
1944
  $metadata: deserializeMetadata(output),
2488
- };
1945
+ });
2489
1946
  await collectBody(output.body, context);
2490
- return Promise.resolve(contents);
1947
+ return contents;
2491
1948
  };
2492
1949
  exports.deserializeAws_restJson1TagResourceCommand = deserializeAws_restJson1TagResourceCommand;
2493
1950
  const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
@@ -2495,7 +1952,6 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
2495
1952
  ...output,
2496
1953
  body: await parseBody(output.body, context),
2497
1954
  };
2498
- let response;
2499
1955
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2500
1956
  switch (errorCode) {
2501
1957
  case "InternalServerException":
@@ -2509,25 +1965,23 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
2509
1965
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2510
1966
  default:
2511
1967
  const parsedBody = parsedOutput.body;
2512
- const $metadata = deserializeMetadata(output);
2513
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2514
- response = new MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException({
2515
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2516
- $fault: "client",
2517
- $metadata,
1968
+ (0, smithy_client_1.throwDefaultError)({
1969
+ output,
1970
+ parsedBody,
1971
+ exceptionCtor: MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException,
1972
+ errorCode,
2518
1973
  });
2519
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2520
1974
  }
2521
1975
  };
2522
1976
  const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
2523
1977
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2524
1978
  return deserializeAws_restJson1UntagResourceCommandError(output, context);
2525
1979
  }
2526
- const contents = {
1980
+ const contents = map({
2527
1981
  $metadata: deserializeMetadata(output),
2528
- };
1982
+ });
2529
1983
  await collectBody(output.body, context);
2530
- return Promise.resolve(contents);
1984
+ return contents;
2531
1985
  };
2532
1986
  exports.deserializeAws_restJson1UntagResourceCommand = deserializeAws_restJson1UntagResourceCommand;
2533
1987
  const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
@@ -2535,7 +1989,6 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
2535
1989
  ...output,
2536
1990
  body: await parseBody(output.body, context),
2537
1991
  };
2538
- let response;
2539
1992
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2540
1993
  switch (errorCode) {
2541
1994
  case "InternalServerException":
@@ -2549,49 +2002,41 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
2549
2002
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2550
2003
  default:
2551
2004
  const parsedBody = parsedOutput.body;
2552
- const $metadata = deserializeMetadata(output);
2553
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2554
- response = new MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException({
2555
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2556
- $fault: "client",
2557
- $metadata,
2005
+ (0, smithy_client_1.throwDefaultError)({
2006
+ output,
2007
+ parsedBody,
2008
+ exceptionCtor: MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException,
2009
+ errorCode,
2558
2010
  });
2559
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2560
2011
  }
2561
2012
  };
2562
2013
  const deserializeAws_restJson1UpdateRouteCommand = async (output, context) => {
2563
2014
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2564
2015
  return deserializeAws_restJson1UpdateRouteCommandError(output, context);
2565
2016
  }
2566
- const contents = {
2017
+ const contents = map({
2567
2018
  $metadata: deserializeMetadata(output),
2568
- ApplicationId: undefined,
2569
- Arn: undefined,
2570
- LastUpdatedTime: undefined,
2571
- RouteId: undefined,
2572
- ServiceId: undefined,
2573
- State: undefined,
2574
- };
2019
+ });
2575
2020
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2576
- if (data.ApplicationId !== undefined && data.ApplicationId !== null) {
2021
+ if (data.ApplicationId != null) {
2577
2022
  contents.ApplicationId = (0, smithy_client_1.expectString)(data.ApplicationId);
2578
2023
  }
2579
- if (data.Arn !== undefined && data.Arn !== null) {
2024
+ if (data.Arn != null) {
2580
2025
  contents.Arn = (0, smithy_client_1.expectString)(data.Arn);
2581
2026
  }
2582
- if (data.LastUpdatedTime !== undefined && data.LastUpdatedTime !== null) {
2027
+ if (data.LastUpdatedTime != null) {
2583
2028
  contents.LastUpdatedTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.LastUpdatedTime)));
2584
2029
  }
2585
- if (data.RouteId !== undefined && data.RouteId !== null) {
2030
+ if (data.RouteId != null) {
2586
2031
  contents.RouteId = (0, smithy_client_1.expectString)(data.RouteId);
2587
2032
  }
2588
- if (data.ServiceId !== undefined && data.ServiceId !== null) {
2033
+ if (data.ServiceId != null) {
2589
2034
  contents.ServiceId = (0, smithy_client_1.expectString)(data.ServiceId);
2590
2035
  }
2591
- if (data.State !== undefined && data.State !== null) {
2036
+ if (data.State != null) {
2592
2037
  contents.State = (0, smithy_client_1.expectString)(data.State);
2593
2038
  }
2594
- return Promise.resolve(contents);
2039
+ return contents;
2595
2040
  };
2596
2041
  exports.deserializeAws_restJson1UpdateRouteCommand = deserializeAws_restJson1UpdateRouteCommand;
2597
2042
  const deserializeAws_restJson1UpdateRouteCommandError = async (output, context) => {
@@ -2599,7 +2044,6 @@ const deserializeAws_restJson1UpdateRouteCommandError = async (output, context)
2599
2044
  ...output,
2600
2045
  body: await parseBody(output.body, context),
2601
2046
  };
2602
- let response;
2603
2047
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2604
2048
  switch (errorCode) {
2605
2049
  case "AccessDeniedException":
@@ -2619,20 +2063,19 @@ const deserializeAws_restJson1UpdateRouteCommandError = async (output, context)
2619
2063
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2620
2064
  default:
2621
2065
  const parsedBody = parsedOutput.body;
2622
- const $metadata = deserializeMetadata(output);
2623
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2624
- response = new MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException({
2625
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2626
- $fault: "client",
2627
- $metadata,
2066
+ (0, smithy_client_1.throwDefaultError)({
2067
+ output,
2068
+ parsedBody,
2069
+ exceptionCtor: MigrationHubRefactorSpacesServiceException_1.MigrationHubRefactorSpacesServiceException,
2070
+ errorCode,
2628
2071
  });
2629
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2630
2072
  }
2631
2073
  };
2074
+ const map = smithy_client_1.map;
2632
2075
  const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
2633
- const contents = {};
2076
+ const contents = map({});
2634
2077
  const data = parsedOutput.body;
2635
- if (data.Message !== undefined && data.Message !== null) {
2078
+ if (data.Message != null) {
2636
2079
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2637
2080
  }
2638
2081
  const exception = new models_0_1.AccessDeniedException({
@@ -2642,15 +2085,15 @@ const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutpu
2642
2085
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2643
2086
  };
2644
2087
  const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
2645
- const contents = {};
2088
+ const contents = map({});
2646
2089
  const data = parsedOutput.body;
2647
- if (data.Message !== undefined && data.Message !== null) {
2090
+ if (data.Message != null) {
2648
2091
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2649
2092
  }
2650
- if (data.ResourceId !== undefined && data.ResourceId !== null) {
2093
+ if (data.ResourceId != null) {
2651
2094
  contents.ResourceId = (0, smithy_client_1.expectString)(data.ResourceId);
2652
2095
  }
2653
- if (data.ResourceType !== undefined && data.ResourceType !== null) {
2096
+ if (data.ResourceType != null) {
2654
2097
  contents.ResourceType = (0, smithy_client_1.expectString)(data.ResourceType);
2655
2098
  }
2656
2099
  const exception = new models_0_1.ConflictException({
@@ -2660,9 +2103,9 @@ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, c
2660
2103
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2661
2104
  };
2662
2105
  const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
2663
- const contents = {};
2106
+ const contents = map({});
2664
2107
  const data = parsedOutput.body;
2665
- if (data.Message !== undefined && data.Message !== null) {
2108
+ if (data.Message != null) {
2666
2109
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2667
2110
  }
2668
2111
  const exception = new models_0_1.InternalServerException({
@@ -2672,9 +2115,9 @@ const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOut
2672
2115
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2673
2116
  };
2674
2117
  const deserializeAws_restJson1InvalidResourcePolicyExceptionResponse = async (parsedOutput, context) => {
2675
- const contents = {};
2118
+ const contents = map({});
2676
2119
  const data = parsedOutput.body;
2677
- if (data.Message !== undefined && data.Message !== null) {
2120
+ if (data.Message != null) {
2678
2121
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2679
2122
  }
2680
2123
  const exception = new models_0_1.InvalidResourcePolicyException({
@@ -2684,15 +2127,15 @@ const deserializeAws_restJson1InvalidResourcePolicyExceptionResponse = async (pa
2684
2127
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2685
2128
  };
2686
2129
  const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
2687
- const contents = {};
2130
+ const contents = map({});
2688
2131
  const data = parsedOutput.body;
2689
- if (data.Message !== undefined && data.Message !== null) {
2132
+ if (data.Message != null) {
2690
2133
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2691
2134
  }
2692
- if (data.ResourceId !== undefined && data.ResourceId !== null) {
2135
+ if (data.ResourceId != null) {
2693
2136
  contents.ResourceId = (0, smithy_client_1.expectString)(data.ResourceId);
2694
2137
  }
2695
- if (data.ResourceType !== undefined && data.ResourceType !== null) {
2138
+ if (data.ResourceType != null) {
2696
2139
  contents.ResourceType = (0, smithy_client_1.expectString)(data.ResourceType);
2697
2140
  }
2698
2141
  const exception = new models_0_1.ResourceNotFoundException({
@@ -2702,21 +2145,21 @@ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedO
2702
2145
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2703
2146
  };
2704
2147
  const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
2705
- const contents = {};
2148
+ const contents = map({});
2706
2149
  const data = parsedOutput.body;
2707
- if (data.Message !== undefined && data.Message !== null) {
2150
+ if (data.Message != null) {
2708
2151
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2709
2152
  }
2710
- if (data.QuotaCode !== undefined && data.QuotaCode !== null) {
2153
+ if (data.QuotaCode != null) {
2711
2154
  contents.QuotaCode = (0, smithy_client_1.expectString)(data.QuotaCode);
2712
2155
  }
2713
- if (data.ResourceId !== undefined && data.ResourceId !== null) {
2156
+ if (data.ResourceId != null) {
2714
2157
  contents.ResourceId = (0, smithy_client_1.expectString)(data.ResourceId);
2715
2158
  }
2716
- if (data.ResourceType !== undefined && data.ResourceType !== null) {
2159
+ if (data.ResourceType != null) {
2717
2160
  contents.ResourceType = (0, smithy_client_1.expectString)(data.ResourceType);
2718
2161
  }
2719
- if (data.ServiceCode !== undefined && data.ServiceCode !== null) {
2162
+ if (data.ServiceCode != null) {
2720
2163
  contents.ServiceCode = (0, smithy_client_1.expectString)(data.ServiceCode);
2721
2164
  }
2722
2165
  const exception = new models_0_1.ServiceQuotaExceededException({
@@ -2726,18 +2169,20 @@ const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (par
2726
2169
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2727
2170
  };
2728
2171
  const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
2729
- const contents = {};
2730
- if (parsedOutput.headers["retry-after"] !== undefined) {
2731
- contents.RetryAfterSeconds = (0, smithy_client_1.strictParseInt32)(parsedOutput.headers["retry-after"]);
2732
- }
2172
+ const contents = map({
2173
+ RetryAfterSeconds: [
2174
+ () => void 0 !== parsedOutput.headers["retry-after"],
2175
+ () => (0, smithy_client_1.strictParseInt32)(parsedOutput.headers["retry-after"]),
2176
+ ],
2177
+ });
2733
2178
  const data = parsedOutput.body;
2734
- if (data.Message !== undefined && data.Message !== null) {
2179
+ if (data.Message != null) {
2735
2180
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2736
2181
  }
2737
- if (data.QuotaCode !== undefined && data.QuotaCode !== null) {
2182
+ if (data.QuotaCode != null) {
2738
2183
  contents.QuotaCode = (0, smithy_client_1.expectString)(data.QuotaCode);
2739
2184
  }
2740
- if (data.ServiceCode !== undefined && data.ServiceCode !== null) {
2185
+ if (data.ServiceCode != null) {
2741
2186
  contents.ServiceCode = (0, smithy_client_1.expectString)(data.ServiceCode);
2742
2187
  }
2743
2188
  const exception = new models_0_1.ThrottlingException({
@@ -2747,9 +2192,9 @@ const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput,
2747
2192
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2748
2193
  };
2749
2194
  const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
2750
- const contents = {};
2195
+ const contents = map({});
2751
2196
  const data = parsedOutput.body;
2752
- if (data.Message !== undefined && data.Message !== null) {
2197
+ if (data.Message != null) {
2753
2198
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2754
2199
  }
2755
2200
  const exception = new models_0_1.ValidationException({
@@ -2773,9 +2218,6 @@ const serializeAws_restJson1HttpMethods = (input, context) => {
2773
2218
  return input
2774
2219
  .filter((e) => e != null)
2775
2220
  .map((entry) => {
2776
- if (entry === null) {
2777
- return null;
2778
- }
2779
2221
  return entry;
2780
2222
  });
2781
2223
  };