@aws-sdk/client-xray 3.210.0 → 3.212.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 (43) hide show
  1. package/dist-cjs/XRay.js +45 -0
  2. package/dist-cjs/commands/DeleteResourcePolicyCommand.js +46 -0
  3. package/dist-cjs/commands/ListResourcePoliciesCommand.js +46 -0
  4. package/dist-cjs/commands/PutResourcePolicyCommand.js +46 -0
  5. package/dist-cjs/commands/index.js +3 -0
  6. package/dist-cjs/models/models_0.js +102 -7
  7. package/dist-cjs/pagination/ListResourcePoliciesPaginator.js +35 -0
  8. package/dist-cjs/pagination/ListTagsForResourcePaginator.js +35 -0
  9. package/dist-cjs/pagination/index.js +2 -0
  10. package/dist-cjs/protocols/Aws_restJson1.js +282 -14
  11. package/dist-es/XRay.js +45 -0
  12. package/dist-es/commands/DeleteResourcePolicyCommand.js +42 -0
  13. package/dist-es/commands/ListResourcePoliciesCommand.js +42 -0
  14. package/dist-es/commands/PutResourcePolicyCommand.js +42 -0
  15. package/dist-es/commands/index.js +3 -0
  16. package/dist-es/models/models_0.js +87 -4
  17. package/dist-es/pagination/ListResourcePoliciesPaginator.js +31 -0
  18. package/dist-es/pagination/ListTagsForResourcePaginator.js +31 -0
  19. package/dist-es/pagination/index.js +2 -0
  20. package/dist-es/protocols/Aws_restJson1.js +275 -13
  21. package/dist-types/XRay.d.ts +26 -0
  22. package/dist-types/XRayClient.d.ts +5 -2
  23. package/dist-types/commands/DeleteResourcePolicyCommand.d.ts +37 -0
  24. package/dist-types/commands/ListResourcePoliciesCommand.d.ts +37 -0
  25. package/dist-types/commands/PutResourcePolicyCommand.d.ts +42 -0
  26. package/dist-types/commands/index.d.ts +3 -0
  27. package/dist-types/models/models_0.d.ts +177 -2
  28. package/dist-types/pagination/ListResourcePoliciesPaginator.d.ts +4 -0
  29. package/dist-types/pagination/ListTagsForResourcePaginator.d.ts +4 -0
  30. package/dist-types/pagination/index.d.ts +2 -0
  31. package/dist-types/protocols/Aws_restJson1.d.ts +9 -0
  32. package/dist-types/ts3.4/XRay.d.ts +51 -0
  33. package/dist-types/ts3.4/XRayClient.d.ts +18 -0
  34. package/dist-types/ts3.4/commands/DeleteResourcePolicyCommand.d.ts +41 -0
  35. package/dist-types/ts3.4/commands/ListResourcePoliciesCommand.d.ts +41 -0
  36. package/dist-types/ts3.4/commands/PutResourcePolicyCommand.d.ts +38 -0
  37. package/dist-types/ts3.4/commands/index.d.ts +3 -0
  38. package/dist-types/ts3.4/models/models_0.d.ts +100 -0
  39. package/dist-types/ts3.4/pagination/ListResourcePoliciesPaginator.d.ts +11 -0
  40. package/dist-types/ts3.4/pagination/ListTagsForResourcePaginator.d.ts +11 -0
  41. package/dist-types/ts3.4/pagination/index.d.ts +2 -0
  42. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +36 -0
  43. package/package.json +28 -28
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deserializeAws_restJson1PutTraceSegmentsCommand = exports.deserializeAws_restJson1PutTelemetryRecordsCommand = exports.deserializeAws_restJson1PutEncryptionConfigCommand = exports.deserializeAws_restJson1ListTagsForResourceCommand = exports.deserializeAws_restJson1GetTraceSummariesCommand = exports.deserializeAws_restJson1GetTraceGraphCommand = exports.deserializeAws_restJson1GetTimeSeriesServiceStatisticsCommand = exports.deserializeAws_restJson1GetServiceGraphCommand = exports.deserializeAws_restJson1GetSamplingTargetsCommand = exports.deserializeAws_restJson1GetSamplingStatisticSummariesCommand = exports.deserializeAws_restJson1GetSamplingRulesCommand = exports.deserializeAws_restJson1GetInsightSummariesCommand = exports.deserializeAws_restJson1GetInsightImpactGraphCommand = exports.deserializeAws_restJson1GetInsightEventsCommand = exports.deserializeAws_restJson1GetInsightCommand = exports.deserializeAws_restJson1GetGroupsCommand = exports.deserializeAws_restJson1GetGroupCommand = exports.deserializeAws_restJson1GetEncryptionConfigCommand = exports.deserializeAws_restJson1DeleteSamplingRuleCommand = exports.deserializeAws_restJson1DeleteGroupCommand = exports.deserializeAws_restJson1CreateSamplingRuleCommand = exports.deserializeAws_restJson1CreateGroupCommand = exports.deserializeAws_restJson1BatchGetTracesCommand = exports.serializeAws_restJson1UpdateSamplingRuleCommand = exports.serializeAws_restJson1UpdateGroupCommand = exports.serializeAws_restJson1UntagResourceCommand = exports.serializeAws_restJson1TagResourceCommand = exports.serializeAws_restJson1PutTraceSegmentsCommand = exports.serializeAws_restJson1PutTelemetryRecordsCommand = exports.serializeAws_restJson1PutEncryptionConfigCommand = exports.serializeAws_restJson1ListTagsForResourceCommand = exports.serializeAws_restJson1GetTraceSummariesCommand = exports.serializeAws_restJson1GetTraceGraphCommand = exports.serializeAws_restJson1GetTimeSeriesServiceStatisticsCommand = exports.serializeAws_restJson1GetServiceGraphCommand = exports.serializeAws_restJson1GetSamplingTargetsCommand = exports.serializeAws_restJson1GetSamplingStatisticSummariesCommand = exports.serializeAws_restJson1GetSamplingRulesCommand = exports.serializeAws_restJson1GetInsightSummariesCommand = exports.serializeAws_restJson1GetInsightImpactGraphCommand = exports.serializeAws_restJson1GetInsightEventsCommand = exports.serializeAws_restJson1GetInsightCommand = exports.serializeAws_restJson1GetGroupsCommand = exports.serializeAws_restJson1GetGroupCommand = exports.serializeAws_restJson1GetEncryptionConfigCommand = exports.serializeAws_restJson1DeleteSamplingRuleCommand = exports.serializeAws_restJson1DeleteGroupCommand = exports.serializeAws_restJson1CreateSamplingRuleCommand = exports.serializeAws_restJson1CreateGroupCommand = exports.serializeAws_restJson1BatchGetTracesCommand = void 0;
4
- exports.deserializeAws_restJson1UpdateSamplingRuleCommand = exports.deserializeAws_restJson1UpdateGroupCommand = exports.deserializeAws_restJson1UntagResourceCommand = exports.deserializeAws_restJson1TagResourceCommand = void 0;
3
+ exports.deserializeAws_restJson1GetTraceSummariesCommand = exports.deserializeAws_restJson1GetTraceGraphCommand = exports.deserializeAws_restJson1GetTimeSeriesServiceStatisticsCommand = exports.deserializeAws_restJson1GetServiceGraphCommand = exports.deserializeAws_restJson1GetSamplingTargetsCommand = exports.deserializeAws_restJson1GetSamplingStatisticSummariesCommand = exports.deserializeAws_restJson1GetSamplingRulesCommand = exports.deserializeAws_restJson1GetInsightSummariesCommand = exports.deserializeAws_restJson1GetInsightImpactGraphCommand = exports.deserializeAws_restJson1GetInsightEventsCommand = exports.deserializeAws_restJson1GetInsightCommand = exports.deserializeAws_restJson1GetGroupsCommand = exports.deserializeAws_restJson1GetGroupCommand = exports.deserializeAws_restJson1GetEncryptionConfigCommand = exports.deserializeAws_restJson1DeleteSamplingRuleCommand = exports.deserializeAws_restJson1DeleteResourcePolicyCommand = exports.deserializeAws_restJson1DeleteGroupCommand = exports.deserializeAws_restJson1CreateSamplingRuleCommand = exports.deserializeAws_restJson1CreateGroupCommand = exports.deserializeAws_restJson1BatchGetTracesCommand = exports.serializeAws_restJson1UpdateSamplingRuleCommand = exports.serializeAws_restJson1UpdateGroupCommand = exports.serializeAws_restJson1UntagResourceCommand = exports.serializeAws_restJson1TagResourceCommand = exports.serializeAws_restJson1PutTraceSegmentsCommand = exports.serializeAws_restJson1PutTelemetryRecordsCommand = exports.serializeAws_restJson1PutResourcePolicyCommand = exports.serializeAws_restJson1PutEncryptionConfigCommand = exports.serializeAws_restJson1ListTagsForResourceCommand = exports.serializeAws_restJson1ListResourcePoliciesCommand = exports.serializeAws_restJson1GetTraceSummariesCommand = exports.serializeAws_restJson1GetTraceGraphCommand = exports.serializeAws_restJson1GetTimeSeriesServiceStatisticsCommand = exports.serializeAws_restJson1GetServiceGraphCommand = exports.serializeAws_restJson1GetSamplingTargetsCommand = exports.serializeAws_restJson1GetSamplingStatisticSummariesCommand = exports.serializeAws_restJson1GetSamplingRulesCommand = exports.serializeAws_restJson1GetInsightSummariesCommand = exports.serializeAws_restJson1GetInsightImpactGraphCommand = exports.serializeAws_restJson1GetInsightEventsCommand = exports.serializeAws_restJson1GetInsightCommand = exports.serializeAws_restJson1GetGroupsCommand = exports.serializeAws_restJson1GetGroupCommand = exports.serializeAws_restJson1GetEncryptionConfigCommand = exports.serializeAws_restJson1DeleteSamplingRuleCommand = exports.serializeAws_restJson1DeleteResourcePolicyCommand = exports.serializeAws_restJson1DeleteGroupCommand = exports.serializeAws_restJson1CreateSamplingRuleCommand = exports.serializeAws_restJson1CreateGroupCommand = exports.serializeAws_restJson1BatchGetTracesCommand = void 0;
4
+ exports.deserializeAws_restJson1UpdateSamplingRuleCommand = exports.deserializeAws_restJson1UpdateGroupCommand = exports.deserializeAws_restJson1UntagResourceCommand = exports.deserializeAws_restJson1TagResourceCommand = exports.deserializeAws_restJson1PutTraceSegmentsCommand = exports.deserializeAws_restJson1PutTelemetryRecordsCommand = exports.deserializeAws_restJson1PutResourcePolicyCommand = exports.deserializeAws_restJson1PutEncryptionConfigCommand = exports.deserializeAws_restJson1ListTagsForResourceCommand = exports.deserializeAws_restJson1ListResourcePoliciesCommand = void 0;
5
5
  const protocol_http_1 = require("@aws-sdk/protocol-http");
6
6
  const smithy_client_1 = require("@aws-sdk/smithy-client");
7
7
  const models_0_1 = require("../models/models_0");
@@ -100,6 +100,28 @@ const serializeAws_restJson1DeleteGroupCommand = async (input, context) => {
100
100
  });
101
101
  };
102
102
  exports.serializeAws_restJson1DeleteGroupCommand = serializeAws_restJson1DeleteGroupCommand;
103
+ const serializeAws_restJson1DeleteResourcePolicyCommand = async (input, context) => {
104
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
105
+ const headers = {
106
+ "content-type": "application/json",
107
+ };
108
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/DeleteResourcePolicy";
109
+ let body;
110
+ body = JSON.stringify({
111
+ ...(input.PolicyName != null && { PolicyName: input.PolicyName }),
112
+ ...(input.PolicyRevisionId != null && { PolicyRevisionId: input.PolicyRevisionId }),
113
+ });
114
+ return new protocol_http_1.HttpRequest({
115
+ protocol,
116
+ hostname,
117
+ port,
118
+ method: "POST",
119
+ headers,
120
+ path: resolvedPath,
121
+ body,
122
+ });
123
+ };
124
+ exports.serializeAws_restJson1DeleteResourcePolicyCommand = serializeAws_restJson1DeleteResourcePolicyCommand;
103
125
  const serializeAws_restJson1DeleteSamplingRuleCommand = async (input, context) => {
104
126
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
105
127
  const headers = {
@@ -448,6 +470,27 @@ const serializeAws_restJson1GetTraceSummariesCommand = async (input, context) =>
448
470
  });
449
471
  };
450
472
  exports.serializeAws_restJson1GetTraceSummariesCommand = serializeAws_restJson1GetTraceSummariesCommand;
473
+ const serializeAws_restJson1ListResourcePoliciesCommand = async (input, context) => {
474
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
475
+ const headers = {
476
+ "content-type": "application/json",
477
+ };
478
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/ListResourcePolicies";
479
+ let body;
480
+ body = JSON.stringify({
481
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
482
+ });
483
+ return new protocol_http_1.HttpRequest({
484
+ protocol,
485
+ hostname,
486
+ port,
487
+ method: "POST",
488
+ headers,
489
+ path: resolvedPath,
490
+ body,
491
+ });
492
+ };
493
+ exports.serializeAws_restJson1ListResourcePoliciesCommand = serializeAws_restJson1ListResourcePoliciesCommand;
451
494
  const serializeAws_restJson1ListTagsForResourceCommand = async (input, context) => {
452
495
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
453
496
  const headers = {
@@ -492,6 +535,30 @@ const serializeAws_restJson1PutEncryptionConfigCommand = async (input, context)
492
535
  });
493
536
  };
494
537
  exports.serializeAws_restJson1PutEncryptionConfigCommand = serializeAws_restJson1PutEncryptionConfigCommand;
538
+ const serializeAws_restJson1PutResourcePolicyCommand = async (input, context) => {
539
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
540
+ const headers = {
541
+ "content-type": "application/json",
542
+ };
543
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/PutResourcePolicy";
544
+ let body;
545
+ body = JSON.stringify({
546
+ ...(input.BypassPolicyLockoutCheck != null && { BypassPolicyLockoutCheck: input.BypassPolicyLockoutCheck }),
547
+ ...(input.PolicyDocument != null && { PolicyDocument: input.PolicyDocument }),
548
+ ...(input.PolicyName != null && { PolicyName: input.PolicyName }),
549
+ ...(input.PolicyRevisionId != null && { PolicyRevisionId: input.PolicyRevisionId }),
550
+ });
551
+ return new protocol_http_1.HttpRequest({
552
+ protocol,
553
+ hostname,
554
+ port,
555
+ method: "POST",
556
+ headers,
557
+ path: resolvedPath,
558
+ body,
559
+ });
560
+ };
561
+ exports.serializeAws_restJson1PutResourcePolicyCommand = serializeAws_restJson1PutResourcePolicyCommand;
495
562
  const serializeAws_restJson1PutTelemetryRecordsCommand = async (input, context) => {
496
563
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
497
564
  const headers = {
@@ -788,6 +855,43 @@ const deserializeAws_restJson1DeleteGroupCommandError = async (output, context)
788
855
  });
789
856
  }
790
857
  };
858
+ const deserializeAws_restJson1DeleteResourcePolicyCommand = async (output, context) => {
859
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
860
+ return deserializeAws_restJson1DeleteResourcePolicyCommandError(output, context);
861
+ }
862
+ const contents = map({
863
+ $metadata: deserializeMetadata(output),
864
+ });
865
+ await collectBody(output.body, context);
866
+ return contents;
867
+ };
868
+ exports.deserializeAws_restJson1DeleteResourcePolicyCommand = deserializeAws_restJson1DeleteResourcePolicyCommand;
869
+ const deserializeAws_restJson1DeleteResourcePolicyCommandError = async (output, context) => {
870
+ const parsedOutput = {
871
+ ...output,
872
+ body: await parseErrorBody(output.body, context),
873
+ };
874
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
875
+ switch (errorCode) {
876
+ case "InvalidPolicyRevisionIdException":
877
+ case "com.amazonaws.xray#InvalidPolicyRevisionIdException":
878
+ throw await deserializeAws_restJson1InvalidPolicyRevisionIdExceptionResponse(parsedOutput, context);
879
+ case "InvalidRequestException":
880
+ case "com.amazonaws.xray#InvalidRequestException":
881
+ throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
882
+ case "ThrottledException":
883
+ case "com.amazonaws.xray#ThrottledException":
884
+ throw await deserializeAws_restJson1ThrottledExceptionResponse(parsedOutput, context);
885
+ default:
886
+ const parsedBody = parsedOutput.body;
887
+ (0, smithy_client_1.throwDefaultError)({
888
+ output,
889
+ parsedBody,
890
+ exceptionCtor: XRayServiceException_1.XRayServiceException,
891
+ errorCode,
892
+ });
893
+ }
894
+ };
791
895
  const deserializeAws_restJson1DeleteSamplingRuleCommand = async (output, context) => {
792
896
  if (output.statusCode !== 200 && output.statusCode >= 300) {
793
897
  return deserializeAws_restJson1DeleteSamplingRuleCommandError(output, context);
@@ -1412,6 +1516,46 @@ const deserializeAws_restJson1GetTraceSummariesCommandError = async (output, con
1412
1516
  });
1413
1517
  }
1414
1518
  };
1519
+ const deserializeAws_restJson1ListResourcePoliciesCommand = async (output, context) => {
1520
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1521
+ return deserializeAws_restJson1ListResourcePoliciesCommandError(output, context);
1522
+ }
1523
+ const contents = map({
1524
+ $metadata: deserializeMetadata(output),
1525
+ });
1526
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1527
+ if (data.NextToken != null) {
1528
+ contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
1529
+ }
1530
+ if (data.ResourcePolicies != null) {
1531
+ contents.ResourcePolicies = deserializeAws_restJson1ResourcePolicyList(data.ResourcePolicies, context);
1532
+ }
1533
+ return contents;
1534
+ };
1535
+ exports.deserializeAws_restJson1ListResourcePoliciesCommand = deserializeAws_restJson1ListResourcePoliciesCommand;
1536
+ const deserializeAws_restJson1ListResourcePoliciesCommandError = async (output, context) => {
1537
+ const parsedOutput = {
1538
+ ...output,
1539
+ body: await parseErrorBody(output.body, context),
1540
+ };
1541
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1542
+ switch (errorCode) {
1543
+ case "InvalidRequestException":
1544
+ case "com.amazonaws.xray#InvalidRequestException":
1545
+ throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
1546
+ case "ThrottledException":
1547
+ case "com.amazonaws.xray#ThrottledException":
1548
+ throw await deserializeAws_restJson1ThrottledExceptionResponse(parsedOutput, context);
1549
+ default:
1550
+ const parsedBody = parsedOutput.body;
1551
+ (0, smithy_client_1.throwDefaultError)({
1552
+ output,
1553
+ parsedBody,
1554
+ exceptionCtor: XRayServiceException_1.XRayServiceException,
1555
+ errorCode,
1556
+ });
1557
+ }
1558
+ };
1415
1559
  const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
1416
1560
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1417
1561
  return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
@@ -1492,6 +1636,55 @@ const deserializeAws_restJson1PutEncryptionConfigCommandError = async (output, c
1492
1636
  });
1493
1637
  }
1494
1638
  };
1639
+ const deserializeAws_restJson1PutResourcePolicyCommand = async (output, context) => {
1640
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1641
+ return deserializeAws_restJson1PutResourcePolicyCommandError(output, context);
1642
+ }
1643
+ const contents = map({
1644
+ $metadata: deserializeMetadata(output),
1645
+ });
1646
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1647
+ if (data.ResourcePolicy != null) {
1648
+ contents.ResourcePolicy = deserializeAws_restJson1ResourcePolicy(data.ResourcePolicy, context);
1649
+ }
1650
+ return contents;
1651
+ };
1652
+ exports.deserializeAws_restJson1PutResourcePolicyCommand = deserializeAws_restJson1PutResourcePolicyCommand;
1653
+ const deserializeAws_restJson1PutResourcePolicyCommandError = async (output, context) => {
1654
+ const parsedOutput = {
1655
+ ...output,
1656
+ body: await parseErrorBody(output.body, context),
1657
+ };
1658
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1659
+ switch (errorCode) {
1660
+ case "InvalidPolicyRevisionIdException":
1661
+ case "com.amazonaws.xray#InvalidPolicyRevisionIdException":
1662
+ throw await deserializeAws_restJson1InvalidPolicyRevisionIdExceptionResponse(parsedOutput, context);
1663
+ case "LockoutPreventionException":
1664
+ case "com.amazonaws.xray#LockoutPreventionException":
1665
+ throw await deserializeAws_restJson1LockoutPreventionExceptionResponse(parsedOutput, context);
1666
+ case "MalformedPolicyDocumentException":
1667
+ case "com.amazonaws.xray#MalformedPolicyDocumentException":
1668
+ throw await deserializeAws_restJson1MalformedPolicyDocumentExceptionResponse(parsedOutput, context);
1669
+ case "PolicyCountLimitExceededException":
1670
+ case "com.amazonaws.xray#PolicyCountLimitExceededException":
1671
+ throw await deserializeAws_restJson1PolicyCountLimitExceededExceptionResponse(parsedOutput, context);
1672
+ case "PolicySizeLimitExceededException":
1673
+ case "com.amazonaws.xray#PolicySizeLimitExceededException":
1674
+ throw await deserializeAws_restJson1PolicySizeLimitExceededExceptionResponse(parsedOutput, context);
1675
+ case "ThrottledException":
1676
+ case "com.amazonaws.xray#ThrottledException":
1677
+ throw await deserializeAws_restJson1ThrottledExceptionResponse(parsedOutput, context);
1678
+ default:
1679
+ const parsedBody = parsedOutput.body;
1680
+ (0, smithy_client_1.throwDefaultError)({
1681
+ output,
1682
+ parsedBody,
1683
+ exceptionCtor: XRayServiceException_1.XRayServiceException,
1684
+ errorCode,
1685
+ });
1686
+ }
1687
+ };
1495
1688
  const deserializeAws_restJson1PutTelemetryRecordsCommand = async (output, context) => {
1496
1689
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1497
1690
  return deserializeAws_restJson1PutTelemetryRecordsCommandError(output, context);
@@ -1715,6 +1908,18 @@ const deserializeAws_restJson1UpdateSamplingRuleCommandError = async (output, co
1715
1908
  }
1716
1909
  };
1717
1910
  const map = smithy_client_1.map;
1911
+ const deserializeAws_restJson1InvalidPolicyRevisionIdExceptionResponse = async (parsedOutput, context) => {
1912
+ const contents = map({});
1913
+ const data = parsedOutput.body;
1914
+ if (data.Message != null) {
1915
+ contents.Message = (0, smithy_client_1.expectString)(data.Message);
1916
+ }
1917
+ const exception = new models_0_1.InvalidPolicyRevisionIdException({
1918
+ $metadata: deserializeMetadata(parsedOutput),
1919
+ ...contents,
1920
+ });
1921
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1922
+ };
1718
1923
  const deserializeAws_restJson1InvalidRequestExceptionResponse = async (parsedOutput, context) => {
1719
1924
  const contents = map({});
1720
1925
  const data = parsedOutput.body;
@@ -1727,6 +1932,54 @@ const deserializeAws_restJson1InvalidRequestExceptionResponse = async (parsedOut
1727
1932
  });
1728
1933
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1729
1934
  };
1935
+ const deserializeAws_restJson1LockoutPreventionExceptionResponse = async (parsedOutput, context) => {
1936
+ const contents = map({});
1937
+ const data = parsedOutput.body;
1938
+ if (data.Message != null) {
1939
+ contents.Message = (0, smithy_client_1.expectString)(data.Message);
1940
+ }
1941
+ const exception = new models_0_1.LockoutPreventionException({
1942
+ $metadata: deserializeMetadata(parsedOutput),
1943
+ ...contents,
1944
+ });
1945
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1946
+ };
1947
+ const deserializeAws_restJson1MalformedPolicyDocumentExceptionResponse = async (parsedOutput, context) => {
1948
+ const contents = map({});
1949
+ const data = parsedOutput.body;
1950
+ if (data.Message != null) {
1951
+ contents.Message = (0, smithy_client_1.expectString)(data.Message);
1952
+ }
1953
+ const exception = new models_0_1.MalformedPolicyDocumentException({
1954
+ $metadata: deserializeMetadata(parsedOutput),
1955
+ ...contents,
1956
+ });
1957
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1958
+ };
1959
+ const deserializeAws_restJson1PolicyCountLimitExceededExceptionResponse = async (parsedOutput, context) => {
1960
+ const contents = map({});
1961
+ const data = parsedOutput.body;
1962
+ if (data.Message != null) {
1963
+ contents.Message = (0, smithy_client_1.expectString)(data.Message);
1964
+ }
1965
+ const exception = new models_0_1.PolicyCountLimitExceededException({
1966
+ $metadata: deserializeMetadata(parsedOutput),
1967
+ ...contents,
1968
+ });
1969
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1970
+ };
1971
+ const deserializeAws_restJson1PolicySizeLimitExceededExceptionResponse = async (parsedOutput, context) => {
1972
+ const contents = map({});
1973
+ const data = parsedOutput.body;
1974
+ if (data.Message != null) {
1975
+ contents.Message = (0, smithy_client_1.expectString)(data.Message);
1976
+ }
1977
+ const exception = new models_0_1.PolicySizeLimitExceededException({
1978
+ $metadata: deserializeMetadata(parsedOutput),
1979
+ ...contents,
1980
+ });
1981
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1982
+ };
1730
1983
  const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
1731
1984
  const contents = map({});
1732
1985
  const data = parsedOutput.body;
@@ -1786,10 +2039,8 @@ const serializeAws_restJson1AttributeMap = (input, context) => {
1786
2039
  if (value === null) {
1787
2040
  return acc;
1788
2041
  }
1789
- return {
1790
- ...acc,
1791
- [key]: value,
1792
- };
2042
+ acc[key] = value;
2043
+ return acc;
1793
2044
  }, {});
1794
2045
  };
1795
2046
  const serializeAws_restJson1BackendConnectionErrors = (input, context) => {
@@ -1958,10 +2209,8 @@ const deserializeAws_restJson1Annotations = (output, context) => {
1958
2209
  if (value === null) {
1959
2210
  return acc;
1960
2211
  }
1961
- return {
1962
- ...acc,
1963
- [key]: deserializeAws_restJson1ValuesWithServiceIds(value, context),
1964
- };
2212
+ acc[key] = deserializeAws_restJson1ValuesWithServiceIds(value, context);
2213
+ return acc;
1965
2214
  }, {});
1966
2215
  };
1967
2216
  const deserializeAws_restJson1AnnotationValue = (output, context) => {
@@ -1997,10 +2246,8 @@ const deserializeAws_restJson1AttributeMap = (output, context) => {
1997
2246
  if (value === null) {
1998
2247
  return acc;
1999
2248
  }
2000
- return {
2001
- ...acc,
2002
- [key]: (0, smithy_client_1.expectString)(value),
2003
- };
2249
+ acc[key] = (0, smithy_client_1.expectString)(value);
2250
+ return acc;
2004
2251
  }, {});
2005
2252
  };
2006
2253
  const deserializeAws_restJson1AvailabilityZoneDetail = (output, context) => {
@@ -2408,6 +2655,27 @@ const deserializeAws_restJson1ResourceARNDetail = (output, context) => {
2408
2655
  ARN: (0, smithy_client_1.expectString)(output.ARN),
2409
2656
  };
2410
2657
  };
2658
+ const deserializeAws_restJson1ResourcePolicy = (output, context) => {
2659
+ return {
2660
+ LastUpdatedTime: output.LastUpdatedTime != null
2661
+ ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.LastUpdatedTime)))
2662
+ : undefined,
2663
+ PolicyDocument: (0, smithy_client_1.expectString)(output.PolicyDocument),
2664
+ PolicyName: (0, smithy_client_1.expectString)(output.PolicyName),
2665
+ PolicyRevisionId: (0, smithy_client_1.expectString)(output.PolicyRevisionId),
2666
+ };
2667
+ };
2668
+ const deserializeAws_restJson1ResourcePolicyList = (output, context) => {
2669
+ const retVal = (output || [])
2670
+ .filter((e) => e != null)
2671
+ .map((entry) => {
2672
+ if (entry === null) {
2673
+ return null;
2674
+ }
2675
+ return deserializeAws_restJson1ResourcePolicy(entry, context);
2676
+ });
2677
+ return retVal;
2678
+ };
2411
2679
  const deserializeAws_restJson1ResponseTimeRootCause = (output, context) => {
2412
2680
  return {
2413
2681
  ClientImpacting: (0, smithy_client_1.expectBoolean)(output.ClientImpacting),
package/dist-es/XRay.js CHANGED
@@ -2,6 +2,7 @@ import { BatchGetTracesCommand, } from "./commands/BatchGetTracesCommand";
2
2
  import { CreateGroupCommand } from "./commands/CreateGroupCommand";
3
3
  import { CreateSamplingRuleCommand, } from "./commands/CreateSamplingRuleCommand";
4
4
  import { DeleteGroupCommand } from "./commands/DeleteGroupCommand";
5
+ import { DeleteResourcePolicyCommand, } from "./commands/DeleteResourcePolicyCommand";
5
6
  import { DeleteSamplingRuleCommand, } from "./commands/DeleteSamplingRuleCommand";
6
7
  import { GetEncryptionConfigCommand, } from "./commands/GetEncryptionConfigCommand";
7
8
  import { GetGroupCommand } from "./commands/GetGroupCommand";
@@ -17,8 +18,10 @@ import { GetServiceGraphCommand, } from "./commands/GetServiceGraphCommand";
17
18
  import { GetTimeSeriesServiceStatisticsCommand, } from "./commands/GetTimeSeriesServiceStatisticsCommand";
18
19
  import { GetTraceGraphCommand, } from "./commands/GetTraceGraphCommand";
19
20
  import { GetTraceSummariesCommand, } from "./commands/GetTraceSummariesCommand";
21
+ import { ListResourcePoliciesCommand, } from "./commands/ListResourcePoliciesCommand";
20
22
  import { ListTagsForResourceCommand, } from "./commands/ListTagsForResourceCommand";
21
23
  import { PutEncryptionConfigCommand, } from "./commands/PutEncryptionConfigCommand";
24
+ import { PutResourcePolicyCommand, } from "./commands/PutResourcePolicyCommand";
22
25
  import { PutTelemetryRecordsCommand, } from "./commands/PutTelemetryRecordsCommand";
23
26
  import { PutTraceSegmentsCommand, } from "./commands/PutTraceSegmentsCommand";
24
27
  import { TagResourceCommand } from "./commands/TagResourceCommand";
@@ -83,6 +86,20 @@ export class XRay extends XRayClient {
83
86
  return this.send(command, optionsOrCb);
84
87
  }
85
88
  }
89
+ deleteResourcePolicy(args, optionsOrCb, cb) {
90
+ const command = new DeleteResourcePolicyCommand(args);
91
+ if (typeof optionsOrCb === "function") {
92
+ this.send(command, optionsOrCb);
93
+ }
94
+ else if (typeof cb === "function") {
95
+ if (typeof optionsOrCb !== "object")
96
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
97
+ this.send(command, optionsOrCb || {}, cb);
98
+ }
99
+ else {
100
+ return this.send(command, optionsOrCb);
101
+ }
102
+ }
86
103
  deleteSamplingRule(args, optionsOrCb, cb) {
87
104
  const command = new DeleteSamplingRuleCommand(args);
88
105
  if (typeof optionsOrCb === "function") {
@@ -293,6 +310,20 @@ export class XRay extends XRayClient {
293
310
  return this.send(command, optionsOrCb);
294
311
  }
295
312
  }
313
+ listResourcePolicies(args, optionsOrCb, cb) {
314
+ const command = new ListResourcePoliciesCommand(args);
315
+ if (typeof optionsOrCb === "function") {
316
+ this.send(command, optionsOrCb);
317
+ }
318
+ else if (typeof cb === "function") {
319
+ if (typeof optionsOrCb !== "object")
320
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
321
+ this.send(command, optionsOrCb || {}, cb);
322
+ }
323
+ else {
324
+ return this.send(command, optionsOrCb);
325
+ }
326
+ }
296
327
  listTagsForResource(args, optionsOrCb, cb) {
297
328
  const command = new ListTagsForResourceCommand(args);
298
329
  if (typeof optionsOrCb === "function") {
@@ -321,6 +352,20 @@ export class XRay extends XRayClient {
321
352
  return this.send(command, optionsOrCb);
322
353
  }
323
354
  }
355
+ putResourcePolicy(args, optionsOrCb, cb) {
356
+ const command = new PutResourcePolicyCommand(args);
357
+ if (typeof optionsOrCb === "function") {
358
+ this.send(command, optionsOrCb);
359
+ }
360
+ else if (typeof cb === "function") {
361
+ if (typeof optionsOrCb !== "object")
362
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
363
+ this.send(command, optionsOrCb || {}, cb);
364
+ }
365
+ else {
366
+ return this.send(command, optionsOrCb);
367
+ }
368
+ }
324
369
  putTelemetryRecords(args, optionsOrCb, cb) {
325
370
  const command = new PutTelemetryRecordsCommand(args);
326
371
  if (typeof optionsOrCb === "function") {
@@ -0,0 +1,42 @@
1
+ import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
2
+ import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3
+ import { Command as $Command } from "@aws-sdk/smithy-client";
4
+ import { DeleteResourcePolicyRequestFilterSensitiveLog, DeleteResourcePolicyResultFilterSensitiveLog, } from "../models/models_0";
5
+ import { deserializeAws_restJson1DeleteResourcePolicyCommand, serializeAws_restJson1DeleteResourcePolicyCommand, } from "../protocols/Aws_restJson1";
6
+ export class DeleteResourcePolicyCommand extends $Command {
7
+ constructor(input) {
8
+ super();
9
+ this.input = input;
10
+ }
11
+ static getEndpointParameterInstructions() {
12
+ return {
13
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
14
+ Endpoint: { type: "builtInParams", name: "endpoint" },
15
+ Region: { type: "builtInParams", name: "region" },
16
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
17
+ };
18
+ }
19
+ resolveMiddleware(clientStack, configuration, options) {
20
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
21
+ this.middlewareStack.use(getEndpointPlugin(configuration, DeleteResourcePolicyCommand.getEndpointParameterInstructions()));
22
+ const stack = clientStack.concat(this.middlewareStack);
23
+ const { logger } = configuration;
24
+ const clientName = "XRayClient";
25
+ const commandName = "DeleteResourcePolicyCommand";
26
+ const handlerExecutionContext = {
27
+ logger,
28
+ clientName,
29
+ commandName,
30
+ inputFilterSensitiveLog: DeleteResourcePolicyRequestFilterSensitiveLog,
31
+ outputFilterSensitiveLog: DeleteResourcePolicyResultFilterSensitiveLog,
32
+ };
33
+ const { requestHandler } = configuration;
34
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
35
+ }
36
+ serialize(input, context) {
37
+ return serializeAws_restJson1DeleteResourcePolicyCommand(input, context);
38
+ }
39
+ deserialize(output, context) {
40
+ return deserializeAws_restJson1DeleteResourcePolicyCommand(output, context);
41
+ }
42
+ }
@@ -0,0 +1,42 @@
1
+ import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
2
+ import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3
+ import { Command as $Command } from "@aws-sdk/smithy-client";
4
+ import { ListResourcePoliciesRequestFilterSensitiveLog, ListResourcePoliciesResultFilterSensitiveLog, } from "../models/models_0";
5
+ import { deserializeAws_restJson1ListResourcePoliciesCommand, serializeAws_restJson1ListResourcePoliciesCommand, } from "../protocols/Aws_restJson1";
6
+ export class ListResourcePoliciesCommand extends $Command {
7
+ constructor(input) {
8
+ super();
9
+ this.input = input;
10
+ }
11
+ static getEndpointParameterInstructions() {
12
+ return {
13
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
14
+ Endpoint: { type: "builtInParams", name: "endpoint" },
15
+ Region: { type: "builtInParams", name: "region" },
16
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
17
+ };
18
+ }
19
+ resolveMiddleware(clientStack, configuration, options) {
20
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
21
+ this.middlewareStack.use(getEndpointPlugin(configuration, ListResourcePoliciesCommand.getEndpointParameterInstructions()));
22
+ const stack = clientStack.concat(this.middlewareStack);
23
+ const { logger } = configuration;
24
+ const clientName = "XRayClient";
25
+ const commandName = "ListResourcePoliciesCommand";
26
+ const handlerExecutionContext = {
27
+ logger,
28
+ clientName,
29
+ commandName,
30
+ inputFilterSensitiveLog: ListResourcePoliciesRequestFilterSensitiveLog,
31
+ outputFilterSensitiveLog: ListResourcePoliciesResultFilterSensitiveLog,
32
+ };
33
+ const { requestHandler } = configuration;
34
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
35
+ }
36
+ serialize(input, context) {
37
+ return serializeAws_restJson1ListResourcePoliciesCommand(input, context);
38
+ }
39
+ deserialize(output, context) {
40
+ return deserializeAws_restJson1ListResourcePoliciesCommand(output, context);
41
+ }
42
+ }
@@ -0,0 +1,42 @@
1
+ import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
2
+ import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3
+ import { Command as $Command } from "@aws-sdk/smithy-client";
4
+ import { PutResourcePolicyRequestFilterSensitiveLog, PutResourcePolicyResultFilterSensitiveLog, } from "../models/models_0";
5
+ import { deserializeAws_restJson1PutResourcePolicyCommand, serializeAws_restJson1PutResourcePolicyCommand, } from "../protocols/Aws_restJson1";
6
+ export class PutResourcePolicyCommand extends $Command {
7
+ constructor(input) {
8
+ super();
9
+ this.input = input;
10
+ }
11
+ static getEndpointParameterInstructions() {
12
+ return {
13
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
14
+ Endpoint: { type: "builtInParams", name: "endpoint" },
15
+ Region: { type: "builtInParams", name: "region" },
16
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
17
+ };
18
+ }
19
+ resolveMiddleware(clientStack, configuration, options) {
20
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
21
+ this.middlewareStack.use(getEndpointPlugin(configuration, PutResourcePolicyCommand.getEndpointParameterInstructions()));
22
+ const stack = clientStack.concat(this.middlewareStack);
23
+ const { logger } = configuration;
24
+ const clientName = "XRayClient";
25
+ const commandName = "PutResourcePolicyCommand";
26
+ const handlerExecutionContext = {
27
+ logger,
28
+ clientName,
29
+ commandName,
30
+ inputFilterSensitiveLog: PutResourcePolicyRequestFilterSensitiveLog,
31
+ outputFilterSensitiveLog: PutResourcePolicyResultFilterSensitiveLog,
32
+ };
33
+ const { requestHandler } = configuration;
34
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
35
+ }
36
+ serialize(input, context) {
37
+ return serializeAws_restJson1PutResourcePolicyCommand(input, context);
38
+ }
39
+ deserialize(output, context) {
40
+ return deserializeAws_restJson1PutResourcePolicyCommand(output, context);
41
+ }
42
+ }
@@ -2,6 +2,7 @@ export * from "./BatchGetTracesCommand";
2
2
  export * from "./CreateGroupCommand";
3
3
  export * from "./CreateSamplingRuleCommand";
4
4
  export * from "./DeleteGroupCommand";
5
+ export * from "./DeleteResourcePolicyCommand";
5
6
  export * from "./DeleteSamplingRuleCommand";
6
7
  export * from "./GetEncryptionConfigCommand";
7
8
  export * from "./GetGroupCommand";
@@ -17,8 +18,10 @@ export * from "./GetServiceGraphCommand";
17
18
  export * from "./GetTimeSeriesServiceStatisticsCommand";
18
19
  export * from "./GetTraceGraphCommand";
19
20
  export * from "./GetTraceSummariesCommand";
21
+ export * from "./ListResourcePoliciesCommand";
20
22
  export * from "./ListTagsForResourceCommand";
21
23
  export * from "./PutEncryptionConfigCommand";
24
+ export * from "./PutResourcePolicyCommand";
22
25
  export * from "./PutTelemetryRecordsCommand";
23
26
  export * from "./PutTraceSegmentsCommand";
24
27
  export * from "./TagResourceCommand";