@aws-sdk/client-location 3.276.0 → 3.278.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/dist-cjs/Location.js +75 -0
  2. package/dist-cjs/commands/CreateKeyCommand.js +46 -0
  3. package/dist-cjs/commands/DeleteKeyCommand.js +46 -0
  4. package/dist-cjs/commands/DescribeKeyCommand.js +46 -0
  5. package/dist-cjs/commands/ListKeysCommand.js +46 -0
  6. package/dist-cjs/commands/UpdateKeyCommand.js +46 -0
  7. package/dist-cjs/commands/index.js +5 -0
  8. package/dist-cjs/endpoint/ruleset.js +3 -3
  9. package/dist-cjs/models/models_0.js +80 -22
  10. package/dist-cjs/pagination/ListKeysPaginator.js +36 -0
  11. package/dist-cjs/pagination/index.js +1 -0
  12. package/dist-cjs/protocols/Aws_restJson1.js +544 -3
  13. package/dist-es/Location.js +75 -0
  14. package/dist-es/commands/CreateKeyCommand.js +42 -0
  15. package/dist-es/commands/DeleteKeyCommand.js +42 -0
  16. package/dist-es/commands/DescribeKeyCommand.js +42 -0
  17. package/dist-es/commands/ListKeysCommand.js +42 -0
  18. package/dist-es/commands/UpdateKeyCommand.js +42 -0
  19. package/dist-es/commands/index.js +5 -0
  20. package/dist-es/endpoint/ruleset.js +3 -3
  21. package/dist-es/models/models_0.js +60 -15
  22. package/dist-es/pagination/ListKeysPaginator.js +32 -0
  23. package/dist-es/pagination/index.js +1 -0
  24. package/dist-es/protocols/Aws_restJson1.js +531 -0
  25. package/dist-types/Location.d.ts +82 -24
  26. package/dist-types/LocationClient.d.ts +7 -2
  27. package/dist-types/commands/CreateKeyCommand.d.ts +44 -0
  28. package/dist-types/commands/CreateMapCommand.d.ts +2 -2
  29. package/dist-types/commands/CreatePlaceIndexCommand.d.ts +2 -2
  30. package/dist-types/commands/CreateRouteCalculatorCommand.d.ts +2 -2
  31. package/dist-types/commands/CreateTrackerCommand.d.ts +1 -1
  32. package/dist-types/commands/DeleteGeofenceCollectionCommand.d.ts +1 -1
  33. package/dist-types/commands/DeleteKeyCommand.d.ts +38 -0
  34. package/dist-types/commands/DeleteMapCommand.d.ts +1 -1
  35. package/dist-types/commands/DeletePlaceIndexCommand.d.ts +1 -1
  36. package/dist-types/commands/DeleteRouteCalculatorCommand.d.ts +1 -1
  37. package/dist-types/commands/DeleteTrackerCommand.d.ts +1 -1
  38. package/dist-types/commands/DescribeKeyCommand.d.ts +42 -0
  39. package/dist-types/commands/GetPlaceCommand.d.ts +2 -2
  40. package/dist-types/commands/ListGeofenceCollectionsCommand.d.ts +1 -1
  41. package/dist-types/commands/ListKeysCommand.d.ts +42 -0
  42. package/dist-types/commands/ListMapsCommand.d.ts +1 -1
  43. package/dist-types/commands/ListPlaceIndexesCommand.d.ts +1 -1
  44. package/dist-types/commands/ListRouteCalculatorsCommand.d.ts +1 -1
  45. package/dist-types/commands/ListTrackersCommand.d.ts +1 -1
  46. package/dist-types/commands/TagResourceCommand.d.ts +5 -5
  47. package/dist-types/commands/UpdateKeyCommand.d.ts +42 -0
  48. package/dist-types/commands/index.d.ts +5 -0
  49. package/dist-types/endpoint/EndpointParameters.d.ts +1 -1
  50. package/dist-types/models/models_0.d.ts +548 -67
  51. package/dist-types/pagination/ListKeysPaginator.d.ts +4 -0
  52. package/dist-types/pagination/index.d.ts +1 -0
  53. package/dist-types/protocols/Aws_restJson1.d.ts +15 -0
  54. package/dist-types/ts3.4/Location.d.ts +85 -0
  55. package/dist-types/ts3.4/LocationClient.d.ts +30 -0
  56. package/dist-types/ts3.4/commands/CreateKeyCommand.d.ts +34 -0
  57. package/dist-types/ts3.4/commands/DeleteKeyCommand.d.ts +34 -0
  58. package/dist-types/ts3.4/commands/DescribeKeyCommand.d.ts +34 -0
  59. package/dist-types/ts3.4/commands/ListKeysCommand.d.ts +34 -0
  60. package/dist-types/ts3.4/commands/UpdateKeyCommand.d.ts +34 -0
  61. package/dist-types/ts3.4/commands/index.d.ts +5 -0
  62. package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +1 -1
  63. package/dist-types/ts3.4/models/models_0.d.ts +131 -15
  64. package/dist-types/ts3.4/pagination/ListKeysPaginator.d.ts +11 -0
  65. package/dist-types/ts3.4/pagination/index.d.ts +1 -0
  66. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +60 -0
  67. package/package.json +4 -4
@@ -333,6 +333,40 @@ export const serializeAws_restJson1CreateGeofenceCollectionCommand = async (inpu
333
333
  body,
334
334
  });
335
335
  };
336
+ export const serializeAws_restJson1CreateKeyCommand = async (input, context) => {
337
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
338
+ const headers = {
339
+ "content-type": "application/json",
340
+ };
341
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/metadata/v0/keys";
342
+ let body;
343
+ body = JSON.stringify({
344
+ ...(input.Description != null && { Description: input.Description }),
345
+ ...(input.ExpireTime != null && { ExpireTime: input.ExpireTime.toISOString().split(".")[0] + "Z" }),
346
+ ...(input.KeyName != null && { KeyName: input.KeyName }),
347
+ ...(input.NoExpiry != null && { NoExpiry: input.NoExpiry }),
348
+ ...(input.Restrictions != null && {
349
+ Restrictions: serializeAws_restJson1ApiKeyRestrictions(input.Restrictions, context),
350
+ }),
351
+ ...(input.Tags != null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }),
352
+ });
353
+ let { hostname: resolvedHostname } = await context.endpoint();
354
+ if (context.disableHostPrefix !== true) {
355
+ resolvedHostname = "metadata." + resolvedHostname;
356
+ if (!__isValidHostname(resolvedHostname)) {
357
+ throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
358
+ }
359
+ }
360
+ return new __HttpRequest({
361
+ protocol,
362
+ hostname: resolvedHostname,
363
+ port,
364
+ method: "POST",
365
+ headers,
366
+ path: resolvedPath,
367
+ body,
368
+ });
369
+ };
336
370
  export const serializeAws_restJson1CreateMapCommand = async (input, context) => {
337
371
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
338
372
  const headers = {
@@ -488,6 +522,29 @@ export const serializeAws_restJson1DeleteGeofenceCollectionCommand = async (inpu
488
522
  body,
489
523
  });
490
524
  };
525
+ export const serializeAws_restJson1DeleteKeyCommand = async (input, context) => {
526
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
527
+ const headers = {};
528
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/metadata/v0/keys/{KeyName}";
529
+ resolvedPath = __resolvedPath(resolvedPath, input, "KeyName", () => input.KeyName, "{KeyName}", false);
530
+ let body;
531
+ let { hostname: resolvedHostname } = await context.endpoint();
532
+ if (context.disableHostPrefix !== true) {
533
+ resolvedHostname = "metadata." + resolvedHostname;
534
+ if (!__isValidHostname(resolvedHostname)) {
535
+ throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
536
+ }
537
+ }
538
+ return new __HttpRequest({
539
+ protocol,
540
+ hostname: resolvedHostname,
541
+ port,
542
+ method: "DELETE",
543
+ headers,
544
+ path: resolvedPath,
545
+ body,
546
+ });
547
+ };
491
548
  export const serializeAws_restJson1DeleteMapCommand = async (input, context) => {
492
549
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
493
550
  const headers = {};
@@ -604,6 +661,29 @@ export const serializeAws_restJson1DescribeGeofenceCollectionCommand = async (in
604
661
  body,
605
662
  });
606
663
  };
664
+ export const serializeAws_restJson1DescribeKeyCommand = async (input, context) => {
665
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
666
+ const headers = {};
667
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/metadata/v0/keys/{KeyName}";
668
+ resolvedPath = __resolvedPath(resolvedPath, input, "KeyName", () => input.KeyName, "{KeyName}", false);
669
+ let body;
670
+ let { hostname: resolvedHostname } = await context.endpoint();
671
+ if (context.disableHostPrefix !== true) {
672
+ resolvedHostname = "metadata." + resolvedHostname;
673
+ if (!__isValidHostname(resolvedHostname)) {
674
+ throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
675
+ }
676
+ }
677
+ return new __HttpRequest({
678
+ protocol,
679
+ hostname: resolvedHostname,
680
+ port,
681
+ method: "GET",
682
+ headers,
683
+ path: resolvedPath,
684
+ body,
685
+ });
686
+ };
607
687
  export const serializeAws_restJson1DescribeMapCommand = async (input, context) => {
608
688
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
609
689
  const headers = {};
@@ -816,6 +896,9 @@ export const serializeAws_restJson1GetMapGlyphsCommand = async (input, context)
816
896
  resolvedPath = __resolvedPath(resolvedPath, input, "MapName", () => input.MapName, "{MapName}", false);
817
897
  resolvedPath = __resolvedPath(resolvedPath, input, "FontStack", () => input.FontStack, "{FontStack}", false);
818
898
  resolvedPath = __resolvedPath(resolvedPath, input, "FontUnicodeRange", () => input.FontUnicodeRange, "{FontUnicodeRange}", false);
899
+ const query = map({
900
+ key: [, input.Key],
901
+ });
819
902
  let body;
820
903
  let { hostname: resolvedHostname } = await context.endpoint();
821
904
  if (context.disableHostPrefix !== true) {
@@ -831,6 +914,7 @@ export const serializeAws_restJson1GetMapGlyphsCommand = async (input, context)
831
914
  method: "GET",
832
915
  headers,
833
916
  path: resolvedPath,
917
+ query,
834
918
  body,
835
919
  });
836
920
  };
@@ -841,6 +925,9 @@ export const serializeAws_restJson1GetMapSpritesCommand = async (input, context)
841
925
  "/maps/v0/maps/{MapName}/sprites/{FileName}";
842
926
  resolvedPath = __resolvedPath(resolvedPath, input, "MapName", () => input.MapName, "{MapName}", false);
843
927
  resolvedPath = __resolvedPath(resolvedPath, input, "FileName", () => input.FileName, "{FileName}", false);
928
+ const query = map({
929
+ key: [, input.Key],
930
+ });
844
931
  let body;
845
932
  let { hostname: resolvedHostname } = await context.endpoint();
846
933
  if (context.disableHostPrefix !== true) {
@@ -856,6 +943,7 @@ export const serializeAws_restJson1GetMapSpritesCommand = async (input, context)
856
943
  method: "GET",
857
944
  headers,
858
945
  path: resolvedPath,
946
+ query,
859
947
  body,
860
948
  });
861
949
  };
@@ -864,6 +952,9 @@ export const serializeAws_restJson1GetMapStyleDescriptorCommand = async (input,
864
952
  const headers = {};
865
953
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/maps/v0/maps/{MapName}/style-descriptor";
866
954
  resolvedPath = __resolvedPath(resolvedPath, input, "MapName", () => input.MapName, "{MapName}", false);
955
+ const query = map({
956
+ key: [, input.Key],
957
+ });
867
958
  let body;
868
959
  let { hostname: resolvedHostname } = await context.endpoint();
869
960
  if (context.disableHostPrefix !== true) {
@@ -879,6 +970,7 @@ export const serializeAws_restJson1GetMapStyleDescriptorCommand = async (input,
879
970
  method: "GET",
880
971
  headers,
881
972
  path: resolvedPath,
973
+ query,
882
974
  body,
883
975
  });
884
976
  };
@@ -890,6 +982,9 @@ export const serializeAws_restJson1GetMapTileCommand = async (input, context) =>
890
982
  resolvedPath = __resolvedPath(resolvedPath, input, "Z", () => input.Z, "{Z}", false);
891
983
  resolvedPath = __resolvedPath(resolvedPath, input, "X", () => input.X, "{X}", false);
892
984
  resolvedPath = __resolvedPath(resolvedPath, input, "Y", () => input.Y, "{Y}", false);
985
+ const query = map({
986
+ key: [, input.Key],
987
+ });
893
988
  let body;
894
989
  let { hostname: resolvedHostname } = await context.endpoint();
895
990
  if (context.disableHostPrefix !== true) {
@@ -905,6 +1000,7 @@ export const serializeAws_restJson1GetMapTileCommand = async (input, context) =>
905
1000
  method: "GET",
906
1001
  headers,
907
1002
  path: resolvedPath,
1003
+ query,
908
1004
  body,
909
1005
  });
910
1006
  };
@@ -1025,6 +1121,35 @@ export const serializeAws_restJson1ListGeofencesCommand = async (input, context)
1025
1121
  body,
1026
1122
  });
1027
1123
  };
1124
+ export const serializeAws_restJson1ListKeysCommand = async (input, context) => {
1125
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1126
+ const headers = {
1127
+ "content-type": "application/json",
1128
+ };
1129
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/metadata/v0/list-keys";
1130
+ let body;
1131
+ body = JSON.stringify({
1132
+ ...(input.Filter != null && { Filter: serializeAws_restJson1ApiKeyFilter(input.Filter, context) }),
1133
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
1134
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
1135
+ });
1136
+ let { hostname: resolvedHostname } = await context.endpoint();
1137
+ if (context.disableHostPrefix !== true) {
1138
+ resolvedHostname = "metadata." + resolvedHostname;
1139
+ if (!__isValidHostname(resolvedHostname)) {
1140
+ throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
1141
+ }
1142
+ }
1143
+ return new __HttpRequest({
1144
+ protocol,
1145
+ hostname: resolvedHostname,
1146
+ port,
1147
+ method: "POST",
1148
+ headers,
1149
+ path: resolvedPath,
1150
+ body,
1151
+ });
1152
+ };
1028
1153
  export const serializeAws_restJson1ListMapsCommand = async (input, context) => {
1029
1154
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1030
1155
  const headers = {
@@ -1412,6 +1537,40 @@ export const serializeAws_restJson1UpdateGeofenceCollectionCommand = async (inpu
1412
1537
  body,
1413
1538
  });
1414
1539
  };
1540
+ export const serializeAws_restJson1UpdateKeyCommand = async (input, context) => {
1541
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1542
+ const headers = {
1543
+ "content-type": "application/json",
1544
+ };
1545
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/metadata/v0/keys/{KeyName}";
1546
+ resolvedPath = __resolvedPath(resolvedPath, input, "KeyName", () => input.KeyName, "{KeyName}", false);
1547
+ let body;
1548
+ body = JSON.stringify({
1549
+ ...(input.Description != null && { Description: input.Description }),
1550
+ ...(input.ExpireTime != null && { ExpireTime: input.ExpireTime.toISOString().split(".")[0] + "Z" }),
1551
+ ...(input.ForceUpdate != null && { ForceUpdate: input.ForceUpdate }),
1552
+ ...(input.NoExpiry != null && { NoExpiry: input.NoExpiry }),
1553
+ ...(input.Restrictions != null && {
1554
+ Restrictions: serializeAws_restJson1ApiKeyRestrictions(input.Restrictions, context),
1555
+ }),
1556
+ });
1557
+ let { hostname: resolvedHostname } = await context.endpoint();
1558
+ if (context.disableHostPrefix !== true) {
1559
+ resolvedHostname = "metadata." + resolvedHostname;
1560
+ if (!__isValidHostname(resolvedHostname)) {
1561
+ throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
1562
+ }
1563
+ }
1564
+ return new __HttpRequest({
1565
+ protocol,
1566
+ hostname: resolvedHostname,
1567
+ port,
1568
+ method: "PATCH",
1569
+ headers,
1570
+ path: resolvedPath,
1571
+ body,
1572
+ });
1573
+ };
1415
1574
  export const serializeAws_restJson1UpdateMapCommand = async (input, context) => {
1416
1575
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1417
1576
  const headers = {
@@ -2013,6 +2172,63 @@ const deserializeAws_restJson1CreateGeofenceCollectionCommandError = async (outp
2013
2172
  });
2014
2173
  }
2015
2174
  };
2175
+ export const deserializeAws_restJson1CreateKeyCommand = async (output, context) => {
2176
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2177
+ return deserializeAws_restJson1CreateKeyCommandError(output, context);
2178
+ }
2179
+ const contents = map({
2180
+ $metadata: deserializeMetadata(output),
2181
+ });
2182
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2183
+ if (data.CreateTime != null) {
2184
+ contents.CreateTime = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.CreateTime));
2185
+ }
2186
+ if (data.Key != null) {
2187
+ contents.Key = __expectString(data.Key);
2188
+ }
2189
+ if (data.KeyArn != null) {
2190
+ contents.KeyArn = __expectString(data.KeyArn);
2191
+ }
2192
+ if (data.KeyName != null) {
2193
+ contents.KeyName = __expectString(data.KeyName);
2194
+ }
2195
+ return contents;
2196
+ };
2197
+ const deserializeAws_restJson1CreateKeyCommandError = async (output, context) => {
2198
+ const parsedOutput = {
2199
+ ...output,
2200
+ body: await parseErrorBody(output.body, context),
2201
+ };
2202
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2203
+ switch (errorCode) {
2204
+ case "AccessDeniedException":
2205
+ case "com.amazonaws.location#AccessDeniedException":
2206
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2207
+ case "ConflictException":
2208
+ case "com.amazonaws.location#ConflictException":
2209
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
2210
+ case "InternalServerException":
2211
+ case "com.amazonaws.location#InternalServerException":
2212
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2213
+ case "ServiceQuotaExceededException":
2214
+ case "com.amazonaws.location#ServiceQuotaExceededException":
2215
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
2216
+ case "ThrottlingException":
2217
+ case "com.amazonaws.location#ThrottlingException":
2218
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2219
+ case "ValidationException":
2220
+ case "com.amazonaws.location#ValidationException":
2221
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2222
+ default:
2223
+ const parsedBody = parsedOutput.body;
2224
+ throwDefaultError({
2225
+ output,
2226
+ parsedBody,
2227
+ exceptionCtor: __BaseException,
2228
+ errorCode,
2229
+ });
2230
+ }
2231
+ };
2016
2232
  export const deserializeAws_restJson1CreateMapCommand = async (output, context) => {
2017
2233
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2018
2234
  return deserializeAws_restJson1CreateMapCommandError(output, context);
@@ -2268,6 +2484,48 @@ const deserializeAws_restJson1DeleteGeofenceCollectionCommandError = async (outp
2268
2484
  });
2269
2485
  }
2270
2486
  };
2487
+ export const deserializeAws_restJson1DeleteKeyCommand = async (output, context) => {
2488
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2489
+ return deserializeAws_restJson1DeleteKeyCommandError(output, context);
2490
+ }
2491
+ const contents = map({
2492
+ $metadata: deserializeMetadata(output),
2493
+ });
2494
+ await collectBody(output.body, context);
2495
+ return contents;
2496
+ };
2497
+ const deserializeAws_restJson1DeleteKeyCommandError = async (output, context) => {
2498
+ const parsedOutput = {
2499
+ ...output,
2500
+ body: await parseErrorBody(output.body, context),
2501
+ };
2502
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2503
+ switch (errorCode) {
2504
+ case "AccessDeniedException":
2505
+ case "com.amazonaws.location#AccessDeniedException":
2506
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2507
+ case "InternalServerException":
2508
+ case "com.amazonaws.location#InternalServerException":
2509
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2510
+ case "ResourceNotFoundException":
2511
+ case "com.amazonaws.location#ResourceNotFoundException":
2512
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2513
+ case "ThrottlingException":
2514
+ case "com.amazonaws.location#ThrottlingException":
2515
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2516
+ case "ValidationException":
2517
+ case "com.amazonaws.location#ValidationException":
2518
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2519
+ default:
2520
+ const parsedBody = parsedOutput.body;
2521
+ throwDefaultError({
2522
+ output,
2523
+ parsedBody,
2524
+ exceptionCtor: __BaseException,
2525
+ errorCode,
2526
+ });
2527
+ }
2528
+ };
2271
2529
  export const deserializeAws_restJson1DeleteMapCommand = async (output, context) => {
2272
2530
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2273
2531
  return deserializeAws_restJson1DeleteMapCommandError(output, context);
@@ -2505,6 +2763,75 @@ const deserializeAws_restJson1DescribeGeofenceCollectionCommandError = async (ou
2505
2763
  });
2506
2764
  }
2507
2765
  };
2766
+ export const deserializeAws_restJson1DescribeKeyCommand = async (output, context) => {
2767
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2768
+ return deserializeAws_restJson1DescribeKeyCommandError(output, context);
2769
+ }
2770
+ const contents = map({
2771
+ $metadata: deserializeMetadata(output),
2772
+ });
2773
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2774
+ if (data.CreateTime != null) {
2775
+ contents.CreateTime = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.CreateTime));
2776
+ }
2777
+ if (data.Description != null) {
2778
+ contents.Description = __expectString(data.Description);
2779
+ }
2780
+ if (data.ExpireTime != null) {
2781
+ contents.ExpireTime = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.ExpireTime));
2782
+ }
2783
+ if (data.Key != null) {
2784
+ contents.Key = __expectString(data.Key);
2785
+ }
2786
+ if (data.KeyArn != null) {
2787
+ contents.KeyArn = __expectString(data.KeyArn);
2788
+ }
2789
+ if (data.KeyName != null) {
2790
+ contents.KeyName = __expectString(data.KeyName);
2791
+ }
2792
+ if (data.Restrictions != null) {
2793
+ contents.Restrictions = deserializeAws_restJson1ApiKeyRestrictions(data.Restrictions, context);
2794
+ }
2795
+ if (data.Tags != null) {
2796
+ contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
2797
+ }
2798
+ if (data.UpdateTime != null) {
2799
+ contents.UpdateTime = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.UpdateTime));
2800
+ }
2801
+ return contents;
2802
+ };
2803
+ const deserializeAws_restJson1DescribeKeyCommandError = async (output, context) => {
2804
+ const parsedOutput = {
2805
+ ...output,
2806
+ body: await parseErrorBody(output.body, context),
2807
+ };
2808
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2809
+ switch (errorCode) {
2810
+ case "AccessDeniedException":
2811
+ case "com.amazonaws.location#AccessDeniedException":
2812
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2813
+ case "InternalServerException":
2814
+ case "com.amazonaws.location#InternalServerException":
2815
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2816
+ case "ResourceNotFoundException":
2817
+ case "com.amazonaws.location#ResourceNotFoundException":
2818
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2819
+ case "ThrottlingException":
2820
+ case "com.amazonaws.location#ThrottlingException":
2821
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2822
+ case "ValidationException":
2823
+ case "com.amazonaws.location#ValidationException":
2824
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2825
+ default:
2826
+ const parsedBody = parsedOutput.body;
2827
+ throwDefaultError({
2828
+ output,
2829
+ parsedBody,
2830
+ exceptionCtor: __BaseException,
2831
+ errorCode,
2832
+ });
2833
+ }
2834
+ };
2508
2835
  export const deserializeAws_restJson1DescribeMapCommand = async (output, context) => {
2509
2836
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2510
2837
  return deserializeAws_restJson1DescribeMapCommandError(output, context);
@@ -2995,6 +3322,7 @@ export const deserializeAws_restJson1GetMapGlyphsCommand = async (output, contex
2995
3322
  const contents = map({
2996
3323
  $metadata: deserializeMetadata(output),
2997
3324
  ContentType: [, output.headers["content-type"]],
3325
+ CacheControl: [, output.headers["cache-control"]],
2998
3326
  });
2999
3327
  const data = await collectBody(output.body, context);
3000
3328
  contents.Blob = data;
@@ -3039,6 +3367,7 @@ export const deserializeAws_restJson1GetMapSpritesCommand = async (output, conte
3039
3367
  const contents = map({
3040
3368
  $metadata: deserializeMetadata(output),
3041
3369
  ContentType: [, output.headers["content-type"]],
3370
+ CacheControl: [, output.headers["cache-control"]],
3042
3371
  });
3043
3372
  const data = await collectBody(output.body, context);
3044
3373
  contents.Blob = data;
@@ -3083,6 +3412,7 @@ export const deserializeAws_restJson1GetMapStyleDescriptorCommand = async (outpu
3083
3412
  const contents = map({
3084
3413
  $metadata: deserializeMetadata(output),
3085
3414
  ContentType: [, output.headers["content-type"]],
3415
+ CacheControl: [, output.headers["cache-control"]],
3086
3416
  });
3087
3417
  const data = await collectBody(output.body, context);
3088
3418
  contents.Blob = data;
@@ -3127,6 +3457,7 @@ export const deserializeAws_restJson1GetMapTileCommand = async (output, context)
3127
3457
  const contents = map({
3128
3458
  $metadata: deserializeMetadata(output),
3129
3459
  ContentType: [, output.headers["content-type"]],
3460
+ CacheControl: [, output.headers["cache-control"]],
3130
3461
  });
3131
3462
  const data = await collectBody(output.body, context);
3132
3463
  contents.Blob = data;
@@ -3347,6 +3678,51 @@ const deserializeAws_restJson1ListGeofencesCommandError = async (output, context
3347
3678
  });
3348
3679
  }
3349
3680
  };
3681
+ export const deserializeAws_restJson1ListKeysCommand = async (output, context) => {
3682
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
3683
+ return deserializeAws_restJson1ListKeysCommandError(output, context);
3684
+ }
3685
+ const contents = map({
3686
+ $metadata: deserializeMetadata(output),
3687
+ });
3688
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
3689
+ if (data.Entries != null) {
3690
+ contents.Entries = deserializeAws_restJson1ListKeysResponseEntryList(data.Entries, context);
3691
+ }
3692
+ if (data.NextToken != null) {
3693
+ contents.NextToken = __expectString(data.NextToken);
3694
+ }
3695
+ return contents;
3696
+ };
3697
+ const deserializeAws_restJson1ListKeysCommandError = async (output, context) => {
3698
+ const parsedOutput = {
3699
+ ...output,
3700
+ body: await parseErrorBody(output.body, context),
3701
+ };
3702
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3703
+ switch (errorCode) {
3704
+ case "AccessDeniedException":
3705
+ case "com.amazonaws.location#AccessDeniedException":
3706
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3707
+ case "InternalServerException":
3708
+ case "com.amazonaws.location#InternalServerException":
3709
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3710
+ case "ThrottlingException":
3711
+ case "com.amazonaws.location#ThrottlingException":
3712
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
3713
+ case "ValidationException":
3714
+ case "com.amazonaws.location#ValidationException":
3715
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3716
+ default:
3717
+ const parsedBody = parsedOutput.body;
3718
+ throwDefaultError({
3719
+ output,
3720
+ parsedBody,
3721
+ exceptionCtor: __BaseException,
3722
+ errorCode,
3723
+ });
3724
+ }
3725
+ };
3350
3726
  export const deserializeAws_restJson1ListMapsCommand = async (output, context) => {
3351
3727
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3352
3728
  return deserializeAws_restJson1ListMapsCommandError(output, context);
@@ -3953,6 +4329,57 @@ const deserializeAws_restJson1UpdateGeofenceCollectionCommandError = async (outp
3953
4329
  });
3954
4330
  }
3955
4331
  };
4332
+ export const deserializeAws_restJson1UpdateKeyCommand = async (output, context) => {
4333
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
4334
+ return deserializeAws_restJson1UpdateKeyCommandError(output, context);
4335
+ }
4336
+ const contents = map({
4337
+ $metadata: deserializeMetadata(output),
4338
+ });
4339
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
4340
+ if (data.KeyArn != null) {
4341
+ contents.KeyArn = __expectString(data.KeyArn);
4342
+ }
4343
+ if (data.KeyName != null) {
4344
+ contents.KeyName = __expectString(data.KeyName);
4345
+ }
4346
+ if (data.UpdateTime != null) {
4347
+ contents.UpdateTime = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.UpdateTime));
4348
+ }
4349
+ return contents;
4350
+ };
4351
+ const deserializeAws_restJson1UpdateKeyCommandError = async (output, context) => {
4352
+ const parsedOutput = {
4353
+ ...output,
4354
+ body: await parseErrorBody(output.body, context),
4355
+ };
4356
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4357
+ switch (errorCode) {
4358
+ case "AccessDeniedException":
4359
+ case "com.amazonaws.location#AccessDeniedException":
4360
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
4361
+ case "InternalServerException":
4362
+ case "com.amazonaws.location#InternalServerException":
4363
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
4364
+ case "ResourceNotFoundException":
4365
+ case "com.amazonaws.location#ResourceNotFoundException":
4366
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
4367
+ case "ThrottlingException":
4368
+ case "com.amazonaws.location#ThrottlingException":
4369
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
4370
+ case "ValidationException":
4371
+ case "com.amazonaws.location#ValidationException":
4372
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4373
+ default:
4374
+ const parsedBody = parsedOutput.body;
4375
+ throwDefaultError({
4376
+ output,
4377
+ parsedBody,
4378
+ exceptionCtor: __BaseException,
4379
+ errorCode,
4380
+ });
4381
+ }
4382
+ };
3956
4383
  export const deserializeAws_restJson1UpdateMapCommand = async (output, context) => {
3957
4384
  if (output.statusCode !== 200 && output.statusCode >= 300) {
3958
4385
  return deserializeAws_restJson1UpdateMapCommandError(output, context);
@@ -4248,6 +4675,31 @@ const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput,
4248
4675
  });
4249
4676
  return __decorateServiceException(exception, parsedOutput.body);
4250
4677
  };
4678
+ const serializeAws_restJson1ApiKeyActionList = (input, context) => {
4679
+ return input
4680
+ .filter((e) => e != null)
4681
+ .map((entry) => {
4682
+ return entry;
4683
+ });
4684
+ };
4685
+ const serializeAws_restJson1ApiKeyFilter = (input, context) => {
4686
+ return {
4687
+ ...(input.KeyStatus != null && { KeyStatus: input.KeyStatus }),
4688
+ };
4689
+ };
4690
+ const serializeAws_restJson1ApiKeyRestrictions = (input, context) => {
4691
+ return {
4692
+ ...(input.AllowActions != null && {
4693
+ AllowActions: serializeAws_restJson1ApiKeyActionList(input.AllowActions, context),
4694
+ }),
4695
+ ...(input.AllowReferers != null && {
4696
+ AllowReferers: serializeAws_restJson1RefererPatternList(input.AllowReferers, context),
4697
+ }),
4698
+ ...(input.AllowResources != null && {
4699
+ AllowResources: serializeAws_restJson1GeoArnList(input.AllowResources, context),
4700
+ }),
4701
+ };
4702
+ };
4251
4703
  const serializeAws_restJson1BatchPutGeofenceRequestEntry = (input, context) => {
4252
4704
  return {
4253
4705
  ...(input.GeofenceId != null && { GeofenceId: input.GeofenceId }),
@@ -4325,6 +4777,13 @@ const serializeAws_restJson1DevicePositionUpdateList = (input, context) => {
4325
4777
  return serializeAws_restJson1DevicePositionUpdate(entry, context);
4326
4778
  });
4327
4779
  };
4780
+ const serializeAws_restJson1GeoArnList = (input, context) => {
4781
+ return input
4782
+ .filter((e) => e != null)
4783
+ .map((entry) => {
4784
+ return entry;
4785
+ });
4786
+ };
4328
4787
  const serializeAws_restJson1GeofenceGeometry = (input, context) => {
4329
4788
  return {
4330
4789
  ...(input.Circle != null && { Circle: serializeAws_restJson1Circle(input.Circle, context) }),
@@ -4385,6 +4844,13 @@ const serializeAws_restJson1PropertyMap = (input, context) => {
4385
4844
  return acc;
4386
4845
  }, {});
4387
4846
  };
4847
+ const serializeAws_restJson1RefererPatternList = (input, context) => {
4848
+ return input
4849
+ .filter((e) => e != null)
4850
+ .map((entry) => {
4851
+ return entry;
4852
+ });
4853
+ };
4388
4854
  const serializeAws_restJson1TagMap = (input, context) => {
4389
4855
  return Object.entries(input).reduce((acc, [key, value]) => {
4390
4856
  if (value === null) {
@@ -4415,6 +4881,26 @@ const serializeAws_restJson1WaypointPositionList = (input, context) => {
4415
4881
  return serializeAws_restJson1Position(entry, context);
4416
4882
  });
4417
4883
  };
4884
+ const deserializeAws_restJson1ApiKeyActionList = (output, context) => {
4885
+ const retVal = (output || [])
4886
+ .filter((e) => e != null)
4887
+ .map((entry) => {
4888
+ if (entry === null) {
4889
+ return null;
4890
+ }
4891
+ return __expectString(entry);
4892
+ });
4893
+ return retVal;
4894
+ };
4895
+ const deserializeAws_restJson1ApiKeyRestrictions = (output, context) => {
4896
+ return {
4897
+ AllowActions: output.AllowActions != null ? deserializeAws_restJson1ApiKeyActionList(output.AllowActions, context) : undefined,
4898
+ AllowReferers: output.AllowReferers != null
4899
+ ? deserializeAws_restJson1RefererPatternList(output.AllowReferers, context)
4900
+ : undefined,
4901
+ AllowResources: output.AllowResources != null ? deserializeAws_restJson1GeoArnList(output.AllowResources, context) : undefined,
4902
+ };
4903
+ };
4418
4904
  const deserializeAws_restJson1ArnList = (output, context) => {
4419
4905
  const retVal = (output || [])
4420
4906
  .filter((e) => e != null)
@@ -4627,6 +5113,17 @@ const deserializeAws_restJson1DevicePositionList = (output, context) => {
4627
5113
  });
4628
5114
  return retVal;
4629
5115
  };
5116
+ const deserializeAws_restJson1GeoArnList = (output, context) => {
5117
+ const retVal = (output || [])
5118
+ .filter((e) => e != null)
5119
+ .map((entry) => {
5120
+ if (entry === null) {
5121
+ return null;
5122
+ }
5123
+ return __expectString(entry);
5124
+ });
5125
+ return retVal;
5126
+ };
4630
5127
  const deserializeAws_restJson1GeofenceGeometry = (output, context) => {
4631
5128
  return {
4632
5129
  Circle: output.Circle != null ? deserializeAws_restJson1Circle(output.Circle, context) : undefined,
@@ -4755,6 +5252,29 @@ const deserializeAws_restJson1ListGeofenceResponseEntryList = (output, context)
4755
5252
  });
4756
5253
  return retVal;
4757
5254
  };
5255
+ const deserializeAws_restJson1ListKeysResponseEntry = (output, context) => {
5256
+ return {
5257
+ CreateTime: output.CreateTime != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.CreateTime)) : undefined,
5258
+ Description: __expectString(output.Description),
5259
+ ExpireTime: output.ExpireTime != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.ExpireTime)) : undefined,
5260
+ KeyName: __expectString(output.KeyName),
5261
+ Restrictions: output.Restrictions != null
5262
+ ? deserializeAws_restJson1ApiKeyRestrictions(output.Restrictions, context)
5263
+ : undefined,
5264
+ UpdateTime: output.UpdateTime != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.UpdateTime)) : undefined,
5265
+ };
5266
+ };
5267
+ const deserializeAws_restJson1ListKeysResponseEntryList = (output, context) => {
5268
+ const retVal = (output || [])
5269
+ .filter((e) => e != null)
5270
+ .map((entry) => {
5271
+ if (entry === null) {
5272
+ return null;
5273
+ }
5274
+ return deserializeAws_restJson1ListKeysResponseEntry(entry, context);
5275
+ });
5276
+ return retVal;
5277
+ };
4758
5278
  const deserializeAws_restJson1ListMapsResponseEntry = (output, context) => {
4759
5279
  return {
4760
5280
  CreateTime: output.CreateTime != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.CreateTime)) : undefined,
@@ -4903,6 +5423,17 @@ const deserializeAws_restJson1PropertyMap = (output, context) => {
4903
5423
  return acc;
4904
5424
  }, {});
4905
5425
  };
5426
+ const deserializeAws_restJson1RefererPatternList = (output, context) => {
5427
+ const retVal = (output || [])
5428
+ .filter((e) => e != null)
5429
+ .map((entry) => {
5430
+ if (entry === null) {
5431
+ return null;
5432
+ }
5433
+ return __expectString(entry);
5434
+ });
5435
+ return retVal;
5436
+ };
4906
5437
  const deserializeAws_restJson1RouteMatrix = (output, context) => {
4907
5438
  const retVal = (output || [])
4908
5439
  .filter((e) => e != null)