@aws-sdk/client-codeguru-security 3.352.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/LICENSE +201 -0
- package/README.md +316 -0
- package/dist-cjs/CodeGuruSecurity.js +37 -0
- package/dist-cjs/CodeGuruSecurityClient.js +41 -0
- package/dist-cjs/commands/BatchGetFindingsCommand.js +46 -0
- package/dist-cjs/commands/CreateScanCommand.js +46 -0
- package/dist-cjs/commands/CreateUploadUrlCommand.js +47 -0
- package/dist-cjs/commands/GetAccountConfigurationCommand.js +46 -0
- package/dist-cjs/commands/GetFindingsCommand.js +46 -0
- package/dist-cjs/commands/GetMetricsSummaryCommand.js +46 -0
- package/dist-cjs/commands/GetScanCommand.js +46 -0
- package/dist-cjs/commands/ListFindingsMetricsCommand.js +46 -0
- package/dist-cjs/commands/ListScansCommand.js +46 -0
- package/dist-cjs/commands/ListTagsForResourceCommand.js +46 -0
- package/dist-cjs/commands/TagResourceCommand.js +46 -0
- package/dist-cjs/commands/UntagResourceCommand.js +46 -0
- package/dist-cjs/commands/UpdateAccountConfigurationCommand.js +46 -0
- package/dist-cjs/commands/index.js +16 -0
- package/dist-cjs/endpoint/EndpointParameters.js +12 -0
- package/dist-cjs/endpoint/endpointResolver.js +12 -0
- package/dist-cjs/endpoint/ruleset.js +7 -0
- package/dist-cjs/index.js +11 -0
- package/dist-cjs/models/CodeGuruSecurityServiceException.js +12 -0
- package/dist-cjs/models/index.js +4 -0
- package/dist-cjs/models/models_0.js +156 -0
- package/dist-cjs/pagination/GetFindingsPaginator.js +29 -0
- package/dist-cjs/pagination/Interfaces.js +2 -0
- package/dist-cjs/pagination/ListFindingsMetricsPaginator.js +29 -0
- package/dist-cjs/pagination/ListScansPaginator.js +29 -0
- package/dist-cjs/pagination/index.js +7 -0
- package/dist-cjs/protocols/Aws_restJson1.js +1131 -0
- package/dist-cjs/runtimeConfig.browser.js +39 -0
- package/dist-cjs/runtimeConfig.js +48 -0
- package/dist-cjs/runtimeConfig.native.js +15 -0
- package/dist-cjs/runtimeConfig.shared.js +21 -0
- package/dist-es/CodeGuruSecurity.js +33 -0
- package/dist-es/CodeGuruSecurityClient.js +37 -0
- package/dist-es/commands/BatchGetFindingsCommand.js +42 -0
- package/dist-es/commands/CreateScanCommand.js +42 -0
- package/dist-es/commands/CreateUploadUrlCommand.js +43 -0
- package/dist-es/commands/GetAccountConfigurationCommand.js +42 -0
- package/dist-es/commands/GetFindingsCommand.js +42 -0
- package/dist-es/commands/GetMetricsSummaryCommand.js +42 -0
- package/dist-es/commands/GetScanCommand.js +42 -0
- package/dist-es/commands/ListFindingsMetricsCommand.js +42 -0
- package/dist-es/commands/ListScansCommand.js +42 -0
- package/dist-es/commands/ListTagsForResourceCommand.js +42 -0
- package/dist-es/commands/TagResourceCommand.js +42 -0
- package/dist-es/commands/UntagResourceCommand.js +42 -0
- package/dist-es/commands/UpdateAccountConfigurationCommand.js +42 -0
- package/dist-es/commands/index.js +13 -0
- package/dist-es/endpoint/EndpointParameters.js +8 -0
- package/dist-es/endpoint/endpointResolver.js +8 -0
- package/dist-es/endpoint/ruleset.js +4 -0
- package/dist-es/index.js +6 -0
- package/dist-es/models/CodeGuruSecurityServiceException.js +8 -0
- package/dist-es/models/index.js +1 -0
- package/dist-es/models/models_0.js +146 -0
- package/dist-es/pagination/GetFindingsPaginator.js +25 -0
- package/dist-es/pagination/Interfaces.js +1 -0
- package/dist-es/pagination/ListFindingsMetricsPaginator.js +25 -0
- package/dist-es/pagination/ListScansPaginator.js +25 -0
- package/dist-es/pagination/index.js +4 -0
- package/dist-es/protocols/Aws_restJson1.js +1102 -0
- package/dist-es/runtimeConfig.browser.js +34 -0
- package/dist-es/runtimeConfig.js +43 -0
- package/dist-es/runtimeConfig.native.js +11 -0
- package/dist-es/runtimeConfig.shared.js +17 -0
- package/dist-types/CodeGuruSecurity.d.ts +108 -0
- package/dist-types/CodeGuruSecurityClient.d.ts +182 -0
- package/dist-types/commands/BatchGetFindingsCommand.d.ts +154 -0
- package/dist-types/commands/CreateScanCommand.d.ts +108 -0
- package/dist-types/commands/CreateUploadUrlCommand.d.ts +91 -0
- package/dist-types/commands/GetAccountConfigurationCommand.d.ts +85 -0
- package/dist-types/commands/GetFindingsCommand.d.ts +153 -0
- package/dist-types/commands/GetMetricsSummaryCommand.d.ts +114 -0
- package/dist-types/commands/GetScanCommand.d.ts +93 -0
- package/dist-types/commands/ListFindingsMetricsCommand.d.ts +121 -0
- package/dist-types/commands/ListScansCommand.d.ts +96 -0
- package/dist-types/commands/ListTagsForResourceCommand.d.ts +95 -0
- package/dist-types/commands/TagResourceCommand.d.ts +94 -0
- package/dist-types/commands/UntagResourceCommand.d.ts +94 -0
- package/dist-types/commands/UpdateAccountConfigurationCommand.d.ts +92 -0
- package/dist-types/commands/index.d.ts +13 -0
- package/dist-types/endpoint/EndpointParameters.d.ts +20 -0
- package/dist-types/endpoint/endpointResolver.d.ts +5 -0
- package/dist-types/endpoint/ruleset.d.ts +2 -0
- package/dist-types/index.d.ts +18 -0
- package/dist-types/models/CodeGuruSecurityServiceException.d.ts +13 -0
- package/dist-types/models/index.d.ts +1 -0
- package/dist-types/models/models_0.d.ts +1114 -0
- package/dist-types/pagination/GetFindingsPaginator.d.ts +7 -0
- package/dist-types/pagination/Interfaces.d.ts +8 -0
- package/dist-types/pagination/ListFindingsMetricsPaginator.d.ts +7 -0
- package/dist-types/pagination/ListScansPaginator.d.ts +7 -0
- package/dist-types/pagination/index.d.ts +4 -0
- package/dist-types/protocols/Aws_restJson1.d.ts +119 -0
- package/dist-types/runtimeConfig.browser.d.ts +42 -0
- package/dist-types/runtimeConfig.d.ts +42 -0
- package/dist-types/runtimeConfig.native.d.ts +41 -0
- package/dist-types/runtimeConfig.shared.d.ts +18 -0
- package/dist-types/ts3.4/CodeGuruSecurity.d.ts +228 -0
- package/dist-types/ts3.4/CodeGuruSecurityClient.d.ts +193 -0
- package/dist-types/ts3.4/commands/BatchGetFindingsCommand.d.ts +38 -0
- package/dist-types/ts3.4/commands/CreateScanCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/CreateUploadUrlCommand.d.ts +38 -0
- package/dist-types/ts3.4/commands/GetAccountConfigurationCommand.d.ts +42 -0
- package/dist-types/ts3.4/commands/GetFindingsCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/GetMetricsSummaryCommand.d.ts +39 -0
- package/dist-types/ts3.4/commands/GetScanCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/ListFindingsMetricsCommand.d.ts +39 -0
- package/dist-types/ts3.4/commands/ListScansCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/ListTagsForResourceCommand.d.ts +39 -0
- package/dist-types/ts3.4/commands/TagResourceCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/UntagResourceCommand.d.ts +38 -0
- package/dist-types/ts3.4/commands/UpdateAccountConfigurationCommand.d.ts +42 -0
- package/dist-types/ts3.4/commands/index.d.ts +13 -0
- package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +32 -0
- package/dist-types/ts3.4/endpoint/endpointResolver.d.ts +8 -0
- package/dist-types/ts3.4/endpoint/ruleset.d.ts +2 -0
- package/dist-types/ts3.4/index.d.ts +6 -0
- package/dist-types/ts3.4/models/CodeGuruSecurityServiceException.d.ts +8 -0
- package/dist-types/ts3.4/models/index.d.ts +1 -0
- package/dist-types/ts3.4/models/models_0.d.ts +340 -0
- package/dist-types/ts3.4/pagination/GetFindingsPaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/Interfaces.d.ts +6 -0
- package/dist-types/ts3.4/pagination/ListFindingsMetricsPaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/ListScansPaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/index.d.ts +4 -0
- package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +161 -0
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +96 -0
- package/dist-types/ts3.4/runtimeConfig.d.ts +93 -0
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +87 -0
- package/dist-types/ts3.4/runtimeConfig.shared.d.ts +20 -0
- package/package.json +101 -0
|
@@ -0,0 +1,1131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.de_UpdateAccountConfigurationCommand = exports.de_UntagResourceCommand = exports.de_TagResourceCommand = exports.de_ListTagsForResourceCommand = exports.de_ListScansCommand = exports.de_ListFindingsMetricsCommand = exports.de_GetScanCommand = exports.de_GetMetricsSummaryCommand = exports.de_GetFindingsCommand = exports.de_GetAccountConfigurationCommand = exports.de_CreateUploadUrlCommand = exports.de_CreateScanCommand = exports.de_BatchGetFindingsCommand = exports.se_UpdateAccountConfigurationCommand = exports.se_UntagResourceCommand = exports.se_TagResourceCommand = exports.se_ListTagsForResourceCommand = exports.se_ListScansCommand = exports.se_ListFindingsMetricsCommand = exports.se_GetScanCommand = exports.se_GetMetricsSummaryCommand = exports.se_GetFindingsCommand = exports.se_GetAccountConfigurationCommand = exports.se_CreateUploadUrlCommand = exports.se_CreateScanCommand = exports.se_BatchGetFindingsCommand = void 0;
|
|
4
|
+
const smithy_client_1 = require("@aws-sdk/smithy-client");
|
|
5
|
+
const protocol_http_1 = require("@smithy/protocol-http");
|
|
6
|
+
const uuid_1 = require("uuid");
|
|
7
|
+
const CodeGuruSecurityServiceException_1 = require("../models/CodeGuruSecurityServiceException");
|
|
8
|
+
const models_0_1 = require("../models/models_0");
|
|
9
|
+
const se_BatchGetFindingsCommand = async (input, context) => {
|
|
10
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
11
|
+
const headers = {
|
|
12
|
+
"content-type": "application/json",
|
|
13
|
+
};
|
|
14
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/batchGetFindings";
|
|
15
|
+
let body;
|
|
16
|
+
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
17
|
+
findingIdentifiers: (_) => (0, smithy_client_1._json)(_),
|
|
18
|
+
}));
|
|
19
|
+
return new protocol_http_1.HttpRequest({
|
|
20
|
+
protocol,
|
|
21
|
+
hostname,
|
|
22
|
+
port,
|
|
23
|
+
method: "POST",
|
|
24
|
+
headers,
|
|
25
|
+
path: resolvedPath,
|
|
26
|
+
body,
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
exports.se_BatchGetFindingsCommand = se_BatchGetFindingsCommand;
|
|
30
|
+
const se_CreateScanCommand = async (input, context) => {
|
|
31
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
32
|
+
const headers = {
|
|
33
|
+
"content-type": "application/json",
|
|
34
|
+
};
|
|
35
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/scans";
|
|
36
|
+
let body;
|
|
37
|
+
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
38
|
+
analysisType: [],
|
|
39
|
+
clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
|
|
40
|
+
resourceId: (_) => (0, smithy_client_1._json)(_),
|
|
41
|
+
scanName: [],
|
|
42
|
+
scanType: [],
|
|
43
|
+
tags: (_) => (0, smithy_client_1._json)(_),
|
|
44
|
+
}));
|
|
45
|
+
return new protocol_http_1.HttpRequest({
|
|
46
|
+
protocol,
|
|
47
|
+
hostname,
|
|
48
|
+
port,
|
|
49
|
+
method: "POST",
|
|
50
|
+
headers,
|
|
51
|
+
path: resolvedPath,
|
|
52
|
+
body,
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
exports.se_CreateScanCommand = se_CreateScanCommand;
|
|
56
|
+
const se_CreateUploadUrlCommand = async (input, context) => {
|
|
57
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
58
|
+
const headers = {
|
|
59
|
+
"content-type": "application/json",
|
|
60
|
+
};
|
|
61
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/uploadUrl";
|
|
62
|
+
let body;
|
|
63
|
+
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
64
|
+
scanName: [],
|
|
65
|
+
}));
|
|
66
|
+
return new protocol_http_1.HttpRequest({
|
|
67
|
+
protocol,
|
|
68
|
+
hostname,
|
|
69
|
+
port,
|
|
70
|
+
method: "POST",
|
|
71
|
+
headers,
|
|
72
|
+
path: resolvedPath,
|
|
73
|
+
body,
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
exports.se_CreateUploadUrlCommand = se_CreateUploadUrlCommand;
|
|
77
|
+
const se_GetAccountConfigurationCommand = async (input, context) => {
|
|
78
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
79
|
+
const headers = {
|
|
80
|
+
"content-type": "application/json",
|
|
81
|
+
};
|
|
82
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/accountConfiguration/get";
|
|
83
|
+
let body;
|
|
84
|
+
body = "";
|
|
85
|
+
return new protocol_http_1.HttpRequest({
|
|
86
|
+
protocol,
|
|
87
|
+
hostname,
|
|
88
|
+
port,
|
|
89
|
+
method: "GET",
|
|
90
|
+
headers,
|
|
91
|
+
path: resolvedPath,
|
|
92
|
+
body,
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
exports.se_GetAccountConfigurationCommand = se_GetAccountConfigurationCommand;
|
|
96
|
+
const se_GetFindingsCommand = async (input, context) => {
|
|
97
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
98
|
+
const headers = {};
|
|
99
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/findings/{scanName}";
|
|
100
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "scanName", () => input.scanName, "{scanName}", false);
|
|
101
|
+
const query = (0, smithy_client_1.map)({
|
|
102
|
+
nextToken: [, input.nextToken],
|
|
103
|
+
maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
|
|
104
|
+
status: [, input.status],
|
|
105
|
+
});
|
|
106
|
+
let body;
|
|
107
|
+
return new protocol_http_1.HttpRequest({
|
|
108
|
+
protocol,
|
|
109
|
+
hostname,
|
|
110
|
+
port,
|
|
111
|
+
method: "GET",
|
|
112
|
+
headers,
|
|
113
|
+
path: resolvedPath,
|
|
114
|
+
query,
|
|
115
|
+
body,
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
exports.se_GetFindingsCommand = se_GetFindingsCommand;
|
|
119
|
+
const se_GetMetricsSummaryCommand = async (input, context) => {
|
|
120
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
121
|
+
const headers = {};
|
|
122
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/metrics/summary";
|
|
123
|
+
const query = (0, smithy_client_1.map)({
|
|
124
|
+
date: [
|
|
125
|
+
(0, smithy_client_1.expectNonNull)(input.date, `date`) != null,
|
|
126
|
+
() => (input.date.toISOString().split(".")[0] + "Z").toString(),
|
|
127
|
+
],
|
|
128
|
+
});
|
|
129
|
+
let body;
|
|
130
|
+
return new protocol_http_1.HttpRequest({
|
|
131
|
+
protocol,
|
|
132
|
+
hostname,
|
|
133
|
+
port,
|
|
134
|
+
method: "GET",
|
|
135
|
+
headers,
|
|
136
|
+
path: resolvedPath,
|
|
137
|
+
query,
|
|
138
|
+
body,
|
|
139
|
+
});
|
|
140
|
+
};
|
|
141
|
+
exports.se_GetMetricsSummaryCommand = se_GetMetricsSummaryCommand;
|
|
142
|
+
const se_GetScanCommand = async (input, context) => {
|
|
143
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
144
|
+
const headers = {};
|
|
145
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/scans/{scanName}";
|
|
146
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "scanName", () => input.scanName, "{scanName}", false);
|
|
147
|
+
const query = (0, smithy_client_1.map)({
|
|
148
|
+
runId: [, input.runId],
|
|
149
|
+
});
|
|
150
|
+
let body;
|
|
151
|
+
return new protocol_http_1.HttpRequest({
|
|
152
|
+
protocol,
|
|
153
|
+
hostname,
|
|
154
|
+
port,
|
|
155
|
+
method: "GET",
|
|
156
|
+
headers,
|
|
157
|
+
path: resolvedPath,
|
|
158
|
+
query,
|
|
159
|
+
body,
|
|
160
|
+
});
|
|
161
|
+
};
|
|
162
|
+
exports.se_GetScanCommand = se_GetScanCommand;
|
|
163
|
+
const se_ListFindingsMetricsCommand = async (input, context) => {
|
|
164
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
165
|
+
const headers = {};
|
|
166
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/metrics/findings";
|
|
167
|
+
const query = (0, smithy_client_1.map)({
|
|
168
|
+
nextToken: [, input.nextToken],
|
|
169
|
+
maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
|
|
170
|
+
startDate: [
|
|
171
|
+
(0, smithy_client_1.expectNonNull)(input.startDate, `startDate`) != null,
|
|
172
|
+
() => (input.startDate.toISOString().split(".")[0] + "Z").toString(),
|
|
173
|
+
],
|
|
174
|
+
endDate: [
|
|
175
|
+
(0, smithy_client_1.expectNonNull)(input.endDate, `endDate`) != null,
|
|
176
|
+
() => (input.endDate.toISOString().split(".")[0] + "Z").toString(),
|
|
177
|
+
],
|
|
178
|
+
});
|
|
179
|
+
let body;
|
|
180
|
+
return new protocol_http_1.HttpRequest({
|
|
181
|
+
protocol,
|
|
182
|
+
hostname,
|
|
183
|
+
port,
|
|
184
|
+
method: "GET",
|
|
185
|
+
headers,
|
|
186
|
+
path: resolvedPath,
|
|
187
|
+
query,
|
|
188
|
+
body,
|
|
189
|
+
});
|
|
190
|
+
};
|
|
191
|
+
exports.se_ListFindingsMetricsCommand = se_ListFindingsMetricsCommand;
|
|
192
|
+
const se_ListScansCommand = async (input, context) => {
|
|
193
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
194
|
+
const headers = {};
|
|
195
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/scans";
|
|
196
|
+
const query = (0, smithy_client_1.map)({
|
|
197
|
+
nextToken: [, input.nextToken],
|
|
198
|
+
maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
|
|
199
|
+
});
|
|
200
|
+
let body;
|
|
201
|
+
return new protocol_http_1.HttpRequest({
|
|
202
|
+
protocol,
|
|
203
|
+
hostname,
|
|
204
|
+
port,
|
|
205
|
+
method: "GET",
|
|
206
|
+
headers,
|
|
207
|
+
path: resolvedPath,
|
|
208
|
+
query,
|
|
209
|
+
body,
|
|
210
|
+
});
|
|
211
|
+
};
|
|
212
|
+
exports.se_ListScansCommand = se_ListScansCommand;
|
|
213
|
+
const se_ListTagsForResourceCommand = async (input, context) => {
|
|
214
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
215
|
+
const headers = {};
|
|
216
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
|
|
217
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
|
|
218
|
+
let body;
|
|
219
|
+
return new protocol_http_1.HttpRequest({
|
|
220
|
+
protocol,
|
|
221
|
+
hostname,
|
|
222
|
+
port,
|
|
223
|
+
method: "GET",
|
|
224
|
+
headers,
|
|
225
|
+
path: resolvedPath,
|
|
226
|
+
body,
|
|
227
|
+
});
|
|
228
|
+
};
|
|
229
|
+
exports.se_ListTagsForResourceCommand = se_ListTagsForResourceCommand;
|
|
230
|
+
const se_TagResourceCommand = async (input, context) => {
|
|
231
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
232
|
+
const headers = {
|
|
233
|
+
"content-type": "application/json",
|
|
234
|
+
};
|
|
235
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
|
|
236
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
|
|
237
|
+
let body;
|
|
238
|
+
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
239
|
+
tags: (_) => (0, smithy_client_1._json)(_),
|
|
240
|
+
}));
|
|
241
|
+
return new protocol_http_1.HttpRequest({
|
|
242
|
+
protocol,
|
|
243
|
+
hostname,
|
|
244
|
+
port,
|
|
245
|
+
method: "POST",
|
|
246
|
+
headers,
|
|
247
|
+
path: resolvedPath,
|
|
248
|
+
body,
|
|
249
|
+
});
|
|
250
|
+
};
|
|
251
|
+
exports.se_TagResourceCommand = se_TagResourceCommand;
|
|
252
|
+
const se_UntagResourceCommand = async (input, context) => {
|
|
253
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
254
|
+
const headers = {};
|
|
255
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
|
|
256
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
|
|
257
|
+
const query = (0, smithy_client_1.map)({
|
|
258
|
+
tagKeys: [
|
|
259
|
+
(0, smithy_client_1.expectNonNull)(input.tagKeys, `tagKeys`) != null,
|
|
260
|
+
() => (input.tagKeys || []).map((_entry) => _entry),
|
|
261
|
+
],
|
|
262
|
+
});
|
|
263
|
+
let body;
|
|
264
|
+
return new protocol_http_1.HttpRequest({
|
|
265
|
+
protocol,
|
|
266
|
+
hostname,
|
|
267
|
+
port,
|
|
268
|
+
method: "DELETE",
|
|
269
|
+
headers,
|
|
270
|
+
path: resolvedPath,
|
|
271
|
+
query,
|
|
272
|
+
body,
|
|
273
|
+
});
|
|
274
|
+
};
|
|
275
|
+
exports.se_UntagResourceCommand = se_UntagResourceCommand;
|
|
276
|
+
const se_UpdateAccountConfigurationCommand = async (input, context) => {
|
|
277
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
278
|
+
const headers = {
|
|
279
|
+
"content-type": "application/json",
|
|
280
|
+
};
|
|
281
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/updateAccountConfiguration";
|
|
282
|
+
let body;
|
|
283
|
+
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
284
|
+
encryptionConfig: (_) => (0, smithy_client_1._json)(_),
|
|
285
|
+
}));
|
|
286
|
+
return new protocol_http_1.HttpRequest({
|
|
287
|
+
protocol,
|
|
288
|
+
hostname,
|
|
289
|
+
port,
|
|
290
|
+
method: "PUT",
|
|
291
|
+
headers,
|
|
292
|
+
path: resolvedPath,
|
|
293
|
+
body,
|
|
294
|
+
});
|
|
295
|
+
};
|
|
296
|
+
exports.se_UpdateAccountConfigurationCommand = se_UpdateAccountConfigurationCommand;
|
|
297
|
+
const de_BatchGetFindingsCommand = async (output, context) => {
|
|
298
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
299
|
+
return de_BatchGetFindingsCommandError(output, context);
|
|
300
|
+
}
|
|
301
|
+
const contents = (0, smithy_client_1.map)({
|
|
302
|
+
$metadata: deserializeMetadata(output),
|
|
303
|
+
});
|
|
304
|
+
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
305
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
306
|
+
failedFindings: smithy_client_1._json,
|
|
307
|
+
findings: (_) => de_Findings(_, context),
|
|
308
|
+
});
|
|
309
|
+
Object.assign(contents, doc);
|
|
310
|
+
return contents;
|
|
311
|
+
};
|
|
312
|
+
exports.de_BatchGetFindingsCommand = de_BatchGetFindingsCommand;
|
|
313
|
+
const de_BatchGetFindingsCommandError = async (output, context) => {
|
|
314
|
+
const parsedOutput = {
|
|
315
|
+
...output,
|
|
316
|
+
body: await parseErrorBody(output.body, context),
|
|
317
|
+
};
|
|
318
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
319
|
+
switch (errorCode) {
|
|
320
|
+
case "AccessDeniedException":
|
|
321
|
+
case "com.amazonaws.codegurusecurity#AccessDeniedException":
|
|
322
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
323
|
+
case "InternalServerException":
|
|
324
|
+
case "com.amazonaws.codegurusecurity#InternalServerException":
|
|
325
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
326
|
+
case "ThrottlingException":
|
|
327
|
+
case "com.amazonaws.codegurusecurity#ThrottlingException":
|
|
328
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
329
|
+
case "ValidationException":
|
|
330
|
+
case "com.amazonaws.codegurusecurity#ValidationException":
|
|
331
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
332
|
+
default:
|
|
333
|
+
const parsedBody = parsedOutput.body;
|
|
334
|
+
return throwDefaultError({
|
|
335
|
+
output,
|
|
336
|
+
parsedBody,
|
|
337
|
+
errorCode,
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
};
|
|
341
|
+
const de_CreateScanCommand = async (output, context) => {
|
|
342
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
343
|
+
return de_CreateScanCommandError(output, context);
|
|
344
|
+
}
|
|
345
|
+
const contents = (0, smithy_client_1.map)({
|
|
346
|
+
$metadata: deserializeMetadata(output),
|
|
347
|
+
});
|
|
348
|
+
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
349
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
350
|
+
resourceId: (_) => (0, smithy_client_1._json)((0, smithy_client_1.expectUnion)(_)),
|
|
351
|
+
runId: smithy_client_1.expectString,
|
|
352
|
+
scanName: smithy_client_1.expectString,
|
|
353
|
+
scanNameArn: smithy_client_1.expectString,
|
|
354
|
+
scanState: smithy_client_1.expectString,
|
|
355
|
+
});
|
|
356
|
+
Object.assign(contents, doc);
|
|
357
|
+
return contents;
|
|
358
|
+
};
|
|
359
|
+
exports.de_CreateScanCommand = de_CreateScanCommand;
|
|
360
|
+
const de_CreateScanCommandError = async (output, context) => {
|
|
361
|
+
const parsedOutput = {
|
|
362
|
+
...output,
|
|
363
|
+
body: await parseErrorBody(output.body, context),
|
|
364
|
+
};
|
|
365
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
366
|
+
switch (errorCode) {
|
|
367
|
+
case "AccessDeniedException":
|
|
368
|
+
case "com.amazonaws.codegurusecurity#AccessDeniedException":
|
|
369
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
370
|
+
case "ConflictException":
|
|
371
|
+
case "com.amazonaws.codegurusecurity#ConflictException":
|
|
372
|
+
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
373
|
+
case "InternalServerException":
|
|
374
|
+
case "com.amazonaws.codegurusecurity#InternalServerException":
|
|
375
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
376
|
+
case "ResourceNotFoundException":
|
|
377
|
+
case "com.amazonaws.codegurusecurity#ResourceNotFoundException":
|
|
378
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
379
|
+
case "ThrottlingException":
|
|
380
|
+
case "com.amazonaws.codegurusecurity#ThrottlingException":
|
|
381
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
382
|
+
case "ValidationException":
|
|
383
|
+
case "com.amazonaws.codegurusecurity#ValidationException":
|
|
384
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
385
|
+
default:
|
|
386
|
+
const parsedBody = parsedOutput.body;
|
|
387
|
+
return throwDefaultError({
|
|
388
|
+
output,
|
|
389
|
+
parsedBody,
|
|
390
|
+
errorCode,
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
};
|
|
394
|
+
const de_CreateUploadUrlCommand = async (output, context) => {
|
|
395
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
396
|
+
return de_CreateUploadUrlCommandError(output, context);
|
|
397
|
+
}
|
|
398
|
+
const contents = (0, smithy_client_1.map)({
|
|
399
|
+
$metadata: deserializeMetadata(output),
|
|
400
|
+
});
|
|
401
|
+
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
402
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
403
|
+
codeArtifactId: smithy_client_1.expectString,
|
|
404
|
+
requestHeaders: smithy_client_1._json,
|
|
405
|
+
s3Url: smithy_client_1.expectString,
|
|
406
|
+
});
|
|
407
|
+
Object.assign(contents, doc);
|
|
408
|
+
return contents;
|
|
409
|
+
};
|
|
410
|
+
exports.de_CreateUploadUrlCommand = de_CreateUploadUrlCommand;
|
|
411
|
+
const de_CreateUploadUrlCommandError = async (output, context) => {
|
|
412
|
+
const parsedOutput = {
|
|
413
|
+
...output,
|
|
414
|
+
body: await parseErrorBody(output.body, context),
|
|
415
|
+
};
|
|
416
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
417
|
+
switch (errorCode) {
|
|
418
|
+
case "AccessDeniedException":
|
|
419
|
+
case "com.amazonaws.codegurusecurity#AccessDeniedException":
|
|
420
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
421
|
+
case "InternalServerException":
|
|
422
|
+
case "com.amazonaws.codegurusecurity#InternalServerException":
|
|
423
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
424
|
+
case "ThrottlingException":
|
|
425
|
+
case "com.amazonaws.codegurusecurity#ThrottlingException":
|
|
426
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
427
|
+
case "ValidationException":
|
|
428
|
+
case "com.amazonaws.codegurusecurity#ValidationException":
|
|
429
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
430
|
+
default:
|
|
431
|
+
const parsedBody = parsedOutput.body;
|
|
432
|
+
return throwDefaultError({
|
|
433
|
+
output,
|
|
434
|
+
parsedBody,
|
|
435
|
+
errorCode,
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
};
|
|
439
|
+
const de_GetAccountConfigurationCommand = async (output, context) => {
|
|
440
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
441
|
+
return de_GetAccountConfigurationCommandError(output, context);
|
|
442
|
+
}
|
|
443
|
+
const contents = (0, smithy_client_1.map)({
|
|
444
|
+
$metadata: deserializeMetadata(output),
|
|
445
|
+
});
|
|
446
|
+
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
447
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
448
|
+
encryptionConfig: smithy_client_1._json,
|
|
449
|
+
});
|
|
450
|
+
Object.assign(contents, doc);
|
|
451
|
+
return contents;
|
|
452
|
+
};
|
|
453
|
+
exports.de_GetAccountConfigurationCommand = de_GetAccountConfigurationCommand;
|
|
454
|
+
const de_GetAccountConfigurationCommandError = async (output, context) => {
|
|
455
|
+
const parsedOutput = {
|
|
456
|
+
...output,
|
|
457
|
+
body: await parseErrorBody(output.body, context),
|
|
458
|
+
};
|
|
459
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
460
|
+
switch (errorCode) {
|
|
461
|
+
case "AccessDeniedException":
|
|
462
|
+
case "com.amazonaws.codegurusecurity#AccessDeniedException":
|
|
463
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
464
|
+
case "InternalServerException":
|
|
465
|
+
case "com.amazonaws.codegurusecurity#InternalServerException":
|
|
466
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
467
|
+
case "ThrottlingException":
|
|
468
|
+
case "com.amazonaws.codegurusecurity#ThrottlingException":
|
|
469
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
470
|
+
case "ValidationException":
|
|
471
|
+
case "com.amazonaws.codegurusecurity#ValidationException":
|
|
472
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
473
|
+
default:
|
|
474
|
+
const parsedBody = parsedOutput.body;
|
|
475
|
+
return throwDefaultError({
|
|
476
|
+
output,
|
|
477
|
+
parsedBody,
|
|
478
|
+
errorCode,
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
};
|
|
482
|
+
const de_GetFindingsCommand = async (output, context) => {
|
|
483
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
484
|
+
return de_GetFindingsCommandError(output, context);
|
|
485
|
+
}
|
|
486
|
+
const contents = (0, smithy_client_1.map)({
|
|
487
|
+
$metadata: deserializeMetadata(output),
|
|
488
|
+
});
|
|
489
|
+
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
490
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
491
|
+
findings: (_) => de_Findings(_, context),
|
|
492
|
+
nextToken: smithy_client_1.expectString,
|
|
493
|
+
});
|
|
494
|
+
Object.assign(contents, doc);
|
|
495
|
+
return contents;
|
|
496
|
+
};
|
|
497
|
+
exports.de_GetFindingsCommand = de_GetFindingsCommand;
|
|
498
|
+
const de_GetFindingsCommandError = async (output, context) => {
|
|
499
|
+
const parsedOutput = {
|
|
500
|
+
...output,
|
|
501
|
+
body: await parseErrorBody(output.body, context),
|
|
502
|
+
};
|
|
503
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
504
|
+
switch (errorCode) {
|
|
505
|
+
case "AccessDeniedException":
|
|
506
|
+
case "com.amazonaws.codegurusecurity#AccessDeniedException":
|
|
507
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
508
|
+
case "ConflictException":
|
|
509
|
+
case "com.amazonaws.codegurusecurity#ConflictException":
|
|
510
|
+
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
511
|
+
case "InternalServerException":
|
|
512
|
+
case "com.amazonaws.codegurusecurity#InternalServerException":
|
|
513
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
514
|
+
case "ResourceNotFoundException":
|
|
515
|
+
case "com.amazonaws.codegurusecurity#ResourceNotFoundException":
|
|
516
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
517
|
+
case "ThrottlingException":
|
|
518
|
+
case "com.amazonaws.codegurusecurity#ThrottlingException":
|
|
519
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
520
|
+
case "ValidationException":
|
|
521
|
+
case "com.amazonaws.codegurusecurity#ValidationException":
|
|
522
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
523
|
+
default:
|
|
524
|
+
const parsedBody = parsedOutput.body;
|
|
525
|
+
return throwDefaultError({
|
|
526
|
+
output,
|
|
527
|
+
parsedBody,
|
|
528
|
+
errorCode,
|
|
529
|
+
});
|
|
530
|
+
}
|
|
531
|
+
};
|
|
532
|
+
const de_GetMetricsSummaryCommand = async (output, context) => {
|
|
533
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
534
|
+
return de_GetMetricsSummaryCommandError(output, context);
|
|
535
|
+
}
|
|
536
|
+
const contents = (0, smithy_client_1.map)({
|
|
537
|
+
$metadata: deserializeMetadata(output),
|
|
538
|
+
});
|
|
539
|
+
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
540
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
541
|
+
metricsSummary: (_) => de_MetricsSummary(_, context),
|
|
542
|
+
});
|
|
543
|
+
Object.assign(contents, doc);
|
|
544
|
+
return contents;
|
|
545
|
+
};
|
|
546
|
+
exports.de_GetMetricsSummaryCommand = de_GetMetricsSummaryCommand;
|
|
547
|
+
const de_GetMetricsSummaryCommandError = async (output, context) => {
|
|
548
|
+
const parsedOutput = {
|
|
549
|
+
...output,
|
|
550
|
+
body: await parseErrorBody(output.body, context),
|
|
551
|
+
};
|
|
552
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
553
|
+
switch (errorCode) {
|
|
554
|
+
case "AccessDeniedException":
|
|
555
|
+
case "com.amazonaws.codegurusecurity#AccessDeniedException":
|
|
556
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
557
|
+
case "InternalServerException":
|
|
558
|
+
case "com.amazonaws.codegurusecurity#InternalServerException":
|
|
559
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
560
|
+
case "ThrottlingException":
|
|
561
|
+
case "com.amazonaws.codegurusecurity#ThrottlingException":
|
|
562
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
563
|
+
case "ValidationException":
|
|
564
|
+
case "com.amazonaws.codegurusecurity#ValidationException":
|
|
565
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
566
|
+
default:
|
|
567
|
+
const parsedBody = parsedOutput.body;
|
|
568
|
+
return throwDefaultError({
|
|
569
|
+
output,
|
|
570
|
+
parsedBody,
|
|
571
|
+
errorCode,
|
|
572
|
+
});
|
|
573
|
+
}
|
|
574
|
+
};
|
|
575
|
+
const de_GetScanCommand = async (output, context) => {
|
|
576
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
577
|
+
return de_GetScanCommandError(output, context);
|
|
578
|
+
}
|
|
579
|
+
const contents = (0, smithy_client_1.map)({
|
|
580
|
+
$metadata: deserializeMetadata(output),
|
|
581
|
+
});
|
|
582
|
+
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
583
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
584
|
+
analysisType: smithy_client_1.expectString,
|
|
585
|
+
createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
|
|
586
|
+
numberOfRevisions: smithy_client_1.expectLong,
|
|
587
|
+
runId: smithy_client_1.expectString,
|
|
588
|
+
scanName: smithy_client_1.expectString,
|
|
589
|
+
scanNameArn: smithy_client_1.expectString,
|
|
590
|
+
scanState: smithy_client_1.expectString,
|
|
591
|
+
updatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
|
|
592
|
+
});
|
|
593
|
+
Object.assign(contents, doc);
|
|
594
|
+
return contents;
|
|
595
|
+
};
|
|
596
|
+
exports.de_GetScanCommand = de_GetScanCommand;
|
|
597
|
+
const de_GetScanCommandError = async (output, context) => {
|
|
598
|
+
const parsedOutput = {
|
|
599
|
+
...output,
|
|
600
|
+
body: await parseErrorBody(output.body, context),
|
|
601
|
+
};
|
|
602
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
603
|
+
switch (errorCode) {
|
|
604
|
+
case "AccessDeniedException":
|
|
605
|
+
case "com.amazonaws.codegurusecurity#AccessDeniedException":
|
|
606
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
607
|
+
case "InternalServerException":
|
|
608
|
+
case "com.amazonaws.codegurusecurity#InternalServerException":
|
|
609
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
610
|
+
case "ResourceNotFoundException":
|
|
611
|
+
case "com.amazonaws.codegurusecurity#ResourceNotFoundException":
|
|
612
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
613
|
+
case "ThrottlingException":
|
|
614
|
+
case "com.amazonaws.codegurusecurity#ThrottlingException":
|
|
615
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
616
|
+
default:
|
|
617
|
+
const parsedBody = parsedOutput.body;
|
|
618
|
+
return throwDefaultError({
|
|
619
|
+
output,
|
|
620
|
+
parsedBody,
|
|
621
|
+
errorCode,
|
|
622
|
+
});
|
|
623
|
+
}
|
|
624
|
+
};
|
|
625
|
+
const de_ListFindingsMetricsCommand = async (output, context) => {
|
|
626
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
627
|
+
return de_ListFindingsMetricsCommandError(output, context);
|
|
628
|
+
}
|
|
629
|
+
const contents = (0, smithy_client_1.map)({
|
|
630
|
+
$metadata: deserializeMetadata(output),
|
|
631
|
+
});
|
|
632
|
+
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
633
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
634
|
+
findingsMetrics: (_) => de_FindingsMetricList(_, context),
|
|
635
|
+
nextToken: smithy_client_1.expectString,
|
|
636
|
+
});
|
|
637
|
+
Object.assign(contents, doc);
|
|
638
|
+
return contents;
|
|
639
|
+
};
|
|
640
|
+
exports.de_ListFindingsMetricsCommand = de_ListFindingsMetricsCommand;
|
|
641
|
+
const de_ListFindingsMetricsCommandError = async (output, context) => {
|
|
642
|
+
const parsedOutput = {
|
|
643
|
+
...output,
|
|
644
|
+
body: await parseErrorBody(output.body, context),
|
|
645
|
+
};
|
|
646
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
647
|
+
switch (errorCode) {
|
|
648
|
+
case "AccessDeniedException":
|
|
649
|
+
case "com.amazonaws.codegurusecurity#AccessDeniedException":
|
|
650
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
651
|
+
case "InternalServerException":
|
|
652
|
+
case "com.amazonaws.codegurusecurity#InternalServerException":
|
|
653
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
654
|
+
case "ThrottlingException":
|
|
655
|
+
case "com.amazonaws.codegurusecurity#ThrottlingException":
|
|
656
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
657
|
+
case "ValidationException":
|
|
658
|
+
case "com.amazonaws.codegurusecurity#ValidationException":
|
|
659
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
660
|
+
default:
|
|
661
|
+
const parsedBody = parsedOutput.body;
|
|
662
|
+
return throwDefaultError({
|
|
663
|
+
output,
|
|
664
|
+
parsedBody,
|
|
665
|
+
errorCode,
|
|
666
|
+
});
|
|
667
|
+
}
|
|
668
|
+
};
|
|
669
|
+
const de_ListScansCommand = async (output, context) => {
|
|
670
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
671
|
+
return de_ListScansCommandError(output, context);
|
|
672
|
+
}
|
|
673
|
+
const contents = (0, smithy_client_1.map)({
|
|
674
|
+
$metadata: deserializeMetadata(output),
|
|
675
|
+
});
|
|
676
|
+
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
677
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
678
|
+
nextToken: smithy_client_1.expectString,
|
|
679
|
+
summaries: (_) => de_ScanSummaries(_, context),
|
|
680
|
+
});
|
|
681
|
+
Object.assign(contents, doc);
|
|
682
|
+
return contents;
|
|
683
|
+
};
|
|
684
|
+
exports.de_ListScansCommand = de_ListScansCommand;
|
|
685
|
+
const de_ListScansCommandError = async (output, context) => {
|
|
686
|
+
const parsedOutput = {
|
|
687
|
+
...output,
|
|
688
|
+
body: await parseErrorBody(output.body, context),
|
|
689
|
+
};
|
|
690
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
691
|
+
switch (errorCode) {
|
|
692
|
+
case "AccessDeniedException":
|
|
693
|
+
case "com.amazonaws.codegurusecurity#AccessDeniedException":
|
|
694
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
695
|
+
case "InternalServerException":
|
|
696
|
+
case "com.amazonaws.codegurusecurity#InternalServerException":
|
|
697
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
698
|
+
case "ThrottlingException":
|
|
699
|
+
case "com.amazonaws.codegurusecurity#ThrottlingException":
|
|
700
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
701
|
+
case "ValidationException":
|
|
702
|
+
case "com.amazonaws.codegurusecurity#ValidationException":
|
|
703
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
704
|
+
default:
|
|
705
|
+
const parsedBody = parsedOutput.body;
|
|
706
|
+
return throwDefaultError({
|
|
707
|
+
output,
|
|
708
|
+
parsedBody,
|
|
709
|
+
errorCode,
|
|
710
|
+
});
|
|
711
|
+
}
|
|
712
|
+
};
|
|
713
|
+
const de_ListTagsForResourceCommand = async (output, context) => {
|
|
714
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
715
|
+
return de_ListTagsForResourceCommandError(output, context);
|
|
716
|
+
}
|
|
717
|
+
const contents = (0, smithy_client_1.map)({
|
|
718
|
+
$metadata: deserializeMetadata(output),
|
|
719
|
+
});
|
|
720
|
+
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
721
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
722
|
+
tags: smithy_client_1._json,
|
|
723
|
+
});
|
|
724
|
+
Object.assign(contents, doc);
|
|
725
|
+
return contents;
|
|
726
|
+
};
|
|
727
|
+
exports.de_ListTagsForResourceCommand = de_ListTagsForResourceCommand;
|
|
728
|
+
const de_ListTagsForResourceCommandError = async (output, context) => {
|
|
729
|
+
const parsedOutput = {
|
|
730
|
+
...output,
|
|
731
|
+
body: await parseErrorBody(output.body, context),
|
|
732
|
+
};
|
|
733
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
734
|
+
switch (errorCode) {
|
|
735
|
+
case "AccessDeniedException":
|
|
736
|
+
case "com.amazonaws.codegurusecurity#AccessDeniedException":
|
|
737
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
738
|
+
case "ConflictException":
|
|
739
|
+
case "com.amazonaws.codegurusecurity#ConflictException":
|
|
740
|
+
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
741
|
+
case "InternalServerException":
|
|
742
|
+
case "com.amazonaws.codegurusecurity#InternalServerException":
|
|
743
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
744
|
+
case "ResourceNotFoundException":
|
|
745
|
+
case "com.amazonaws.codegurusecurity#ResourceNotFoundException":
|
|
746
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
747
|
+
case "ThrottlingException":
|
|
748
|
+
case "com.amazonaws.codegurusecurity#ThrottlingException":
|
|
749
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
750
|
+
case "ValidationException":
|
|
751
|
+
case "com.amazonaws.codegurusecurity#ValidationException":
|
|
752
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
753
|
+
default:
|
|
754
|
+
const parsedBody = parsedOutput.body;
|
|
755
|
+
return throwDefaultError({
|
|
756
|
+
output,
|
|
757
|
+
parsedBody,
|
|
758
|
+
errorCode,
|
|
759
|
+
});
|
|
760
|
+
}
|
|
761
|
+
};
|
|
762
|
+
const de_TagResourceCommand = async (output, context) => {
|
|
763
|
+
if (output.statusCode !== 204 && output.statusCode >= 300) {
|
|
764
|
+
return de_TagResourceCommandError(output, context);
|
|
765
|
+
}
|
|
766
|
+
const contents = (0, smithy_client_1.map)({
|
|
767
|
+
$metadata: deserializeMetadata(output),
|
|
768
|
+
});
|
|
769
|
+
await collectBody(output.body, context);
|
|
770
|
+
return contents;
|
|
771
|
+
};
|
|
772
|
+
exports.de_TagResourceCommand = de_TagResourceCommand;
|
|
773
|
+
const de_TagResourceCommandError = async (output, context) => {
|
|
774
|
+
const parsedOutput = {
|
|
775
|
+
...output,
|
|
776
|
+
body: await parseErrorBody(output.body, context),
|
|
777
|
+
};
|
|
778
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
779
|
+
switch (errorCode) {
|
|
780
|
+
case "AccessDeniedException":
|
|
781
|
+
case "com.amazonaws.codegurusecurity#AccessDeniedException":
|
|
782
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
783
|
+
case "ConflictException":
|
|
784
|
+
case "com.amazonaws.codegurusecurity#ConflictException":
|
|
785
|
+
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
786
|
+
case "InternalServerException":
|
|
787
|
+
case "com.amazonaws.codegurusecurity#InternalServerException":
|
|
788
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
789
|
+
case "ResourceNotFoundException":
|
|
790
|
+
case "com.amazonaws.codegurusecurity#ResourceNotFoundException":
|
|
791
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
792
|
+
case "ThrottlingException":
|
|
793
|
+
case "com.amazonaws.codegurusecurity#ThrottlingException":
|
|
794
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
795
|
+
case "ValidationException":
|
|
796
|
+
case "com.amazonaws.codegurusecurity#ValidationException":
|
|
797
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
798
|
+
default:
|
|
799
|
+
const parsedBody = parsedOutput.body;
|
|
800
|
+
return throwDefaultError({
|
|
801
|
+
output,
|
|
802
|
+
parsedBody,
|
|
803
|
+
errorCode,
|
|
804
|
+
});
|
|
805
|
+
}
|
|
806
|
+
};
|
|
807
|
+
const de_UntagResourceCommand = async (output, context) => {
|
|
808
|
+
if (output.statusCode !== 204 && output.statusCode >= 300) {
|
|
809
|
+
return de_UntagResourceCommandError(output, context);
|
|
810
|
+
}
|
|
811
|
+
const contents = (0, smithy_client_1.map)({
|
|
812
|
+
$metadata: deserializeMetadata(output),
|
|
813
|
+
});
|
|
814
|
+
await collectBody(output.body, context);
|
|
815
|
+
return contents;
|
|
816
|
+
};
|
|
817
|
+
exports.de_UntagResourceCommand = de_UntagResourceCommand;
|
|
818
|
+
const de_UntagResourceCommandError = async (output, context) => {
|
|
819
|
+
const parsedOutput = {
|
|
820
|
+
...output,
|
|
821
|
+
body: await parseErrorBody(output.body, context),
|
|
822
|
+
};
|
|
823
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
824
|
+
switch (errorCode) {
|
|
825
|
+
case "AccessDeniedException":
|
|
826
|
+
case "com.amazonaws.codegurusecurity#AccessDeniedException":
|
|
827
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
828
|
+
case "ConflictException":
|
|
829
|
+
case "com.amazonaws.codegurusecurity#ConflictException":
|
|
830
|
+
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
831
|
+
case "InternalServerException":
|
|
832
|
+
case "com.amazonaws.codegurusecurity#InternalServerException":
|
|
833
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
834
|
+
case "ResourceNotFoundException":
|
|
835
|
+
case "com.amazonaws.codegurusecurity#ResourceNotFoundException":
|
|
836
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
837
|
+
case "ThrottlingException":
|
|
838
|
+
case "com.amazonaws.codegurusecurity#ThrottlingException":
|
|
839
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
840
|
+
case "ValidationException":
|
|
841
|
+
case "com.amazonaws.codegurusecurity#ValidationException":
|
|
842
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
843
|
+
default:
|
|
844
|
+
const parsedBody = parsedOutput.body;
|
|
845
|
+
return throwDefaultError({
|
|
846
|
+
output,
|
|
847
|
+
parsedBody,
|
|
848
|
+
errorCode,
|
|
849
|
+
});
|
|
850
|
+
}
|
|
851
|
+
};
|
|
852
|
+
const de_UpdateAccountConfigurationCommand = async (output, context) => {
|
|
853
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
854
|
+
return de_UpdateAccountConfigurationCommandError(output, context);
|
|
855
|
+
}
|
|
856
|
+
const contents = (0, smithy_client_1.map)({
|
|
857
|
+
$metadata: deserializeMetadata(output),
|
|
858
|
+
});
|
|
859
|
+
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
860
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
861
|
+
encryptionConfig: smithy_client_1._json,
|
|
862
|
+
});
|
|
863
|
+
Object.assign(contents, doc);
|
|
864
|
+
return contents;
|
|
865
|
+
};
|
|
866
|
+
exports.de_UpdateAccountConfigurationCommand = de_UpdateAccountConfigurationCommand;
|
|
867
|
+
const de_UpdateAccountConfigurationCommandError = async (output, context) => {
|
|
868
|
+
const parsedOutput = {
|
|
869
|
+
...output,
|
|
870
|
+
body: await parseErrorBody(output.body, context),
|
|
871
|
+
};
|
|
872
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
873
|
+
switch (errorCode) {
|
|
874
|
+
case "AccessDeniedException":
|
|
875
|
+
case "com.amazonaws.codegurusecurity#AccessDeniedException":
|
|
876
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
877
|
+
case "InternalServerException":
|
|
878
|
+
case "com.amazonaws.codegurusecurity#InternalServerException":
|
|
879
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
880
|
+
case "ResourceNotFoundException":
|
|
881
|
+
case "com.amazonaws.codegurusecurity#ResourceNotFoundException":
|
|
882
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
883
|
+
case "ThrottlingException":
|
|
884
|
+
case "com.amazonaws.codegurusecurity#ThrottlingException":
|
|
885
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
886
|
+
case "ValidationException":
|
|
887
|
+
case "com.amazonaws.codegurusecurity#ValidationException":
|
|
888
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
889
|
+
default:
|
|
890
|
+
const parsedBody = parsedOutput.body;
|
|
891
|
+
return throwDefaultError({
|
|
892
|
+
output,
|
|
893
|
+
parsedBody,
|
|
894
|
+
errorCode,
|
|
895
|
+
});
|
|
896
|
+
}
|
|
897
|
+
};
|
|
898
|
+
const throwDefaultError = (0, smithy_client_1.withBaseException)(CodeGuruSecurityServiceException_1.CodeGuruSecurityServiceException);
|
|
899
|
+
const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
|
|
900
|
+
const contents = (0, smithy_client_1.map)({});
|
|
901
|
+
const data = parsedOutput.body;
|
|
902
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
903
|
+
errorCode: smithy_client_1.expectString,
|
|
904
|
+
message: smithy_client_1.expectString,
|
|
905
|
+
resourceId: smithy_client_1.expectString,
|
|
906
|
+
resourceType: smithy_client_1.expectString,
|
|
907
|
+
});
|
|
908
|
+
Object.assign(contents, doc);
|
|
909
|
+
const exception = new models_0_1.AccessDeniedException({
|
|
910
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
911
|
+
...contents,
|
|
912
|
+
});
|
|
913
|
+
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
914
|
+
};
|
|
915
|
+
const de_ConflictExceptionRes = async (parsedOutput, context) => {
|
|
916
|
+
const contents = (0, smithy_client_1.map)({});
|
|
917
|
+
const data = parsedOutput.body;
|
|
918
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
919
|
+
errorCode: smithy_client_1.expectString,
|
|
920
|
+
message: smithy_client_1.expectString,
|
|
921
|
+
resourceId: smithy_client_1.expectString,
|
|
922
|
+
resourceType: smithy_client_1.expectString,
|
|
923
|
+
});
|
|
924
|
+
Object.assign(contents, doc);
|
|
925
|
+
const exception = new models_0_1.ConflictException({
|
|
926
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
927
|
+
...contents,
|
|
928
|
+
});
|
|
929
|
+
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
930
|
+
};
|
|
931
|
+
const de_InternalServerExceptionRes = async (parsedOutput, context) => {
|
|
932
|
+
const contents = (0, smithy_client_1.map)({});
|
|
933
|
+
const data = parsedOutput.body;
|
|
934
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
935
|
+
error: smithy_client_1.expectString,
|
|
936
|
+
message: smithy_client_1.expectString,
|
|
937
|
+
});
|
|
938
|
+
Object.assign(contents, doc);
|
|
939
|
+
const exception = new models_0_1.InternalServerException({
|
|
940
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
941
|
+
...contents,
|
|
942
|
+
});
|
|
943
|
+
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
944
|
+
};
|
|
945
|
+
const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
946
|
+
const contents = (0, smithy_client_1.map)({});
|
|
947
|
+
const data = parsedOutput.body;
|
|
948
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
949
|
+
errorCode: smithy_client_1.expectString,
|
|
950
|
+
message: smithy_client_1.expectString,
|
|
951
|
+
resourceId: smithy_client_1.expectString,
|
|
952
|
+
resourceType: smithy_client_1.expectString,
|
|
953
|
+
});
|
|
954
|
+
Object.assign(contents, doc);
|
|
955
|
+
const exception = new models_0_1.ResourceNotFoundException({
|
|
956
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
957
|
+
...contents,
|
|
958
|
+
});
|
|
959
|
+
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
960
|
+
};
|
|
961
|
+
const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
|
|
962
|
+
const contents = (0, smithy_client_1.map)({});
|
|
963
|
+
const data = parsedOutput.body;
|
|
964
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
965
|
+
errorCode: smithy_client_1.expectString,
|
|
966
|
+
message: smithy_client_1.expectString,
|
|
967
|
+
quotaCode: smithy_client_1.expectString,
|
|
968
|
+
serviceCode: smithy_client_1.expectString,
|
|
969
|
+
});
|
|
970
|
+
Object.assign(contents, doc);
|
|
971
|
+
const exception = new models_0_1.ThrottlingException({
|
|
972
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
973
|
+
...contents,
|
|
974
|
+
});
|
|
975
|
+
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
976
|
+
};
|
|
977
|
+
const de_ValidationExceptionRes = async (parsedOutput, context) => {
|
|
978
|
+
const contents = (0, smithy_client_1.map)({});
|
|
979
|
+
const data = parsedOutput.body;
|
|
980
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
981
|
+
errorCode: smithy_client_1.expectString,
|
|
982
|
+
fieldList: smithy_client_1._json,
|
|
983
|
+
message: smithy_client_1.expectString,
|
|
984
|
+
reason: smithy_client_1.expectString,
|
|
985
|
+
});
|
|
986
|
+
Object.assign(contents, doc);
|
|
987
|
+
const exception = new models_0_1.ValidationException({
|
|
988
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
989
|
+
...contents,
|
|
990
|
+
});
|
|
991
|
+
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
992
|
+
};
|
|
993
|
+
const de_AccountFindingsMetric = (output, context) => {
|
|
994
|
+
return (0, smithy_client_1.take)(output, {
|
|
995
|
+
closedFindings: (_) => de_FindingMetricsValuePerSeverity(_, context),
|
|
996
|
+
date: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
|
|
997
|
+
meanTimeToClose: (_) => de_FindingMetricsValuePerSeverity(_, context),
|
|
998
|
+
newFindings: (_) => de_FindingMetricsValuePerSeverity(_, context),
|
|
999
|
+
openFindings: (_) => de_FindingMetricsValuePerSeverity(_, context),
|
|
1000
|
+
});
|
|
1001
|
+
};
|
|
1002
|
+
const de_Finding = (output, context) => {
|
|
1003
|
+
return (0, smithy_client_1.take)(output, {
|
|
1004
|
+
createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
|
|
1005
|
+
description: smithy_client_1.expectString,
|
|
1006
|
+
detectorId: smithy_client_1.expectString,
|
|
1007
|
+
detectorName: smithy_client_1.expectString,
|
|
1008
|
+
detectorTags: smithy_client_1._json,
|
|
1009
|
+
generatorId: smithy_client_1.expectString,
|
|
1010
|
+
id: smithy_client_1.expectString,
|
|
1011
|
+
remediation: smithy_client_1._json,
|
|
1012
|
+
resource: smithy_client_1._json,
|
|
1013
|
+
ruleId: smithy_client_1.expectString,
|
|
1014
|
+
severity: smithy_client_1.expectString,
|
|
1015
|
+
status: smithy_client_1.expectString,
|
|
1016
|
+
title: smithy_client_1.expectString,
|
|
1017
|
+
type: smithy_client_1.expectString,
|
|
1018
|
+
updatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
|
|
1019
|
+
vulnerability: smithy_client_1._json,
|
|
1020
|
+
});
|
|
1021
|
+
};
|
|
1022
|
+
const de_FindingMetricsValuePerSeverity = (output, context) => {
|
|
1023
|
+
return (0, smithy_client_1.take)(output, {
|
|
1024
|
+
critical: smithy_client_1.limitedParseDouble,
|
|
1025
|
+
high: smithy_client_1.limitedParseDouble,
|
|
1026
|
+
info: smithy_client_1.limitedParseDouble,
|
|
1027
|
+
low: smithy_client_1.limitedParseDouble,
|
|
1028
|
+
medium: smithy_client_1.limitedParseDouble,
|
|
1029
|
+
});
|
|
1030
|
+
};
|
|
1031
|
+
const de_Findings = (output, context) => {
|
|
1032
|
+
const retVal = (output || [])
|
|
1033
|
+
.filter((e) => e != null)
|
|
1034
|
+
.map((entry) => {
|
|
1035
|
+
return de_Finding(entry, context);
|
|
1036
|
+
});
|
|
1037
|
+
return retVal;
|
|
1038
|
+
};
|
|
1039
|
+
const de_FindingsMetricList = (output, context) => {
|
|
1040
|
+
const retVal = (output || [])
|
|
1041
|
+
.filter((e) => e != null)
|
|
1042
|
+
.map((entry) => {
|
|
1043
|
+
return de_AccountFindingsMetric(entry, context);
|
|
1044
|
+
});
|
|
1045
|
+
return retVal;
|
|
1046
|
+
};
|
|
1047
|
+
const de_MetricsSummary = (output, context) => {
|
|
1048
|
+
return (0, smithy_client_1.take)(output, {
|
|
1049
|
+
categoriesWithMostFindings: smithy_client_1._json,
|
|
1050
|
+
date: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
|
|
1051
|
+
openFindings: (_) => de_FindingMetricsValuePerSeverity(_, context),
|
|
1052
|
+
scansWithMostOpenCriticalFindings: smithy_client_1._json,
|
|
1053
|
+
scansWithMostOpenFindings: smithy_client_1._json,
|
|
1054
|
+
});
|
|
1055
|
+
};
|
|
1056
|
+
const de_ScanSummaries = (output, context) => {
|
|
1057
|
+
const retVal = (output || [])
|
|
1058
|
+
.filter((e) => e != null)
|
|
1059
|
+
.map((entry) => {
|
|
1060
|
+
return de_ScanSummary(entry, context);
|
|
1061
|
+
});
|
|
1062
|
+
return retVal;
|
|
1063
|
+
};
|
|
1064
|
+
const de_ScanSummary = (output, context) => {
|
|
1065
|
+
return (0, smithy_client_1.take)(output, {
|
|
1066
|
+
createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
|
|
1067
|
+
runId: smithy_client_1.expectString,
|
|
1068
|
+
scanName: smithy_client_1.expectString,
|
|
1069
|
+
scanNameArn: smithy_client_1.expectString,
|
|
1070
|
+
scanState: smithy_client_1.expectString,
|
|
1071
|
+
updatedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
|
|
1072
|
+
});
|
|
1073
|
+
};
|
|
1074
|
+
const deserializeMetadata = (output) => ({
|
|
1075
|
+
httpStatusCode: output.statusCode,
|
|
1076
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
1077
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
1078
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
1079
|
+
});
|
|
1080
|
+
const collectBody = (streamBody = new Uint8Array(), context) => {
|
|
1081
|
+
if (streamBody instanceof Uint8Array) {
|
|
1082
|
+
return Promise.resolve(streamBody);
|
|
1083
|
+
}
|
|
1084
|
+
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
1085
|
+
};
|
|
1086
|
+
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
1087
|
+
const isSerializableHeaderValue = (value) => value !== undefined &&
|
|
1088
|
+
value !== null &&
|
|
1089
|
+
value !== "" &&
|
|
1090
|
+
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
1091
|
+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
1092
|
+
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
1093
|
+
if (encoded.length) {
|
|
1094
|
+
return JSON.parse(encoded);
|
|
1095
|
+
}
|
|
1096
|
+
return {};
|
|
1097
|
+
});
|
|
1098
|
+
const parseErrorBody = async (errorBody, context) => {
|
|
1099
|
+
const value = await parseBody(errorBody, context);
|
|
1100
|
+
value.message = value.message ?? value.Message;
|
|
1101
|
+
return value;
|
|
1102
|
+
};
|
|
1103
|
+
const loadRestJsonErrorCode = (output, data) => {
|
|
1104
|
+
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
1105
|
+
const sanitizeErrorCode = (rawValue) => {
|
|
1106
|
+
let cleanValue = rawValue;
|
|
1107
|
+
if (typeof cleanValue === "number") {
|
|
1108
|
+
cleanValue = cleanValue.toString();
|
|
1109
|
+
}
|
|
1110
|
+
if (cleanValue.indexOf(",") >= 0) {
|
|
1111
|
+
cleanValue = cleanValue.split(",")[0];
|
|
1112
|
+
}
|
|
1113
|
+
if (cleanValue.indexOf(":") >= 0) {
|
|
1114
|
+
cleanValue = cleanValue.split(":")[0];
|
|
1115
|
+
}
|
|
1116
|
+
if (cleanValue.indexOf("#") >= 0) {
|
|
1117
|
+
cleanValue = cleanValue.split("#")[1];
|
|
1118
|
+
}
|
|
1119
|
+
return cleanValue;
|
|
1120
|
+
};
|
|
1121
|
+
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
1122
|
+
if (headerKey !== undefined) {
|
|
1123
|
+
return sanitizeErrorCode(output.headers[headerKey]);
|
|
1124
|
+
}
|
|
1125
|
+
if (data.code !== undefined) {
|
|
1126
|
+
return sanitizeErrorCode(data.code);
|
|
1127
|
+
}
|
|
1128
|
+
if (data["__type"] !== undefined) {
|
|
1129
|
+
return sanitizeErrorCode(data["__type"]);
|
|
1130
|
+
}
|
|
1131
|
+
};
|