@aws-sdk/client-efs 3.141.0 → 3.150.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.
@@ -100,16 +100,7 @@ const serializeAws_restJson1CreateReplicationConfigurationCommand = async (input
100
100
  };
101
101
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
102
102
  "/2015-02-01/file-systems/{SourceFileSystemId}/replication-configuration";
103
- if (input.SourceFileSystemId !== undefined) {
104
- const labelValue = input.SourceFileSystemId;
105
- if (labelValue.length <= 0) {
106
- throw new Error("Empty value provided for input HTTP label: SourceFileSystemId.");
107
- }
108
- resolvedPath = resolvedPath.replace("{SourceFileSystemId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
109
- }
110
- else {
111
- throw new Error("No value provided for input HTTP label: SourceFileSystemId.");
112
- }
103
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "SourceFileSystemId", () => input.SourceFileSystemId, "{SourceFileSystemId}", false);
113
104
  let body;
114
105
  body = JSON.stringify({
115
106
  ...(input.Destinations != null && {
@@ -133,16 +124,7 @@ const serializeAws_restJson1CreateTagsCommand = async (input, context) => {
133
124
  "content-type": "application/json",
134
125
  };
135
126
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/2015-02-01/create-tags/{FileSystemId}";
136
- if (input.FileSystemId !== undefined) {
137
- const labelValue = input.FileSystemId;
138
- if (labelValue.length <= 0) {
139
- throw new Error("Empty value provided for input HTTP label: FileSystemId.");
140
- }
141
- resolvedPath = resolvedPath.replace("{FileSystemId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
142
- }
143
- else {
144
- throw new Error("No value provided for input HTTP label: FileSystemId.");
145
- }
127
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "FileSystemId", () => input.FileSystemId, "{FileSystemId}", false);
146
128
  let body;
147
129
  body = JSON.stringify({
148
130
  ...(input.Tags != null && { Tags: serializeAws_restJson1Tags(input.Tags, context) }),
@@ -162,16 +144,7 @@ const serializeAws_restJson1DeleteAccessPointCommand = async (input, context) =>
162
144
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
163
145
  const headers = {};
164
146
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/2015-02-01/access-points/{AccessPointId}";
165
- if (input.AccessPointId !== undefined) {
166
- const labelValue = input.AccessPointId;
167
- if (labelValue.length <= 0) {
168
- throw new Error("Empty value provided for input HTTP label: AccessPointId.");
169
- }
170
- resolvedPath = resolvedPath.replace("{AccessPointId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
171
- }
172
- else {
173
- throw new Error("No value provided for input HTTP label: AccessPointId.");
174
- }
147
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "AccessPointId", () => input.AccessPointId, "{AccessPointId}", false);
175
148
  let body;
176
149
  return new protocol_http_1.HttpRequest({
177
150
  protocol,
@@ -188,16 +161,7 @@ const serializeAws_restJson1DeleteFileSystemCommand = async (input, context) =>
188
161
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
189
162
  const headers = {};
190
163
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/2015-02-01/file-systems/{FileSystemId}";
191
- if (input.FileSystemId !== undefined) {
192
- const labelValue = input.FileSystemId;
193
- if (labelValue.length <= 0) {
194
- throw new Error("Empty value provided for input HTTP label: FileSystemId.");
195
- }
196
- resolvedPath = resolvedPath.replace("{FileSystemId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
197
- }
198
- else {
199
- throw new Error("No value provided for input HTTP label: FileSystemId.");
200
- }
164
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "FileSystemId", () => input.FileSystemId, "{FileSystemId}", false);
201
165
  let body;
202
166
  return new protocol_http_1.HttpRequest({
203
167
  protocol,
@@ -215,16 +179,7 @@ const serializeAws_restJson1DeleteFileSystemPolicyCommand = async (input, contex
215
179
  const headers = {};
216
180
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
217
181
  "/2015-02-01/file-systems/{FileSystemId}/policy";
218
- if (input.FileSystemId !== undefined) {
219
- const labelValue = input.FileSystemId;
220
- if (labelValue.length <= 0) {
221
- throw new Error("Empty value provided for input HTTP label: FileSystemId.");
222
- }
223
- resolvedPath = resolvedPath.replace("{FileSystemId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
224
- }
225
- else {
226
- throw new Error("No value provided for input HTTP label: FileSystemId.");
227
- }
182
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "FileSystemId", () => input.FileSystemId, "{FileSystemId}", false);
228
183
  let body;
229
184
  return new protocol_http_1.HttpRequest({
230
185
  protocol,
@@ -241,16 +196,7 @@ const serializeAws_restJson1DeleteMountTargetCommand = async (input, context) =>
241
196
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
242
197
  const headers = {};
243
198
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/2015-02-01/mount-targets/{MountTargetId}";
244
- if (input.MountTargetId !== undefined) {
245
- const labelValue = input.MountTargetId;
246
- if (labelValue.length <= 0) {
247
- throw new Error("Empty value provided for input HTTP label: MountTargetId.");
248
- }
249
- resolvedPath = resolvedPath.replace("{MountTargetId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
250
- }
251
- else {
252
- throw new Error("No value provided for input HTTP label: MountTargetId.");
253
- }
199
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "MountTargetId", () => input.MountTargetId, "{MountTargetId}", false);
254
200
  let body;
255
201
  return new protocol_http_1.HttpRequest({
256
202
  protocol,
@@ -268,16 +214,7 @@ const serializeAws_restJson1DeleteReplicationConfigurationCommand = async (input
268
214
  const headers = {};
269
215
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
270
216
  "/2015-02-01/file-systems/{SourceFileSystemId}/replication-configuration";
271
- if (input.SourceFileSystemId !== undefined) {
272
- const labelValue = input.SourceFileSystemId;
273
- if (labelValue.length <= 0) {
274
- throw new Error("Empty value provided for input HTTP label: SourceFileSystemId.");
275
- }
276
- resolvedPath = resolvedPath.replace("{SourceFileSystemId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
277
- }
278
- else {
279
- throw new Error("No value provided for input HTTP label: SourceFileSystemId.");
280
- }
217
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "SourceFileSystemId", () => input.SourceFileSystemId, "{SourceFileSystemId}", false);
281
218
  let body;
282
219
  return new protocol_http_1.HttpRequest({
283
220
  protocol,
@@ -296,16 +233,7 @@ const serializeAws_restJson1DeleteTagsCommand = async (input, context) => {
296
233
  "content-type": "application/json",
297
234
  };
298
235
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/2015-02-01/delete-tags/{FileSystemId}";
299
- if (input.FileSystemId !== undefined) {
300
- const labelValue = input.FileSystemId;
301
- if (labelValue.length <= 0) {
302
- throw new Error("Empty value provided for input HTTP label: FileSystemId.");
303
- }
304
- resolvedPath = resolvedPath.replace("{FileSystemId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
305
- }
306
- else {
307
- throw new Error("No value provided for input HTTP label: FileSystemId.");
308
- }
236
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "FileSystemId", () => input.FileSystemId, "{FileSystemId}", false);
309
237
  let body;
310
238
  body = JSON.stringify({
311
239
  ...(input.TagKeys != null && { TagKeys: serializeAws_restJson1TagKeys(input.TagKeys, context) }),
@@ -325,12 +253,12 @@ const serializeAws_restJson1DescribeAccessPointsCommand = async (input, context)
325
253
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
326
254
  const headers = {};
327
255
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/2015-02-01/access-points";
328
- const query = {
329
- ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults.toString() }),
330
- ...(input.NextToken !== undefined && { NextToken: input.NextToken }),
331
- ...(input.AccessPointId !== undefined && { AccessPointId: input.AccessPointId }),
332
- ...(input.FileSystemId !== undefined && { FileSystemId: input.FileSystemId }),
333
- };
256
+ const query = map({
257
+ MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
258
+ NextToken: [, input.NextToken],
259
+ AccessPointId: [, input.AccessPointId],
260
+ FileSystemId: [, input.FileSystemId],
261
+ });
334
262
  let body;
335
263
  return new protocol_http_1.HttpRequest({
336
264
  protocol,
@@ -371,16 +299,7 @@ const serializeAws_restJson1DescribeBackupPolicyCommand = async (input, context)
371
299
  const headers = {};
372
300
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
373
301
  "/2015-02-01/file-systems/{FileSystemId}/backup-policy";
374
- if (input.FileSystemId !== undefined) {
375
- const labelValue = input.FileSystemId;
376
- if (labelValue.length <= 0) {
377
- throw new Error("Empty value provided for input HTTP label: FileSystemId.");
378
- }
379
- resolvedPath = resolvedPath.replace("{FileSystemId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
380
- }
381
- else {
382
- throw new Error("No value provided for input HTTP label: FileSystemId.");
383
- }
302
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "FileSystemId", () => input.FileSystemId, "{FileSystemId}", false);
384
303
  let body;
385
304
  return new protocol_http_1.HttpRequest({
386
305
  protocol,
@@ -398,16 +317,7 @@ const serializeAws_restJson1DescribeFileSystemPolicyCommand = async (input, cont
398
317
  const headers = {};
399
318
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
400
319
  "/2015-02-01/file-systems/{FileSystemId}/policy";
401
- if (input.FileSystemId !== undefined) {
402
- const labelValue = input.FileSystemId;
403
- if (labelValue.length <= 0) {
404
- throw new Error("Empty value provided for input HTTP label: FileSystemId.");
405
- }
406
- resolvedPath = resolvedPath.replace("{FileSystemId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
407
- }
408
- else {
409
- throw new Error("No value provided for input HTTP label: FileSystemId.");
410
- }
320
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "FileSystemId", () => input.FileSystemId, "{FileSystemId}", false);
411
321
  let body;
412
322
  return new protocol_http_1.HttpRequest({
413
323
  protocol,
@@ -424,12 +334,12 @@ const serializeAws_restJson1DescribeFileSystemsCommand = async (input, context)
424
334
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
425
335
  const headers = {};
426
336
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/2015-02-01/file-systems";
427
- const query = {
428
- ...(input.MaxItems !== undefined && { MaxItems: input.MaxItems.toString() }),
429
- ...(input.Marker !== undefined && { Marker: input.Marker }),
430
- ...(input.CreationToken !== undefined && { CreationToken: input.CreationToken }),
431
- ...(input.FileSystemId !== undefined && { FileSystemId: input.FileSystemId }),
432
- };
337
+ const query = map({
338
+ MaxItems: [() => input.MaxItems !== void 0, () => input.MaxItems.toString()],
339
+ Marker: [, input.Marker],
340
+ CreationToken: [, input.CreationToken],
341
+ FileSystemId: [, input.FileSystemId],
342
+ });
433
343
  let body;
434
344
  return new protocol_http_1.HttpRequest({
435
345
  protocol,
@@ -448,16 +358,7 @@ const serializeAws_restJson1DescribeLifecycleConfigurationCommand = async (input
448
358
  const headers = {};
449
359
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
450
360
  "/2015-02-01/file-systems/{FileSystemId}/lifecycle-configuration";
451
- if (input.FileSystemId !== undefined) {
452
- const labelValue = input.FileSystemId;
453
- if (labelValue.length <= 0) {
454
- throw new Error("Empty value provided for input HTTP label: FileSystemId.");
455
- }
456
- resolvedPath = resolvedPath.replace("{FileSystemId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
457
- }
458
- else {
459
- throw new Error("No value provided for input HTTP label: FileSystemId.");
460
- }
361
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "FileSystemId", () => input.FileSystemId, "{FileSystemId}", false);
461
362
  let body;
462
363
  return new protocol_http_1.HttpRequest({
463
364
  protocol,
@@ -474,13 +375,13 @@ const serializeAws_restJson1DescribeMountTargetsCommand = async (input, context)
474
375
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
475
376
  const headers = {};
476
377
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/2015-02-01/mount-targets";
477
- const query = {
478
- ...(input.MaxItems !== undefined && { MaxItems: input.MaxItems.toString() }),
479
- ...(input.Marker !== undefined && { Marker: input.Marker }),
480
- ...(input.FileSystemId !== undefined && { FileSystemId: input.FileSystemId }),
481
- ...(input.MountTargetId !== undefined && { MountTargetId: input.MountTargetId }),
482
- ...(input.AccessPointId !== undefined && { AccessPointId: input.AccessPointId }),
483
- };
378
+ const query = map({
379
+ MaxItems: [() => input.MaxItems !== void 0, () => input.MaxItems.toString()],
380
+ Marker: [, input.Marker],
381
+ FileSystemId: [, input.FileSystemId],
382
+ MountTargetId: [, input.MountTargetId],
383
+ AccessPointId: [, input.AccessPointId],
384
+ });
484
385
  let body;
485
386
  return new protocol_http_1.HttpRequest({
486
387
  protocol,
@@ -499,16 +400,7 @@ const serializeAws_restJson1DescribeMountTargetSecurityGroupsCommand = async (in
499
400
  const headers = {};
500
401
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
501
402
  "/2015-02-01/mount-targets/{MountTargetId}/security-groups";
502
- if (input.MountTargetId !== undefined) {
503
- const labelValue = input.MountTargetId;
504
- if (labelValue.length <= 0) {
505
- throw new Error("Empty value provided for input HTTP label: MountTargetId.");
506
- }
507
- resolvedPath = resolvedPath.replace("{MountTargetId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
508
- }
509
- else {
510
- throw new Error("No value provided for input HTTP label: MountTargetId.");
511
- }
403
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "MountTargetId", () => input.MountTargetId, "{MountTargetId}", false);
512
404
  let body;
513
405
  return new protocol_http_1.HttpRequest({
514
406
  protocol,
@@ -526,11 +418,11 @@ const serializeAws_restJson1DescribeReplicationConfigurationsCommand = async (in
526
418
  const headers = {};
527
419
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
528
420
  "/2015-02-01/file-systems/replication-configurations";
529
- const query = {
530
- ...(input.FileSystemId !== undefined && { FileSystemId: input.FileSystemId }),
531
- ...(input.NextToken !== undefined && { NextToken: input.NextToken }),
532
- ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults.toString() }),
533
- };
421
+ const query = map({
422
+ FileSystemId: [, input.FileSystemId],
423
+ NextToken: [, input.NextToken],
424
+ MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
425
+ });
534
426
  let body;
535
427
  return new protocol_http_1.HttpRequest({
536
428
  protocol,
@@ -548,20 +440,11 @@ const serializeAws_restJson1DescribeTagsCommand = async (input, context) => {
548
440
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
549
441
  const headers = {};
550
442
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/2015-02-01/tags/{FileSystemId}";
551
- if (input.FileSystemId !== undefined) {
552
- const labelValue = input.FileSystemId;
553
- if (labelValue.length <= 0) {
554
- throw new Error("Empty value provided for input HTTP label: FileSystemId.");
555
- }
556
- resolvedPath = resolvedPath.replace("{FileSystemId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
557
- }
558
- else {
559
- throw new Error("No value provided for input HTTP label: FileSystemId.");
560
- }
561
- const query = {
562
- ...(input.MaxItems !== undefined && { MaxItems: input.MaxItems.toString() }),
563
- ...(input.Marker !== undefined && { Marker: input.Marker }),
564
- };
443
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "FileSystemId", () => input.FileSystemId, "{FileSystemId}", false);
444
+ const query = map({
445
+ MaxItems: [() => input.MaxItems !== void 0, () => input.MaxItems.toString()],
446
+ Marker: [, input.Marker],
447
+ });
565
448
  let body;
566
449
  return new protocol_http_1.HttpRequest({
567
450
  protocol,
@@ -579,20 +462,11 @@ const serializeAws_restJson1ListTagsForResourceCommand = async (input, context)
579
462
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
580
463
  const headers = {};
581
464
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/2015-02-01/resource-tags/{ResourceId}";
582
- if (input.ResourceId !== undefined) {
583
- const labelValue = input.ResourceId;
584
- if (labelValue.length <= 0) {
585
- throw new Error("Empty value provided for input HTTP label: ResourceId.");
586
- }
587
- resolvedPath = resolvedPath.replace("{ResourceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
588
- }
589
- else {
590
- throw new Error("No value provided for input HTTP label: ResourceId.");
591
- }
592
- const query = {
593
- ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults.toString() }),
594
- ...(input.NextToken !== undefined && { NextToken: input.NextToken }),
595
- };
465
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ResourceId", () => input.ResourceId, "{ResourceId}", false);
466
+ const query = map({
467
+ MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
468
+ NextToken: [, input.NextToken],
469
+ });
596
470
  let body;
597
471
  return new protocol_http_1.HttpRequest({
598
472
  protocol,
@@ -613,16 +487,7 @@ const serializeAws_restJson1ModifyMountTargetSecurityGroupsCommand = async (inpu
613
487
  };
614
488
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
615
489
  "/2015-02-01/mount-targets/{MountTargetId}/security-groups";
616
- if (input.MountTargetId !== undefined) {
617
- const labelValue = input.MountTargetId;
618
- if (labelValue.length <= 0) {
619
- throw new Error("Empty value provided for input HTTP label: MountTargetId.");
620
- }
621
- resolvedPath = resolvedPath.replace("{MountTargetId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
622
- }
623
- else {
624
- throw new Error("No value provided for input HTTP label: MountTargetId.");
625
- }
490
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "MountTargetId", () => input.MountTargetId, "{MountTargetId}", false);
626
491
  let body;
627
492
  body = JSON.stringify({
628
493
  ...(input.SecurityGroups != null && {
@@ -668,16 +533,7 @@ const serializeAws_restJson1PutBackupPolicyCommand = async (input, context) => {
668
533
  };
669
534
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
670
535
  "/2015-02-01/file-systems/{FileSystemId}/backup-policy";
671
- if (input.FileSystemId !== undefined) {
672
- const labelValue = input.FileSystemId;
673
- if (labelValue.length <= 0) {
674
- throw new Error("Empty value provided for input HTTP label: FileSystemId.");
675
- }
676
- resolvedPath = resolvedPath.replace("{FileSystemId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
677
- }
678
- else {
679
- throw new Error("No value provided for input HTTP label: FileSystemId.");
680
- }
536
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "FileSystemId", () => input.FileSystemId, "{FileSystemId}", false);
681
537
  let body;
682
538
  body = JSON.stringify({
683
539
  ...(input.BackupPolicy != null && {
@@ -702,16 +558,7 @@ const serializeAws_restJson1PutFileSystemPolicyCommand = async (input, context)
702
558
  };
703
559
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
704
560
  "/2015-02-01/file-systems/{FileSystemId}/policy";
705
- if (input.FileSystemId !== undefined) {
706
- const labelValue = input.FileSystemId;
707
- if (labelValue.length <= 0) {
708
- throw new Error("Empty value provided for input HTTP label: FileSystemId.");
709
- }
710
- resolvedPath = resolvedPath.replace("{FileSystemId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
711
- }
712
- else {
713
- throw new Error("No value provided for input HTTP label: FileSystemId.");
714
- }
561
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "FileSystemId", () => input.FileSystemId, "{FileSystemId}", false);
715
562
  let body;
716
563
  body = JSON.stringify({
717
564
  ...(input.BypassPolicyLockoutSafetyCheck != null && {
@@ -737,16 +584,7 @@ const serializeAws_restJson1PutLifecycleConfigurationCommand = async (input, con
737
584
  };
738
585
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
739
586
  "/2015-02-01/file-systems/{FileSystemId}/lifecycle-configuration";
740
- if (input.FileSystemId !== undefined) {
741
- const labelValue = input.FileSystemId;
742
- if (labelValue.length <= 0) {
743
- throw new Error("Empty value provided for input HTTP label: FileSystemId.");
744
- }
745
- resolvedPath = resolvedPath.replace("{FileSystemId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
746
- }
747
- else {
748
- throw new Error("No value provided for input HTTP label: FileSystemId.");
749
- }
587
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "FileSystemId", () => input.FileSystemId, "{FileSystemId}", false);
750
588
  let body;
751
589
  body = JSON.stringify({
752
590
  ...(input.LifecyclePolicies != null && {
@@ -770,16 +608,7 @@ const serializeAws_restJson1TagResourceCommand = async (input, context) => {
770
608
  "content-type": "application/json",
771
609
  };
772
610
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/2015-02-01/resource-tags/{ResourceId}";
773
- if (input.ResourceId !== undefined) {
774
- const labelValue = input.ResourceId;
775
- if (labelValue.length <= 0) {
776
- throw new Error("Empty value provided for input HTTP label: ResourceId.");
777
- }
778
- resolvedPath = resolvedPath.replace("{ResourceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
779
- }
780
- else {
781
- throw new Error("No value provided for input HTTP label: ResourceId.");
782
- }
611
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ResourceId", () => input.ResourceId, "{ResourceId}", false);
783
612
  let body;
784
613
  body = JSON.stringify({
785
614
  ...(input.Tags != null && { Tags: serializeAws_restJson1Tags(input.Tags, context) }),
@@ -799,19 +628,10 @@ const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
799
628
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
800
629
  const headers = {};
801
630
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/2015-02-01/resource-tags/{ResourceId}";
802
- if (input.ResourceId !== undefined) {
803
- const labelValue = input.ResourceId;
804
- if (labelValue.length <= 0) {
805
- throw new Error("Empty value provided for input HTTP label: ResourceId.");
806
- }
807
- resolvedPath = resolvedPath.replace("{ResourceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
808
- }
809
- else {
810
- throw new Error("No value provided for input HTTP label: ResourceId.");
811
- }
812
- const query = {
813
- ...(input.TagKeys !== undefined && { tagKeys: (input.TagKeys || []).map((_entry) => _entry) }),
814
- };
631
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ResourceId", () => input.ResourceId, "{ResourceId}", false);
632
+ const query = map({
633
+ tagKeys: [() => input.TagKeys !== void 0, () => (input.TagKeys || []).map((_entry) => _entry)],
634
+ });
815
635
  let body;
816
636
  return new protocol_http_1.HttpRequest({
817
637
  protocol,
@@ -831,16 +651,7 @@ const serializeAws_restJson1UpdateFileSystemCommand = async (input, context) =>
831
651
  "content-type": "application/json",
832
652
  };
833
653
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/2015-02-01/file-systems/{FileSystemId}";
834
- if (input.FileSystemId !== undefined) {
835
- const labelValue = input.FileSystemId;
836
- if (labelValue.length <= 0) {
837
- throw new Error("Empty value provided for input HTTP label: FileSystemId.");
838
- }
839
- resolvedPath = resolvedPath.replace("{FileSystemId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
840
- }
841
- else {
842
- throw new Error("No value provided for input HTTP label: FileSystemId.");
843
- }
654
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "FileSystemId", () => input.FileSystemId, "{FileSystemId}", false);
844
655
  let body;
845
656
  body = JSON.stringify({
846
657
  ...(input.ProvisionedThroughputInMibps != null && {
@@ -863,51 +674,41 @@ const deserializeAws_restJson1CreateAccessPointCommand = async (output, context)
863
674
  if (output.statusCode !== 200 && output.statusCode >= 300) {
864
675
  return deserializeAws_restJson1CreateAccessPointCommandError(output, context);
865
676
  }
866
- const contents = {
677
+ const contents = map({
867
678
  $metadata: deserializeMetadata(output),
868
- AccessPointArn: undefined,
869
- AccessPointId: undefined,
870
- ClientToken: undefined,
871
- FileSystemId: undefined,
872
- LifeCycleState: undefined,
873
- Name: undefined,
874
- OwnerId: undefined,
875
- PosixUser: undefined,
876
- RootDirectory: undefined,
877
- Tags: undefined,
878
- };
679
+ });
879
680
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
880
- if (data.AccessPointArn !== undefined && data.AccessPointArn !== null) {
681
+ if (data.AccessPointArn != null) {
881
682
  contents.AccessPointArn = (0, smithy_client_1.expectString)(data.AccessPointArn);
882
683
  }
883
- if (data.AccessPointId !== undefined && data.AccessPointId !== null) {
684
+ if (data.AccessPointId != null) {
884
685
  contents.AccessPointId = (0, smithy_client_1.expectString)(data.AccessPointId);
885
686
  }
886
- if (data.ClientToken !== undefined && data.ClientToken !== null) {
687
+ if (data.ClientToken != null) {
887
688
  contents.ClientToken = (0, smithy_client_1.expectString)(data.ClientToken);
888
689
  }
889
- if (data.FileSystemId !== undefined && data.FileSystemId !== null) {
690
+ if (data.FileSystemId != null) {
890
691
  contents.FileSystemId = (0, smithy_client_1.expectString)(data.FileSystemId);
891
692
  }
892
- if (data.LifeCycleState !== undefined && data.LifeCycleState !== null) {
693
+ if (data.LifeCycleState != null) {
893
694
  contents.LifeCycleState = (0, smithy_client_1.expectString)(data.LifeCycleState);
894
695
  }
895
- if (data.Name !== undefined && data.Name !== null) {
696
+ if (data.Name != null) {
896
697
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
897
698
  }
898
- if (data.OwnerId !== undefined && data.OwnerId !== null) {
699
+ if (data.OwnerId != null) {
899
700
  contents.OwnerId = (0, smithy_client_1.expectString)(data.OwnerId);
900
701
  }
901
- if (data.PosixUser !== undefined && data.PosixUser !== null) {
702
+ if (data.PosixUser != null) {
902
703
  contents.PosixUser = deserializeAws_restJson1PosixUser(data.PosixUser, context);
903
704
  }
904
- if (data.RootDirectory !== undefined && data.RootDirectory !== null) {
705
+ if (data.RootDirectory != null) {
905
706
  contents.RootDirectory = deserializeAws_restJson1RootDirectory(data.RootDirectory, context);
906
707
  }
907
- if (data.Tags !== undefined && data.Tags !== null) {
708
+ if (data.Tags != null) {
908
709
  contents.Tags = deserializeAws_restJson1Tags(data.Tags, context);
909
710
  }
910
- return Promise.resolve(contents);
711
+ return contents;
911
712
  };
912
713
  exports.deserializeAws_restJson1CreateAccessPointCommand = deserializeAws_restJson1CreateAccessPointCommand;
913
714
  const deserializeAws_restJson1CreateAccessPointCommandError = async (output, context) => {
@@ -915,7 +716,6 @@ const deserializeAws_restJson1CreateAccessPointCommandError = async (output, con
915
716
  ...output,
916
717
  body: await parseBody(output.body, context),
917
718
  };
918
- let response;
919
719
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
920
720
  switch (errorCode) {
921
721
  case "AccessPointAlreadyExists":
@@ -941,93 +741,74 @@ const deserializeAws_restJson1CreateAccessPointCommandError = async (output, con
941
741
  throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
942
742
  default:
943
743
  const parsedBody = parsedOutput.body;
944
- const $metadata = deserializeMetadata(output);
945
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
946
- response = new EFSServiceException_1.EFSServiceException({
947
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
948
- $fault: "client",
949
- $metadata,
744
+ (0, smithy_client_1.throwDefaultError)({
745
+ output,
746
+ parsedBody,
747
+ exceptionCtor: EFSServiceException_1.EFSServiceException,
748
+ errorCode,
950
749
  });
951
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
952
750
  }
953
751
  };
954
752
  const deserializeAws_restJson1CreateFileSystemCommand = async (output, context) => {
955
753
  if (output.statusCode !== 201 && output.statusCode >= 300) {
956
754
  return deserializeAws_restJson1CreateFileSystemCommandError(output, context);
957
755
  }
958
- const contents = {
756
+ const contents = map({
959
757
  $metadata: deserializeMetadata(output),
960
- AvailabilityZoneId: undefined,
961
- AvailabilityZoneName: undefined,
962
- CreationTime: undefined,
963
- CreationToken: undefined,
964
- Encrypted: undefined,
965
- FileSystemArn: undefined,
966
- FileSystemId: undefined,
967
- KmsKeyId: undefined,
968
- LifeCycleState: undefined,
969
- Name: undefined,
970
- NumberOfMountTargets: undefined,
971
- OwnerId: undefined,
972
- PerformanceMode: undefined,
973
- ProvisionedThroughputInMibps: undefined,
974
- SizeInBytes: undefined,
975
- Tags: undefined,
976
- ThroughputMode: undefined,
977
- };
758
+ });
978
759
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
979
- if (data.AvailabilityZoneId !== undefined && data.AvailabilityZoneId !== null) {
760
+ if (data.AvailabilityZoneId != null) {
980
761
  contents.AvailabilityZoneId = (0, smithy_client_1.expectString)(data.AvailabilityZoneId);
981
762
  }
982
- if (data.AvailabilityZoneName !== undefined && data.AvailabilityZoneName !== null) {
763
+ if (data.AvailabilityZoneName != null) {
983
764
  contents.AvailabilityZoneName = (0, smithy_client_1.expectString)(data.AvailabilityZoneName);
984
765
  }
985
- if (data.CreationTime !== undefined && data.CreationTime !== null) {
766
+ if (data.CreationTime != null) {
986
767
  contents.CreationTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.CreationTime)));
987
768
  }
988
- if (data.CreationToken !== undefined && data.CreationToken !== null) {
769
+ if (data.CreationToken != null) {
989
770
  contents.CreationToken = (0, smithy_client_1.expectString)(data.CreationToken);
990
771
  }
991
- if (data.Encrypted !== undefined && data.Encrypted !== null) {
772
+ if (data.Encrypted != null) {
992
773
  contents.Encrypted = (0, smithy_client_1.expectBoolean)(data.Encrypted);
993
774
  }
994
- if (data.FileSystemArn !== undefined && data.FileSystemArn !== null) {
775
+ if (data.FileSystemArn != null) {
995
776
  contents.FileSystemArn = (0, smithy_client_1.expectString)(data.FileSystemArn);
996
777
  }
997
- if (data.FileSystemId !== undefined && data.FileSystemId !== null) {
778
+ if (data.FileSystemId != null) {
998
779
  contents.FileSystemId = (0, smithy_client_1.expectString)(data.FileSystemId);
999
780
  }
1000
- if (data.KmsKeyId !== undefined && data.KmsKeyId !== null) {
781
+ if (data.KmsKeyId != null) {
1001
782
  contents.KmsKeyId = (0, smithy_client_1.expectString)(data.KmsKeyId);
1002
783
  }
1003
- if (data.LifeCycleState !== undefined && data.LifeCycleState !== null) {
784
+ if (data.LifeCycleState != null) {
1004
785
  contents.LifeCycleState = (0, smithy_client_1.expectString)(data.LifeCycleState);
1005
786
  }
1006
- if (data.Name !== undefined && data.Name !== null) {
787
+ if (data.Name != null) {
1007
788
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
1008
789
  }
1009
- if (data.NumberOfMountTargets !== undefined && data.NumberOfMountTargets !== null) {
790
+ if (data.NumberOfMountTargets != null) {
1010
791
  contents.NumberOfMountTargets = (0, smithy_client_1.expectInt32)(data.NumberOfMountTargets);
1011
792
  }
1012
- if (data.OwnerId !== undefined && data.OwnerId !== null) {
793
+ if (data.OwnerId != null) {
1013
794
  contents.OwnerId = (0, smithy_client_1.expectString)(data.OwnerId);
1014
795
  }
1015
- if (data.PerformanceMode !== undefined && data.PerformanceMode !== null) {
796
+ if (data.PerformanceMode != null) {
1016
797
  contents.PerformanceMode = (0, smithy_client_1.expectString)(data.PerformanceMode);
1017
798
  }
1018
- if (data.ProvisionedThroughputInMibps !== undefined && data.ProvisionedThroughputInMibps !== null) {
799
+ if (data.ProvisionedThroughputInMibps != null) {
1019
800
  contents.ProvisionedThroughputInMibps = (0, smithy_client_1.limitedParseDouble)(data.ProvisionedThroughputInMibps);
1020
801
  }
1021
- if (data.SizeInBytes !== undefined && data.SizeInBytes !== null) {
802
+ if (data.SizeInBytes != null) {
1022
803
  contents.SizeInBytes = deserializeAws_restJson1FileSystemSize(data.SizeInBytes, context);
1023
804
  }
1024
- if (data.Tags !== undefined && data.Tags !== null) {
805
+ if (data.Tags != null) {
1025
806
  contents.Tags = deserializeAws_restJson1Tags(data.Tags, context);
1026
807
  }
1027
- if (data.ThroughputMode !== undefined && data.ThroughputMode !== null) {
808
+ if (data.ThroughputMode != null) {
1028
809
  contents.ThroughputMode = (0, smithy_client_1.expectString)(data.ThroughputMode);
1029
810
  }
1030
- return Promise.resolve(contents);
811
+ return contents;
1031
812
  };
1032
813
  exports.deserializeAws_restJson1CreateFileSystemCommand = deserializeAws_restJson1CreateFileSystemCommand;
1033
814
  const deserializeAws_restJson1CreateFileSystemCommandError = async (output, context) => {
@@ -1035,7 +816,6 @@ const deserializeAws_restJson1CreateFileSystemCommandError = async (output, cont
1035
816
  ...output,
1036
817
  body: await parseBody(output.body, context),
1037
818
  };
1038
- let response;
1039
819
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1040
820
  switch (errorCode) {
1041
821
  case "BadRequest":
@@ -1061,65 +841,53 @@ const deserializeAws_restJson1CreateFileSystemCommandError = async (output, cont
1061
841
  throw await deserializeAws_restJson1UnsupportedAvailabilityZoneResponse(parsedOutput, context);
1062
842
  default:
1063
843
  const parsedBody = parsedOutput.body;
1064
- const $metadata = deserializeMetadata(output);
1065
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1066
- response = new EFSServiceException_1.EFSServiceException({
1067
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1068
- $fault: "client",
1069
- $metadata,
844
+ (0, smithy_client_1.throwDefaultError)({
845
+ output,
846
+ parsedBody,
847
+ exceptionCtor: EFSServiceException_1.EFSServiceException,
848
+ errorCode,
1070
849
  });
1071
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1072
850
  }
1073
851
  };
1074
852
  const deserializeAws_restJson1CreateMountTargetCommand = async (output, context) => {
1075
853
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1076
854
  return deserializeAws_restJson1CreateMountTargetCommandError(output, context);
1077
855
  }
1078
- const contents = {
856
+ const contents = map({
1079
857
  $metadata: deserializeMetadata(output),
1080
- AvailabilityZoneId: undefined,
1081
- AvailabilityZoneName: undefined,
1082
- FileSystemId: undefined,
1083
- IpAddress: undefined,
1084
- LifeCycleState: undefined,
1085
- MountTargetId: undefined,
1086
- NetworkInterfaceId: undefined,
1087
- OwnerId: undefined,
1088
- SubnetId: undefined,
1089
- VpcId: undefined,
1090
- };
858
+ });
1091
859
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1092
- if (data.AvailabilityZoneId !== undefined && data.AvailabilityZoneId !== null) {
860
+ if (data.AvailabilityZoneId != null) {
1093
861
  contents.AvailabilityZoneId = (0, smithy_client_1.expectString)(data.AvailabilityZoneId);
1094
862
  }
1095
- if (data.AvailabilityZoneName !== undefined && data.AvailabilityZoneName !== null) {
863
+ if (data.AvailabilityZoneName != null) {
1096
864
  contents.AvailabilityZoneName = (0, smithy_client_1.expectString)(data.AvailabilityZoneName);
1097
865
  }
1098
- if (data.FileSystemId !== undefined && data.FileSystemId !== null) {
866
+ if (data.FileSystemId != null) {
1099
867
  contents.FileSystemId = (0, smithy_client_1.expectString)(data.FileSystemId);
1100
868
  }
1101
- if (data.IpAddress !== undefined && data.IpAddress !== null) {
869
+ if (data.IpAddress != null) {
1102
870
  contents.IpAddress = (0, smithy_client_1.expectString)(data.IpAddress);
1103
871
  }
1104
- if (data.LifeCycleState !== undefined && data.LifeCycleState !== null) {
872
+ if (data.LifeCycleState != null) {
1105
873
  contents.LifeCycleState = (0, smithy_client_1.expectString)(data.LifeCycleState);
1106
874
  }
1107
- if (data.MountTargetId !== undefined && data.MountTargetId !== null) {
875
+ if (data.MountTargetId != null) {
1108
876
  contents.MountTargetId = (0, smithy_client_1.expectString)(data.MountTargetId);
1109
877
  }
1110
- if (data.NetworkInterfaceId !== undefined && data.NetworkInterfaceId !== null) {
878
+ if (data.NetworkInterfaceId != null) {
1111
879
  contents.NetworkInterfaceId = (0, smithy_client_1.expectString)(data.NetworkInterfaceId);
1112
880
  }
1113
- if (data.OwnerId !== undefined && data.OwnerId !== null) {
881
+ if (data.OwnerId != null) {
1114
882
  contents.OwnerId = (0, smithy_client_1.expectString)(data.OwnerId);
1115
883
  }
1116
- if (data.SubnetId !== undefined && data.SubnetId !== null) {
884
+ if (data.SubnetId != null) {
1117
885
  contents.SubnetId = (0, smithy_client_1.expectString)(data.SubnetId);
1118
886
  }
1119
- if (data.VpcId !== undefined && data.VpcId !== null) {
887
+ if (data.VpcId != null) {
1120
888
  contents.VpcId = (0, smithy_client_1.expectString)(data.VpcId);
1121
889
  }
1122
- return Promise.resolve(contents);
890
+ return contents;
1123
891
  };
1124
892
  exports.deserializeAws_restJson1CreateMountTargetCommand = deserializeAws_restJson1CreateMountTargetCommand;
1125
893
  const deserializeAws_restJson1CreateMountTargetCommandError = async (output, context) => {
@@ -1127,7 +895,6 @@ const deserializeAws_restJson1CreateMountTargetCommandError = async (output, con
1127
895
  ...output,
1128
896
  body: await parseBody(output.body, context),
1129
897
  };
1130
- let response;
1131
898
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1132
899
  switch (errorCode) {
1133
900
  case "AvailabilityZonesMismatch":
@@ -1171,49 +938,41 @@ const deserializeAws_restJson1CreateMountTargetCommandError = async (output, con
1171
938
  throw await deserializeAws_restJson1UnsupportedAvailabilityZoneResponse(parsedOutput, context);
1172
939
  default:
1173
940
  const parsedBody = parsedOutput.body;
1174
- const $metadata = deserializeMetadata(output);
1175
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1176
- response = new EFSServiceException_1.EFSServiceException({
1177
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1178
- $fault: "client",
1179
- $metadata,
941
+ (0, smithy_client_1.throwDefaultError)({
942
+ output,
943
+ parsedBody,
944
+ exceptionCtor: EFSServiceException_1.EFSServiceException,
945
+ errorCode,
1180
946
  });
1181
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1182
947
  }
1183
948
  };
1184
949
  const deserializeAws_restJson1CreateReplicationConfigurationCommand = async (output, context) => {
1185
950
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1186
951
  return deserializeAws_restJson1CreateReplicationConfigurationCommandError(output, context);
1187
952
  }
1188
- const contents = {
953
+ const contents = map({
1189
954
  $metadata: deserializeMetadata(output),
1190
- CreationTime: undefined,
1191
- Destinations: undefined,
1192
- OriginalSourceFileSystemArn: undefined,
1193
- SourceFileSystemArn: undefined,
1194
- SourceFileSystemId: undefined,
1195
- SourceFileSystemRegion: undefined,
1196
- };
955
+ });
1197
956
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1198
- if (data.CreationTime !== undefined && data.CreationTime !== null) {
957
+ if (data.CreationTime != null) {
1199
958
  contents.CreationTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.CreationTime)));
1200
959
  }
1201
- if (data.Destinations !== undefined && data.Destinations !== null) {
960
+ if (data.Destinations != null) {
1202
961
  contents.Destinations = deserializeAws_restJson1Destinations(data.Destinations, context);
1203
962
  }
1204
- if (data.OriginalSourceFileSystemArn !== undefined && data.OriginalSourceFileSystemArn !== null) {
963
+ if (data.OriginalSourceFileSystemArn != null) {
1205
964
  contents.OriginalSourceFileSystemArn = (0, smithy_client_1.expectString)(data.OriginalSourceFileSystemArn);
1206
965
  }
1207
- if (data.SourceFileSystemArn !== undefined && data.SourceFileSystemArn !== null) {
966
+ if (data.SourceFileSystemArn != null) {
1208
967
  contents.SourceFileSystemArn = (0, smithy_client_1.expectString)(data.SourceFileSystemArn);
1209
968
  }
1210
- if (data.SourceFileSystemId !== undefined && data.SourceFileSystemId !== null) {
969
+ if (data.SourceFileSystemId != null) {
1211
970
  contents.SourceFileSystemId = (0, smithy_client_1.expectString)(data.SourceFileSystemId);
1212
971
  }
1213
- if (data.SourceFileSystemRegion !== undefined && data.SourceFileSystemRegion !== null) {
972
+ if (data.SourceFileSystemRegion != null) {
1214
973
  contents.SourceFileSystemRegion = (0, smithy_client_1.expectString)(data.SourceFileSystemRegion);
1215
974
  }
1216
- return Promise.resolve(contents);
975
+ return contents;
1217
976
  };
1218
977
  exports.deserializeAws_restJson1CreateReplicationConfigurationCommand = deserializeAws_restJson1CreateReplicationConfigurationCommand;
1219
978
  const deserializeAws_restJson1CreateReplicationConfigurationCommandError = async (output, context) => {
@@ -1221,7 +980,6 @@ const deserializeAws_restJson1CreateReplicationConfigurationCommandError = async
1221
980
  ...output,
1222
981
  body: await parseBody(output.body, context),
1223
982
  };
1224
- let response;
1225
983
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1226
984
  switch (errorCode) {
1227
985
  case "BadRequest":
@@ -1256,25 +1014,23 @@ const deserializeAws_restJson1CreateReplicationConfigurationCommandError = async
1256
1014
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1257
1015
  default:
1258
1016
  const parsedBody = parsedOutput.body;
1259
- const $metadata = deserializeMetadata(output);
1260
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1261
- response = new EFSServiceException_1.EFSServiceException({
1262
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1263
- $fault: "client",
1264
- $metadata,
1017
+ (0, smithy_client_1.throwDefaultError)({
1018
+ output,
1019
+ parsedBody,
1020
+ exceptionCtor: EFSServiceException_1.EFSServiceException,
1021
+ errorCode,
1265
1022
  });
1266
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1267
1023
  }
1268
1024
  };
1269
1025
  const deserializeAws_restJson1CreateTagsCommand = async (output, context) => {
1270
1026
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1271
1027
  return deserializeAws_restJson1CreateTagsCommandError(output, context);
1272
1028
  }
1273
- const contents = {
1029
+ const contents = map({
1274
1030
  $metadata: deserializeMetadata(output),
1275
- };
1031
+ });
1276
1032
  await collectBody(output.body, context);
1277
- return Promise.resolve(contents);
1033
+ return contents;
1278
1034
  };
1279
1035
  exports.deserializeAws_restJson1CreateTagsCommand = deserializeAws_restJson1CreateTagsCommand;
1280
1036
  const deserializeAws_restJson1CreateTagsCommandError = async (output, context) => {
@@ -1282,7 +1038,6 @@ const deserializeAws_restJson1CreateTagsCommandError = async (output, context) =
1282
1038
  ...output,
1283
1039
  body: await parseBody(output.body, context),
1284
1040
  };
1285
- let response;
1286
1041
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1287
1042
  switch (errorCode) {
1288
1043
  case "BadRequest":
@@ -1296,25 +1051,23 @@ const deserializeAws_restJson1CreateTagsCommandError = async (output, context) =
1296
1051
  throw await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context);
1297
1052
  default:
1298
1053
  const parsedBody = parsedOutput.body;
1299
- const $metadata = deserializeMetadata(output);
1300
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1301
- response = new EFSServiceException_1.EFSServiceException({
1302
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1303
- $fault: "client",
1304
- $metadata,
1054
+ (0, smithy_client_1.throwDefaultError)({
1055
+ output,
1056
+ parsedBody,
1057
+ exceptionCtor: EFSServiceException_1.EFSServiceException,
1058
+ errorCode,
1305
1059
  });
1306
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1307
1060
  }
1308
1061
  };
1309
1062
  const deserializeAws_restJson1DeleteAccessPointCommand = async (output, context) => {
1310
1063
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1311
1064
  return deserializeAws_restJson1DeleteAccessPointCommandError(output, context);
1312
1065
  }
1313
- const contents = {
1066
+ const contents = map({
1314
1067
  $metadata: deserializeMetadata(output),
1315
- };
1068
+ });
1316
1069
  await collectBody(output.body, context);
1317
- return Promise.resolve(contents);
1070
+ return contents;
1318
1071
  };
1319
1072
  exports.deserializeAws_restJson1DeleteAccessPointCommand = deserializeAws_restJson1DeleteAccessPointCommand;
1320
1073
  const deserializeAws_restJson1DeleteAccessPointCommandError = async (output, context) => {
@@ -1322,7 +1075,6 @@ const deserializeAws_restJson1DeleteAccessPointCommandError = async (output, con
1322
1075
  ...output,
1323
1076
  body: await parseBody(output.body, context),
1324
1077
  };
1325
- let response;
1326
1078
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1327
1079
  switch (errorCode) {
1328
1080
  case "AccessPointNotFound":
@@ -1336,25 +1088,23 @@ const deserializeAws_restJson1DeleteAccessPointCommandError = async (output, con
1336
1088
  throw await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context);
1337
1089
  default:
1338
1090
  const parsedBody = parsedOutput.body;
1339
- const $metadata = deserializeMetadata(output);
1340
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1341
- response = new EFSServiceException_1.EFSServiceException({
1342
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1343
- $fault: "client",
1344
- $metadata,
1091
+ (0, smithy_client_1.throwDefaultError)({
1092
+ output,
1093
+ parsedBody,
1094
+ exceptionCtor: EFSServiceException_1.EFSServiceException,
1095
+ errorCode,
1345
1096
  });
1346
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1347
1097
  }
1348
1098
  };
1349
1099
  const deserializeAws_restJson1DeleteFileSystemCommand = async (output, context) => {
1350
1100
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1351
1101
  return deserializeAws_restJson1DeleteFileSystemCommandError(output, context);
1352
1102
  }
1353
- const contents = {
1103
+ const contents = map({
1354
1104
  $metadata: deserializeMetadata(output),
1355
- };
1105
+ });
1356
1106
  await collectBody(output.body, context);
1357
- return Promise.resolve(contents);
1107
+ return contents;
1358
1108
  };
1359
1109
  exports.deserializeAws_restJson1DeleteFileSystemCommand = deserializeAws_restJson1DeleteFileSystemCommand;
1360
1110
  const deserializeAws_restJson1DeleteFileSystemCommandError = async (output, context) => {
@@ -1362,7 +1112,6 @@ const deserializeAws_restJson1DeleteFileSystemCommandError = async (output, cont
1362
1112
  ...output,
1363
1113
  body: await parseBody(output.body, context),
1364
1114
  };
1365
- let response;
1366
1115
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1367
1116
  switch (errorCode) {
1368
1117
  case "BadRequest":
@@ -1379,25 +1128,23 @@ const deserializeAws_restJson1DeleteFileSystemCommandError = async (output, cont
1379
1128
  throw await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context);
1380
1129
  default:
1381
1130
  const parsedBody = parsedOutput.body;
1382
- const $metadata = deserializeMetadata(output);
1383
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1384
- response = new EFSServiceException_1.EFSServiceException({
1385
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1386
- $fault: "client",
1387
- $metadata,
1131
+ (0, smithy_client_1.throwDefaultError)({
1132
+ output,
1133
+ parsedBody,
1134
+ exceptionCtor: EFSServiceException_1.EFSServiceException,
1135
+ errorCode,
1388
1136
  });
1389
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1390
1137
  }
1391
1138
  };
1392
1139
  const deserializeAws_restJson1DeleteFileSystemPolicyCommand = async (output, context) => {
1393
1140
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1394
1141
  return deserializeAws_restJson1DeleteFileSystemPolicyCommandError(output, context);
1395
1142
  }
1396
- const contents = {
1143
+ const contents = map({
1397
1144
  $metadata: deserializeMetadata(output),
1398
- };
1145
+ });
1399
1146
  await collectBody(output.body, context);
1400
- return Promise.resolve(contents);
1147
+ return contents;
1401
1148
  };
1402
1149
  exports.deserializeAws_restJson1DeleteFileSystemPolicyCommand = deserializeAws_restJson1DeleteFileSystemPolicyCommand;
1403
1150
  const deserializeAws_restJson1DeleteFileSystemPolicyCommandError = async (output, context) => {
@@ -1405,7 +1152,6 @@ const deserializeAws_restJson1DeleteFileSystemPolicyCommandError = async (output
1405
1152
  ...output,
1406
1153
  body: await parseBody(output.body, context),
1407
1154
  };
1408
- let response;
1409
1155
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1410
1156
  switch (errorCode) {
1411
1157
  case "BadRequest":
@@ -1422,25 +1168,23 @@ const deserializeAws_restJson1DeleteFileSystemPolicyCommandError = async (output
1422
1168
  throw await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context);
1423
1169
  default:
1424
1170
  const parsedBody = parsedOutput.body;
1425
- const $metadata = deserializeMetadata(output);
1426
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1427
- response = new EFSServiceException_1.EFSServiceException({
1428
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1429
- $fault: "client",
1430
- $metadata,
1171
+ (0, smithy_client_1.throwDefaultError)({
1172
+ output,
1173
+ parsedBody,
1174
+ exceptionCtor: EFSServiceException_1.EFSServiceException,
1175
+ errorCode,
1431
1176
  });
1432
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1433
1177
  }
1434
1178
  };
1435
1179
  const deserializeAws_restJson1DeleteMountTargetCommand = async (output, context) => {
1436
1180
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1437
1181
  return deserializeAws_restJson1DeleteMountTargetCommandError(output, context);
1438
1182
  }
1439
- const contents = {
1183
+ const contents = map({
1440
1184
  $metadata: deserializeMetadata(output),
1441
- };
1185
+ });
1442
1186
  await collectBody(output.body, context);
1443
- return Promise.resolve(contents);
1187
+ return contents;
1444
1188
  };
1445
1189
  exports.deserializeAws_restJson1DeleteMountTargetCommand = deserializeAws_restJson1DeleteMountTargetCommand;
1446
1190
  const deserializeAws_restJson1DeleteMountTargetCommandError = async (output, context) => {
@@ -1448,7 +1192,6 @@ const deserializeAws_restJson1DeleteMountTargetCommandError = async (output, con
1448
1192
  ...output,
1449
1193
  body: await parseBody(output.body, context),
1450
1194
  };
1451
- let response;
1452
1195
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1453
1196
  switch (errorCode) {
1454
1197
  case "BadRequest":
@@ -1465,25 +1208,23 @@ const deserializeAws_restJson1DeleteMountTargetCommandError = async (output, con
1465
1208
  throw await deserializeAws_restJson1MountTargetNotFoundResponse(parsedOutput, context);
1466
1209
  default:
1467
1210
  const parsedBody = parsedOutput.body;
1468
- const $metadata = deserializeMetadata(output);
1469
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1470
- response = new EFSServiceException_1.EFSServiceException({
1471
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1472
- $fault: "client",
1473
- $metadata,
1211
+ (0, smithy_client_1.throwDefaultError)({
1212
+ output,
1213
+ parsedBody,
1214
+ exceptionCtor: EFSServiceException_1.EFSServiceException,
1215
+ errorCode,
1474
1216
  });
1475
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1476
1217
  }
1477
1218
  };
1478
1219
  const deserializeAws_restJson1DeleteReplicationConfigurationCommand = async (output, context) => {
1479
1220
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1480
1221
  return deserializeAws_restJson1DeleteReplicationConfigurationCommandError(output, context);
1481
1222
  }
1482
- const contents = {
1223
+ const contents = map({
1483
1224
  $metadata: deserializeMetadata(output),
1484
- };
1225
+ });
1485
1226
  await collectBody(output.body, context);
1486
- return Promise.resolve(contents);
1227
+ return contents;
1487
1228
  };
1488
1229
  exports.deserializeAws_restJson1DeleteReplicationConfigurationCommand = deserializeAws_restJson1DeleteReplicationConfigurationCommand;
1489
1230
  const deserializeAws_restJson1DeleteReplicationConfigurationCommandError = async (output, context) => {
@@ -1491,7 +1232,6 @@ const deserializeAws_restJson1DeleteReplicationConfigurationCommandError = async
1491
1232
  ...output,
1492
1233
  body: await parseBody(output.body, context),
1493
1234
  };
1494
- let response;
1495
1235
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1496
1236
  switch (errorCode) {
1497
1237
  case "BadRequest":
@@ -1508,25 +1248,23 @@ const deserializeAws_restJson1DeleteReplicationConfigurationCommandError = async
1508
1248
  throw await deserializeAws_restJson1ReplicationNotFoundResponse(parsedOutput, context);
1509
1249
  default:
1510
1250
  const parsedBody = parsedOutput.body;
1511
- const $metadata = deserializeMetadata(output);
1512
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1513
- response = new EFSServiceException_1.EFSServiceException({
1514
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1515
- $fault: "client",
1516
- $metadata,
1251
+ (0, smithy_client_1.throwDefaultError)({
1252
+ output,
1253
+ parsedBody,
1254
+ exceptionCtor: EFSServiceException_1.EFSServiceException,
1255
+ errorCode,
1517
1256
  });
1518
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1519
1257
  }
1520
1258
  };
1521
1259
  const deserializeAws_restJson1DeleteTagsCommand = async (output, context) => {
1522
1260
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1523
1261
  return deserializeAws_restJson1DeleteTagsCommandError(output, context);
1524
1262
  }
1525
- const contents = {
1263
+ const contents = map({
1526
1264
  $metadata: deserializeMetadata(output),
1527
- };
1265
+ });
1528
1266
  await collectBody(output.body, context);
1529
- return Promise.resolve(contents);
1267
+ return contents;
1530
1268
  };
1531
1269
  exports.deserializeAws_restJson1DeleteTagsCommand = deserializeAws_restJson1DeleteTagsCommand;
1532
1270
  const deserializeAws_restJson1DeleteTagsCommandError = async (output, context) => {
@@ -1534,7 +1272,6 @@ const deserializeAws_restJson1DeleteTagsCommandError = async (output, context) =
1534
1272
  ...output,
1535
1273
  body: await parseBody(output.body, context),
1536
1274
  };
1537
- let response;
1538
1275
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1539
1276
  switch (errorCode) {
1540
1277
  case "BadRequest":
@@ -1548,33 +1285,29 @@ const deserializeAws_restJson1DeleteTagsCommandError = async (output, context) =
1548
1285
  throw await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context);
1549
1286
  default:
1550
1287
  const parsedBody = parsedOutput.body;
1551
- const $metadata = deserializeMetadata(output);
1552
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1553
- response = new EFSServiceException_1.EFSServiceException({
1554
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1555
- $fault: "client",
1556
- $metadata,
1288
+ (0, smithy_client_1.throwDefaultError)({
1289
+ output,
1290
+ parsedBody,
1291
+ exceptionCtor: EFSServiceException_1.EFSServiceException,
1292
+ errorCode,
1557
1293
  });
1558
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1559
1294
  }
1560
1295
  };
1561
1296
  const deserializeAws_restJson1DescribeAccessPointsCommand = async (output, context) => {
1562
1297
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1563
1298
  return deserializeAws_restJson1DescribeAccessPointsCommandError(output, context);
1564
1299
  }
1565
- const contents = {
1300
+ const contents = map({
1566
1301
  $metadata: deserializeMetadata(output),
1567
- AccessPoints: undefined,
1568
- NextToken: undefined,
1569
- };
1302
+ });
1570
1303
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1571
- if (data.AccessPoints !== undefined && data.AccessPoints !== null) {
1304
+ if (data.AccessPoints != null) {
1572
1305
  contents.AccessPoints = deserializeAws_restJson1AccessPointDescriptions(data.AccessPoints, context);
1573
1306
  }
1574
- if (data.NextToken !== undefined && data.NextToken !== null) {
1307
+ if (data.NextToken != null) {
1575
1308
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
1576
1309
  }
1577
- return Promise.resolve(contents);
1310
+ return contents;
1578
1311
  };
1579
1312
  exports.deserializeAws_restJson1DescribeAccessPointsCommand = deserializeAws_restJson1DescribeAccessPointsCommand;
1580
1313
  const deserializeAws_restJson1DescribeAccessPointsCommandError = async (output, context) => {
@@ -1582,7 +1315,6 @@ const deserializeAws_restJson1DescribeAccessPointsCommandError = async (output,
1582
1315
  ...output,
1583
1316
  body: await parseBody(output.body, context),
1584
1317
  };
1585
- let response;
1586
1318
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1587
1319
  switch (errorCode) {
1588
1320
  case "AccessPointNotFound":
@@ -1599,33 +1331,29 @@ const deserializeAws_restJson1DescribeAccessPointsCommandError = async (output,
1599
1331
  throw await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context);
1600
1332
  default:
1601
1333
  const parsedBody = parsedOutput.body;
1602
- const $metadata = deserializeMetadata(output);
1603
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1604
- response = new EFSServiceException_1.EFSServiceException({
1605
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1606
- $fault: "client",
1607
- $metadata,
1334
+ (0, smithy_client_1.throwDefaultError)({
1335
+ output,
1336
+ parsedBody,
1337
+ exceptionCtor: EFSServiceException_1.EFSServiceException,
1338
+ errorCode,
1608
1339
  });
1609
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1610
1340
  }
1611
1341
  };
1612
1342
  const deserializeAws_restJson1DescribeAccountPreferencesCommand = async (output, context) => {
1613
1343
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1614
1344
  return deserializeAws_restJson1DescribeAccountPreferencesCommandError(output, context);
1615
1345
  }
1616
- const contents = {
1346
+ const contents = map({
1617
1347
  $metadata: deserializeMetadata(output),
1618
- NextToken: undefined,
1619
- ResourceIdPreference: undefined,
1620
- };
1348
+ });
1621
1349
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1622
- if (data.NextToken !== undefined && data.NextToken !== null) {
1350
+ if (data.NextToken != null) {
1623
1351
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
1624
1352
  }
1625
- if (data.ResourceIdPreference !== undefined && data.ResourceIdPreference !== null) {
1353
+ if (data.ResourceIdPreference != null) {
1626
1354
  contents.ResourceIdPreference = deserializeAws_restJson1ResourceIdPreference(data.ResourceIdPreference, context);
1627
1355
  }
1628
- return Promise.resolve(contents);
1356
+ return contents;
1629
1357
  };
1630
1358
  exports.deserializeAws_restJson1DescribeAccountPreferencesCommand = deserializeAws_restJson1DescribeAccountPreferencesCommand;
1631
1359
  const deserializeAws_restJson1DescribeAccountPreferencesCommandError = async (output, context) => {
@@ -1633,7 +1361,6 @@ const deserializeAws_restJson1DescribeAccountPreferencesCommandError = async (ou
1633
1361
  ...output,
1634
1362
  body: await parseBody(output.body, context),
1635
1363
  };
1636
- let response;
1637
1364
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1638
1365
  switch (errorCode) {
1639
1366
  case "InternalServerError":
@@ -1641,29 +1368,26 @@ const deserializeAws_restJson1DescribeAccountPreferencesCommandError = async (ou
1641
1368
  throw await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context);
1642
1369
  default:
1643
1370
  const parsedBody = parsedOutput.body;
1644
- const $metadata = deserializeMetadata(output);
1645
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1646
- response = new EFSServiceException_1.EFSServiceException({
1647
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1648
- $fault: "client",
1649
- $metadata,
1371
+ (0, smithy_client_1.throwDefaultError)({
1372
+ output,
1373
+ parsedBody,
1374
+ exceptionCtor: EFSServiceException_1.EFSServiceException,
1375
+ errorCode,
1650
1376
  });
1651
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1652
1377
  }
1653
1378
  };
1654
1379
  const deserializeAws_restJson1DescribeBackupPolicyCommand = async (output, context) => {
1655
1380
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1656
1381
  return deserializeAws_restJson1DescribeBackupPolicyCommandError(output, context);
1657
1382
  }
1658
- const contents = {
1383
+ const contents = map({
1659
1384
  $metadata: deserializeMetadata(output),
1660
- BackupPolicy: undefined,
1661
- };
1385
+ });
1662
1386
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1663
- if (data.BackupPolicy !== undefined && data.BackupPolicy !== null) {
1387
+ if (data.BackupPolicy != null) {
1664
1388
  contents.BackupPolicy = deserializeAws_restJson1BackupPolicy(data.BackupPolicy, context);
1665
1389
  }
1666
- return Promise.resolve(contents);
1390
+ return contents;
1667
1391
  };
1668
1392
  exports.deserializeAws_restJson1DescribeBackupPolicyCommand = deserializeAws_restJson1DescribeBackupPolicyCommand;
1669
1393
  const deserializeAws_restJson1DescribeBackupPolicyCommandError = async (output, context) => {
@@ -1671,7 +1395,6 @@ const deserializeAws_restJson1DescribeBackupPolicyCommandError = async (output,
1671
1395
  ...output,
1672
1396
  body: await parseBody(output.body, context),
1673
1397
  };
1674
- let response;
1675
1398
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1676
1399
  switch (errorCode) {
1677
1400
  case "BadRequest":
@@ -1691,33 +1414,29 @@ const deserializeAws_restJson1DescribeBackupPolicyCommandError = async (output,
1691
1414
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1692
1415
  default:
1693
1416
  const parsedBody = parsedOutput.body;
1694
- const $metadata = deserializeMetadata(output);
1695
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1696
- response = new EFSServiceException_1.EFSServiceException({
1697
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1698
- $fault: "client",
1699
- $metadata,
1417
+ (0, smithy_client_1.throwDefaultError)({
1418
+ output,
1419
+ parsedBody,
1420
+ exceptionCtor: EFSServiceException_1.EFSServiceException,
1421
+ errorCode,
1700
1422
  });
1701
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1702
1423
  }
1703
1424
  };
1704
1425
  const deserializeAws_restJson1DescribeFileSystemPolicyCommand = async (output, context) => {
1705
1426
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1706
1427
  return deserializeAws_restJson1DescribeFileSystemPolicyCommandError(output, context);
1707
1428
  }
1708
- const contents = {
1429
+ const contents = map({
1709
1430
  $metadata: deserializeMetadata(output),
1710
- FileSystemId: undefined,
1711
- Policy: undefined,
1712
- };
1431
+ });
1713
1432
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1714
- if (data.FileSystemId !== undefined && data.FileSystemId !== null) {
1433
+ if (data.FileSystemId != null) {
1715
1434
  contents.FileSystemId = (0, smithy_client_1.expectString)(data.FileSystemId);
1716
1435
  }
1717
- if (data.Policy !== undefined && data.Policy !== null) {
1436
+ if (data.Policy != null) {
1718
1437
  contents.Policy = (0, smithy_client_1.expectString)(data.Policy);
1719
1438
  }
1720
- return Promise.resolve(contents);
1439
+ return contents;
1721
1440
  };
1722
1441
  exports.deserializeAws_restJson1DescribeFileSystemPolicyCommand = deserializeAws_restJson1DescribeFileSystemPolicyCommand;
1723
1442
  const deserializeAws_restJson1DescribeFileSystemPolicyCommandError = async (output, context) => {
@@ -1725,7 +1444,6 @@ const deserializeAws_restJson1DescribeFileSystemPolicyCommandError = async (outp
1725
1444
  ...output,
1726
1445
  body: await parseBody(output.body, context),
1727
1446
  };
1728
- let response;
1729
1447
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1730
1448
  switch (errorCode) {
1731
1449
  case "BadRequest":
@@ -1742,37 +1460,32 @@ const deserializeAws_restJson1DescribeFileSystemPolicyCommandError = async (outp
1742
1460
  throw await deserializeAws_restJson1PolicyNotFoundResponse(parsedOutput, context);
1743
1461
  default:
1744
1462
  const parsedBody = parsedOutput.body;
1745
- const $metadata = deserializeMetadata(output);
1746
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1747
- response = new EFSServiceException_1.EFSServiceException({
1748
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1749
- $fault: "client",
1750
- $metadata,
1463
+ (0, smithy_client_1.throwDefaultError)({
1464
+ output,
1465
+ parsedBody,
1466
+ exceptionCtor: EFSServiceException_1.EFSServiceException,
1467
+ errorCode,
1751
1468
  });
1752
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1753
1469
  }
1754
1470
  };
1755
1471
  const deserializeAws_restJson1DescribeFileSystemsCommand = async (output, context) => {
1756
1472
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1757
1473
  return deserializeAws_restJson1DescribeFileSystemsCommandError(output, context);
1758
1474
  }
1759
- const contents = {
1475
+ const contents = map({
1760
1476
  $metadata: deserializeMetadata(output),
1761
- FileSystems: undefined,
1762
- Marker: undefined,
1763
- NextMarker: undefined,
1764
- };
1477
+ });
1765
1478
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1766
- if (data.FileSystems !== undefined && data.FileSystems !== null) {
1479
+ if (data.FileSystems != null) {
1767
1480
  contents.FileSystems = deserializeAws_restJson1FileSystemDescriptions(data.FileSystems, context);
1768
1481
  }
1769
- if (data.Marker !== undefined && data.Marker !== null) {
1482
+ if (data.Marker != null) {
1770
1483
  contents.Marker = (0, smithy_client_1.expectString)(data.Marker);
1771
1484
  }
1772
- if (data.NextMarker !== undefined && data.NextMarker !== null) {
1485
+ if (data.NextMarker != null) {
1773
1486
  contents.NextMarker = (0, smithy_client_1.expectString)(data.NextMarker);
1774
1487
  }
1775
- return Promise.resolve(contents);
1488
+ return contents;
1776
1489
  };
1777
1490
  exports.deserializeAws_restJson1DescribeFileSystemsCommand = deserializeAws_restJson1DescribeFileSystemsCommand;
1778
1491
  const deserializeAws_restJson1DescribeFileSystemsCommandError = async (output, context) => {
@@ -1780,7 +1493,6 @@ const deserializeAws_restJson1DescribeFileSystemsCommandError = async (output, c
1780
1493
  ...output,
1781
1494
  body: await parseBody(output.body, context),
1782
1495
  };
1783
- let response;
1784
1496
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1785
1497
  switch (errorCode) {
1786
1498
  case "BadRequest":
@@ -1794,29 +1506,26 @@ const deserializeAws_restJson1DescribeFileSystemsCommandError = async (output, c
1794
1506
  throw await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context);
1795
1507
  default:
1796
1508
  const parsedBody = parsedOutput.body;
1797
- const $metadata = deserializeMetadata(output);
1798
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1799
- response = new EFSServiceException_1.EFSServiceException({
1800
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1801
- $fault: "client",
1802
- $metadata,
1509
+ (0, smithy_client_1.throwDefaultError)({
1510
+ output,
1511
+ parsedBody,
1512
+ exceptionCtor: EFSServiceException_1.EFSServiceException,
1513
+ errorCode,
1803
1514
  });
1804
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1805
1515
  }
1806
1516
  };
1807
1517
  const deserializeAws_restJson1DescribeLifecycleConfigurationCommand = async (output, context) => {
1808
1518
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1809
1519
  return deserializeAws_restJson1DescribeLifecycleConfigurationCommandError(output, context);
1810
1520
  }
1811
- const contents = {
1521
+ const contents = map({
1812
1522
  $metadata: deserializeMetadata(output),
1813
- LifecyclePolicies: undefined,
1814
- };
1523
+ });
1815
1524
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1816
- if (data.LifecyclePolicies !== undefined && data.LifecyclePolicies !== null) {
1525
+ if (data.LifecyclePolicies != null) {
1817
1526
  contents.LifecyclePolicies = deserializeAws_restJson1LifecyclePolicies(data.LifecyclePolicies, context);
1818
1527
  }
1819
- return Promise.resolve(contents);
1528
+ return contents;
1820
1529
  };
1821
1530
  exports.deserializeAws_restJson1DescribeLifecycleConfigurationCommand = deserializeAws_restJson1DescribeLifecycleConfigurationCommand;
1822
1531
  const deserializeAws_restJson1DescribeLifecycleConfigurationCommandError = async (output, context) => {
@@ -1824,7 +1533,6 @@ const deserializeAws_restJson1DescribeLifecycleConfigurationCommandError = async
1824
1533
  ...output,
1825
1534
  body: await parseBody(output.body, context),
1826
1535
  };
1827
- let response;
1828
1536
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1829
1537
  switch (errorCode) {
1830
1538
  case "BadRequest":
@@ -1838,37 +1546,32 @@ const deserializeAws_restJson1DescribeLifecycleConfigurationCommandError = async
1838
1546
  throw await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context);
1839
1547
  default:
1840
1548
  const parsedBody = parsedOutput.body;
1841
- const $metadata = deserializeMetadata(output);
1842
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1843
- response = new EFSServiceException_1.EFSServiceException({
1844
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1845
- $fault: "client",
1846
- $metadata,
1549
+ (0, smithy_client_1.throwDefaultError)({
1550
+ output,
1551
+ parsedBody,
1552
+ exceptionCtor: EFSServiceException_1.EFSServiceException,
1553
+ errorCode,
1847
1554
  });
1848
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1849
1555
  }
1850
1556
  };
1851
1557
  const deserializeAws_restJson1DescribeMountTargetsCommand = async (output, context) => {
1852
1558
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1853
1559
  return deserializeAws_restJson1DescribeMountTargetsCommandError(output, context);
1854
1560
  }
1855
- const contents = {
1561
+ const contents = map({
1856
1562
  $metadata: deserializeMetadata(output),
1857
- Marker: undefined,
1858
- MountTargets: undefined,
1859
- NextMarker: undefined,
1860
- };
1563
+ });
1861
1564
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1862
- if (data.Marker !== undefined && data.Marker !== null) {
1565
+ if (data.Marker != null) {
1863
1566
  contents.Marker = (0, smithy_client_1.expectString)(data.Marker);
1864
1567
  }
1865
- if (data.MountTargets !== undefined && data.MountTargets !== null) {
1568
+ if (data.MountTargets != null) {
1866
1569
  contents.MountTargets = deserializeAws_restJson1MountTargetDescriptions(data.MountTargets, context);
1867
1570
  }
1868
- if (data.NextMarker !== undefined && data.NextMarker !== null) {
1571
+ if (data.NextMarker != null) {
1869
1572
  contents.NextMarker = (0, smithy_client_1.expectString)(data.NextMarker);
1870
1573
  }
1871
- return Promise.resolve(contents);
1574
+ return contents;
1872
1575
  };
1873
1576
  exports.deserializeAws_restJson1DescribeMountTargetsCommand = deserializeAws_restJson1DescribeMountTargetsCommand;
1874
1577
  const deserializeAws_restJson1DescribeMountTargetsCommandError = async (output, context) => {
@@ -1876,7 +1579,6 @@ const deserializeAws_restJson1DescribeMountTargetsCommandError = async (output,
1876
1579
  ...output,
1877
1580
  body: await parseBody(output.body, context),
1878
1581
  };
1879
- let response;
1880
1582
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1881
1583
  switch (errorCode) {
1882
1584
  case "AccessPointNotFound":
@@ -1896,29 +1598,26 @@ const deserializeAws_restJson1DescribeMountTargetsCommandError = async (output,
1896
1598
  throw await deserializeAws_restJson1MountTargetNotFoundResponse(parsedOutput, context);
1897
1599
  default:
1898
1600
  const parsedBody = parsedOutput.body;
1899
- const $metadata = deserializeMetadata(output);
1900
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1901
- response = new EFSServiceException_1.EFSServiceException({
1902
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1903
- $fault: "client",
1904
- $metadata,
1601
+ (0, smithy_client_1.throwDefaultError)({
1602
+ output,
1603
+ parsedBody,
1604
+ exceptionCtor: EFSServiceException_1.EFSServiceException,
1605
+ errorCode,
1905
1606
  });
1906
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1907
1607
  }
1908
1608
  };
1909
1609
  const deserializeAws_restJson1DescribeMountTargetSecurityGroupsCommand = async (output, context) => {
1910
1610
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1911
1611
  return deserializeAws_restJson1DescribeMountTargetSecurityGroupsCommandError(output, context);
1912
1612
  }
1913
- const contents = {
1613
+ const contents = map({
1914
1614
  $metadata: deserializeMetadata(output),
1915
- SecurityGroups: undefined,
1916
- };
1615
+ });
1917
1616
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1918
- if (data.SecurityGroups !== undefined && data.SecurityGroups !== null) {
1617
+ if (data.SecurityGroups != null) {
1919
1618
  contents.SecurityGroups = deserializeAws_restJson1SecurityGroups(data.SecurityGroups, context);
1920
1619
  }
1921
- return Promise.resolve(contents);
1620
+ return contents;
1922
1621
  };
1923
1622
  exports.deserializeAws_restJson1DescribeMountTargetSecurityGroupsCommand = deserializeAws_restJson1DescribeMountTargetSecurityGroupsCommand;
1924
1623
  const deserializeAws_restJson1DescribeMountTargetSecurityGroupsCommandError = async (output, context) => {
@@ -1926,7 +1625,6 @@ const deserializeAws_restJson1DescribeMountTargetSecurityGroupsCommandError = as
1926
1625
  ...output,
1927
1626
  body: await parseBody(output.body, context),
1928
1627
  };
1929
- let response;
1930
1628
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1931
1629
  switch (errorCode) {
1932
1630
  case "BadRequest":
@@ -1943,33 +1641,29 @@ const deserializeAws_restJson1DescribeMountTargetSecurityGroupsCommandError = as
1943
1641
  throw await deserializeAws_restJson1MountTargetNotFoundResponse(parsedOutput, context);
1944
1642
  default:
1945
1643
  const parsedBody = parsedOutput.body;
1946
- const $metadata = deserializeMetadata(output);
1947
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1948
- response = new EFSServiceException_1.EFSServiceException({
1949
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1950
- $fault: "client",
1951
- $metadata,
1644
+ (0, smithy_client_1.throwDefaultError)({
1645
+ output,
1646
+ parsedBody,
1647
+ exceptionCtor: EFSServiceException_1.EFSServiceException,
1648
+ errorCode,
1952
1649
  });
1953
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1954
1650
  }
1955
1651
  };
1956
1652
  const deserializeAws_restJson1DescribeReplicationConfigurationsCommand = async (output, context) => {
1957
1653
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1958
1654
  return deserializeAws_restJson1DescribeReplicationConfigurationsCommandError(output, context);
1959
1655
  }
1960
- const contents = {
1656
+ const contents = map({
1961
1657
  $metadata: deserializeMetadata(output),
1962
- NextToken: undefined,
1963
- Replications: undefined,
1964
- };
1658
+ });
1965
1659
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1966
- if (data.NextToken !== undefined && data.NextToken !== null) {
1660
+ if (data.NextToken != null) {
1967
1661
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
1968
1662
  }
1969
- if (data.Replications !== undefined && data.Replications !== null) {
1663
+ if (data.Replications != null) {
1970
1664
  contents.Replications = deserializeAws_restJson1ReplicationConfigurationDescriptions(data.Replications, context);
1971
1665
  }
1972
- return Promise.resolve(contents);
1666
+ return contents;
1973
1667
  };
1974
1668
  exports.deserializeAws_restJson1DescribeReplicationConfigurationsCommand = deserializeAws_restJson1DescribeReplicationConfigurationsCommand;
1975
1669
  const deserializeAws_restJson1DescribeReplicationConfigurationsCommandError = async (output, context) => {
@@ -1977,7 +1671,6 @@ const deserializeAws_restJson1DescribeReplicationConfigurationsCommandError = as
1977
1671
  ...output,
1978
1672
  body: await parseBody(output.body, context),
1979
1673
  };
1980
- let response;
1981
1674
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1982
1675
  switch (errorCode) {
1983
1676
  case "BadRequest":
@@ -1997,37 +1690,32 @@ const deserializeAws_restJson1DescribeReplicationConfigurationsCommandError = as
1997
1690
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1998
1691
  default:
1999
1692
  const parsedBody = parsedOutput.body;
2000
- const $metadata = deserializeMetadata(output);
2001
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2002
- response = new EFSServiceException_1.EFSServiceException({
2003
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2004
- $fault: "client",
2005
- $metadata,
1693
+ (0, smithy_client_1.throwDefaultError)({
1694
+ output,
1695
+ parsedBody,
1696
+ exceptionCtor: EFSServiceException_1.EFSServiceException,
1697
+ errorCode,
2006
1698
  });
2007
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2008
1699
  }
2009
1700
  };
2010
1701
  const deserializeAws_restJson1DescribeTagsCommand = async (output, context) => {
2011
1702
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2012
1703
  return deserializeAws_restJson1DescribeTagsCommandError(output, context);
2013
1704
  }
2014
- const contents = {
1705
+ const contents = map({
2015
1706
  $metadata: deserializeMetadata(output),
2016
- Marker: undefined,
2017
- NextMarker: undefined,
2018
- Tags: undefined,
2019
- };
1707
+ });
2020
1708
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2021
- if (data.Marker !== undefined && data.Marker !== null) {
1709
+ if (data.Marker != null) {
2022
1710
  contents.Marker = (0, smithy_client_1.expectString)(data.Marker);
2023
1711
  }
2024
- if (data.NextMarker !== undefined && data.NextMarker !== null) {
1712
+ if (data.NextMarker != null) {
2025
1713
  contents.NextMarker = (0, smithy_client_1.expectString)(data.NextMarker);
2026
1714
  }
2027
- if (data.Tags !== undefined && data.Tags !== null) {
1715
+ if (data.Tags != null) {
2028
1716
  contents.Tags = deserializeAws_restJson1Tags(data.Tags, context);
2029
1717
  }
2030
- return Promise.resolve(contents);
1718
+ return contents;
2031
1719
  };
2032
1720
  exports.deserializeAws_restJson1DescribeTagsCommand = deserializeAws_restJson1DescribeTagsCommand;
2033
1721
  const deserializeAws_restJson1DescribeTagsCommandError = async (output, context) => {
@@ -2035,7 +1723,6 @@ const deserializeAws_restJson1DescribeTagsCommandError = async (output, context)
2035
1723
  ...output,
2036
1724
  body: await parseBody(output.body, context),
2037
1725
  };
2038
- let response;
2039
1726
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2040
1727
  switch (errorCode) {
2041
1728
  case "BadRequest":
@@ -2049,33 +1736,29 @@ const deserializeAws_restJson1DescribeTagsCommandError = async (output, context)
2049
1736
  throw await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context);
2050
1737
  default:
2051
1738
  const parsedBody = parsedOutput.body;
2052
- const $metadata = deserializeMetadata(output);
2053
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2054
- response = new EFSServiceException_1.EFSServiceException({
2055
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2056
- $fault: "client",
2057
- $metadata,
1739
+ (0, smithy_client_1.throwDefaultError)({
1740
+ output,
1741
+ parsedBody,
1742
+ exceptionCtor: EFSServiceException_1.EFSServiceException,
1743
+ errorCode,
2058
1744
  });
2059
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2060
1745
  }
2061
1746
  };
2062
1747
  const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
2063
1748
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2064
1749
  return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
2065
1750
  }
2066
- const contents = {
1751
+ const contents = map({
2067
1752
  $metadata: deserializeMetadata(output),
2068
- NextToken: undefined,
2069
- Tags: undefined,
2070
- };
1753
+ });
2071
1754
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2072
- if (data.NextToken !== undefined && data.NextToken !== null) {
1755
+ if (data.NextToken != null) {
2073
1756
  contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
2074
1757
  }
2075
- if (data.Tags !== undefined && data.Tags !== null) {
1758
+ if (data.Tags != null) {
2076
1759
  contents.Tags = deserializeAws_restJson1Tags(data.Tags, context);
2077
1760
  }
2078
- return Promise.resolve(contents);
1761
+ return contents;
2079
1762
  };
2080
1763
  exports.deserializeAws_restJson1ListTagsForResourceCommand = deserializeAws_restJson1ListTagsForResourceCommand;
2081
1764
  const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
@@ -2083,7 +1766,6 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
2083
1766
  ...output,
2084
1767
  body: await parseBody(output.body, context),
2085
1768
  };
2086
- let response;
2087
1769
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2088
1770
  switch (errorCode) {
2089
1771
  case "AccessPointNotFound":
@@ -2100,25 +1782,23 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
2100
1782
  throw await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context);
2101
1783
  default:
2102
1784
  const parsedBody = parsedOutput.body;
2103
- const $metadata = deserializeMetadata(output);
2104
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2105
- response = new EFSServiceException_1.EFSServiceException({
2106
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2107
- $fault: "client",
2108
- $metadata,
1785
+ (0, smithy_client_1.throwDefaultError)({
1786
+ output,
1787
+ parsedBody,
1788
+ exceptionCtor: EFSServiceException_1.EFSServiceException,
1789
+ errorCode,
2109
1790
  });
2110
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2111
1791
  }
2112
1792
  };
2113
1793
  const deserializeAws_restJson1ModifyMountTargetSecurityGroupsCommand = async (output, context) => {
2114
1794
  if (output.statusCode !== 204 && output.statusCode >= 300) {
2115
1795
  return deserializeAws_restJson1ModifyMountTargetSecurityGroupsCommandError(output, context);
2116
1796
  }
2117
- const contents = {
1797
+ const contents = map({
2118
1798
  $metadata: deserializeMetadata(output),
2119
- };
1799
+ });
2120
1800
  await collectBody(output.body, context);
2121
- return Promise.resolve(contents);
1801
+ return contents;
2122
1802
  };
2123
1803
  exports.deserializeAws_restJson1ModifyMountTargetSecurityGroupsCommand = deserializeAws_restJson1ModifyMountTargetSecurityGroupsCommand;
2124
1804
  const deserializeAws_restJson1ModifyMountTargetSecurityGroupsCommandError = async (output, context) => {
@@ -2126,7 +1806,6 @@ const deserializeAws_restJson1ModifyMountTargetSecurityGroupsCommandError = asyn
2126
1806
  ...output,
2127
1807
  body: await parseBody(output.body, context),
2128
1808
  };
2129
- let response;
2130
1809
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2131
1810
  switch (errorCode) {
2132
1811
  case "BadRequest":
@@ -2149,29 +1828,26 @@ const deserializeAws_restJson1ModifyMountTargetSecurityGroupsCommandError = asyn
2149
1828
  throw await deserializeAws_restJson1SecurityGroupNotFoundResponse(parsedOutput, context);
2150
1829
  default:
2151
1830
  const parsedBody = parsedOutput.body;
2152
- const $metadata = deserializeMetadata(output);
2153
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2154
- response = new EFSServiceException_1.EFSServiceException({
2155
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2156
- $fault: "client",
2157
- $metadata,
1831
+ (0, smithy_client_1.throwDefaultError)({
1832
+ output,
1833
+ parsedBody,
1834
+ exceptionCtor: EFSServiceException_1.EFSServiceException,
1835
+ errorCode,
2158
1836
  });
2159
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2160
1837
  }
2161
1838
  };
2162
1839
  const deserializeAws_restJson1PutAccountPreferencesCommand = async (output, context) => {
2163
1840
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2164
1841
  return deserializeAws_restJson1PutAccountPreferencesCommandError(output, context);
2165
1842
  }
2166
- const contents = {
1843
+ const contents = map({
2167
1844
  $metadata: deserializeMetadata(output),
2168
- ResourceIdPreference: undefined,
2169
- };
1845
+ });
2170
1846
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2171
- if (data.ResourceIdPreference !== undefined && data.ResourceIdPreference !== null) {
1847
+ if (data.ResourceIdPreference != null) {
2172
1848
  contents.ResourceIdPreference = deserializeAws_restJson1ResourceIdPreference(data.ResourceIdPreference, context);
2173
1849
  }
2174
- return Promise.resolve(contents);
1850
+ return contents;
2175
1851
  };
2176
1852
  exports.deserializeAws_restJson1PutAccountPreferencesCommand = deserializeAws_restJson1PutAccountPreferencesCommand;
2177
1853
  const deserializeAws_restJson1PutAccountPreferencesCommandError = async (output, context) => {
@@ -2179,7 +1855,6 @@ const deserializeAws_restJson1PutAccountPreferencesCommandError = async (output,
2179
1855
  ...output,
2180
1856
  body: await parseBody(output.body, context),
2181
1857
  };
2182
- let response;
2183
1858
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2184
1859
  switch (errorCode) {
2185
1860
  case "BadRequest":
@@ -2190,29 +1865,26 @@ const deserializeAws_restJson1PutAccountPreferencesCommandError = async (output,
2190
1865
  throw await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context);
2191
1866
  default:
2192
1867
  const parsedBody = parsedOutput.body;
2193
- const $metadata = deserializeMetadata(output);
2194
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2195
- response = new EFSServiceException_1.EFSServiceException({
2196
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2197
- $fault: "client",
2198
- $metadata,
1868
+ (0, smithy_client_1.throwDefaultError)({
1869
+ output,
1870
+ parsedBody,
1871
+ exceptionCtor: EFSServiceException_1.EFSServiceException,
1872
+ errorCode,
2199
1873
  });
2200
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2201
1874
  }
2202
1875
  };
2203
1876
  const deserializeAws_restJson1PutBackupPolicyCommand = async (output, context) => {
2204
1877
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2205
1878
  return deserializeAws_restJson1PutBackupPolicyCommandError(output, context);
2206
1879
  }
2207
- const contents = {
1880
+ const contents = map({
2208
1881
  $metadata: deserializeMetadata(output),
2209
- BackupPolicy: undefined,
2210
- };
1882
+ });
2211
1883
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2212
- if (data.BackupPolicy !== undefined && data.BackupPolicy !== null) {
1884
+ if (data.BackupPolicy != null) {
2213
1885
  contents.BackupPolicy = deserializeAws_restJson1BackupPolicy(data.BackupPolicy, context);
2214
1886
  }
2215
- return Promise.resolve(contents);
1887
+ return contents;
2216
1888
  };
2217
1889
  exports.deserializeAws_restJson1PutBackupPolicyCommand = deserializeAws_restJson1PutBackupPolicyCommand;
2218
1890
  const deserializeAws_restJson1PutBackupPolicyCommandError = async (output, context) => {
@@ -2220,7 +1892,6 @@ const deserializeAws_restJson1PutBackupPolicyCommandError = async (output, conte
2220
1892
  ...output,
2221
1893
  body: await parseBody(output.body, context),
2222
1894
  };
2223
- let response;
2224
1895
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2225
1896
  switch (errorCode) {
2226
1897
  case "BadRequest":
@@ -2240,33 +1911,29 @@ const deserializeAws_restJson1PutBackupPolicyCommandError = async (output, conte
2240
1911
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2241
1912
  default:
2242
1913
  const parsedBody = parsedOutput.body;
2243
- const $metadata = deserializeMetadata(output);
2244
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2245
- response = new EFSServiceException_1.EFSServiceException({
2246
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2247
- $fault: "client",
2248
- $metadata,
1914
+ (0, smithy_client_1.throwDefaultError)({
1915
+ output,
1916
+ parsedBody,
1917
+ exceptionCtor: EFSServiceException_1.EFSServiceException,
1918
+ errorCode,
2249
1919
  });
2250
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2251
1920
  }
2252
1921
  };
2253
1922
  const deserializeAws_restJson1PutFileSystemPolicyCommand = async (output, context) => {
2254
1923
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2255
1924
  return deserializeAws_restJson1PutFileSystemPolicyCommandError(output, context);
2256
1925
  }
2257
- const contents = {
1926
+ const contents = map({
2258
1927
  $metadata: deserializeMetadata(output),
2259
- FileSystemId: undefined,
2260
- Policy: undefined,
2261
- };
1928
+ });
2262
1929
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2263
- if (data.FileSystemId !== undefined && data.FileSystemId !== null) {
1930
+ if (data.FileSystemId != null) {
2264
1931
  contents.FileSystemId = (0, smithy_client_1.expectString)(data.FileSystemId);
2265
1932
  }
2266
- if (data.Policy !== undefined && data.Policy !== null) {
1933
+ if (data.Policy != null) {
2267
1934
  contents.Policy = (0, smithy_client_1.expectString)(data.Policy);
2268
1935
  }
2269
- return Promise.resolve(contents);
1936
+ return contents;
2270
1937
  };
2271
1938
  exports.deserializeAws_restJson1PutFileSystemPolicyCommand = deserializeAws_restJson1PutFileSystemPolicyCommand;
2272
1939
  const deserializeAws_restJson1PutFileSystemPolicyCommandError = async (output, context) => {
@@ -2274,7 +1941,6 @@ const deserializeAws_restJson1PutFileSystemPolicyCommandError = async (output, c
2274
1941
  ...output,
2275
1942
  body: await parseBody(output.body, context),
2276
1943
  };
2277
- let response;
2278
1944
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2279
1945
  switch (errorCode) {
2280
1946
  case "BadRequest":
@@ -2294,29 +1960,26 @@ const deserializeAws_restJson1PutFileSystemPolicyCommandError = async (output, c
2294
1960
  throw await deserializeAws_restJson1InvalidPolicyExceptionResponse(parsedOutput, context);
2295
1961
  default:
2296
1962
  const parsedBody = parsedOutput.body;
2297
- const $metadata = deserializeMetadata(output);
2298
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2299
- response = new EFSServiceException_1.EFSServiceException({
2300
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2301
- $fault: "client",
2302
- $metadata,
1963
+ (0, smithy_client_1.throwDefaultError)({
1964
+ output,
1965
+ parsedBody,
1966
+ exceptionCtor: EFSServiceException_1.EFSServiceException,
1967
+ errorCode,
2303
1968
  });
2304
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2305
1969
  }
2306
1970
  };
2307
1971
  const deserializeAws_restJson1PutLifecycleConfigurationCommand = async (output, context) => {
2308
1972
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2309
1973
  return deserializeAws_restJson1PutLifecycleConfigurationCommandError(output, context);
2310
1974
  }
2311
- const contents = {
1975
+ const contents = map({
2312
1976
  $metadata: deserializeMetadata(output),
2313
- LifecyclePolicies: undefined,
2314
- };
1977
+ });
2315
1978
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2316
- if (data.LifecyclePolicies !== undefined && data.LifecyclePolicies !== null) {
1979
+ if (data.LifecyclePolicies != null) {
2317
1980
  contents.LifecyclePolicies = deserializeAws_restJson1LifecyclePolicies(data.LifecyclePolicies, context);
2318
1981
  }
2319
- return Promise.resolve(contents);
1982
+ return contents;
2320
1983
  };
2321
1984
  exports.deserializeAws_restJson1PutLifecycleConfigurationCommand = deserializeAws_restJson1PutLifecycleConfigurationCommand;
2322
1985
  const deserializeAws_restJson1PutLifecycleConfigurationCommandError = async (output, context) => {
@@ -2324,7 +1987,6 @@ const deserializeAws_restJson1PutLifecycleConfigurationCommandError = async (out
2324
1987
  ...output,
2325
1988
  body: await parseBody(output.body, context),
2326
1989
  };
2327
- let response;
2328
1990
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2329
1991
  switch (errorCode) {
2330
1992
  case "BadRequest":
@@ -2341,25 +2003,23 @@ const deserializeAws_restJson1PutLifecycleConfigurationCommandError = async (out
2341
2003
  throw await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context);
2342
2004
  default:
2343
2005
  const parsedBody = parsedOutput.body;
2344
- const $metadata = deserializeMetadata(output);
2345
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2346
- response = new EFSServiceException_1.EFSServiceException({
2347
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2348
- $fault: "client",
2349
- $metadata,
2006
+ (0, smithy_client_1.throwDefaultError)({
2007
+ output,
2008
+ parsedBody,
2009
+ exceptionCtor: EFSServiceException_1.EFSServiceException,
2010
+ errorCode,
2350
2011
  });
2351
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2352
2012
  }
2353
2013
  };
2354
2014
  const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
2355
2015
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2356
2016
  return deserializeAws_restJson1TagResourceCommandError(output, context);
2357
2017
  }
2358
- const contents = {
2018
+ const contents = map({
2359
2019
  $metadata: deserializeMetadata(output),
2360
- };
2020
+ });
2361
2021
  await collectBody(output.body, context);
2362
- return Promise.resolve(contents);
2022
+ return contents;
2363
2023
  };
2364
2024
  exports.deserializeAws_restJson1TagResourceCommand = deserializeAws_restJson1TagResourceCommand;
2365
2025
  const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
@@ -2367,7 +2027,6 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
2367
2027
  ...output,
2368
2028
  body: await parseBody(output.body, context),
2369
2029
  };
2370
- let response;
2371
2030
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2372
2031
  switch (errorCode) {
2373
2032
  case "AccessPointNotFound":
@@ -2384,25 +2043,23 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
2384
2043
  throw await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context);
2385
2044
  default:
2386
2045
  const parsedBody = parsedOutput.body;
2387
- const $metadata = deserializeMetadata(output);
2388
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2389
- response = new EFSServiceException_1.EFSServiceException({
2390
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2391
- $fault: "client",
2392
- $metadata,
2046
+ (0, smithy_client_1.throwDefaultError)({
2047
+ output,
2048
+ parsedBody,
2049
+ exceptionCtor: EFSServiceException_1.EFSServiceException,
2050
+ errorCode,
2393
2051
  });
2394
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2395
2052
  }
2396
2053
  };
2397
2054
  const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
2398
2055
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2399
2056
  return deserializeAws_restJson1UntagResourceCommandError(output, context);
2400
2057
  }
2401
- const contents = {
2058
+ const contents = map({
2402
2059
  $metadata: deserializeMetadata(output),
2403
- };
2060
+ });
2404
2061
  await collectBody(output.body, context);
2405
- return Promise.resolve(contents);
2062
+ return contents;
2406
2063
  };
2407
2064
  exports.deserializeAws_restJson1UntagResourceCommand = deserializeAws_restJson1UntagResourceCommand;
2408
2065
  const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
@@ -2410,7 +2067,6 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
2410
2067
  ...output,
2411
2068
  body: await parseBody(output.body, context),
2412
2069
  };
2413
- let response;
2414
2070
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2415
2071
  switch (errorCode) {
2416
2072
  case "AccessPointNotFound":
@@ -2427,93 +2083,74 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
2427
2083
  throw await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context);
2428
2084
  default:
2429
2085
  const parsedBody = parsedOutput.body;
2430
- const $metadata = deserializeMetadata(output);
2431
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2432
- response = new EFSServiceException_1.EFSServiceException({
2433
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2434
- $fault: "client",
2435
- $metadata,
2086
+ (0, smithy_client_1.throwDefaultError)({
2087
+ output,
2088
+ parsedBody,
2089
+ exceptionCtor: EFSServiceException_1.EFSServiceException,
2090
+ errorCode,
2436
2091
  });
2437
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2438
2092
  }
2439
2093
  };
2440
2094
  const deserializeAws_restJson1UpdateFileSystemCommand = async (output, context) => {
2441
2095
  if (output.statusCode !== 202 && output.statusCode >= 300) {
2442
2096
  return deserializeAws_restJson1UpdateFileSystemCommandError(output, context);
2443
2097
  }
2444
- const contents = {
2098
+ const contents = map({
2445
2099
  $metadata: deserializeMetadata(output),
2446
- AvailabilityZoneId: undefined,
2447
- AvailabilityZoneName: undefined,
2448
- CreationTime: undefined,
2449
- CreationToken: undefined,
2450
- Encrypted: undefined,
2451
- FileSystemArn: undefined,
2452
- FileSystemId: undefined,
2453
- KmsKeyId: undefined,
2454
- LifeCycleState: undefined,
2455
- Name: undefined,
2456
- NumberOfMountTargets: undefined,
2457
- OwnerId: undefined,
2458
- PerformanceMode: undefined,
2459
- ProvisionedThroughputInMibps: undefined,
2460
- SizeInBytes: undefined,
2461
- Tags: undefined,
2462
- ThroughputMode: undefined,
2463
- };
2100
+ });
2464
2101
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2465
- if (data.AvailabilityZoneId !== undefined && data.AvailabilityZoneId !== null) {
2102
+ if (data.AvailabilityZoneId != null) {
2466
2103
  contents.AvailabilityZoneId = (0, smithy_client_1.expectString)(data.AvailabilityZoneId);
2467
2104
  }
2468
- if (data.AvailabilityZoneName !== undefined && data.AvailabilityZoneName !== null) {
2105
+ if (data.AvailabilityZoneName != null) {
2469
2106
  contents.AvailabilityZoneName = (0, smithy_client_1.expectString)(data.AvailabilityZoneName);
2470
2107
  }
2471
- if (data.CreationTime !== undefined && data.CreationTime !== null) {
2108
+ if (data.CreationTime != null) {
2472
2109
  contents.CreationTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.CreationTime)));
2473
2110
  }
2474
- if (data.CreationToken !== undefined && data.CreationToken !== null) {
2111
+ if (data.CreationToken != null) {
2475
2112
  contents.CreationToken = (0, smithy_client_1.expectString)(data.CreationToken);
2476
2113
  }
2477
- if (data.Encrypted !== undefined && data.Encrypted !== null) {
2114
+ if (data.Encrypted != null) {
2478
2115
  contents.Encrypted = (0, smithy_client_1.expectBoolean)(data.Encrypted);
2479
2116
  }
2480
- if (data.FileSystemArn !== undefined && data.FileSystemArn !== null) {
2117
+ if (data.FileSystemArn != null) {
2481
2118
  contents.FileSystemArn = (0, smithy_client_1.expectString)(data.FileSystemArn);
2482
2119
  }
2483
- if (data.FileSystemId !== undefined && data.FileSystemId !== null) {
2120
+ if (data.FileSystemId != null) {
2484
2121
  contents.FileSystemId = (0, smithy_client_1.expectString)(data.FileSystemId);
2485
2122
  }
2486
- if (data.KmsKeyId !== undefined && data.KmsKeyId !== null) {
2123
+ if (data.KmsKeyId != null) {
2487
2124
  contents.KmsKeyId = (0, smithy_client_1.expectString)(data.KmsKeyId);
2488
2125
  }
2489
- if (data.LifeCycleState !== undefined && data.LifeCycleState !== null) {
2126
+ if (data.LifeCycleState != null) {
2490
2127
  contents.LifeCycleState = (0, smithy_client_1.expectString)(data.LifeCycleState);
2491
2128
  }
2492
- if (data.Name !== undefined && data.Name !== null) {
2129
+ if (data.Name != null) {
2493
2130
  contents.Name = (0, smithy_client_1.expectString)(data.Name);
2494
2131
  }
2495
- if (data.NumberOfMountTargets !== undefined && data.NumberOfMountTargets !== null) {
2132
+ if (data.NumberOfMountTargets != null) {
2496
2133
  contents.NumberOfMountTargets = (0, smithy_client_1.expectInt32)(data.NumberOfMountTargets);
2497
2134
  }
2498
- if (data.OwnerId !== undefined && data.OwnerId !== null) {
2135
+ if (data.OwnerId != null) {
2499
2136
  contents.OwnerId = (0, smithy_client_1.expectString)(data.OwnerId);
2500
2137
  }
2501
- if (data.PerformanceMode !== undefined && data.PerformanceMode !== null) {
2138
+ if (data.PerformanceMode != null) {
2502
2139
  contents.PerformanceMode = (0, smithy_client_1.expectString)(data.PerformanceMode);
2503
2140
  }
2504
- if (data.ProvisionedThroughputInMibps !== undefined && data.ProvisionedThroughputInMibps !== null) {
2141
+ if (data.ProvisionedThroughputInMibps != null) {
2505
2142
  contents.ProvisionedThroughputInMibps = (0, smithy_client_1.limitedParseDouble)(data.ProvisionedThroughputInMibps);
2506
2143
  }
2507
- if (data.SizeInBytes !== undefined && data.SizeInBytes !== null) {
2144
+ if (data.SizeInBytes != null) {
2508
2145
  contents.SizeInBytes = deserializeAws_restJson1FileSystemSize(data.SizeInBytes, context);
2509
2146
  }
2510
- if (data.Tags !== undefined && data.Tags !== null) {
2147
+ if (data.Tags != null) {
2511
2148
  contents.Tags = deserializeAws_restJson1Tags(data.Tags, context);
2512
2149
  }
2513
- if (data.ThroughputMode !== undefined && data.ThroughputMode !== null) {
2150
+ if (data.ThroughputMode != null) {
2514
2151
  contents.ThroughputMode = (0, smithy_client_1.expectString)(data.ThroughputMode);
2515
2152
  }
2516
- return Promise.resolve(contents);
2153
+ return contents;
2517
2154
  };
2518
2155
  exports.deserializeAws_restJson1UpdateFileSystemCommand = deserializeAws_restJson1UpdateFileSystemCommand;
2519
2156
  const deserializeAws_restJson1UpdateFileSystemCommandError = async (output, context) => {
@@ -2521,7 +2158,6 @@ const deserializeAws_restJson1UpdateFileSystemCommandError = async (output, cont
2521
2158
  ...output,
2522
2159
  body: await parseBody(output.body, context),
2523
2160
  };
2524
- let response;
2525
2161
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2526
2162
  switch (errorCode) {
2527
2163
  case "BadRequest":
@@ -2547,26 +2183,25 @@ const deserializeAws_restJson1UpdateFileSystemCommandError = async (output, cont
2547
2183
  throw await deserializeAws_restJson1TooManyRequestsResponse(parsedOutput, context);
2548
2184
  default:
2549
2185
  const parsedBody = parsedOutput.body;
2550
- const $metadata = deserializeMetadata(output);
2551
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2552
- response = new EFSServiceException_1.EFSServiceException({
2553
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2554
- $fault: "client",
2555
- $metadata,
2186
+ (0, smithy_client_1.throwDefaultError)({
2187
+ output,
2188
+ parsedBody,
2189
+ exceptionCtor: EFSServiceException_1.EFSServiceException,
2190
+ errorCode,
2556
2191
  });
2557
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2558
2192
  }
2559
2193
  };
2194
+ const map = smithy_client_1.map;
2560
2195
  const deserializeAws_restJson1AccessPointAlreadyExistsResponse = async (parsedOutput, context) => {
2561
- const contents = {};
2196
+ const contents = map({});
2562
2197
  const data = parsedOutput.body;
2563
- if (data.AccessPointId !== undefined && data.AccessPointId !== null) {
2198
+ if (data.AccessPointId != null) {
2564
2199
  contents.AccessPointId = (0, smithy_client_1.expectString)(data.AccessPointId);
2565
2200
  }
2566
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
2201
+ if (data.ErrorCode != null) {
2567
2202
  contents.ErrorCode = (0, smithy_client_1.expectString)(data.ErrorCode);
2568
2203
  }
2569
- if (data.Message !== undefined && data.Message !== null) {
2204
+ if (data.Message != null) {
2570
2205
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2571
2206
  }
2572
2207
  const exception = new models_0_1.AccessPointAlreadyExists({
@@ -2576,12 +2211,12 @@ const deserializeAws_restJson1AccessPointAlreadyExistsResponse = async (parsedOu
2576
2211
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2577
2212
  };
2578
2213
  const deserializeAws_restJson1AccessPointLimitExceededResponse = async (parsedOutput, context) => {
2579
- const contents = {};
2214
+ const contents = map({});
2580
2215
  const data = parsedOutput.body;
2581
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
2216
+ if (data.ErrorCode != null) {
2582
2217
  contents.ErrorCode = (0, smithy_client_1.expectString)(data.ErrorCode);
2583
2218
  }
2584
- if (data.Message !== undefined && data.Message !== null) {
2219
+ if (data.Message != null) {
2585
2220
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2586
2221
  }
2587
2222
  const exception = new models_0_1.AccessPointLimitExceeded({
@@ -2591,12 +2226,12 @@ const deserializeAws_restJson1AccessPointLimitExceededResponse = async (parsedOu
2591
2226
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2592
2227
  };
2593
2228
  const deserializeAws_restJson1AccessPointNotFoundResponse = async (parsedOutput, context) => {
2594
- const contents = {};
2229
+ const contents = map({});
2595
2230
  const data = parsedOutput.body;
2596
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
2231
+ if (data.ErrorCode != null) {
2597
2232
  contents.ErrorCode = (0, smithy_client_1.expectString)(data.ErrorCode);
2598
2233
  }
2599
- if (data.Message !== undefined && data.Message !== null) {
2234
+ if (data.Message != null) {
2600
2235
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2601
2236
  }
2602
2237
  const exception = new models_0_1.AccessPointNotFound({
@@ -2606,12 +2241,12 @@ const deserializeAws_restJson1AccessPointNotFoundResponse = async (parsedOutput,
2606
2241
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2607
2242
  };
2608
2243
  const deserializeAws_restJson1AvailabilityZonesMismatchResponse = async (parsedOutput, context) => {
2609
- const contents = {};
2244
+ const contents = map({});
2610
2245
  const data = parsedOutput.body;
2611
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
2246
+ if (data.ErrorCode != null) {
2612
2247
  contents.ErrorCode = (0, smithy_client_1.expectString)(data.ErrorCode);
2613
2248
  }
2614
- if (data.Message !== undefined && data.Message !== null) {
2249
+ if (data.Message != null) {
2615
2250
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2616
2251
  }
2617
2252
  const exception = new models_0_1.AvailabilityZonesMismatch({
@@ -2621,12 +2256,12 @@ const deserializeAws_restJson1AvailabilityZonesMismatchResponse = async (parsedO
2621
2256
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2622
2257
  };
2623
2258
  const deserializeAws_restJson1BadRequestResponse = async (parsedOutput, context) => {
2624
- const contents = {};
2259
+ const contents = map({});
2625
2260
  const data = parsedOutput.body;
2626
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
2261
+ if (data.ErrorCode != null) {
2627
2262
  contents.ErrorCode = (0, smithy_client_1.expectString)(data.ErrorCode);
2628
2263
  }
2629
- if (data.Message !== undefined && data.Message !== null) {
2264
+ if (data.Message != null) {
2630
2265
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2631
2266
  }
2632
2267
  const exception = new models_0_1.BadRequest({
@@ -2636,12 +2271,12 @@ const deserializeAws_restJson1BadRequestResponse = async (parsedOutput, context)
2636
2271
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2637
2272
  };
2638
2273
  const deserializeAws_restJson1DependencyTimeoutResponse = async (parsedOutput, context) => {
2639
- const contents = {};
2274
+ const contents = map({});
2640
2275
  const data = parsedOutput.body;
2641
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
2276
+ if (data.ErrorCode != null) {
2642
2277
  contents.ErrorCode = (0, smithy_client_1.expectString)(data.ErrorCode);
2643
2278
  }
2644
- if (data.Message !== undefined && data.Message !== null) {
2279
+ if (data.Message != null) {
2645
2280
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2646
2281
  }
2647
2282
  const exception = new models_0_1.DependencyTimeout({
@@ -2651,15 +2286,15 @@ const deserializeAws_restJson1DependencyTimeoutResponse = async (parsedOutput, c
2651
2286
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2652
2287
  };
2653
2288
  const deserializeAws_restJson1FileSystemAlreadyExistsResponse = async (parsedOutput, context) => {
2654
- const contents = {};
2289
+ const contents = map({});
2655
2290
  const data = parsedOutput.body;
2656
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
2291
+ if (data.ErrorCode != null) {
2657
2292
  contents.ErrorCode = (0, smithy_client_1.expectString)(data.ErrorCode);
2658
2293
  }
2659
- if (data.FileSystemId !== undefined && data.FileSystemId !== null) {
2294
+ if (data.FileSystemId != null) {
2660
2295
  contents.FileSystemId = (0, smithy_client_1.expectString)(data.FileSystemId);
2661
2296
  }
2662
- if (data.Message !== undefined && data.Message !== null) {
2297
+ if (data.Message != null) {
2663
2298
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2664
2299
  }
2665
2300
  const exception = new models_0_1.FileSystemAlreadyExists({
@@ -2669,12 +2304,12 @@ const deserializeAws_restJson1FileSystemAlreadyExistsResponse = async (parsedOut
2669
2304
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2670
2305
  };
2671
2306
  const deserializeAws_restJson1FileSystemInUseResponse = async (parsedOutput, context) => {
2672
- const contents = {};
2307
+ const contents = map({});
2673
2308
  const data = parsedOutput.body;
2674
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
2309
+ if (data.ErrorCode != null) {
2675
2310
  contents.ErrorCode = (0, smithy_client_1.expectString)(data.ErrorCode);
2676
2311
  }
2677
- if (data.Message !== undefined && data.Message !== null) {
2312
+ if (data.Message != null) {
2678
2313
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2679
2314
  }
2680
2315
  const exception = new models_0_1.FileSystemInUse({
@@ -2684,12 +2319,12 @@ const deserializeAws_restJson1FileSystemInUseResponse = async (parsedOutput, con
2684
2319
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2685
2320
  };
2686
2321
  const deserializeAws_restJson1FileSystemLimitExceededResponse = async (parsedOutput, context) => {
2687
- const contents = {};
2322
+ const contents = map({});
2688
2323
  const data = parsedOutput.body;
2689
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
2324
+ if (data.ErrorCode != null) {
2690
2325
  contents.ErrorCode = (0, smithy_client_1.expectString)(data.ErrorCode);
2691
2326
  }
2692
- if (data.Message !== undefined && data.Message !== null) {
2327
+ if (data.Message != null) {
2693
2328
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2694
2329
  }
2695
2330
  const exception = new models_0_1.FileSystemLimitExceeded({
@@ -2699,12 +2334,12 @@ const deserializeAws_restJson1FileSystemLimitExceededResponse = async (parsedOut
2699
2334
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2700
2335
  };
2701
2336
  const deserializeAws_restJson1FileSystemNotFoundResponse = async (parsedOutput, context) => {
2702
- const contents = {};
2337
+ const contents = map({});
2703
2338
  const data = parsedOutput.body;
2704
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
2339
+ if (data.ErrorCode != null) {
2705
2340
  contents.ErrorCode = (0, smithy_client_1.expectString)(data.ErrorCode);
2706
2341
  }
2707
- if (data.Message !== undefined && data.Message !== null) {
2342
+ if (data.Message != null) {
2708
2343
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2709
2344
  }
2710
2345
  const exception = new models_0_1.FileSystemNotFound({
@@ -2714,12 +2349,12 @@ const deserializeAws_restJson1FileSystemNotFoundResponse = async (parsedOutput,
2714
2349
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2715
2350
  };
2716
2351
  const deserializeAws_restJson1IncorrectFileSystemLifeCycleStateResponse = async (parsedOutput, context) => {
2717
- const contents = {};
2352
+ const contents = map({});
2718
2353
  const data = parsedOutput.body;
2719
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
2354
+ if (data.ErrorCode != null) {
2720
2355
  contents.ErrorCode = (0, smithy_client_1.expectString)(data.ErrorCode);
2721
2356
  }
2722
- if (data.Message !== undefined && data.Message !== null) {
2357
+ if (data.Message != null) {
2723
2358
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2724
2359
  }
2725
2360
  const exception = new models_0_1.IncorrectFileSystemLifeCycleState({
@@ -2729,12 +2364,12 @@ const deserializeAws_restJson1IncorrectFileSystemLifeCycleStateResponse = async
2729
2364
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2730
2365
  };
2731
2366
  const deserializeAws_restJson1IncorrectMountTargetStateResponse = async (parsedOutput, context) => {
2732
- const contents = {};
2367
+ const contents = map({});
2733
2368
  const data = parsedOutput.body;
2734
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
2369
+ if (data.ErrorCode != null) {
2735
2370
  contents.ErrorCode = (0, smithy_client_1.expectString)(data.ErrorCode);
2736
2371
  }
2737
- if (data.Message !== undefined && data.Message !== null) {
2372
+ if (data.Message != null) {
2738
2373
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2739
2374
  }
2740
2375
  const exception = new models_0_1.IncorrectMountTargetState({
@@ -2744,12 +2379,12 @@ const deserializeAws_restJson1IncorrectMountTargetStateResponse = async (parsedO
2744
2379
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2745
2380
  };
2746
2381
  const deserializeAws_restJson1InsufficientThroughputCapacityResponse = async (parsedOutput, context) => {
2747
- const contents = {};
2382
+ const contents = map({});
2748
2383
  const data = parsedOutput.body;
2749
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
2384
+ if (data.ErrorCode != null) {
2750
2385
  contents.ErrorCode = (0, smithy_client_1.expectString)(data.ErrorCode);
2751
2386
  }
2752
- if (data.Message !== undefined && data.Message !== null) {
2387
+ if (data.Message != null) {
2753
2388
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2754
2389
  }
2755
2390
  const exception = new models_0_1.InsufficientThroughputCapacity({
@@ -2759,12 +2394,12 @@ const deserializeAws_restJson1InsufficientThroughputCapacityResponse = async (pa
2759
2394
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2760
2395
  };
2761
2396
  const deserializeAws_restJson1InternalServerErrorResponse = async (parsedOutput, context) => {
2762
- const contents = {};
2397
+ const contents = map({});
2763
2398
  const data = parsedOutput.body;
2764
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
2399
+ if (data.ErrorCode != null) {
2765
2400
  contents.ErrorCode = (0, smithy_client_1.expectString)(data.ErrorCode);
2766
2401
  }
2767
- if (data.Message !== undefined && data.Message !== null) {
2402
+ if (data.Message != null) {
2768
2403
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2769
2404
  }
2770
2405
  const exception = new models_0_1.InternalServerError({
@@ -2774,12 +2409,12 @@ const deserializeAws_restJson1InternalServerErrorResponse = async (parsedOutput,
2774
2409
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2775
2410
  };
2776
2411
  const deserializeAws_restJson1InvalidPolicyExceptionResponse = async (parsedOutput, context) => {
2777
- const contents = {};
2412
+ const contents = map({});
2778
2413
  const data = parsedOutput.body;
2779
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
2414
+ if (data.ErrorCode != null) {
2780
2415
  contents.ErrorCode = (0, smithy_client_1.expectString)(data.ErrorCode);
2781
2416
  }
2782
- if (data.Message !== undefined && data.Message !== null) {
2417
+ if (data.Message != null) {
2783
2418
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2784
2419
  }
2785
2420
  const exception = new models_0_1.InvalidPolicyException({
@@ -2789,12 +2424,12 @@ const deserializeAws_restJson1InvalidPolicyExceptionResponse = async (parsedOutp
2789
2424
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2790
2425
  };
2791
2426
  const deserializeAws_restJson1IpAddressInUseResponse = async (parsedOutput, context) => {
2792
- const contents = {};
2427
+ const contents = map({});
2793
2428
  const data = parsedOutput.body;
2794
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
2429
+ if (data.ErrorCode != null) {
2795
2430
  contents.ErrorCode = (0, smithy_client_1.expectString)(data.ErrorCode);
2796
2431
  }
2797
- if (data.Message !== undefined && data.Message !== null) {
2432
+ if (data.Message != null) {
2798
2433
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2799
2434
  }
2800
2435
  const exception = new models_0_1.IpAddressInUse({
@@ -2804,12 +2439,12 @@ const deserializeAws_restJson1IpAddressInUseResponse = async (parsedOutput, cont
2804
2439
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2805
2440
  };
2806
2441
  const deserializeAws_restJson1MountTargetConflictResponse = async (parsedOutput, context) => {
2807
- const contents = {};
2442
+ const contents = map({});
2808
2443
  const data = parsedOutput.body;
2809
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
2444
+ if (data.ErrorCode != null) {
2810
2445
  contents.ErrorCode = (0, smithy_client_1.expectString)(data.ErrorCode);
2811
2446
  }
2812
- if (data.Message !== undefined && data.Message !== null) {
2447
+ if (data.Message != null) {
2813
2448
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2814
2449
  }
2815
2450
  const exception = new models_0_1.MountTargetConflict({
@@ -2819,12 +2454,12 @@ const deserializeAws_restJson1MountTargetConflictResponse = async (parsedOutput,
2819
2454
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2820
2455
  };
2821
2456
  const deserializeAws_restJson1MountTargetNotFoundResponse = async (parsedOutput, context) => {
2822
- const contents = {};
2457
+ const contents = map({});
2823
2458
  const data = parsedOutput.body;
2824
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
2459
+ if (data.ErrorCode != null) {
2825
2460
  contents.ErrorCode = (0, smithy_client_1.expectString)(data.ErrorCode);
2826
2461
  }
2827
- if (data.Message !== undefined && data.Message !== null) {
2462
+ if (data.Message != null) {
2828
2463
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2829
2464
  }
2830
2465
  const exception = new models_0_1.MountTargetNotFound({
@@ -2834,12 +2469,12 @@ const deserializeAws_restJson1MountTargetNotFoundResponse = async (parsedOutput,
2834
2469
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2835
2470
  };
2836
2471
  const deserializeAws_restJson1NetworkInterfaceLimitExceededResponse = async (parsedOutput, context) => {
2837
- const contents = {};
2472
+ const contents = map({});
2838
2473
  const data = parsedOutput.body;
2839
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
2474
+ if (data.ErrorCode != null) {
2840
2475
  contents.ErrorCode = (0, smithy_client_1.expectString)(data.ErrorCode);
2841
2476
  }
2842
- if (data.Message !== undefined && data.Message !== null) {
2477
+ if (data.Message != null) {
2843
2478
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2844
2479
  }
2845
2480
  const exception = new models_0_1.NetworkInterfaceLimitExceeded({
@@ -2849,12 +2484,12 @@ const deserializeAws_restJson1NetworkInterfaceLimitExceededResponse = async (par
2849
2484
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2850
2485
  };
2851
2486
  const deserializeAws_restJson1NoFreeAddressesInSubnetResponse = async (parsedOutput, context) => {
2852
- const contents = {};
2487
+ const contents = map({});
2853
2488
  const data = parsedOutput.body;
2854
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
2489
+ if (data.ErrorCode != null) {
2855
2490
  contents.ErrorCode = (0, smithy_client_1.expectString)(data.ErrorCode);
2856
2491
  }
2857
- if (data.Message !== undefined && data.Message !== null) {
2492
+ if (data.Message != null) {
2858
2493
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2859
2494
  }
2860
2495
  const exception = new models_0_1.NoFreeAddressesInSubnet({
@@ -2864,12 +2499,12 @@ const deserializeAws_restJson1NoFreeAddressesInSubnetResponse = async (parsedOut
2864
2499
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2865
2500
  };
2866
2501
  const deserializeAws_restJson1PolicyNotFoundResponse = async (parsedOutput, context) => {
2867
- const contents = {};
2502
+ const contents = map({});
2868
2503
  const data = parsedOutput.body;
2869
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
2504
+ if (data.ErrorCode != null) {
2870
2505
  contents.ErrorCode = (0, smithy_client_1.expectString)(data.ErrorCode);
2871
2506
  }
2872
- if (data.Message !== undefined && data.Message !== null) {
2507
+ if (data.Message != null) {
2873
2508
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2874
2509
  }
2875
2510
  const exception = new models_0_1.PolicyNotFound({
@@ -2879,12 +2514,12 @@ const deserializeAws_restJson1PolicyNotFoundResponse = async (parsedOutput, cont
2879
2514
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2880
2515
  };
2881
2516
  const deserializeAws_restJson1ReplicationNotFoundResponse = async (parsedOutput, context) => {
2882
- const contents = {};
2517
+ const contents = map({});
2883
2518
  const data = parsedOutput.body;
2884
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
2519
+ if (data.ErrorCode != null) {
2885
2520
  contents.ErrorCode = (0, smithy_client_1.expectString)(data.ErrorCode);
2886
2521
  }
2887
- if (data.Message !== undefined && data.Message !== null) {
2522
+ if (data.Message != null) {
2888
2523
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2889
2524
  }
2890
2525
  const exception = new models_0_1.ReplicationNotFound({
@@ -2894,12 +2529,12 @@ const deserializeAws_restJson1ReplicationNotFoundResponse = async (parsedOutput,
2894
2529
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2895
2530
  };
2896
2531
  const deserializeAws_restJson1SecurityGroupLimitExceededResponse = async (parsedOutput, context) => {
2897
- const contents = {};
2532
+ const contents = map({});
2898
2533
  const data = parsedOutput.body;
2899
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
2534
+ if (data.ErrorCode != null) {
2900
2535
  contents.ErrorCode = (0, smithy_client_1.expectString)(data.ErrorCode);
2901
2536
  }
2902
- if (data.Message !== undefined && data.Message !== null) {
2537
+ if (data.Message != null) {
2903
2538
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2904
2539
  }
2905
2540
  const exception = new models_0_1.SecurityGroupLimitExceeded({
@@ -2909,12 +2544,12 @@ const deserializeAws_restJson1SecurityGroupLimitExceededResponse = async (parsed
2909
2544
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2910
2545
  };
2911
2546
  const deserializeAws_restJson1SecurityGroupNotFoundResponse = async (parsedOutput, context) => {
2912
- const contents = {};
2547
+ const contents = map({});
2913
2548
  const data = parsedOutput.body;
2914
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
2549
+ if (data.ErrorCode != null) {
2915
2550
  contents.ErrorCode = (0, smithy_client_1.expectString)(data.ErrorCode);
2916
2551
  }
2917
- if (data.Message !== undefined && data.Message !== null) {
2552
+ if (data.Message != null) {
2918
2553
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2919
2554
  }
2920
2555
  const exception = new models_0_1.SecurityGroupNotFound({
@@ -2924,12 +2559,12 @@ const deserializeAws_restJson1SecurityGroupNotFoundResponse = async (parsedOutpu
2924
2559
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2925
2560
  };
2926
2561
  const deserializeAws_restJson1SubnetNotFoundResponse = async (parsedOutput, context) => {
2927
- const contents = {};
2562
+ const contents = map({});
2928
2563
  const data = parsedOutput.body;
2929
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
2564
+ if (data.ErrorCode != null) {
2930
2565
  contents.ErrorCode = (0, smithy_client_1.expectString)(data.ErrorCode);
2931
2566
  }
2932
- if (data.Message !== undefined && data.Message !== null) {
2567
+ if (data.Message != null) {
2933
2568
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2934
2569
  }
2935
2570
  const exception = new models_0_1.SubnetNotFound({
@@ -2939,12 +2574,12 @@ const deserializeAws_restJson1SubnetNotFoundResponse = async (parsedOutput, cont
2939
2574
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2940
2575
  };
2941
2576
  const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
2942
- const contents = {};
2577
+ const contents = map({});
2943
2578
  const data = parsedOutput.body;
2944
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
2579
+ if (data.ErrorCode != null) {
2945
2580
  contents.ErrorCode = (0, smithy_client_1.expectString)(data.ErrorCode);
2946
2581
  }
2947
- if (data.Message !== undefined && data.Message !== null) {
2582
+ if (data.Message != null) {
2948
2583
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2949
2584
  }
2950
2585
  const exception = new models_0_1.ThrottlingException({
@@ -2954,12 +2589,12 @@ const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput,
2954
2589
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2955
2590
  };
2956
2591
  const deserializeAws_restJson1ThroughputLimitExceededResponse = async (parsedOutput, context) => {
2957
- const contents = {};
2592
+ const contents = map({});
2958
2593
  const data = parsedOutput.body;
2959
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
2594
+ if (data.ErrorCode != null) {
2960
2595
  contents.ErrorCode = (0, smithy_client_1.expectString)(data.ErrorCode);
2961
2596
  }
2962
- if (data.Message !== undefined && data.Message !== null) {
2597
+ if (data.Message != null) {
2963
2598
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2964
2599
  }
2965
2600
  const exception = new models_0_1.ThroughputLimitExceeded({
@@ -2969,12 +2604,12 @@ const deserializeAws_restJson1ThroughputLimitExceededResponse = async (parsedOut
2969
2604
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2970
2605
  };
2971
2606
  const deserializeAws_restJson1TooManyRequestsResponse = async (parsedOutput, context) => {
2972
- const contents = {};
2607
+ const contents = map({});
2973
2608
  const data = parsedOutput.body;
2974
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
2609
+ if (data.ErrorCode != null) {
2975
2610
  contents.ErrorCode = (0, smithy_client_1.expectString)(data.ErrorCode);
2976
2611
  }
2977
- if (data.Message !== undefined && data.Message !== null) {
2612
+ if (data.Message != null) {
2978
2613
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2979
2614
  }
2980
2615
  const exception = new models_0_1.TooManyRequests({
@@ -2984,12 +2619,12 @@ const deserializeAws_restJson1TooManyRequestsResponse = async (parsedOutput, con
2984
2619
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2985
2620
  };
2986
2621
  const deserializeAws_restJson1UnsupportedAvailabilityZoneResponse = async (parsedOutput, context) => {
2987
- const contents = {};
2622
+ const contents = map({});
2988
2623
  const data = parsedOutput.body;
2989
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
2624
+ if (data.ErrorCode != null) {
2990
2625
  contents.ErrorCode = (0, smithy_client_1.expectString)(data.ErrorCode);
2991
2626
  }
2992
- if (data.Message !== undefined && data.Message !== null) {
2627
+ if (data.Message != null) {
2993
2628
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
2994
2629
  }
2995
2630
  const exception = new models_0_1.UnsupportedAvailabilityZone({
@@ -2999,12 +2634,12 @@ const deserializeAws_restJson1UnsupportedAvailabilityZoneResponse = async (parse
2999
2634
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
3000
2635
  };
3001
2636
  const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
3002
- const contents = {};
2637
+ const contents = map({});
3003
2638
  const data = parsedOutput.body;
3004
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
2639
+ if (data.ErrorCode != null) {
3005
2640
  contents.ErrorCode = (0, smithy_client_1.expectString)(data.ErrorCode);
3006
2641
  }
3007
- if (data.Message !== undefined && data.Message !== null) {
2642
+ if (data.Message != null) {
3008
2643
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
3009
2644
  }
3010
2645
  const exception = new models_0_1.ValidationException({
@@ -3029,9 +2664,6 @@ const serializeAws_restJson1DestinationsToCreate = (input, context) => {
3029
2664
  return input
3030
2665
  .filter((e) => e != null)
3031
2666
  .map((entry) => {
3032
- if (entry === null) {
3033
- return null;
3034
- }
3035
2667
  return serializeAws_restJson1DestinationToCreate(entry, context);
3036
2668
  });
3037
2669
  };
@@ -3046,9 +2678,6 @@ const serializeAws_restJson1LifecyclePolicies = (input, context) => {
3046
2678
  return input
3047
2679
  .filter((e) => e != null)
3048
2680
  .map((entry) => {
3049
- if (entry === null) {
3050
- return null;
3051
- }
3052
2681
  return serializeAws_restJson1LifecyclePolicy(entry, context);
3053
2682
  });
3054
2683
  };
@@ -3081,9 +2710,6 @@ const serializeAws_restJson1SecondaryGids = (input, context) => {
3081
2710
  return input
3082
2711
  .filter((e) => e != null)
3083
2712
  .map((entry) => {
3084
- if (entry === null) {
3085
- return null;
3086
- }
3087
2713
  return entry;
3088
2714
  });
3089
2715
  };
@@ -3091,9 +2717,6 @@ const serializeAws_restJson1SecurityGroups = (input, context) => {
3091
2717
  return input
3092
2718
  .filter((e) => e != null)
3093
2719
  .map((entry) => {
3094
- if (entry === null) {
3095
- return null;
3096
- }
3097
2720
  return entry;
3098
2721
  });
3099
2722
  };
@@ -3107,9 +2730,6 @@ const serializeAws_restJson1TagKeys = (input, context) => {
3107
2730
  return input
3108
2731
  .filter((e) => e != null)
3109
2732
  .map((entry) => {
3110
- if (entry === null) {
3111
- return null;
3112
- }
3113
2733
  return entry;
3114
2734
  });
3115
2735
  };
@@ -3117,9 +2737,6 @@ const serializeAws_restJson1Tags = (input, context) => {
3117
2737
  return input
3118
2738
  .filter((e) => e != null)
3119
2739
  .map((entry) => {
3120
- if (entry === null) {
3121
- return null;
3122
- }
3123
2740
  return serializeAws_restJson1Tag(entry, context);
3124
2741
  });
3125
2742
  };