Skip to content

Commit 85d62db

Browse files
author
awstools
committed
feat(client-guardduty): Add support for new statistic types in GetFindingsStatistics.
1 parent 33886e7 commit 85d62db

File tree

10 files changed

+956
-197
lines changed

10 files changed

+956
-197
lines changed

clients/client-guardduty/src/commands/CreatePublishingDestinationCommand.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ export interface CreatePublishingDestinationCommandOutput
3333
__MetadataBearer {}
3434

3535
/**
36-
* <p>Creates a publishing destination to export findings to. The resource to export findings to
37-
* must exist before you use this operation.</p>
36+
* <p>Creates a publishing destination where you can export your GuardDuty findings. Before you start exporting the
37+
* findings, the destination resource must exist.</p>
3838
* @example
3939
* Use a bare-bones client and the command you need to make an API call.
4040
* ```javascript

clients/client-guardduty/src/commands/GetDetectorCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export interface GetDetectorCommandInput extends GetDetectorRequest {}
2828
export interface GetDetectorCommandOutput extends GetDetectorResponse, __MetadataBearer {}
2929

3030
/**
31-
* <p>Retrieves an Amazon GuardDuty detector specified by the detectorId.</p>
31+
* <p>Retrieves a GuardDuty detector specified by the detectorId.</p>
3232
* <p>There might be regional differences because some data sources might not be
3333
* available in all the Amazon Web Services Regions where GuardDuty is presently supported. For more
3434
* information, see <a href="https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_regions.html">Regions and endpoints</a>.</p>

clients/client-guardduty/src/commands/GetFindingsStatisticsCommand.ts

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ export interface GetFindingsStatisticsCommandInput extends GetFindingsStatistics
2828
export interface GetFindingsStatisticsCommandOutput extends GetFindingsStatisticsResponse, __MetadataBearer {}
2929

3030
/**
31-
* <p>Lists Amazon GuardDuty findings statistics for the specified detector ID.</p>
31+
* <p>Lists GuardDuty findings statistics for the specified detector ID.</p>
32+
* <p>You must provide either <code>findingStatisticTypes</code> or
33+
* <code>groupBy</code> parameter, and not both. You can use the <code>maxResults</code> and <code>orderBy</code>
34+
* parameters only when using <code>groupBy</code>.</p>
3235
* <p>There might be regional differences because some flags might not be available in all the Regions where GuardDuty
3336
* is currently supported. For more information, see <a href="https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_regions.html">Regions and endpoints</a>.</p>
3437
* @example
@@ -39,7 +42,7 @@ export interface GetFindingsStatisticsCommandOutput extends GetFindingsStatistic
3942
* const client = new GuardDutyClient(config);
4043
* const input = { // GetFindingsStatisticsRequest
4144
* DetectorId: "STRING_VALUE", // required
42-
* FindingStatisticTypes: [ // FindingStatisticTypes // required
45+
* FindingStatisticTypes: [ // FindingStatisticTypes
4346
* "COUNT_BY_SEVERITY",
4447
* ],
4548
* FindingCriteria: { // FindingCriteria
@@ -68,6 +71,9 @@ export interface GetFindingsStatisticsCommandOutput extends GetFindingsStatistic
6871
* },
6972
* },
7073
* },
74+
* GroupBy: "ACCOUNT" || "DATE" || "FINDING_TYPE" || "RESOURCE" || "SEVERITY",
75+
* OrderBy: "ASC" || "DESC",
76+
* MaxResults: Number("int"),
7177
* };
7278
* const command = new GetFindingsStatisticsCommand(input);
7379
* const response = await client.send(command);
@@ -76,7 +82,46 @@ export interface GetFindingsStatisticsCommandOutput extends GetFindingsStatistic
7682
* // CountBySeverity: { // CountBySeverity
7783
* // "<keys>": Number("int"),
7884
* // },
85+
* // GroupedByAccount: [ // GroupedByAccount
86+
* // { // AccountStatistics
87+
* // AccountId: "STRING_VALUE",
88+
* // LastGeneratedAt: new Date("TIMESTAMP"),
89+
* // TotalFindings: Number("int"),
90+
* // },
91+
* // ],
92+
* // GroupedByDate: [ // GroupedByDate
93+
* // { // DateStatistics
94+
* // Date: new Date("TIMESTAMP"),
95+
* // LastGeneratedAt: new Date("TIMESTAMP"),
96+
* // Severity: Number("double"),
97+
* // TotalFindings: Number("int"),
98+
* // },
99+
* // ],
100+
* // GroupedByFindingType: [ // GroupedByFindingType
101+
* // { // FindingTypeStatistics
102+
* // FindingType: "STRING_VALUE",
103+
* // LastGeneratedAt: new Date("TIMESTAMP"),
104+
* // TotalFindings: Number("int"),
105+
* // },
106+
* // ],
107+
* // GroupedByResource: [ // GroupedByResource
108+
* // { // ResourceStatistics
109+
* // AccountId: "STRING_VALUE",
110+
* // LastGeneratedAt: new Date("TIMESTAMP"),
111+
* // ResourceId: "STRING_VALUE",
112+
* // ResourceType: "STRING_VALUE",
113+
* // TotalFindings: Number("int"),
114+
* // },
115+
* // ],
116+
* // GroupedBySeverity: [ // GroupedBySeverity
117+
* // { // SeverityStatistics
118+
* // LastGeneratedAt: new Date("TIMESTAMP"),
119+
* // Severity: Number("double"),
120+
* // TotalFindings: Number("int"),
121+
* // },
122+
* // ],
79123
* // },
124+
* // NextToken: "STRING_VALUE",
80125
* // };
81126
*
82127
* ```

clients/client-guardduty/src/commands/GetOrganizationStatisticsCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
66

77
import { commonParams } from "../endpoint/EndpointParameters";
88
import { GuardDutyClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../GuardDutyClient";
9-
import { GetOrganizationStatisticsResponse } from "../models/models_0";
9+
import { GetOrganizationStatisticsResponse } from "../models/models_1";
1010
import { de_GetOrganizationStatisticsCommand, se_GetOrganizationStatisticsCommand } from "../protocols/Aws_restJson1";
1111

1212
/**

clients/client-guardduty/src/commands/GetRemainingFreeTrialDaysCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
66

77
import { commonParams } from "../endpoint/EndpointParameters";
88
import { GuardDutyClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../GuardDutyClient";
9-
import { GetRemainingFreeTrialDaysRequest, GetRemainingFreeTrialDaysResponse } from "../models/models_0";
9+
import { GetRemainingFreeTrialDaysRequest, GetRemainingFreeTrialDaysResponse } from "../models/models_1";
1010
import { de_GetRemainingFreeTrialDaysCommand, se_GetRemainingFreeTrialDaysCommand } from "../protocols/Aws_restJson1";
1111

1212
/**

clients/client-guardduty/src/commands/GetThreatIntelSetCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
66

77
import { commonParams } from "../endpoint/EndpointParameters";
88
import { GuardDutyClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../GuardDutyClient";
9-
import { GetThreatIntelSetRequest, GetThreatIntelSetResponse } from "../models/models_0";
9+
import { GetThreatIntelSetRequest, GetThreatIntelSetResponse } from "../models/models_1";
1010
import { de_GetThreatIntelSetCommand, se_GetThreatIntelSetCommand } from "../protocols/Aws_restJson1";
1111

1212
/**

0 commit comments

Comments
 (0)