@aws-sdk/client-guardduty 3.110.0 → 3.111.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/CHANGELOG.md +11 -0
- package/README.md +15 -13
- package/dist-cjs/GuardDuty.js +60 -0
- package/dist-cjs/commands/AcceptAdministratorInvitationCommand.js +36 -0
- package/dist-cjs/commands/DisassociateFromAdministratorAccountCommand.js +36 -0
- package/dist-cjs/commands/GetAdministratorAccountCommand.js +36 -0
- package/dist-cjs/commands/GetRemainingFreeTrialDaysCommand.js +36 -0
- package/dist-cjs/commands/index.js +4 -0
- package/dist-cjs/models/models_0.js +97 -13
- package/dist-cjs/protocols/Aws_restJson1.js +364 -5
- package/dist-es/GuardDuty.js +60 -0
- package/dist-es/commands/AcceptAdministratorInvitationCommand.js +39 -0
- package/dist-es/commands/DisassociateFromAdministratorAccountCommand.js +39 -0
- package/dist-es/commands/GetAdministratorAccountCommand.js +39 -0
- package/dist-es/commands/GetRemainingFreeTrialDaysCommand.js +39 -0
- package/dist-es/commands/index.js +4 -0
- package/dist-es/models/models_0.js +64 -8
- package/dist-es/protocols/Aws_restJson1.js +451 -2
- package/dist-types/GuardDuty.d.ts +47 -11
- package/dist-types/GuardDutyClient.d.ts +14 -8
- package/dist-types/commands/AcceptAdministratorInvitationCommand.d.ts +35 -0
- package/dist-types/commands/AcceptInvitationCommand.d.ts +2 -0
- package/dist-types/commands/DisassociateFromAdministratorAccountCommand.d.ts +35 -0
- package/dist-types/commands/DisassociateFromMasterAccountCommand.d.ts +2 -0
- package/dist-types/commands/DisassociateMembersCommand.d.ts +1 -2
- package/dist-types/commands/GetAdministratorAccountCommand.d.ts +36 -0
- package/dist-types/commands/GetMasterAccountCommand.d.ts +2 -0
- package/dist-types/commands/GetRemainingFreeTrialDaysCommand.d.ts +35 -0
- package/dist-types/commands/GetUsageStatisticsCommand.d.ts +3 -3
- package/dist-types/commands/index.d.ts +4 -0
- package/dist-types/models/models_0.d.ts +258 -8
- package/dist-types/protocols/Aws_restJson1.d.ts +12 -0
- package/dist-types/ts3.4/GuardDuty.d.ts +20 -0
- package/dist-types/ts3.4/GuardDutyClient.d.ts +6 -2
- package/dist-types/ts3.4/commands/AcceptAdministratorInvitationCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/DisassociateFromAdministratorAccountCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/GetAdministratorAccountCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/GetRemainingFreeTrialDaysCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/index.d.ts +4 -0
- package/dist-types/ts3.4/models/models_0.d.ts +157 -7
- package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +12 -0
- package/package.json +1 -1
|
@@ -4,6 +4,41 @@ import { decorateServiceException as __decorateServiceException, expectBoolean a
|
|
|
4
4
|
import { v4 as generateIdempotencyToken } from "uuid";
|
|
5
5
|
import { GuardDutyServiceException as __BaseException } from "../models/GuardDutyServiceException";
|
|
6
6
|
import { BadRequestException, InternalServerErrorException, } from "../models/models_0";
|
|
7
|
+
export var serializeAws_restJson1AcceptAdministratorInvitationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
8
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
|
|
9
|
+
return __generator(this, function (_c) {
|
|
10
|
+
switch (_c.label) {
|
|
11
|
+
case 0: return [4, context.endpoint()];
|
|
12
|
+
case 1:
|
|
13
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
14
|
+
headers = {
|
|
15
|
+
"content-type": "application/json",
|
|
16
|
+
};
|
|
17
|
+
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/detector/{DetectorId}/administrator";
|
|
18
|
+
if (input.DetectorId !== undefined) {
|
|
19
|
+
labelValue = input.DetectorId;
|
|
20
|
+
if (labelValue.length <= 0) {
|
|
21
|
+
throw new Error("Empty value provided for input HTTP label: DetectorId.");
|
|
22
|
+
}
|
|
23
|
+
resolvedPath = resolvedPath.replace("{DetectorId}", __extendedEncodeURIComponent(labelValue));
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
throw new Error("No value provided for input HTTP label: DetectorId.");
|
|
27
|
+
}
|
|
28
|
+
body = JSON.stringify(__assign(__assign({}, (input.AdministratorId !== undefined &&
|
|
29
|
+
input.AdministratorId !== null && { administratorId: input.AdministratorId })), (input.InvitationId !== undefined && input.InvitationId !== null && { invitationId: input.InvitationId })));
|
|
30
|
+
return [2, new __HttpRequest({
|
|
31
|
+
protocol: protocol,
|
|
32
|
+
hostname: hostname,
|
|
33
|
+
port: port,
|
|
34
|
+
method: "POST",
|
|
35
|
+
headers: headers,
|
|
36
|
+
path: resolvedPath,
|
|
37
|
+
body: body,
|
|
38
|
+
})];
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}); };
|
|
7
42
|
export var serializeAws_restJson1AcceptInvitationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
8
43
|
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
|
|
9
44
|
return __generator(this, function (_c) {
|
|
@@ -703,6 +738,38 @@ export var serializeAws_restJson1DisableOrganizationAdminAccountCommand = functi
|
|
|
703
738
|
}
|
|
704
739
|
});
|
|
705
740
|
}); };
|
|
741
|
+
export var serializeAws_restJson1DisassociateFromAdministratorAccountCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
742
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
|
|
743
|
+
return __generator(this, function (_c) {
|
|
744
|
+
switch (_c.label) {
|
|
745
|
+
case 0: return [4, context.endpoint()];
|
|
746
|
+
case 1:
|
|
747
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
748
|
+
headers = {};
|
|
749
|
+
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
|
|
750
|
+
"/detector/{DetectorId}/administrator/disassociate";
|
|
751
|
+
if (input.DetectorId !== undefined) {
|
|
752
|
+
labelValue = input.DetectorId;
|
|
753
|
+
if (labelValue.length <= 0) {
|
|
754
|
+
throw new Error("Empty value provided for input HTTP label: DetectorId.");
|
|
755
|
+
}
|
|
756
|
+
resolvedPath = resolvedPath.replace("{DetectorId}", __extendedEncodeURIComponent(labelValue));
|
|
757
|
+
}
|
|
758
|
+
else {
|
|
759
|
+
throw new Error("No value provided for input HTTP label: DetectorId.");
|
|
760
|
+
}
|
|
761
|
+
return [2, new __HttpRequest({
|
|
762
|
+
protocol: protocol,
|
|
763
|
+
hostname: hostname,
|
|
764
|
+
port: port,
|
|
765
|
+
method: "POST",
|
|
766
|
+
headers: headers,
|
|
767
|
+
path: resolvedPath,
|
|
768
|
+
body: body,
|
|
769
|
+
})];
|
|
770
|
+
}
|
|
771
|
+
});
|
|
772
|
+
}); };
|
|
706
773
|
export var serializeAws_restJson1DisassociateFromMasterAccountCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
707
774
|
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
|
|
708
775
|
return __generator(this, function (_c) {
|
|
@@ -796,6 +863,37 @@ export var serializeAws_restJson1EnableOrganizationAdminAccountCommand = functio
|
|
|
796
863
|
}
|
|
797
864
|
});
|
|
798
865
|
}); };
|
|
866
|
+
export var serializeAws_restJson1GetAdministratorAccountCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
867
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
|
|
868
|
+
return __generator(this, function (_c) {
|
|
869
|
+
switch (_c.label) {
|
|
870
|
+
case 0: return [4, context.endpoint()];
|
|
871
|
+
case 1:
|
|
872
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
873
|
+
headers = {};
|
|
874
|
+
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/detector/{DetectorId}/administrator";
|
|
875
|
+
if (input.DetectorId !== undefined) {
|
|
876
|
+
labelValue = input.DetectorId;
|
|
877
|
+
if (labelValue.length <= 0) {
|
|
878
|
+
throw new Error("Empty value provided for input HTTP label: DetectorId.");
|
|
879
|
+
}
|
|
880
|
+
resolvedPath = resolvedPath.replace("{DetectorId}", __extendedEncodeURIComponent(labelValue));
|
|
881
|
+
}
|
|
882
|
+
else {
|
|
883
|
+
throw new Error("No value provided for input HTTP label: DetectorId.");
|
|
884
|
+
}
|
|
885
|
+
return [2, new __HttpRequest({
|
|
886
|
+
protocol: protocol,
|
|
887
|
+
hostname: hostname,
|
|
888
|
+
port: port,
|
|
889
|
+
method: "GET",
|
|
890
|
+
headers: headers,
|
|
891
|
+
path: resolvedPath,
|
|
892
|
+
body: body,
|
|
893
|
+
})];
|
|
894
|
+
}
|
|
895
|
+
});
|
|
896
|
+
}); };
|
|
799
897
|
export var serializeAws_restJson1GetDetectorCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
800
898
|
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
|
|
801
899
|
return __generator(this, function (_c) {
|
|
@@ -1113,6 +1211,42 @@ export var serializeAws_restJson1GetMembersCommand = function (input, context) {
|
|
|
1113
1211
|
}
|
|
1114
1212
|
});
|
|
1115
1213
|
}); };
|
|
1214
|
+
export var serializeAws_restJson1GetRemainingFreeTrialDaysCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1215
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
|
|
1216
|
+
return __generator(this, function (_c) {
|
|
1217
|
+
switch (_c.label) {
|
|
1218
|
+
case 0: return [4, context.endpoint()];
|
|
1219
|
+
case 1:
|
|
1220
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
1221
|
+
headers = {
|
|
1222
|
+
"content-type": "application/json",
|
|
1223
|
+
};
|
|
1224
|
+
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
|
|
1225
|
+
"/detector/{DetectorId}/freeTrial/daysRemaining";
|
|
1226
|
+
if (input.DetectorId !== undefined) {
|
|
1227
|
+
labelValue = input.DetectorId;
|
|
1228
|
+
if (labelValue.length <= 0) {
|
|
1229
|
+
throw new Error("Empty value provided for input HTTP label: DetectorId.");
|
|
1230
|
+
}
|
|
1231
|
+
resolvedPath = resolvedPath.replace("{DetectorId}", __extendedEncodeURIComponent(labelValue));
|
|
1232
|
+
}
|
|
1233
|
+
else {
|
|
1234
|
+
throw new Error("No value provided for input HTTP label: DetectorId.");
|
|
1235
|
+
}
|
|
1236
|
+
body = JSON.stringify(__assign({}, (input.AccountIds !== undefined &&
|
|
1237
|
+
input.AccountIds !== null && { accountIds: serializeAws_restJson1AccountIds(input.AccountIds, context) })));
|
|
1238
|
+
return [2, new __HttpRequest({
|
|
1239
|
+
protocol: protocol,
|
|
1240
|
+
hostname: hostname,
|
|
1241
|
+
port: port,
|
|
1242
|
+
method: "POST",
|
|
1243
|
+
headers: headers,
|
|
1244
|
+
path: resolvedPath,
|
|
1245
|
+
body: body,
|
|
1246
|
+
})];
|
|
1247
|
+
}
|
|
1248
|
+
});
|
|
1249
|
+
}); };
|
|
1116
1250
|
export var serializeAws_restJson1GetThreatIntelSetCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1117
1251
|
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
|
|
1118
1252
|
return __generator(this, function (_c) {
|
|
@@ -2039,6 +2173,60 @@ export var serializeAws_restJson1UpdateThreatIntelSetCommand = function (input,
|
|
|
2039
2173
|
}
|
|
2040
2174
|
});
|
|
2041
2175
|
}); };
|
|
2176
|
+
export var deserializeAws_restJson1AcceptAdministratorInvitationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2177
|
+
var contents;
|
|
2178
|
+
return __generator(this, function (_a) {
|
|
2179
|
+
switch (_a.label) {
|
|
2180
|
+
case 0:
|
|
2181
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2182
|
+
return [2, deserializeAws_restJson1AcceptAdministratorInvitationCommandError(output, context)];
|
|
2183
|
+
}
|
|
2184
|
+
contents = {
|
|
2185
|
+
$metadata: deserializeMetadata(output),
|
|
2186
|
+
};
|
|
2187
|
+
return [4, collectBody(output.body, context)];
|
|
2188
|
+
case 1:
|
|
2189
|
+
_a.sent();
|
|
2190
|
+
return [2, Promise.resolve(contents)];
|
|
2191
|
+
}
|
|
2192
|
+
});
|
|
2193
|
+
}); };
|
|
2194
|
+
var deserializeAws_restJson1AcceptAdministratorInvitationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2195
|
+
var parsedOutput, _a, response, errorCode, _b, parsedBody;
|
|
2196
|
+
var _c;
|
|
2197
|
+
return __generator(this, function (_d) {
|
|
2198
|
+
switch (_d.label) {
|
|
2199
|
+
case 0:
|
|
2200
|
+
_a = [__assign({}, output)];
|
|
2201
|
+
_c = {};
|
|
2202
|
+
return [4, parseBody(output.body, context)];
|
|
2203
|
+
case 1:
|
|
2204
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
2205
|
+
errorCode = "UnknownError";
|
|
2206
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2207
|
+
_b = errorCode;
|
|
2208
|
+
switch (_b) {
|
|
2209
|
+
case "BadRequestException": return [3, 2];
|
|
2210
|
+
case "com.amazonaws.guardduty#BadRequestException": return [3, 2];
|
|
2211
|
+
case "InternalServerErrorException": return [3, 4];
|
|
2212
|
+
case "com.amazonaws.guardduty#InternalServerErrorException": return [3, 4];
|
|
2213
|
+
}
|
|
2214
|
+
return [3, 6];
|
|
2215
|
+
case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
|
|
2216
|
+
case 3: throw _d.sent();
|
|
2217
|
+
case 4: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
|
|
2218
|
+
case 5: throw _d.sent();
|
|
2219
|
+
case 6:
|
|
2220
|
+
parsedBody = parsedOutput.body;
|
|
2221
|
+
response = new __BaseException({
|
|
2222
|
+
name: parsedBody.code || parsedBody.Code || errorCode,
|
|
2223
|
+
$fault: "client",
|
|
2224
|
+
$metadata: deserializeMetadata(output),
|
|
2225
|
+
});
|
|
2226
|
+
throw __decorateServiceException(response, parsedBody);
|
|
2227
|
+
}
|
|
2228
|
+
});
|
|
2229
|
+
}); };
|
|
2042
2230
|
export var deserializeAws_restJson1AcceptInvitationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2043
2231
|
var contents;
|
|
2044
2232
|
return __generator(this, function (_a) {
|
|
@@ -3209,6 +3397,60 @@ var deserializeAws_restJson1DisableOrganizationAdminAccountCommandError = functi
|
|
|
3209
3397
|
}
|
|
3210
3398
|
});
|
|
3211
3399
|
}); };
|
|
3400
|
+
export var deserializeAws_restJson1DisassociateFromAdministratorAccountCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
3401
|
+
var contents;
|
|
3402
|
+
return __generator(this, function (_a) {
|
|
3403
|
+
switch (_a.label) {
|
|
3404
|
+
case 0:
|
|
3405
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
3406
|
+
return [2, deserializeAws_restJson1DisassociateFromAdministratorAccountCommandError(output, context)];
|
|
3407
|
+
}
|
|
3408
|
+
contents = {
|
|
3409
|
+
$metadata: deserializeMetadata(output),
|
|
3410
|
+
};
|
|
3411
|
+
return [4, collectBody(output.body, context)];
|
|
3412
|
+
case 1:
|
|
3413
|
+
_a.sent();
|
|
3414
|
+
return [2, Promise.resolve(contents)];
|
|
3415
|
+
}
|
|
3416
|
+
});
|
|
3417
|
+
}); };
|
|
3418
|
+
var deserializeAws_restJson1DisassociateFromAdministratorAccountCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
3419
|
+
var parsedOutput, _a, response, errorCode, _b, parsedBody;
|
|
3420
|
+
var _c;
|
|
3421
|
+
return __generator(this, function (_d) {
|
|
3422
|
+
switch (_d.label) {
|
|
3423
|
+
case 0:
|
|
3424
|
+
_a = [__assign({}, output)];
|
|
3425
|
+
_c = {};
|
|
3426
|
+
return [4, parseBody(output.body, context)];
|
|
3427
|
+
case 1:
|
|
3428
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
3429
|
+
errorCode = "UnknownError";
|
|
3430
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
3431
|
+
_b = errorCode;
|
|
3432
|
+
switch (_b) {
|
|
3433
|
+
case "BadRequestException": return [3, 2];
|
|
3434
|
+
case "com.amazonaws.guardduty#BadRequestException": return [3, 2];
|
|
3435
|
+
case "InternalServerErrorException": return [3, 4];
|
|
3436
|
+
case "com.amazonaws.guardduty#InternalServerErrorException": return [3, 4];
|
|
3437
|
+
}
|
|
3438
|
+
return [3, 6];
|
|
3439
|
+
case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
|
|
3440
|
+
case 3: throw _d.sent();
|
|
3441
|
+
case 4: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
|
|
3442
|
+
case 5: throw _d.sent();
|
|
3443
|
+
case 6:
|
|
3444
|
+
parsedBody = parsedOutput.body;
|
|
3445
|
+
response = new __BaseException({
|
|
3446
|
+
name: parsedBody.code || parsedBody.Code || errorCode,
|
|
3447
|
+
$fault: "client",
|
|
3448
|
+
$metadata: deserializeMetadata(output),
|
|
3449
|
+
});
|
|
3450
|
+
throw __decorateServiceException(response, parsedBody);
|
|
3451
|
+
}
|
|
3452
|
+
});
|
|
3453
|
+
}); };
|
|
3212
3454
|
export var deserializeAws_restJson1DisassociateFromMasterAccountCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
3213
3455
|
var contents;
|
|
3214
3456
|
return __generator(this, function (_a) {
|
|
@@ -3377,6 +3619,66 @@ var deserializeAws_restJson1EnableOrganizationAdminAccountCommandError = functio
|
|
|
3377
3619
|
}
|
|
3378
3620
|
});
|
|
3379
3621
|
}); };
|
|
3622
|
+
export var deserializeAws_restJson1GetAdministratorAccountCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
3623
|
+
var contents, data, _a, _b;
|
|
3624
|
+
return __generator(this, function (_c) {
|
|
3625
|
+
switch (_c.label) {
|
|
3626
|
+
case 0:
|
|
3627
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
3628
|
+
return [2, deserializeAws_restJson1GetAdministratorAccountCommandError(output, context)];
|
|
3629
|
+
}
|
|
3630
|
+
contents = {
|
|
3631
|
+
$metadata: deserializeMetadata(output),
|
|
3632
|
+
Administrator: undefined,
|
|
3633
|
+
};
|
|
3634
|
+
_a = __expectNonNull;
|
|
3635
|
+
_b = __expectObject;
|
|
3636
|
+
return [4, parseBody(output.body, context)];
|
|
3637
|
+
case 1:
|
|
3638
|
+
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
3639
|
+
if (data.administrator !== undefined && data.administrator !== null) {
|
|
3640
|
+
contents.Administrator = deserializeAws_restJson1Administrator(data.administrator, context);
|
|
3641
|
+
}
|
|
3642
|
+
return [2, Promise.resolve(contents)];
|
|
3643
|
+
}
|
|
3644
|
+
});
|
|
3645
|
+
}); };
|
|
3646
|
+
var deserializeAws_restJson1GetAdministratorAccountCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
3647
|
+
var parsedOutput, _a, response, errorCode, _b, parsedBody;
|
|
3648
|
+
var _c;
|
|
3649
|
+
return __generator(this, function (_d) {
|
|
3650
|
+
switch (_d.label) {
|
|
3651
|
+
case 0:
|
|
3652
|
+
_a = [__assign({}, output)];
|
|
3653
|
+
_c = {};
|
|
3654
|
+
return [4, parseBody(output.body, context)];
|
|
3655
|
+
case 1:
|
|
3656
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
3657
|
+
errorCode = "UnknownError";
|
|
3658
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
3659
|
+
_b = errorCode;
|
|
3660
|
+
switch (_b) {
|
|
3661
|
+
case "BadRequestException": return [3, 2];
|
|
3662
|
+
case "com.amazonaws.guardduty#BadRequestException": return [3, 2];
|
|
3663
|
+
case "InternalServerErrorException": return [3, 4];
|
|
3664
|
+
case "com.amazonaws.guardduty#InternalServerErrorException": return [3, 4];
|
|
3665
|
+
}
|
|
3666
|
+
return [3, 6];
|
|
3667
|
+
case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
|
|
3668
|
+
case 3: throw _d.sent();
|
|
3669
|
+
case 4: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
|
|
3670
|
+
case 5: throw _d.sent();
|
|
3671
|
+
case 6:
|
|
3672
|
+
parsedBody = parsedOutput.body;
|
|
3673
|
+
response = new __BaseException({
|
|
3674
|
+
name: parsedBody.code || parsedBody.Code || errorCode,
|
|
3675
|
+
$fault: "client",
|
|
3676
|
+
$metadata: deserializeMetadata(output),
|
|
3677
|
+
});
|
|
3678
|
+
throw __decorateServiceException(response, parsedBody);
|
|
3679
|
+
}
|
|
3680
|
+
});
|
|
3681
|
+
}); };
|
|
3380
3682
|
export var deserializeAws_restJson1GetDetectorCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
3381
3683
|
var contents, data, _a, _b;
|
|
3382
3684
|
return __generator(this, function (_c) {
|
|
@@ -3985,6 +4287,70 @@ var deserializeAws_restJson1GetMembersCommandError = function (output, context)
|
|
|
3985
4287
|
}
|
|
3986
4288
|
});
|
|
3987
4289
|
}); };
|
|
4290
|
+
export var deserializeAws_restJson1GetRemainingFreeTrialDaysCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
4291
|
+
var contents, data, _a, _b;
|
|
4292
|
+
return __generator(this, function (_c) {
|
|
4293
|
+
switch (_c.label) {
|
|
4294
|
+
case 0:
|
|
4295
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
4296
|
+
return [2, deserializeAws_restJson1GetRemainingFreeTrialDaysCommandError(output, context)];
|
|
4297
|
+
}
|
|
4298
|
+
contents = {
|
|
4299
|
+
$metadata: deserializeMetadata(output),
|
|
4300
|
+
Accounts: undefined,
|
|
4301
|
+
UnprocessedAccounts: undefined,
|
|
4302
|
+
};
|
|
4303
|
+
_a = __expectNonNull;
|
|
4304
|
+
_b = __expectObject;
|
|
4305
|
+
return [4, parseBody(output.body, context)];
|
|
4306
|
+
case 1:
|
|
4307
|
+
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
4308
|
+
if (data.accounts !== undefined && data.accounts !== null) {
|
|
4309
|
+
contents.Accounts = deserializeAws_restJson1AccountFreeTrialInfos(data.accounts, context);
|
|
4310
|
+
}
|
|
4311
|
+
if (data.unprocessedAccounts !== undefined && data.unprocessedAccounts !== null) {
|
|
4312
|
+
contents.UnprocessedAccounts = deserializeAws_restJson1UnprocessedAccounts(data.unprocessedAccounts, context);
|
|
4313
|
+
}
|
|
4314
|
+
return [2, Promise.resolve(contents)];
|
|
4315
|
+
}
|
|
4316
|
+
});
|
|
4317
|
+
}); };
|
|
4318
|
+
var deserializeAws_restJson1GetRemainingFreeTrialDaysCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
4319
|
+
var parsedOutput, _a, response, errorCode, _b, parsedBody;
|
|
4320
|
+
var _c;
|
|
4321
|
+
return __generator(this, function (_d) {
|
|
4322
|
+
switch (_d.label) {
|
|
4323
|
+
case 0:
|
|
4324
|
+
_a = [__assign({}, output)];
|
|
4325
|
+
_c = {};
|
|
4326
|
+
return [4, parseBody(output.body, context)];
|
|
4327
|
+
case 1:
|
|
4328
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
4329
|
+
errorCode = "UnknownError";
|
|
4330
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
4331
|
+
_b = errorCode;
|
|
4332
|
+
switch (_b) {
|
|
4333
|
+
case "BadRequestException": return [3, 2];
|
|
4334
|
+
case "com.amazonaws.guardduty#BadRequestException": return [3, 2];
|
|
4335
|
+
case "InternalServerErrorException": return [3, 4];
|
|
4336
|
+
case "com.amazonaws.guardduty#InternalServerErrorException": return [3, 4];
|
|
4337
|
+
}
|
|
4338
|
+
return [3, 6];
|
|
4339
|
+
case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
|
|
4340
|
+
case 3: throw _d.sent();
|
|
4341
|
+
case 4: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
|
|
4342
|
+
case 5: throw _d.sent();
|
|
4343
|
+
case 6:
|
|
4344
|
+
parsedBody = parsedOutput.body;
|
|
4345
|
+
response = new __BaseException({
|
|
4346
|
+
name: parsedBody.code || parsedBody.Code || errorCode,
|
|
4347
|
+
$fault: "client",
|
|
4348
|
+
$metadata: deserializeMetadata(output),
|
|
4349
|
+
});
|
|
4350
|
+
throw __decorateServiceException(response, parsedBody);
|
|
4351
|
+
}
|
|
4352
|
+
});
|
|
4353
|
+
}); };
|
|
3988
4354
|
export var deserializeAws_restJson1GetThreatIntelSetCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
3989
4355
|
var contents, data, _a, _b;
|
|
3990
4356
|
return __generator(this, function (_c) {
|
|
@@ -5788,6 +6154,25 @@ var deserializeAws_restJson1AccessKeyDetails = function (output, context) {
|
|
|
5788
6154
|
UserType: __expectString(output.userType),
|
|
5789
6155
|
};
|
|
5790
6156
|
};
|
|
6157
|
+
var deserializeAws_restJson1AccountFreeTrialInfo = function (output, context) {
|
|
6158
|
+
return {
|
|
6159
|
+
AccountId: __expectString(output.accountId),
|
|
6160
|
+
DataSources: output.dataSources !== undefined && output.dataSources !== null
|
|
6161
|
+
? deserializeAws_restJson1DataSourcesFreeTrial(output.dataSources, context)
|
|
6162
|
+
: undefined,
|
|
6163
|
+
};
|
|
6164
|
+
};
|
|
6165
|
+
var deserializeAws_restJson1AccountFreeTrialInfos = function (output, context) {
|
|
6166
|
+
var retVal = (output || [])
|
|
6167
|
+
.filter(function (e) { return e != null; })
|
|
6168
|
+
.map(function (entry) {
|
|
6169
|
+
if (entry === null) {
|
|
6170
|
+
return null;
|
|
6171
|
+
}
|
|
6172
|
+
return deserializeAws_restJson1AccountFreeTrialInfo(entry, context);
|
|
6173
|
+
});
|
|
6174
|
+
return retVal;
|
|
6175
|
+
};
|
|
5791
6176
|
var deserializeAws_restJson1AccountLevelPermissions = function (output, context) {
|
|
5792
6177
|
return {
|
|
5793
6178
|
BlockPublicAccess: output.blockPublicAccess !== undefined && output.blockPublicAccess !== null
|
|
@@ -5832,8 +6217,29 @@ var deserializeAws_restJson1AdminAccounts = function (output, context) {
|
|
|
5832
6217
|
});
|
|
5833
6218
|
return retVal;
|
|
5834
6219
|
};
|
|
6220
|
+
var deserializeAws_restJson1Administrator = function (output, context) {
|
|
6221
|
+
return {
|
|
6222
|
+
AccountId: __expectString(output.accountId),
|
|
6223
|
+
InvitationId: __expectString(output.invitationId),
|
|
6224
|
+
InvitedAt: __expectString(output.invitedAt),
|
|
6225
|
+
RelationshipStatus: __expectString(output.relationshipStatus),
|
|
6226
|
+
};
|
|
6227
|
+
};
|
|
6228
|
+
var deserializeAws_restJson1AffectedResources = function (output, context) {
|
|
6229
|
+
return Object.entries(output).reduce(function (acc, _a) {
|
|
6230
|
+
var _b;
|
|
6231
|
+
var _c = __read(_a, 2), key = _c[0], value = _c[1];
|
|
6232
|
+
if (value === null) {
|
|
6233
|
+
return acc;
|
|
6234
|
+
}
|
|
6235
|
+
return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
|
|
6236
|
+
}, {});
|
|
6237
|
+
};
|
|
5835
6238
|
var deserializeAws_restJson1AwsApiCallAction = function (output, context) {
|
|
5836
6239
|
return {
|
|
6240
|
+
AffectedResources: output.affectedResources !== undefined && output.affectedResources !== null
|
|
6241
|
+
? deserializeAws_restJson1AffectedResources(output.affectedResources, context)
|
|
6242
|
+
: undefined,
|
|
5837
6243
|
Api: __expectString(output.api),
|
|
5838
6244
|
CallerType: __expectString(output.callerType),
|
|
5839
6245
|
DomainDetails: output.domainDetails !== undefined && output.domainDetails !== null
|
|
@@ -5978,6 +6384,30 @@ var deserializeAws_restJson1DataSourceConfigurationsResult = function (output, c
|
|
|
5978
6384
|
: undefined,
|
|
5979
6385
|
};
|
|
5980
6386
|
};
|
|
6387
|
+
var deserializeAws_restJson1DataSourceFreeTrial = function (output, context) {
|
|
6388
|
+
return {
|
|
6389
|
+
FreeTrialDaysRemaining: __expectInt32(output.freeTrialDaysRemaining),
|
|
6390
|
+
};
|
|
6391
|
+
};
|
|
6392
|
+
var deserializeAws_restJson1DataSourcesFreeTrial = function (output, context) {
|
|
6393
|
+
return {
|
|
6394
|
+
CloudTrail: output.cloudTrail !== undefined && output.cloudTrail !== null
|
|
6395
|
+
? deserializeAws_restJson1DataSourceFreeTrial(output.cloudTrail, context)
|
|
6396
|
+
: undefined,
|
|
6397
|
+
DnsLogs: output.dnsLogs !== undefined && output.dnsLogs !== null
|
|
6398
|
+
? deserializeAws_restJson1DataSourceFreeTrial(output.dnsLogs, context)
|
|
6399
|
+
: undefined,
|
|
6400
|
+
FlowLogs: output.flowLogs !== undefined && output.flowLogs !== null
|
|
6401
|
+
? deserializeAws_restJson1DataSourceFreeTrial(output.flowLogs, context)
|
|
6402
|
+
: undefined,
|
|
6403
|
+
Kubernetes: output.kubernetes !== undefined && output.kubernetes !== null
|
|
6404
|
+
? deserializeAws_restJson1KubernetesDataSourceFreeTrial(output.kubernetes, context)
|
|
6405
|
+
: undefined,
|
|
6406
|
+
S3Logs: output.s3Logs !== undefined && output.s3Logs !== null
|
|
6407
|
+
? deserializeAws_restJson1DataSourceFreeTrial(output.s3Logs, context)
|
|
6408
|
+
: undefined,
|
|
6409
|
+
};
|
|
6410
|
+
};
|
|
5981
6411
|
var deserializeAws_restJson1DefaultServerSideEncryption = function (output, context) {
|
|
5982
6412
|
return {
|
|
5983
6413
|
EncryptionType: __expectString(output.encryptionType),
|
|
@@ -6026,7 +6456,9 @@ var deserializeAws_restJson1DNSLogsConfigurationResult = function (output, conte
|
|
|
6026
6456
|
};
|
|
6027
6457
|
var deserializeAws_restJson1DnsRequestAction = function (output, context) {
|
|
6028
6458
|
return {
|
|
6459
|
+
Blocked: __expectBoolean(output.blocked),
|
|
6029
6460
|
Domain: __expectString(output.domain),
|
|
6461
|
+
Protocol: __expectString(output.protocol),
|
|
6030
6462
|
};
|
|
6031
6463
|
};
|
|
6032
6464
|
var deserializeAws_restJson1DomainDetails = function (output, context) {
|
|
@@ -6273,6 +6705,13 @@ var deserializeAws_restJson1KubernetesConfigurationResult = function (output, co
|
|
|
6273
6705
|
: undefined,
|
|
6274
6706
|
};
|
|
6275
6707
|
};
|
|
6708
|
+
var deserializeAws_restJson1KubernetesDataSourceFreeTrial = function (output, context) {
|
|
6709
|
+
return {
|
|
6710
|
+
AuditLogs: output.auditLogs !== undefined && output.auditLogs !== null
|
|
6711
|
+
? deserializeAws_restJson1DataSourceFreeTrial(output.auditLogs, context)
|
|
6712
|
+
: undefined,
|
|
6713
|
+
};
|
|
6714
|
+
};
|
|
6276
6715
|
var deserializeAws_restJson1KubernetesDetails = function (output, context) {
|
|
6277
6716
|
return {
|
|
6278
6717
|
KubernetesUserDetails: output.kubernetesUserDetails !== undefined && output.kubernetesUserDetails !== null
|
|
@@ -6329,6 +6768,7 @@ var deserializeAws_restJson1Master = function (output, context) {
|
|
|
6329
6768
|
var deserializeAws_restJson1Member = function (output, context) {
|
|
6330
6769
|
return {
|
|
6331
6770
|
AccountId: __expectString(output.accountId),
|
|
6771
|
+
AdministratorId: __expectString(output.administratorId),
|
|
6332
6772
|
DetectorId: __expectString(output.detectorId),
|
|
6333
6773
|
Email: __expectString(output.email),
|
|
6334
6774
|
InvitedAt: __expectString(output.invitedAt),
|
|
@@ -6540,8 +6980,8 @@ var deserializeAws_restJson1PrivateIpAddresses = function (output, context) {
|
|
|
6540
6980
|
};
|
|
6541
6981
|
var deserializeAws_restJson1ProductCode = function (output, context) {
|
|
6542
6982
|
return {
|
|
6543
|
-
Code: __expectString(output.
|
|
6544
|
-
ProductType: __expectString(output.
|
|
6983
|
+
Code: __expectString(output.productCodeId),
|
|
6984
|
+
ProductType: __expectString(output.productCodeType),
|
|
6545
6985
|
};
|
|
6546
6986
|
};
|
|
6547
6987
|
var deserializeAws_restJson1ProductCodes = function (output, context) {
|
|
@@ -6677,6 +7117,9 @@ var deserializeAws_restJson1Service = function (output, context) {
|
|
|
6677
7117
|
Action: output.action !== undefined && output.action !== null
|
|
6678
7118
|
? deserializeAws_restJson1Action(output.action, context)
|
|
6679
7119
|
: undefined,
|
|
7120
|
+
AdditionalInfo: output.additionalInfo !== undefined && output.additionalInfo !== null
|
|
7121
|
+
? deserializeAws_restJson1ServiceAdditionalInfo(output.additionalInfo, context)
|
|
7122
|
+
: undefined,
|
|
6680
7123
|
Archived: __expectBoolean(output.archived),
|
|
6681
7124
|
Count: __expectInt32(output.count),
|
|
6682
7125
|
DetectorId: __expectString(output.detectorId),
|
|
@@ -6690,6 +7133,12 @@ var deserializeAws_restJson1Service = function (output, context) {
|
|
|
6690
7133
|
UserFeedback: __expectString(output.userFeedback),
|
|
6691
7134
|
};
|
|
6692
7135
|
};
|
|
7136
|
+
var deserializeAws_restJson1ServiceAdditionalInfo = function (output, context) {
|
|
7137
|
+
return {
|
|
7138
|
+
Type: __expectString(output.type),
|
|
7139
|
+
Value: __expectString(output.value),
|
|
7140
|
+
};
|
|
7141
|
+
};
|
|
6693
7142
|
var deserializeAws_restJson1SourceIps = function (output, context) {
|
|
6694
7143
|
var retVal = (output || [])
|
|
6695
7144
|
.filter(function (e) { return e != null; })
|