@aws-sdk/client-xray 3.211.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.
- package/dist-cjs/XRay.js +45 -0
- package/dist-cjs/commands/DeleteResourcePolicyCommand.js +46 -0
- package/dist-cjs/commands/ListResourcePoliciesCommand.js +46 -0
- package/dist-cjs/commands/PutResourcePolicyCommand.js +46 -0
- package/dist-cjs/commands/index.js +3 -0
- package/dist-cjs/models/models_0.js +102 -7
- package/dist-cjs/pagination/ListResourcePoliciesPaginator.js +35 -0
- package/dist-cjs/pagination/ListTagsForResourcePaginator.js +35 -0
- package/dist-cjs/pagination/index.js +2 -0
- package/dist-cjs/protocols/Aws_restJson1.js +282 -14
- package/dist-es/XRay.js +45 -0
- package/dist-es/commands/DeleteResourcePolicyCommand.js +42 -0
- package/dist-es/commands/ListResourcePoliciesCommand.js +42 -0
- package/dist-es/commands/PutResourcePolicyCommand.js +42 -0
- package/dist-es/commands/index.js +3 -0
- package/dist-es/models/models_0.js +87 -4
- package/dist-es/pagination/ListResourcePoliciesPaginator.js +31 -0
- package/dist-es/pagination/ListTagsForResourcePaginator.js +31 -0
- package/dist-es/pagination/index.js +2 -0
- package/dist-es/protocols/Aws_restJson1.js +275 -13
- package/dist-types/XRay.d.ts +26 -0
- package/dist-types/XRayClient.d.ts +5 -2
- package/dist-types/commands/DeleteResourcePolicyCommand.d.ts +37 -0
- package/dist-types/commands/ListResourcePoliciesCommand.d.ts +37 -0
- package/dist-types/commands/PutResourcePolicyCommand.d.ts +42 -0
- package/dist-types/commands/index.d.ts +3 -0
- package/dist-types/models/models_0.d.ts +177 -2
- package/dist-types/pagination/ListResourcePoliciesPaginator.d.ts +4 -0
- package/dist-types/pagination/ListTagsForResourcePaginator.d.ts +4 -0
- package/dist-types/pagination/index.d.ts +2 -0
- package/dist-types/protocols/Aws_restJson1.d.ts +9 -0
- package/dist-types/ts3.4/XRay.d.ts +51 -0
- package/dist-types/ts3.4/XRayClient.d.ts +18 -0
- package/dist-types/ts3.4/commands/DeleteResourcePolicyCommand.d.ts +41 -0
- package/dist-types/ts3.4/commands/ListResourcePoliciesCommand.d.ts +41 -0
- package/dist-types/ts3.4/commands/PutResourcePolicyCommand.d.ts +38 -0
- package/dist-types/ts3.4/commands/index.d.ts +3 -0
- package/dist-types/ts3.4/models/models_0.d.ts +100 -0
- package/dist-types/ts3.4/pagination/ListResourcePoliciesPaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/ListTagsForResourcePaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/index.d.ts +2 -0
- package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +36 -0
- package/package.json +28 -28
|
@@ -50,6 +50,19 @@ export class RuleLimitExceededException extends __BaseException {
|
|
|
50
50
|
this.Message = opts.Message;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
+
export class InvalidPolicyRevisionIdException extends __BaseException {
|
|
54
|
+
constructor(opts) {
|
|
55
|
+
super({
|
|
56
|
+
name: "InvalidPolicyRevisionIdException",
|
|
57
|
+
$fault: "client",
|
|
58
|
+
...opts,
|
|
59
|
+
});
|
|
60
|
+
this.name = "InvalidPolicyRevisionIdException";
|
|
61
|
+
this.$fault = "client";
|
|
62
|
+
Object.setPrototypeOf(this, InvalidPolicyRevisionIdException.prototype);
|
|
63
|
+
this.Message = opts.Message;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
53
66
|
export var EncryptionStatus;
|
|
54
67
|
(function (EncryptionStatus) {
|
|
55
68
|
EncryptionStatus["ACTIVE"] = "ACTIVE";
|
|
@@ -93,6 +106,58 @@ export class ResourceNotFoundException extends __BaseException {
|
|
|
93
106
|
this.ResourceName = opts.ResourceName;
|
|
94
107
|
}
|
|
95
108
|
}
|
|
109
|
+
export class LockoutPreventionException extends __BaseException {
|
|
110
|
+
constructor(opts) {
|
|
111
|
+
super({
|
|
112
|
+
name: "LockoutPreventionException",
|
|
113
|
+
$fault: "client",
|
|
114
|
+
...opts,
|
|
115
|
+
});
|
|
116
|
+
this.name = "LockoutPreventionException";
|
|
117
|
+
this.$fault = "client";
|
|
118
|
+
Object.setPrototypeOf(this, LockoutPreventionException.prototype);
|
|
119
|
+
this.Message = opts.Message;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
export class MalformedPolicyDocumentException extends __BaseException {
|
|
123
|
+
constructor(opts) {
|
|
124
|
+
super({
|
|
125
|
+
name: "MalformedPolicyDocumentException",
|
|
126
|
+
$fault: "client",
|
|
127
|
+
...opts,
|
|
128
|
+
});
|
|
129
|
+
this.name = "MalformedPolicyDocumentException";
|
|
130
|
+
this.$fault = "client";
|
|
131
|
+
Object.setPrototypeOf(this, MalformedPolicyDocumentException.prototype);
|
|
132
|
+
this.Message = opts.Message;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
export class PolicyCountLimitExceededException extends __BaseException {
|
|
136
|
+
constructor(opts) {
|
|
137
|
+
super({
|
|
138
|
+
name: "PolicyCountLimitExceededException",
|
|
139
|
+
$fault: "client",
|
|
140
|
+
...opts,
|
|
141
|
+
});
|
|
142
|
+
this.name = "PolicyCountLimitExceededException";
|
|
143
|
+
this.$fault = "client";
|
|
144
|
+
Object.setPrototypeOf(this, PolicyCountLimitExceededException.prototype);
|
|
145
|
+
this.Message = opts.Message;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
export class PolicySizeLimitExceededException extends __BaseException {
|
|
149
|
+
constructor(opts) {
|
|
150
|
+
super({
|
|
151
|
+
name: "PolicySizeLimitExceededException",
|
|
152
|
+
$fault: "client",
|
|
153
|
+
...opts,
|
|
154
|
+
});
|
|
155
|
+
this.name = "PolicySizeLimitExceededException";
|
|
156
|
+
this.$fault = "client";
|
|
157
|
+
Object.setPrototypeOf(this, PolicySizeLimitExceededException.prototype);
|
|
158
|
+
this.Message = opts.Message;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
96
161
|
export class TooManyTagsException extends __BaseException {
|
|
97
162
|
constructor(opts) {
|
|
98
163
|
super({
|
|
@@ -178,6 +243,12 @@ export const DeleteGroupRequestFilterSensitiveLog = (obj) => ({
|
|
|
178
243
|
export const DeleteGroupResultFilterSensitiveLog = (obj) => ({
|
|
179
244
|
...obj,
|
|
180
245
|
});
|
|
246
|
+
export const DeleteResourcePolicyRequestFilterSensitiveLog = (obj) => ({
|
|
247
|
+
...obj,
|
|
248
|
+
});
|
|
249
|
+
export const DeleteResourcePolicyResultFilterSensitiveLog = (obj) => ({
|
|
250
|
+
...obj,
|
|
251
|
+
});
|
|
181
252
|
export const DeleteSamplingRuleRequestFilterSensitiveLog = (obj) => ({
|
|
182
253
|
...obj,
|
|
183
254
|
});
|
|
@@ -376,15 +447,21 @@ export const TraceUserFilterSensitiveLog = (obj) => ({
|
|
|
376
447
|
export const TraceSummaryFilterSensitiveLog = (obj) => ({
|
|
377
448
|
...obj,
|
|
378
449
|
...(obj.Annotations && {
|
|
379
|
-
Annotations: Object.entries(obj.Annotations).reduce((acc, [key, value]) => ({
|
|
380
|
-
...acc,
|
|
381
|
-
[key]: value.map((item) => ValueWithServiceIdsFilterSensitiveLog(item)),
|
|
382
|
-
}), {}),
|
|
450
|
+
Annotations: Object.entries(obj.Annotations).reduce((acc, [key, value]) => ((acc[key] = value.map((item) => ValueWithServiceIdsFilterSensitiveLog(item))), acc), {}),
|
|
383
451
|
}),
|
|
384
452
|
});
|
|
385
453
|
export const GetTraceSummariesResultFilterSensitiveLog = (obj) => ({
|
|
386
454
|
...obj,
|
|
387
455
|
});
|
|
456
|
+
export const ListResourcePoliciesRequestFilterSensitiveLog = (obj) => ({
|
|
457
|
+
...obj,
|
|
458
|
+
});
|
|
459
|
+
export const ResourcePolicyFilterSensitiveLog = (obj) => ({
|
|
460
|
+
...obj,
|
|
461
|
+
});
|
|
462
|
+
export const ListResourcePoliciesResultFilterSensitiveLog = (obj) => ({
|
|
463
|
+
...obj,
|
|
464
|
+
});
|
|
388
465
|
export const ListTagsForResourceRequestFilterSensitiveLog = (obj) => ({
|
|
389
466
|
...obj,
|
|
390
467
|
});
|
|
@@ -397,6 +474,12 @@ export const PutEncryptionConfigRequestFilterSensitiveLog = (obj) => ({
|
|
|
397
474
|
export const PutEncryptionConfigResultFilterSensitiveLog = (obj) => ({
|
|
398
475
|
...obj,
|
|
399
476
|
});
|
|
477
|
+
export const PutResourcePolicyRequestFilterSensitiveLog = (obj) => ({
|
|
478
|
+
...obj,
|
|
479
|
+
});
|
|
480
|
+
export const PutResourcePolicyResultFilterSensitiveLog = (obj) => ({
|
|
481
|
+
...obj,
|
|
482
|
+
});
|
|
400
483
|
export const BackendConnectionErrorsFilterSensitiveLog = (obj) => ({
|
|
401
484
|
...obj,
|
|
402
485
|
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ListResourcePoliciesCommand, } from "../commands/ListResourcePoliciesCommand";
|
|
2
|
+
import { XRay } from "../XRay";
|
|
3
|
+
import { XRayClient } from "../XRayClient";
|
|
4
|
+
const makePagedClientRequest = async (client, input, ...args) => {
|
|
5
|
+
return await client.send(new ListResourcePoliciesCommand(input), ...args);
|
|
6
|
+
};
|
|
7
|
+
const makePagedRequest = async (client, input, ...args) => {
|
|
8
|
+
return await client.listResourcePolicies(input, ...args);
|
|
9
|
+
};
|
|
10
|
+
export async function* paginateListResourcePolicies(config, input, ...additionalArguments) {
|
|
11
|
+
let token = config.startingToken || undefined;
|
|
12
|
+
let hasNext = true;
|
|
13
|
+
let page;
|
|
14
|
+
while (hasNext) {
|
|
15
|
+
input.NextToken = token;
|
|
16
|
+
if (config.client instanceof XRay) {
|
|
17
|
+
page = await makePagedRequest(config.client, input, ...additionalArguments);
|
|
18
|
+
}
|
|
19
|
+
else if (config.client instanceof XRayClient) {
|
|
20
|
+
page = await makePagedClientRequest(config.client, input, ...additionalArguments);
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
throw new Error("Invalid client, expected XRay | XRayClient");
|
|
24
|
+
}
|
|
25
|
+
yield page;
|
|
26
|
+
const prevToken = token;
|
|
27
|
+
token = page.NextToken;
|
|
28
|
+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
|
|
29
|
+
}
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ListTagsForResourceCommand, } from "../commands/ListTagsForResourceCommand";
|
|
2
|
+
import { XRay } from "../XRay";
|
|
3
|
+
import { XRayClient } from "../XRayClient";
|
|
4
|
+
const makePagedClientRequest = async (client, input, ...args) => {
|
|
5
|
+
return await client.send(new ListTagsForResourceCommand(input), ...args);
|
|
6
|
+
};
|
|
7
|
+
const makePagedRequest = async (client, input, ...args) => {
|
|
8
|
+
return await client.listTagsForResource(input, ...args);
|
|
9
|
+
};
|
|
10
|
+
export async function* paginateListTagsForResource(config, input, ...additionalArguments) {
|
|
11
|
+
let token = config.startingToken || undefined;
|
|
12
|
+
let hasNext = true;
|
|
13
|
+
let page;
|
|
14
|
+
while (hasNext) {
|
|
15
|
+
input.NextToken = token;
|
|
16
|
+
if (config.client instanceof XRay) {
|
|
17
|
+
page = await makePagedRequest(config.client, input, ...additionalArguments);
|
|
18
|
+
}
|
|
19
|
+
else if (config.client instanceof XRayClient) {
|
|
20
|
+
page = await makePagedClientRequest(config.client, input, ...additionalArguments);
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
throw new Error("Invalid client, expected XRay | XRayClient");
|
|
24
|
+
}
|
|
25
|
+
yield page;
|
|
26
|
+
const prevToken = token;
|
|
27
|
+
token = page.NextToken;
|
|
28
|
+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
|
|
29
|
+
}
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
@@ -9,3 +9,5 @@ export * from "./GetTimeSeriesServiceStatisticsPaginator";
|
|
|
9
9
|
export * from "./GetTraceGraphPaginator";
|
|
10
10
|
export * from "./GetTraceSummariesPaginator";
|
|
11
11
|
export * from "./Interfaces";
|
|
12
|
+
export * from "./ListResourcePoliciesPaginator";
|
|
13
|
+
export * from "./ListTagsForResourcePaginator";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
|
|
2
2
|
import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, expectUnion as __expectUnion, limitedParseDouble as __limitedParseDouble, map as __map, parseEpochTimestamp as __parseEpochTimestamp, serializeFloat as __serializeFloat, throwDefaultError, } from "@aws-sdk/smithy-client";
|
|
3
|
-
import { InvalidRequestException, ResourceNotFoundException, RuleLimitExceededException, ThrottledException, TooManyTagsException, } from "../models/models_0";
|
|
3
|
+
import { InvalidPolicyRevisionIdException, InvalidRequestException, LockoutPreventionException, MalformedPolicyDocumentException, PolicyCountLimitExceededException, PolicySizeLimitExceededException, ResourceNotFoundException, RuleLimitExceededException, ThrottledException, TooManyTagsException, } from "../models/models_0";
|
|
4
4
|
import { XRayServiceException as __BaseException } from "../models/XRayServiceException";
|
|
5
5
|
export const serializeAws_restJson1BatchGetTracesCommand = async (input, context) => {
|
|
6
6
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
@@ -92,6 +92,27 @@ export const serializeAws_restJson1DeleteGroupCommand = async (input, context) =
|
|
|
92
92
|
body,
|
|
93
93
|
});
|
|
94
94
|
};
|
|
95
|
+
export const serializeAws_restJson1DeleteResourcePolicyCommand = async (input, context) => {
|
|
96
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
97
|
+
const headers = {
|
|
98
|
+
"content-type": "application/json",
|
|
99
|
+
};
|
|
100
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/DeleteResourcePolicy";
|
|
101
|
+
let body;
|
|
102
|
+
body = JSON.stringify({
|
|
103
|
+
...(input.PolicyName != null && { PolicyName: input.PolicyName }),
|
|
104
|
+
...(input.PolicyRevisionId != null && { PolicyRevisionId: input.PolicyRevisionId }),
|
|
105
|
+
});
|
|
106
|
+
return new __HttpRequest({
|
|
107
|
+
protocol,
|
|
108
|
+
hostname,
|
|
109
|
+
port,
|
|
110
|
+
method: "POST",
|
|
111
|
+
headers,
|
|
112
|
+
path: resolvedPath,
|
|
113
|
+
body,
|
|
114
|
+
});
|
|
115
|
+
};
|
|
95
116
|
export const serializeAws_restJson1DeleteSamplingRuleCommand = async (input, context) => {
|
|
96
117
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
97
118
|
const headers = {
|
|
@@ -425,6 +446,26 @@ export const serializeAws_restJson1GetTraceSummariesCommand = async (input, cont
|
|
|
425
446
|
body,
|
|
426
447
|
});
|
|
427
448
|
};
|
|
449
|
+
export const serializeAws_restJson1ListResourcePoliciesCommand = async (input, context) => {
|
|
450
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
451
|
+
const headers = {
|
|
452
|
+
"content-type": "application/json",
|
|
453
|
+
};
|
|
454
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/ListResourcePolicies";
|
|
455
|
+
let body;
|
|
456
|
+
body = JSON.stringify({
|
|
457
|
+
...(input.NextToken != null && { NextToken: input.NextToken }),
|
|
458
|
+
});
|
|
459
|
+
return new __HttpRequest({
|
|
460
|
+
protocol,
|
|
461
|
+
hostname,
|
|
462
|
+
port,
|
|
463
|
+
method: "POST",
|
|
464
|
+
headers,
|
|
465
|
+
path: resolvedPath,
|
|
466
|
+
body,
|
|
467
|
+
});
|
|
468
|
+
};
|
|
428
469
|
export const serializeAws_restJson1ListTagsForResourceCommand = async (input, context) => {
|
|
429
470
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
430
471
|
const headers = {
|
|
@@ -467,6 +508,29 @@ export const serializeAws_restJson1PutEncryptionConfigCommand = async (input, co
|
|
|
467
508
|
body,
|
|
468
509
|
});
|
|
469
510
|
};
|
|
511
|
+
export const serializeAws_restJson1PutResourcePolicyCommand = async (input, context) => {
|
|
512
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
513
|
+
const headers = {
|
|
514
|
+
"content-type": "application/json",
|
|
515
|
+
};
|
|
516
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/PutResourcePolicy";
|
|
517
|
+
let body;
|
|
518
|
+
body = JSON.stringify({
|
|
519
|
+
...(input.BypassPolicyLockoutCheck != null && { BypassPolicyLockoutCheck: input.BypassPolicyLockoutCheck }),
|
|
520
|
+
...(input.PolicyDocument != null && { PolicyDocument: input.PolicyDocument }),
|
|
521
|
+
...(input.PolicyName != null && { PolicyName: input.PolicyName }),
|
|
522
|
+
...(input.PolicyRevisionId != null && { PolicyRevisionId: input.PolicyRevisionId }),
|
|
523
|
+
});
|
|
524
|
+
return new __HttpRequest({
|
|
525
|
+
protocol,
|
|
526
|
+
hostname,
|
|
527
|
+
port,
|
|
528
|
+
method: "POST",
|
|
529
|
+
headers,
|
|
530
|
+
path: resolvedPath,
|
|
531
|
+
body,
|
|
532
|
+
});
|
|
533
|
+
};
|
|
470
534
|
export const serializeAws_restJson1PutTelemetryRecordsCommand = async (input, context) => {
|
|
471
535
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
472
536
|
const headers = {
|
|
@@ -753,6 +817,42 @@ const deserializeAws_restJson1DeleteGroupCommandError = async (output, context)
|
|
|
753
817
|
});
|
|
754
818
|
}
|
|
755
819
|
};
|
|
820
|
+
export const deserializeAws_restJson1DeleteResourcePolicyCommand = async (output, context) => {
|
|
821
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
822
|
+
return deserializeAws_restJson1DeleteResourcePolicyCommandError(output, context);
|
|
823
|
+
}
|
|
824
|
+
const contents = map({
|
|
825
|
+
$metadata: deserializeMetadata(output),
|
|
826
|
+
});
|
|
827
|
+
await collectBody(output.body, context);
|
|
828
|
+
return contents;
|
|
829
|
+
};
|
|
830
|
+
const deserializeAws_restJson1DeleteResourcePolicyCommandError = async (output, context) => {
|
|
831
|
+
const parsedOutput = {
|
|
832
|
+
...output,
|
|
833
|
+
body: await parseErrorBody(output.body, context),
|
|
834
|
+
};
|
|
835
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
836
|
+
switch (errorCode) {
|
|
837
|
+
case "InvalidPolicyRevisionIdException":
|
|
838
|
+
case "com.amazonaws.xray#InvalidPolicyRevisionIdException":
|
|
839
|
+
throw await deserializeAws_restJson1InvalidPolicyRevisionIdExceptionResponse(parsedOutput, context);
|
|
840
|
+
case "InvalidRequestException":
|
|
841
|
+
case "com.amazonaws.xray#InvalidRequestException":
|
|
842
|
+
throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
|
|
843
|
+
case "ThrottledException":
|
|
844
|
+
case "com.amazonaws.xray#ThrottledException":
|
|
845
|
+
throw await deserializeAws_restJson1ThrottledExceptionResponse(parsedOutput, context);
|
|
846
|
+
default:
|
|
847
|
+
const parsedBody = parsedOutput.body;
|
|
848
|
+
throwDefaultError({
|
|
849
|
+
output,
|
|
850
|
+
parsedBody,
|
|
851
|
+
exceptionCtor: __BaseException,
|
|
852
|
+
errorCode,
|
|
853
|
+
});
|
|
854
|
+
}
|
|
855
|
+
};
|
|
756
856
|
export const deserializeAws_restJson1DeleteSamplingRuleCommand = async (output, context) => {
|
|
757
857
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
758
858
|
return deserializeAws_restJson1DeleteSamplingRuleCommandError(output, context);
|
|
@@ -1362,6 +1462,45 @@ const deserializeAws_restJson1GetTraceSummariesCommandError = async (output, con
|
|
|
1362
1462
|
});
|
|
1363
1463
|
}
|
|
1364
1464
|
};
|
|
1465
|
+
export const deserializeAws_restJson1ListResourcePoliciesCommand = async (output, context) => {
|
|
1466
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1467
|
+
return deserializeAws_restJson1ListResourcePoliciesCommandError(output, context);
|
|
1468
|
+
}
|
|
1469
|
+
const contents = map({
|
|
1470
|
+
$metadata: deserializeMetadata(output),
|
|
1471
|
+
});
|
|
1472
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1473
|
+
if (data.NextToken != null) {
|
|
1474
|
+
contents.NextToken = __expectString(data.NextToken);
|
|
1475
|
+
}
|
|
1476
|
+
if (data.ResourcePolicies != null) {
|
|
1477
|
+
contents.ResourcePolicies = deserializeAws_restJson1ResourcePolicyList(data.ResourcePolicies, context);
|
|
1478
|
+
}
|
|
1479
|
+
return contents;
|
|
1480
|
+
};
|
|
1481
|
+
const deserializeAws_restJson1ListResourcePoliciesCommandError = async (output, context) => {
|
|
1482
|
+
const parsedOutput = {
|
|
1483
|
+
...output,
|
|
1484
|
+
body: await parseErrorBody(output.body, context),
|
|
1485
|
+
};
|
|
1486
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1487
|
+
switch (errorCode) {
|
|
1488
|
+
case "InvalidRequestException":
|
|
1489
|
+
case "com.amazonaws.xray#InvalidRequestException":
|
|
1490
|
+
throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
|
|
1491
|
+
case "ThrottledException":
|
|
1492
|
+
case "com.amazonaws.xray#ThrottledException":
|
|
1493
|
+
throw await deserializeAws_restJson1ThrottledExceptionResponse(parsedOutput, context);
|
|
1494
|
+
default:
|
|
1495
|
+
const parsedBody = parsedOutput.body;
|
|
1496
|
+
throwDefaultError({
|
|
1497
|
+
output,
|
|
1498
|
+
parsedBody,
|
|
1499
|
+
exceptionCtor: __BaseException,
|
|
1500
|
+
errorCode,
|
|
1501
|
+
});
|
|
1502
|
+
}
|
|
1503
|
+
};
|
|
1365
1504
|
export const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
|
|
1366
1505
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1367
1506
|
return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
|
|
@@ -1440,6 +1579,54 @@ const deserializeAws_restJson1PutEncryptionConfigCommandError = async (output, c
|
|
|
1440
1579
|
});
|
|
1441
1580
|
}
|
|
1442
1581
|
};
|
|
1582
|
+
export const deserializeAws_restJson1PutResourcePolicyCommand = async (output, context) => {
|
|
1583
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1584
|
+
return deserializeAws_restJson1PutResourcePolicyCommandError(output, context);
|
|
1585
|
+
}
|
|
1586
|
+
const contents = map({
|
|
1587
|
+
$metadata: deserializeMetadata(output),
|
|
1588
|
+
});
|
|
1589
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1590
|
+
if (data.ResourcePolicy != null) {
|
|
1591
|
+
contents.ResourcePolicy = deserializeAws_restJson1ResourcePolicy(data.ResourcePolicy, context);
|
|
1592
|
+
}
|
|
1593
|
+
return contents;
|
|
1594
|
+
};
|
|
1595
|
+
const deserializeAws_restJson1PutResourcePolicyCommandError = async (output, context) => {
|
|
1596
|
+
const parsedOutput = {
|
|
1597
|
+
...output,
|
|
1598
|
+
body: await parseErrorBody(output.body, context),
|
|
1599
|
+
};
|
|
1600
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1601
|
+
switch (errorCode) {
|
|
1602
|
+
case "InvalidPolicyRevisionIdException":
|
|
1603
|
+
case "com.amazonaws.xray#InvalidPolicyRevisionIdException":
|
|
1604
|
+
throw await deserializeAws_restJson1InvalidPolicyRevisionIdExceptionResponse(parsedOutput, context);
|
|
1605
|
+
case "LockoutPreventionException":
|
|
1606
|
+
case "com.amazonaws.xray#LockoutPreventionException":
|
|
1607
|
+
throw await deserializeAws_restJson1LockoutPreventionExceptionResponse(parsedOutput, context);
|
|
1608
|
+
case "MalformedPolicyDocumentException":
|
|
1609
|
+
case "com.amazonaws.xray#MalformedPolicyDocumentException":
|
|
1610
|
+
throw await deserializeAws_restJson1MalformedPolicyDocumentExceptionResponse(parsedOutput, context);
|
|
1611
|
+
case "PolicyCountLimitExceededException":
|
|
1612
|
+
case "com.amazonaws.xray#PolicyCountLimitExceededException":
|
|
1613
|
+
throw await deserializeAws_restJson1PolicyCountLimitExceededExceptionResponse(parsedOutput, context);
|
|
1614
|
+
case "PolicySizeLimitExceededException":
|
|
1615
|
+
case "com.amazonaws.xray#PolicySizeLimitExceededException":
|
|
1616
|
+
throw await deserializeAws_restJson1PolicySizeLimitExceededExceptionResponse(parsedOutput, context);
|
|
1617
|
+
case "ThrottledException":
|
|
1618
|
+
case "com.amazonaws.xray#ThrottledException":
|
|
1619
|
+
throw await deserializeAws_restJson1ThrottledExceptionResponse(parsedOutput, context);
|
|
1620
|
+
default:
|
|
1621
|
+
const parsedBody = parsedOutput.body;
|
|
1622
|
+
throwDefaultError({
|
|
1623
|
+
output,
|
|
1624
|
+
parsedBody,
|
|
1625
|
+
exceptionCtor: __BaseException,
|
|
1626
|
+
errorCode,
|
|
1627
|
+
});
|
|
1628
|
+
}
|
|
1629
|
+
};
|
|
1443
1630
|
export const deserializeAws_restJson1PutTelemetryRecordsCommand = async (output, context) => {
|
|
1444
1631
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1445
1632
|
return deserializeAws_restJson1PutTelemetryRecordsCommandError(output, context);
|
|
@@ -1657,6 +1844,18 @@ const deserializeAws_restJson1UpdateSamplingRuleCommandError = async (output, co
|
|
|
1657
1844
|
}
|
|
1658
1845
|
};
|
|
1659
1846
|
const map = __map;
|
|
1847
|
+
const deserializeAws_restJson1InvalidPolicyRevisionIdExceptionResponse = async (parsedOutput, context) => {
|
|
1848
|
+
const contents = map({});
|
|
1849
|
+
const data = parsedOutput.body;
|
|
1850
|
+
if (data.Message != null) {
|
|
1851
|
+
contents.Message = __expectString(data.Message);
|
|
1852
|
+
}
|
|
1853
|
+
const exception = new InvalidPolicyRevisionIdException({
|
|
1854
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
1855
|
+
...contents,
|
|
1856
|
+
});
|
|
1857
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
1858
|
+
};
|
|
1660
1859
|
const deserializeAws_restJson1InvalidRequestExceptionResponse = async (parsedOutput, context) => {
|
|
1661
1860
|
const contents = map({});
|
|
1662
1861
|
const data = parsedOutput.body;
|
|
@@ -1669,6 +1868,54 @@ const deserializeAws_restJson1InvalidRequestExceptionResponse = async (parsedOut
|
|
|
1669
1868
|
});
|
|
1670
1869
|
return __decorateServiceException(exception, parsedOutput.body);
|
|
1671
1870
|
};
|
|
1871
|
+
const deserializeAws_restJson1LockoutPreventionExceptionResponse = async (parsedOutput, context) => {
|
|
1872
|
+
const contents = map({});
|
|
1873
|
+
const data = parsedOutput.body;
|
|
1874
|
+
if (data.Message != null) {
|
|
1875
|
+
contents.Message = __expectString(data.Message);
|
|
1876
|
+
}
|
|
1877
|
+
const exception = new LockoutPreventionException({
|
|
1878
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
1879
|
+
...contents,
|
|
1880
|
+
});
|
|
1881
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
1882
|
+
};
|
|
1883
|
+
const deserializeAws_restJson1MalformedPolicyDocumentExceptionResponse = async (parsedOutput, context) => {
|
|
1884
|
+
const contents = map({});
|
|
1885
|
+
const data = parsedOutput.body;
|
|
1886
|
+
if (data.Message != null) {
|
|
1887
|
+
contents.Message = __expectString(data.Message);
|
|
1888
|
+
}
|
|
1889
|
+
const exception = new MalformedPolicyDocumentException({
|
|
1890
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
1891
|
+
...contents,
|
|
1892
|
+
});
|
|
1893
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
1894
|
+
};
|
|
1895
|
+
const deserializeAws_restJson1PolicyCountLimitExceededExceptionResponse = async (parsedOutput, context) => {
|
|
1896
|
+
const contents = map({});
|
|
1897
|
+
const data = parsedOutput.body;
|
|
1898
|
+
if (data.Message != null) {
|
|
1899
|
+
contents.Message = __expectString(data.Message);
|
|
1900
|
+
}
|
|
1901
|
+
const exception = new PolicyCountLimitExceededException({
|
|
1902
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
1903
|
+
...contents,
|
|
1904
|
+
});
|
|
1905
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
1906
|
+
};
|
|
1907
|
+
const deserializeAws_restJson1PolicySizeLimitExceededExceptionResponse = async (parsedOutput, context) => {
|
|
1908
|
+
const contents = map({});
|
|
1909
|
+
const data = parsedOutput.body;
|
|
1910
|
+
if (data.Message != null) {
|
|
1911
|
+
contents.Message = __expectString(data.Message);
|
|
1912
|
+
}
|
|
1913
|
+
const exception = new PolicySizeLimitExceededException({
|
|
1914
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
1915
|
+
...contents,
|
|
1916
|
+
});
|
|
1917
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
1918
|
+
};
|
|
1672
1919
|
const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
|
|
1673
1920
|
const contents = map({});
|
|
1674
1921
|
const data = parsedOutput.body;
|
|
@@ -1728,10 +1975,8 @@ const serializeAws_restJson1AttributeMap = (input, context) => {
|
|
|
1728
1975
|
if (value === null) {
|
|
1729
1976
|
return acc;
|
|
1730
1977
|
}
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
[key]: value,
|
|
1734
|
-
};
|
|
1978
|
+
acc[key] = value;
|
|
1979
|
+
return acc;
|
|
1735
1980
|
}, {});
|
|
1736
1981
|
};
|
|
1737
1982
|
const serializeAws_restJson1BackendConnectionErrors = (input, context) => {
|
|
@@ -1900,10 +2145,8 @@ const deserializeAws_restJson1Annotations = (output, context) => {
|
|
|
1900
2145
|
if (value === null) {
|
|
1901
2146
|
return acc;
|
|
1902
2147
|
}
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
[key]: deserializeAws_restJson1ValuesWithServiceIds(value, context),
|
|
1906
|
-
};
|
|
2148
|
+
acc[key] = deserializeAws_restJson1ValuesWithServiceIds(value, context);
|
|
2149
|
+
return acc;
|
|
1907
2150
|
}, {});
|
|
1908
2151
|
};
|
|
1909
2152
|
const deserializeAws_restJson1AnnotationValue = (output, context) => {
|
|
@@ -1939,10 +2182,8 @@ const deserializeAws_restJson1AttributeMap = (output, context) => {
|
|
|
1939
2182
|
if (value === null) {
|
|
1940
2183
|
return acc;
|
|
1941
2184
|
}
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
[key]: __expectString(value),
|
|
1945
|
-
};
|
|
2185
|
+
acc[key] = __expectString(value);
|
|
2186
|
+
return acc;
|
|
1946
2187
|
}, {});
|
|
1947
2188
|
};
|
|
1948
2189
|
const deserializeAws_restJson1AvailabilityZoneDetail = (output, context) => {
|
|
@@ -2350,6 +2591,27 @@ const deserializeAws_restJson1ResourceARNDetail = (output, context) => {
|
|
|
2350
2591
|
ARN: __expectString(output.ARN),
|
|
2351
2592
|
};
|
|
2352
2593
|
};
|
|
2594
|
+
const deserializeAws_restJson1ResourcePolicy = (output, context) => {
|
|
2595
|
+
return {
|
|
2596
|
+
LastUpdatedTime: output.LastUpdatedTime != null
|
|
2597
|
+
? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.LastUpdatedTime)))
|
|
2598
|
+
: undefined,
|
|
2599
|
+
PolicyDocument: __expectString(output.PolicyDocument),
|
|
2600
|
+
PolicyName: __expectString(output.PolicyName),
|
|
2601
|
+
PolicyRevisionId: __expectString(output.PolicyRevisionId),
|
|
2602
|
+
};
|
|
2603
|
+
};
|
|
2604
|
+
const deserializeAws_restJson1ResourcePolicyList = (output, context) => {
|
|
2605
|
+
const retVal = (output || [])
|
|
2606
|
+
.filter((e) => e != null)
|
|
2607
|
+
.map((entry) => {
|
|
2608
|
+
if (entry === null) {
|
|
2609
|
+
return null;
|
|
2610
|
+
}
|
|
2611
|
+
return deserializeAws_restJson1ResourcePolicy(entry, context);
|
|
2612
|
+
});
|
|
2613
|
+
return retVal;
|
|
2614
|
+
};
|
|
2353
2615
|
const deserializeAws_restJson1ResponseTimeRootCause = (output, context) => {
|
|
2354
2616
|
return {
|
|
2355
2617
|
ClientImpacting: __expectBoolean(output.ClientImpacting),
|
package/dist-types/XRay.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { BatchGetTracesCommandInput, BatchGetTracesCommandOutput } from "./comma
|
|
|
3
3
|
import { CreateGroupCommandInput, CreateGroupCommandOutput } from "./commands/CreateGroupCommand";
|
|
4
4
|
import { CreateSamplingRuleCommandInput, CreateSamplingRuleCommandOutput } from "./commands/CreateSamplingRuleCommand";
|
|
5
5
|
import { DeleteGroupCommandInput, DeleteGroupCommandOutput } from "./commands/DeleteGroupCommand";
|
|
6
|
+
import { DeleteResourcePolicyCommandInput, DeleteResourcePolicyCommandOutput } from "./commands/DeleteResourcePolicyCommand";
|
|
6
7
|
import { DeleteSamplingRuleCommandInput, DeleteSamplingRuleCommandOutput } from "./commands/DeleteSamplingRuleCommand";
|
|
7
8
|
import { GetEncryptionConfigCommandInput, GetEncryptionConfigCommandOutput } from "./commands/GetEncryptionConfigCommand";
|
|
8
9
|
import { GetGroupCommandInput, GetGroupCommandOutput } from "./commands/GetGroupCommand";
|
|
@@ -18,8 +19,10 @@ import { GetServiceGraphCommandInput, GetServiceGraphCommandOutput } from "./com
|
|
|
18
19
|
import { GetTimeSeriesServiceStatisticsCommandInput, GetTimeSeriesServiceStatisticsCommandOutput } from "./commands/GetTimeSeriesServiceStatisticsCommand";
|
|
19
20
|
import { GetTraceGraphCommandInput, GetTraceGraphCommandOutput } from "./commands/GetTraceGraphCommand";
|
|
20
21
|
import { GetTraceSummariesCommandInput, GetTraceSummariesCommandOutput } from "./commands/GetTraceSummariesCommand";
|
|
22
|
+
import { ListResourcePoliciesCommandInput, ListResourcePoliciesCommandOutput } from "./commands/ListResourcePoliciesCommand";
|
|
21
23
|
import { ListTagsForResourceCommandInput, ListTagsForResourceCommandOutput } from "./commands/ListTagsForResourceCommand";
|
|
22
24
|
import { PutEncryptionConfigCommandInput, PutEncryptionConfigCommandOutput } from "./commands/PutEncryptionConfigCommand";
|
|
25
|
+
import { PutResourcePolicyCommandInput, PutResourcePolicyCommandOutput } from "./commands/PutResourcePolicyCommand";
|
|
23
26
|
import { PutTelemetryRecordsCommandInput, PutTelemetryRecordsCommandOutput } from "./commands/PutTelemetryRecordsCommand";
|
|
24
27
|
import { PutTraceSegmentsCommandInput, PutTraceSegmentsCommandOutput } from "./commands/PutTraceSegmentsCommand";
|
|
25
28
|
import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
|
|
@@ -64,6 +67,12 @@ export declare class XRay extends XRayClient {
|
|
|
64
67
|
deleteGroup(args: DeleteGroupCommandInput, options?: __HttpHandlerOptions): Promise<DeleteGroupCommandOutput>;
|
|
65
68
|
deleteGroup(args: DeleteGroupCommandInput, cb: (err: any, data?: DeleteGroupCommandOutput) => void): void;
|
|
66
69
|
deleteGroup(args: DeleteGroupCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: DeleteGroupCommandOutput) => void): void;
|
|
70
|
+
/**
|
|
71
|
+
* <p>Deletes a resource policy from the target Amazon Web Services account.</p>
|
|
72
|
+
*/
|
|
73
|
+
deleteResourcePolicy(args: DeleteResourcePolicyCommandInput, options?: __HttpHandlerOptions): Promise<DeleteResourcePolicyCommandOutput>;
|
|
74
|
+
deleteResourcePolicy(args: DeleteResourcePolicyCommandInput, cb: (err: any, data?: DeleteResourcePolicyCommandOutput) => void): void;
|
|
75
|
+
deleteResourcePolicy(args: DeleteResourcePolicyCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: DeleteResourcePolicyCommandOutput) => void): void;
|
|
67
76
|
/**
|
|
68
77
|
* <p>Deletes a sampling rule.</p>
|
|
69
78
|
*/
|
|
@@ -181,6 +190,12 @@ export declare class XRay extends XRayClient {
|
|
|
181
190
|
getTraceSummaries(args: GetTraceSummariesCommandInput, options?: __HttpHandlerOptions): Promise<GetTraceSummariesCommandOutput>;
|
|
182
191
|
getTraceSummaries(args: GetTraceSummariesCommandInput, cb: (err: any, data?: GetTraceSummariesCommandOutput) => void): void;
|
|
183
192
|
getTraceSummaries(args: GetTraceSummariesCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetTraceSummariesCommandOutput) => void): void;
|
|
193
|
+
/**
|
|
194
|
+
* <p>Returns the list of resource policies in the target Amazon Web Services account.</p>
|
|
195
|
+
*/
|
|
196
|
+
listResourcePolicies(args: ListResourcePoliciesCommandInput, options?: __HttpHandlerOptions): Promise<ListResourcePoliciesCommandOutput>;
|
|
197
|
+
listResourcePolicies(args: ListResourcePoliciesCommandInput, cb: (err: any, data?: ListResourcePoliciesCommandOutput) => void): void;
|
|
198
|
+
listResourcePolicies(args: ListResourcePoliciesCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: ListResourcePoliciesCommandOutput) => void): void;
|
|
184
199
|
/**
|
|
185
200
|
* <p>Returns a list of tags that are applied to the specified Amazon Web Services X-Ray group or sampling rule.</p>
|
|
186
201
|
*/
|
|
@@ -193,6 +208,17 @@ export declare class XRay extends XRayClient {
|
|
|
193
208
|
putEncryptionConfig(args: PutEncryptionConfigCommandInput, options?: __HttpHandlerOptions): Promise<PutEncryptionConfigCommandOutput>;
|
|
194
209
|
putEncryptionConfig(args: PutEncryptionConfigCommandInput, cb: (err: any, data?: PutEncryptionConfigCommandOutput) => void): void;
|
|
195
210
|
putEncryptionConfig(args: PutEncryptionConfigCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: PutEncryptionConfigCommandOutput) => void): void;
|
|
211
|
+
/**
|
|
212
|
+
* <p>
|
|
213
|
+
* Sets the resource policy to grant one or more Amazon Web Services services and accounts permissions to
|
|
214
|
+
* access X-Ray. Each resource policy will be associated with a specific Amazon Web Services account.
|
|
215
|
+
* Each Amazon Web Services account can have a maximum of 5 resource policies, and each policy name must be
|
|
216
|
+
* unique within that account. The maximum size of each resource policy is 5KB.
|
|
217
|
+
* </p>
|
|
218
|
+
*/
|
|
219
|
+
putResourcePolicy(args: PutResourcePolicyCommandInput, options?: __HttpHandlerOptions): Promise<PutResourcePolicyCommandOutput>;
|
|
220
|
+
putResourcePolicy(args: PutResourcePolicyCommandInput, cb: (err: any, data?: PutResourcePolicyCommandOutput) => void): void;
|
|
221
|
+
putResourcePolicy(args: PutResourcePolicyCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: PutResourcePolicyCommandOutput) => void): void;
|
|
196
222
|
/**
|
|
197
223
|
* <p>Used by the Amazon Web Services X-Ray daemon to upload telemetry.</p>
|
|
198
224
|
*/
|