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