@aws-sdk/client-detective 3.451.0 → 3.458.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/README.md +64 -24
  2. package/dist-cjs/Detective.js +10 -0
  3. package/dist-cjs/commands/GetInvestigationCommand.js +51 -0
  4. package/dist-cjs/commands/ListIndicatorsCommand.js +51 -0
  5. package/dist-cjs/commands/ListInvestigationsCommand.js +51 -0
  6. package/dist-cjs/commands/StartInvestigationCommand.js +51 -0
  7. package/dist-cjs/commands/UpdateInvestigationStateCommand.js +51 -0
  8. package/dist-cjs/commands/index.js +5 -0
  9. package/dist-cjs/models/models_0.js +43 -1
  10. package/dist-cjs/protocols/Aws_restJson1.js +394 -1
  11. package/dist-es/Detective.js +10 -0
  12. package/dist-es/commands/GetInvestigationCommand.js +47 -0
  13. package/dist-es/commands/ListIndicatorsCommand.js +47 -0
  14. package/dist-es/commands/ListInvestigationsCommand.js +47 -0
  15. package/dist-es/commands/StartInvestigationCommand.js +47 -0
  16. package/dist-es/commands/UpdateInvestigationStateCommand.js +47 -0
  17. package/dist-es/commands/index.js +5 -0
  18. package/dist-es/models/models_0.js +42 -0
  19. package/dist-es/protocols/Aws_restJson1.js +382 -0
  20. package/dist-types/Detective.d.ts +35 -0
  21. package/dist-types/DetectiveClient.d.ts +7 -2
  22. package/dist-types/commands/CreateMembersCommand.d.ts +2 -2
  23. package/dist-types/commands/GetInvestigationCommand.d.ts +100 -0
  24. package/dist-types/commands/ListIndicatorsCommand.d.ts +144 -0
  25. package/dist-types/commands/ListInvestigationsCommand.d.ts +125 -0
  26. package/dist-types/commands/StartInvestigationCommand.d.ts +93 -0
  27. package/dist-types/commands/UpdateInvestigationStateCommand.d.ts +90 -0
  28. package/dist-types/commands/index.d.ts +5 -0
  29. package/dist-types/models/models_0.d.ts +687 -0
  30. package/dist-types/protocols/Aws_restJson1.d.ts +45 -0
  31. package/dist-types/ts3.4/Detective.d.ts +85 -0
  32. package/dist-types/ts3.4/DetectiveClient.d.ts +30 -0
  33. package/dist-types/ts3.4/commands/GetInvestigationCommand.d.ts +38 -0
  34. package/dist-types/ts3.4/commands/ListIndicatorsCommand.d.ts +38 -0
  35. package/dist-types/ts3.4/commands/ListInvestigationsCommand.d.ts +39 -0
  36. package/dist-types/ts3.4/commands/StartInvestigationCommand.d.ts +39 -0
  37. package/dist-types/ts3.4/commands/UpdateInvestigationStateCommand.d.ts +38 -0
  38. package/dist-types/ts3.4/commands/index.d.ts +5 -0
  39. package/dist-types/ts3.4/models/models_0.d.ts +186 -0
  40. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +60 -0
  41. package/package.json +3 -3
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ListMembersResponseFilterSensitiveLog = exports.ListInvitationsResponseFilterSensitiveLog = exports.GetMembersResponseFilterSensitiveLog = exports.CreateMembersResponseFilterSensitiveLog = exports.MemberDetailFilterSensitiveLog = exports.CreateMembersRequestFilterSensitiveLog = exports.AccountFilterSensitiveLog = exports.TooManyRequestsException = exports.MemberStatus = exports.InvitationType = exports.MemberDisabledReason = exports.ServiceQuotaExceededException = exports.DatasourcePackageIngestState = exports.DatasourcePackage = exports.ValidationException = exports.ResourceNotFoundException = exports.InternalServerException = exports.ConflictException = exports.AccessDeniedException = exports.ErrorCode = void 0;
3
+ exports.ListMembersResponseFilterSensitiveLog = exports.ListInvitationsResponseFilterSensitiveLog = exports.GetMembersResponseFilterSensitiveLog = exports.CreateMembersResponseFilterSensitiveLog = exports.MemberDetailFilterSensitiveLog = exports.CreateMembersRequestFilterSensitiveLog = exports.AccountFilterSensitiveLog = exports.SortOrder = exports.Field = exports.Reason = exports.IndicatorType = exports.Status = exports.State = exports.Severity = exports.EntityType = exports.TooManyRequestsException = exports.MemberStatus = exports.InvitationType = exports.MemberDisabledReason = exports.ServiceQuotaExceededException = exports.DatasourcePackageIngestState = exports.DatasourcePackage = exports.ValidationException = exports.ResourceNotFoundException = exports.InternalServerException = exports.ConflictException = exports.AccessDeniedException = exports.ErrorCode = void 0;
4
4
  const smithy_client_1 = require("@smithy/smithy-client");
5
5
  const DetectiveServiceException_1 = require("./DetectiveServiceException");
6
6
  exports.ErrorCode = {
@@ -138,6 +138,48 @@ class TooManyRequestsException extends DetectiveServiceException_1.DetectiveServ
138
138
  }
139
139
  }
140
140
  exports.TooManyRequestsException = TooManyRequestsException;
141
+ exports.EntityType = {
142
+ IAM_ROLE: "IAM_ROLE",
143
+ IAM_USER: "IAM_USER",
144
+ };
145
+ exports.Severity = {
146
+ CRITICAL: "CRITICAL",
147
+ HIGH: "HIGH",
148
+ INFORMATIONAL: "INFORMATIONAL",
149
+ LOW: "LOW",
150
+ MEDIUM: "MEDIUM",
151
+ };
152
+ exports.State = {
153
+ ACTIVE: "ACTIVE",
154
+ ARCHIVED: "ARCHIVED",
155
+ };
156
+ exports.Status = {
157
+ FAILED: "FAILED",
158
+ RUNNING: "RUNNING",
159
+ SUCCESSFUL: "SUCCESSFUL",
160
+ };
161
+ exports.IndicatorType = {
162
+ FLAGGED_IP_ADDRESS: "FLAGGED_IP_ADDRESS",
163
+ IMPOSSIBLE_TRAVEL: "IMPOSSIBLE_TRAVEL",
164
+ NEW_ASO: "NEW_ASO",
165
+ NEW_GEOLOCATION: "NEW_GEOLOCATION",
166
+ NEW_USER_AGENT: "NEW_USER_AGENT",
167
+ RELATED_FINDING: "RELATED_FINDING",
168
+ RELATED_FINDING_GROUP: "RELATED_FINDING_GROUP",
169
+ TTP_OBSERVED: "TTP_OBSERVED",
170
+ };
171
+ exports.Reason = {
172
+ AWS_THREAT_INTELLIGENCE: "AWS_THREAT_INTELLIGENCE",
173
+ };
174
+ exports.Field = {
175
+ CREATED_TIME: "CREATED_TIME",
176
+ SEVERITY: "SEVERITY",
177
+ STATUS: "STATUS",
178
+ };
179
+ exports.SortOrder = {
180
+ ASC: "ASC",
181
+ DESC: "DESC",
182
+ };
141
183
  const AccountFilterSensitiveLog = (obj) => ({
142
184
  ...obj,
143
185
  ...(obj.EmailAddress && { EmailAddress: smithy_client_1.SENSITIVE_STRING }),
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_UpdateOrganizationConfigurationCommand = exports.de_UpdateDatasourcePackagesCommand = exports.de_UntagResourceCommand = exports.de_TagResourceCommand = exports.de_StartMonitoringMemberCommand = exports.de_RejectInvitationCommand = exports.de_ListTagsForResourceCommand = exports.de_ListOrganizationAdminAccountsCommand = exports.de_ListMembersCommand = exports.de_ListInvitationsCommand = exports.de_ListGraphsCommand = exports.de_ListDatasourcePackagesCommand = exports.de_GetMembersCommand = exports.de_EnableOrganizationAdminAccountCommand = exports.de_DisassociateMembershipCommand = exports.de_DisableOrganizationAdminAccountCommand = exports.de_DescribeOrganizationConfigurationCommand = exports.de_DeleteMembersCommand = exports.de_DeleteGraphCommand = exports.de_CreateMembersCommand = exports.de_CreateGraphCommand = exports.de_BatchGetMembershipDatasourcesCommand = exports.de_BatchGetGraphMemberDatasourcesCommand = exports.de_AcceptInvitationCommand = exports.se_UpdateOrganizationConfigurationCommand = exports.se_UpdateDatasourcePackagesCommand = exports.se_UntagResourceCommand = exports.se_TagResourceCommand = exports.se_StartMonitoringMemberCommand = exports.se_RejectInvitationCommand = exports.se_ListTagsForResourceCommand = exports.se_ListOrganizationAdminAccountsCommand = exports.se_ListMembersCommand = exports.se_ListInvitationsCommand = exports.se_ListGraphsCommand = exports.se_ListDatasourcePackagesCommand = exports.se_GetMembersCommand = exports.se_EnableOrganizationAdminAccountCommand = exports.se_DisassociateMembershipCommand = exports.se_DisableOrganizationAdminAccountCommand = exports.se_DescribeOrganizationConfigurationCommand = exports.se_DeleteMembersCommand = exports.se_DeleteGraphCommand = exports.se_CreateMembersCommand = exports.se_CreateGraphCommand = exports.se_BatchGetMembershipDatasourcesCommand = exports.se_BatchGetGraphMemberDatasourcesCommand = exports.se_AcceptInvitationCommand = void 0;
3
+ exports.de_ListTagsForResourceCommand = exports.de_ListOrganizationAdminAccountsCommand = exports.de_ListMembersCommand = exports.de_ListInvitationsCommand = exports.de_ListInvestigationsCommand = exports.de_ListIndicatorsCommand = exports.de_ListGraphsCommand = exports.de_ListDatasourcePackagesCommand = exports.de_GetMembersCommand = exports.de_GetInvestigationCommand = exports.de_EnableOrganizationAdminAccountCommand = exports.de_DisassociateMembershipCommand = exports.de_DisableOrganizationAdminAccountCommand = exports.de_DescribeOrganizationConfigurationCommand = exports.de_DeleteMembersCommand = exports.de_DeleteGraphCommand = exports.de_CreateMembersCommand = exports.de_CreateGraphCommand = exports.de_BatchGetMembershipDatasourcesCommand = exports.de_BatchGetGraphMemberDatasourcesCommand = exports.de_AcceptInvitationCommand = exports.se_UpdateOrganizationConfigurationCommand = exports.se_UpdateInvestigationStateCommand = exports.se_UpdateDatasourcePackagesCommand = exports.se_UntagResourceCommand = exports.se_TagResourceCommand = exports.se_StartMonitoringMemberCommand = exports.se_StartInvestigationCommand = exports.se_RejectInvitationCommand = exports.se_ListTagsForResourceCommand = exports.se_ListOrganizationAdminAccountsCommand = exports.se_ListMembersCommand = exports.se_ListInvitationsCommand = exports.se_ListInvestigationsCommand = exports.se_ListIndicatorsCommand = exports.se_ListGraphsCommand = exports.se_ListDatasourcePackagesCommand = exports.se_GetMembersCommand = exports.se_GetInvestigationCommand = exports.se_EnableOrganizationAdminAccountCommand = exports.se_DisassociateMembershipCommand = exports.se_DisableOrganizationAdminAccountCommand = exports.se_DescribeOrganizationConfigurationCommand = exports.se_DeleteMembersCommand = exports.se_DeleteGraphCommand = exports.se_CreateMembersCommand = exports.se_CreateGraphCommand = exports.se_BatchGetMembershipDatasourcesCommand = exports.se_BatchGetGraphMemberDatasourcesCommand = exports.se_AcceptInvitationCommand = void 0;
4
+ exports.de_UpdateOrganizationConfigurationCommand = exports.de_UpdateInvestigationStateCommand = exports.de_UpdateDatasourcePackagesCommand = exports.de_UntagResourceCommand = exports.de_TagResourceCommand = exports.de_StartMonitoringMemberCommand = exports.de_StartInvestigationCommand = exports.de_RejectInvitationCommand = void 0;
4
5
  const protocol_http_1 = require("@smithy/protocol-http");
5
6
  const smithy_client_1 = require("@smithy/smithy-client");
6
7
  const DetectiveServiceException_1 = require("../models/DetectiveServiceException");
@@ -239,6 +240,28 @@ const se_EnableOrganizationAdminAccountCommand = async (input, context) => {
239
240
  });
240
241
  };
241
242
  exports.se_EnableOrganizationAdminAccountCommand = se_EnableOrganizationAdminAccountCommand;
243
+ const se_GetInvestigationCommand = async (input, context) => {
244
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
245
+ const headers = {
246
+ "content-type": "application/json",
247
+ };
248
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/investigations/getInvestigation";
249
+ let body;
250
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
251
+ GraphArn: [],
252
+ InvestigationId: [],
253
+ }));
254
+ return new protocol_http_1.HttpRequest({
255
+ protocol,
256
+ hostname,
257
+ port,
258
+ method: "POST",
259
+ headers,
260
+ path: resolvedPath,
261
+ body,
262
+ });
263
+ };
264
+ exports.se_GetInvestigationCommand = se_GetInvestigationCommand;
242
265
  const se_GetMembersCommand = async (input, context) => {
243
266
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
244
267
  const headers = {
@@ -306,6 +329,56 @@ const se_ListGraphsCommand = async (input, context) => {
306
329
  });
307
330
  };
308
331
  exports.se_ListGraphsCommand = se_ListGraphsCommand;
332
+ const se_ListIndicatorsCommand = async (input, context) => {
333
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
334
+ const headers = {
335
+ "content-type": "application/json",
336
+ };
337
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/investigations/listIndicators";
338
+ let body;
339
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
340
+ GraphArn: [],
341
+ IndicatorType: [],
342
+ InvestigationId: [],
343
+ MaxResults: [],
344
+ NextToken: [],
345
+ }));
346
+ return new protocol_http_1.HttpRequest({
347
+ protocol,
348
+ hostname,
349
+ port,
350
+ method: "POST",
351
+ headers,
352
+ path: resolvedPath,
353
+ body,
354
+ });
355
+ };
356
+ exports.se_ListIndicatorsCommand = se_ListIndicatorsCommand;
357
+ const se_ListInvestigationsCommand = async (input, context) => {
358
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
359
+ const headers = {
360
+ "content-type": "application/json",
361
+ };
362
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/investigations/listInvestigations";
363
+ let body;
364
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
365
+ FilterCriteria: (_) => se_FilterCriteria(_, context),
366
+ GraphArn: [],
367
+ MaxResults: [],
368
+ NextToken: [],
369
+ SortCriteria: (_) => (0, smithy_client_1._json)(_),
370
+ }));
371
+ return new protocol_http_1.HttpRequest({
372
+ protocol,
373
+ hostname,
374
+ port,
375
+ method: "POST",
376
+ headers,
377
+ path: resolvedPath,
378
+ body,
379
+ });
380
+ };
381
+ exports.se_ListInvestigationsCommand = se_ListInvestigationsCommand;
309
382
  const se_ListInvitationsCommand = async (input, context) => {
310
383
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
311
384
  const headers = {
@@ -411,6 +484,30 @@ const se_RejectInvitationCommand = async (input, context) => {
411
484
  });
412
485
  };
413
486
  exports.se_RejectInvitationCommand = se_RejectInvitationCommand;
487
+ const se_StartInvestigationCommand = async (input, context) => {
488
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
489
+ const headers = {
490
+ "content-type": "application/json",
491
+ };
492
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/investigations/startInvestigation";
493
+ let body;
494
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
495
+ EntityArn: [],
496
+ GraphArn: [],
497
+ ScopeEndTime: (_) => _.toISOString().split(".")[0] + "Z",
498
+ ScopeStartTime: (_) => _.toISOString().split(".")[0] + "Z",
499
+ }));
500
+ return new protocol_http_1.HttpRequest({
501
+ protocol,
502
+ hostname,
503
+ port,
504
+ method: "POST",
505
+ headers,
506
+ path: resolvedPath,
507
+ body,
508
+ });
509
+ };
510
+ exports.se_StartInvestigationCommand = se_StartInvestigationCommand;
414
511
  const se_StartMonitoringMemberCommand = async (input, context) => {
415
512
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
416
513
  const headers = {
@@ -501,6 +598,29 @@ const se_UpdateDatasourcePackagesCommand = async (input, context) => {
501
598
  });
502
599
  };
503
600
  exports.se_UpdateDatasourcePackagesCommand = se_UpdateDatasourcePackagesCommand;
601
+ const se_UpdateInvestigationStateCommand = async (input, context) => {
602
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
603
+ const headers = {
604
+ "content-type": "application/json",
605
+ };
606
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/investigations/updateInvestigationState";
607
+ let body;
608
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
609
+ GraphArn: [],
610
+ InvestigationId: [],
611
+ State: [],
612
+ }));
613
+ return new protocol_http_1.HttpRequest({
614
+ protocol,
615
+ hostname,
616
+ port,
617
+ method: "POST",
618
+ headers,
619
+ path: resolvedPath,
620
+ body,
621
+ });
622
+ };
623
+ exports.se_UpdateInvestigationStateCommand = se_UpdateInvestigationStateCommand;
504
624
  const se_UpdateOrganizationConfigurationCommand = async (input, context) => {
505
625
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
506
626
  const headers = {
@@ -992,6 +1112,61 @@ const de_EnableOrganizationAdminAccountCommandError = async (output, context) =>
992
1112
  });
993
1113
  }
994
1114
  };
1115
+ const de_GetInvestigationCommand = async (output, context) => {
1116
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1117
+ return de_GetInvestigationCommandError(output, context);
1118
+ }
1119
+ const contents = (0, smithy_client_1.map)({
1120
+ $metadata: deserializeMetadata(output),
1121
+ });
1122
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1123
+ const doc = (0, smithy_client_1.take)(data, {
1124
+ CreatedTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
1125
+ EntityArn: smithy_client_1.expectString,
1126
+ EntityType: smithy_client_1.expectString,
1127
+ GraphArn: smithy_client_1.expectString,
1128
+ InvestigationId: smithy_client_1.expectString,
1129
+ ScopeEndTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
1130
+ ScopeStartTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
1131
+ Severity: smithy_client_1.expectString,
1132
+ State: smithy_client_1.expectString,
1133
+ Status: smithy_client_1.expectString,
1134
+ });
1135
+ Object.assign(contents, doc);
1136
+ return contents;
1137
+ };
1138
+ exports.de_GetInvestigationCommand = de_GetInvestigationCommand;
1139
+ const de_GetInvestigationCommandError = async (output, context) => {
1140
+ const parsedOutput = {
1141
+ ...output,
1142
+ body: await parseErrorBody(output.body, context),
1143
+ };
1144
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1145
+ switch (errorCode) {
1146
+ case "AccessDeniedException":
1147
+ case "com.amazonaws.detective#AccessDeniedException":
1148
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1149
+ case "InternalServerException":
1150
+ case "com.amazonaws.detective#InternalServerException":
1151
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
1152
+ case "ResourceNotFoundException":
1153
+ case "com.amazonaws.detective#ResourceNotFoundException":
1154
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1155
+ case "TooManyRequestsException":
1156
+ case "com.amazonaws.detective#TooManyRequestsException":
1157
+ throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
1158
+ case "ValidationException":
1159
+ case "com.amazonaws.detective#ValidationException":
1160
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1161
+ default:
1162
+ const parsedBody = parsedOutput.body;
1163
+ return throwDefaultError({
1164
+ output,
1165
+ parsedBody,
1166
+ errorCode,
1167
+ });
1168
+ }
1169
+ };
995
1170
  const de_GetMembersCommand = async (output, context) => {
996
1171
  if (output.statusCode !== 200 && output.statusCode >= 300) {
997
1172
  return de_GetMembersCommandError(output, context);
@@ -1121,6 +1296,102 @@ const de_ListGraphsCommandError = async (output, context) => {
1121
1296
  });
1122
1297
  }
1123
1298
  };
1299
+ const de_ListIndicatorsCommand = async (output, context) => {
1300
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1301
+ return de_ListIndicatorsCommandError(output, context);
1302
+ }
1303
+ const contents = (0, smithy_client_1.map)({
1304
+ $metadata: deserializeMetadata(output),
1305
+ });
1306
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1307
+ const doc = (0, smithy_client_1.take)(data, {
1308
+ GraphArn: smithy_client_1.expectString,
1309
+ Indicators: smithy_client_1._json,
1310
+ InvestigationId: smithy_client_1.expectString,
1311
+ NextToken: smithy_client_1.expectString,
1312
+ });
1313
+ Object.assign(contents, doc);
1314
+ return contents;
1315
+ };
1316
+ exports.de_ListIndicatorsCommand = de_ListIndicatorsCommand;
1317
+ const de_ListIndicatorsCommandError = async (output, context) => {
1318
+ const parsedOutput = {
1319
+ ...output,
1320
+ body: await parseErrorBody(output.body, context),
1321
+ };
1322
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1323
+ switch (errorCode) {
1324
+ case "AccessDeniedException":
1325
+ case "com.amazonaws.detective#AccessDeniedException":
1326
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1327
+ case "InternalServerException":
1328
+ case "com.amazonaws.detective#InternalServerException":
1329
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
1330
+ case "ResourceNotFoundException":
1331
+ case "com.amazonaws.detective#ResourceNotFoundException":
1332
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1333
+ case "TooManyRequestsException":
1334
+ case "com.amazonaws.detective#TooManyRequestsException":
1335
+ throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
1336
+ case "ValidationException":
1337
+ case "com.amazonaws.detective#ValidationException":
1338
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1339
+ default:
1340
+ const parsedBody = parsedOutput.body;
1341
+ return throwDefaultError({
1342
+ output,
1343
+ parsedBody,
1344
+ errorCode,
1345
+ });
1346
+ }
1347
+ };
1348
+ const de_ListInvestigationsCommand = async (output, context) => {
1349
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1350
+ return de_ListInvestigationsCommandError(output, context);
1351
+ }
1352
+ const contents = (0, smithy_client_1.map)({
1353
+ $metadata: deserializeMetadata(output),
1354
+ });
1355
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1356
+ const doc = (0, smithy_client_1.take)(data, {
1357
+ InvestigationDetails: (_) => de_InvestigationDetails(_, context),
1358
+ NextToken: smithy_client_1.expectString,
1359
+ });
1360
+ Object.assign(contents, doc);
1361
+ return contents;
1362
+ };
1363
+ exports.de_ListInvestigationsCommand = de_ListInvestigationsCommand;
1364
+ const de_ListInvestigationsCommandError = async (output, context) => {
1365
+ const parsedOutput = {
1366
+ ...output,
1367
+ body: await parseErrorBody(output.body, context),
1368
+ };
1369
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1370
+ switch (errorCode) {
1371
+ case "AccessDeniedException":
1372
+ case "com.amazonaws.detective#AccessDeniedException":
1373
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1374
+ case "InternalServerException":
1375
+ case "com.amazonaws.detective#InternalServerException":
1376
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
1377
+ case "ResourceNotFoundException":
1378
+ case "com.amazonaws.detective#ResourceNotFoundException":
1379
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1380
+ case "TooManyRequestsException":
1381
+ case "com.amazonaws.detective#TooManyRequestsException":
1382
+ throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
1383
+ case "ValidationException":
1384
+ case "com.amazonaws.detective#ValidationException":
1385
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1386
+ default:
1387
+ const parsedBody = parsedOutput.body;
1388
+ return throwDefaultError({
1389
+ output,
1390
+ parsedBody,
1391
+ errorCode,
1392
+ });
1393
+ }
1394
+ };
1124
1395
  const de_ListInvitationsCommand = async (output, context) => {
1125
1396
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1126
1397
  return de_ListInvitationsCommandError(output, context);
@@ -1335,6 +1606,52 @@ const de_RejectInvitationCommandError = async (output, context) => {
1335
1606
  });
1336
1607
  }
1337
1608
  };
1609
+ const de_StartInvestigationCommand = async (output, context) => {
1610
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1611
+ return de_StartInvestigationCommandError(output, context);
1612
+ }
1613
+ const contents = (0, smithy_client_1.map)({
1614
+ $metadata: deserializeMetadata(output),
1615
+ });
1616
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1617
+ const doc = (0, smithy_client_1.take)(data, {
1618
+ InvestigationId: smithy_client_1.expectString,
1619
+ });
1620
+ Object.assign(contents, doc);
1621
+ return contents;
1622
+ };
1623
+ exports.de_StartInvestigationCommand = de_StartInvestigationCommand;
1624
+ const de_StartInvestigationCommandError = async (output, context) => {
1625
+ const parsedOutput = {
1626
+ ...output,
1627
+ body: await parseErrorBody(output.body, context),
1628
+ };
1629
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1630
+ switch (errorCode) {
1631
+ case "AccessDeniedException":
1632
+ case "com.amazonaws.detective#AccessDeniedException":
1633
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1634
+ case "InternalServerException":
1635
+ case "com.amazonaws.detective#InternalServerException":
1636
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
1637
+ case "ResourceNotFoundException":
1638
+ case "com.amazonaws.detective#ResourceNotFoundException":
1639
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1640
+ case "TooManyRequestsException":
1641
+ case "com.amazonaws.detective#TooManyRequestsException":
1642
+ throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
1643
+ case "ValidationException":
1644
+ case "com.amazonaws.detective#ValidationException":
1645
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1646
+ default:
1647
+ const parsedBody = parsedOutput.body;
1648
+ return throwDefaultError({
1649
+ output,
1650
+ parsedBody,
1651
+ errorCode,
1652
+ });
1653
+ }
1654
+ };
1338
1655
  const de_StartMonitoringMemberCommand = async (output, context) => {
1339
1656
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1340
1657
  return de_StartMonitoringMemberCommandError(output, context);
@@ -1500,6 +1817,48 @@ const de_UpdateDatasourcePackagesCommandError = async (output, context) => {
1500
1817
  });
1501
1818
  }
1502
1819
  };
1820
+ const de_UpdateInvestigationStateCommand = async (output, context) => {
1821
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1822
+ return de_UpdateInvestigationStateCommandError(output, context);
1823
+ }
1824
+ const contents = (0, smithy_client_1.map)({
1825
+ $metadata: deserializeMetadata(output),
1826
+ });
1827
+ await (0, smithy_client_1.collectBody)(output.body, context);
1828
+ return contents;
1829
+ };
1830
+ exports.de_UpdateInvestigationStateCommand = de_UpdateInvestigationStateCommand;
1831
+ const de_UpdateInvestigationStateCommandError = async (output, context) => {
1832
+ const parsedOutput = {
1833
+ ...output,
1834
+ body: await parseErrorBody(output.body, context),
1835
+ };
1836
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1837
+ switch (errorCode) {
1838
+ case "AccessDeniedException":
1839
+ case "com.amazonaws.detective#AccessDeniedException":
1840
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1841
+ case "InternalServerException":
1842
+ case "com.amazonaws.detective#InternalServerException":
1843
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
1844
+ case "ResourceNotFoundException":
1845
+ case "com.amazonaws.detective#ResourceNotFoundException":
1846
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1847
+ case "TooManyRequestsException":
1848
+ case "com.amazonaws.detective#TooManyRequestsException":
1849
+ throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
1850
+ case "ValidationException":
1851
+ case "com.amazonaws.detective#ValidationException":
1852
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1853
+ default:
1854
+ const parsedBody = parsedOutput.body;
1855
+ return throwDefaultError({
1856
+ output,
1857
+ parsedBody,
1858
+ errorCode,
1859
+ });
1860
+ }
1861
+ };
1503
1862
  const de_UpdateOrganizationConfigurationCommand = async (output, context) => {
1504
1863
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1505
1864
  return de_UpdateOrganizationConfigurationCommandError(output, context);
@@ -1638,6 +1997,21 @@ const de_ValidationExceptionRes = async (parsedOutput, context) => {
1638
1997
  });
1639
1998
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1640
1999
  };
2000
+ const se_DateFilter = (input, context) => {
2001
+ return (0, smithy_client_1.take)(input, {
2002
+ EndInclusive: (_) => _.toISOString().split(".")[0] + "Z",
2003
+ StartInclusive: (_) => _.toISOString().split(".")[0] + "Z",
2004
+ });
2005
+ };
2006
+ const se_FilterCriteria = (input, context) => {
2007
+ return (0, smithy_client_1.take)(input, {
2008
+ CreatedTime: (_) => se_DateFilter(_, context),
2009
+ EntityArn: smithy_client_1._json,
2010
+ Severity: smithy_client_1._json,
2011
+ State: smithy_client_1._json,
2012
+ Status: smithy_client_1._json,
2013
+ });
2014
+ };
1641
2015
  const de_Administrator = (output, context) => {
1642
2016
  return (0, smithy_client_1.take)(output, {
1643
2017
  AccountId: smithy_client_1.expectString,
@@ -1697,6 +2071,25 @@ const de_GraphList = (output, context) => {
1697
2071
  });
1698
2072
  return retVal;
1699
2073
  };
2074
+ const de_InvestigationDetail = (output, context) => {
2075
+ return (0, smithy_client_1.take)(output, {
2076
+ CreatedTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
2077
+ EntityArn: smithy_client_1.expectString,
2078
+ EntityType: smithy_client_1.expectString,
2079
+ InvestigationId: smithy_client_1.expectString,
2080
+ Severity: smithy_client_1.expectString,
2081
+ State: smithy_client_1.expectString,
2082
+ Status: smithy_client_1.expectString,
2083
+ });
2084
+ };
2085
+ const de_InvestigationDetails = (output, context) => {
2086
+ const retVal = (output || [])
2087
+ .filter((e) => e != null)
2088
+ .map((entry) => {
2089
+ return de_InvestigationDetail(entry, context);
2090
+ });
2091
+ return retVal;
2092
+ };
1700
2093
  const de_LastIngestStateChangeDates = (output, context) => {
1701
2094
  return Object.entries(output).reduce((acc, [key, value]) => {
1702
2095
  if (value === null) {
@@ -10,18 +10,23 @@ import { DescribeOrganizationConfigurationCommand, } from "./commands/DescribeOr
10
10
  import { DisableOrganizationAdminAccountCommand, } from "./commands/DisableOrganizationAdminAccountCommand";
11
11
  import { DisassociateMembershipCommand, } from "./commands/DisassociateMembershipCommand";
12
12
  import { EnableOrganizationAdminAccountCommand, } from "./commands/EnableOrganizationAdminAccountCommand";
13
+ import { GetInvestigationCommand, } from "./commands/GetInvestigationCommand";
13
14
  import { GetMembersCommand } from "./commands/GetMembersCommand";
14
15
  import { ListDatasourcePackagesCommand, } from "./commands/ListDatasourcePackagesCommand";
15
16
  import { ListGraphsCommand } from "./commands/ListGraphsCommand";
17
+ import { ListIndicatorsCommand, } from "./commands/ListIndicatorsCommand";
18
+ import { ListInvestigationsCommand, } from "./commands/ListInvestigationsCommand";
16
19
  import { ListInvitationsCommand, } from "./commands/ListInvitationsCommand";
17
20
  import { ListMembersCommand } from "./commands/ListMembersCommand";
18
21
  import { ListOrganizationAdminAccountsCommand, } from "./commands/ListOrganizationAdminAccountsCommand";
19
22
  import { ListTagsForResourceCommand, } from "./commands/ListTagsForResourceCommand";
20
23
  import { RejectInvitationCommand, } from "./commands/RejectInvitationCommand";
24
+ import { StartInvestigationCommand, } from "./commands/StartInvestigationCommand";
21
25
  import { StartMonitoringMemberCommand, } from "./commands/StartMonitoringMemberCommand";
22
26
  import { TagResourceCommand } from "./commands/TagResourceCommand";
23
27
  import { UntagResourceCommand, } from "./commands/UntagResourceCommand";
24
28
  import { UpdateDatasourcePackagesCommand, } from "./commands/UpdateDatasourcePackagesCommand";
29
+ import { UpdateInvestigationStateCommand, } from "./commands/UpdateInvestigationStateCommand";
25
30
  import { UpdateOrganizationConfigurationCommand, } from "./commands/UpdateOrganizationConfigurationCommand";
26
31
  import { DetectiveClient } from "./DetectiveClient";
27
32
  const commands = {
@@ -36,18 +41,23 @@ const commands = {
36
41
  DisableOrganizationAdminAccountCommand,
37
42
  DisassociateMembershipCommand,
38
43
  EnableOrganizationAdminAccountCommand,
44
+ GetInvestigationCommand,
39
45
  GetMembersCommand,
40
46
  ListDatasourcePackagesCommand,
41
47
  ListGraphsCommand,
48
+ ListIndicatorsCommand,
49
+ ListInvestigationsCommand,
42
50
  ListInvitationsCommand,
43
51
  ListMembersCommand,
44
52
  ListOrganizationAdminAccountsCommand,
45
53
  ListTagsForResourceCommand,
46
54
  RejectInvitationCommand,
55
+ StartInvestigationCommand,
47
56
  StartMonitoringMemberCommand,
48
57
  TagResourceCommand,
49
58
  UntagResourceCommand,
50
59
  UpdateDatasourcePackagesCommand,
60
+ UpdateInvestigationStateCommand,
51
61
  UpdateOrganizationConfigurationCommand,
52
62
  };
53
63
  export class Detective extends DetectiveClient {
@@ -0,0 +1,47 @@
1
+ import { getEndpointPlugin } from "@smithy/middleware-endpoint";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ import { SMITHY_CONTEXT_KEY, } from "@smithy/types";
5
+ import { de_GetInvestigationCommand, se_GetInvestigationCommand } from "../protocols/Aws_restJson1";
6
+ export { $Command };
7
+ export class GetInvestigationCommand extends $Command {
8
+ static getEndpointParameterInstructions() {
9
+ return {
10
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
11
+ Endpoint: { type: "builtInParams", name: "endpoint" },
12
+ Region: { type: "builtInParams", name: "region" },
13
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
14
+ };
15
+ }
16
+ constructor(input) {
17
+ super();
18
+ this.input = input;
19
+ }
20
+ resolveMiddleware(clientStack, configuration, options) {
21
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
22
+ this.middlewareStack.use(getEndpointPlugin(configuration, GetInvestigationCommand.getEndpointParameterInstructions()));
23
+ const stack = clientStack.concat(this.middlewareStack);
24
+ const { logger } = configuration;
25
+ const clientName = "DetectiveClient";
26
+ const commandName = "GetInvestigationCommand";
27
+ const handlerExecutionContext = {
28
+ logger,
29
+ clientName,
30
+ commandName,
31
+ inputFilterSensitiveLog: (_) => _,
32
+ outputFilterSensitiveLog: (_) => _,
33
+ [SMITHY_CONTEXT_KEY]: {
34
+ service: "AmazonDetective",
35
+ operation: "GetInvestigation",
36
+ },
37
+ };
38
+ const { requestHandler } = configuration;
39
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
40
+ }
41
+ serialize(input, context) {
42
+ return se_GetInvestigationCommand(input, context);
43
+ }
44
+ deserialize(output, context) {
45
+ return de_GetInvestigationCommand(output, context);
46
+ }
47
+ }
@@ -0,0 +1,47 @@
1
+ import { getEndpointPlugin } from "@smithy/middleware-endpoint";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ import { SMITHY_CONTEXT_KEY, } from "@smithy/types";
5
+ import { de_ListIndicatorsCommand, se_ListIndicatorsCommand } from "../protocols/Aws_restJson1";
6
+ export { $Command };
7
+ export class ListIndicatorsCommand extends $Command {
8
+ static getEndpointParameterInstructions() {
9
+ return {
10
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
11
+ Endpoint: { type: "builtInParams", name: "endpoint" },
12
+ Region: { type: "builtInParams", name: "region" },
13
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
14
+ };
15
+ }
16
+ constructor(input) {
17
+ super();
18
+ this.input = input;
19
+ }
20
+ resolveMiddleware(clientStack, configuration, options) {
21
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
22
+ this.middlewareStack.use(getEndpointPlugin(configuration, ListIndicatorsCommand.getEndpointParameterInstructions()));
23
+ const stack = clientStack.concat(this.middlewareStack);
24
+ const { logger } = configuration;
25
+ const clientName = "DetectiveClient";
26
+ const commandName = "ListIndicatorsCommand";
27
+ const handlerExecutionContext = {
28
+ logger,
29
+ clientName,
30
+ commandName,
31
+ inputFilterSensitiveLog: (_) => _,
32
+ outputFilterSensitiveLog: (_) => _,
33
+ [SMITHY_CONTEXT_KEY]: {
34
+ service: "AmazonDetective",
35
+ operation: "ListIndicators",
36
+ },
37
+ };
38
+ const { requestHandler } = configuration;
39
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
40
+ }
41
+ serialize(input, context) {
42
+ return se_ListIndicatorsCommand(input, context);
43
+ }
44
+ deserialize(output, context) {
45
+ return de_ListIndicatorsCommand(output, context);
46
+ }
47
+ }