Skip to content

Commit 00eeecb

Browse files
author
awstools
committed
feat(client-macie2): This release adds support for retrieving (revealing) sample occurrences of sensitive data that Amazon Macie detects and reports in findings.
1 parent 34e5ab6 commit 00eeecb

14 files changed

+1809
-22
lines changed

clients/client-macie2/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"@aws-sdk/util-user-agent-node": "*",
5050
"@aws-sdk/util-utf8-browser": "*",
5151
"@aws-sdk/util-utf8-node": "*",
52+
"@aws-sdk/util-waiter": "*",
5253
"tslib": "^2.3.1",
5354
"uuid": "^8.3.2"
5455
},

clients/client-macie2/src/Macie2.ts

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,21 @@ import {
164164
GetMasterAccountCommandOutput,
165165
} from "./commands/GetMasterAccountCommand";
166166
import { GetMemberCommand, GetMemberCommandInput, GetMemberCommandOutput } from "./commands/GetMemberCommand";
167+
import {
168+
GetRevealConfigurationCommand,
169+
GetRevealConfigurationCommandInput,
170+
GetRevealConfigurationCommandOutput,
171+
} from "./commands/GetRevealConfigurationCommand";
172+
import {
173+
GetSensitiveDataOccurrencesAvailabilityCommand,
174+
GetSensitiveDataOccurrencesAvailabilityCommandInput,
175+
GetSensitiveDataOccurrencesAvailabilityCommandOutput,
176+
} from "./commands/GetSensitiveDataOccurrencesAvailabilityCommand";
177+
import {
178+
GetSensitiveDataOccurrencesCommand,
179+
GetSensitiveDataOccurrencesCommandInput,
180+
GetSensitiveDataOccurrencesCommandOutput,
181+
} from "./commands/GetSensitiveDataOccurrencesCommand";
167182
import {
168183
GetUsageStatisticsCommand,
169184
GetUsageStatisticsCommandInput,
@@ -266,6 +281,11 @@ import {
266281
UpdateOrganizationConfigurationCommandInput,
267282
UpdateOrganizationConfigurationCommandOutput,
268283
} from "./commands/UpdateOrganizationConfigurationCommand";
284+
import {
285+
UpdateRevealConfigurationCommand,
286+
UpdateRevealConfigurationCommandInput,
287+
UpdateRevealConfigurationCommandOutput,
288+
} from "./commands/UpdateRevealConfigurationCommand";
269289
import { Macie2Client } from "./Macie2Client";
270290

271291
/**
@@ -1365,6 +1385,104 @@ export class Macie2 extends Macie2Client {
13651385
}
13661386
}
13671387

1388+
/**
1389+
* <p>Retrieves the status and configuration settings for retrieving (revealing) occurrences of sensitive data reported by findings.</p>
1390+
*/
1391+
public getRevealConfiguration(
1392+
args: GetRevealConfigurationCommandInput,
1393+
options?: __HttpHandlerOptions
1394+
): Promise<GetRevealConfigurationCommandOutput>;
1395+
public getRevealConfiguration(
1396+
args: GetRevealConfigurationCommandInput,
1397+
cb: (err: any, data?: GetRevealConfigurationCommandOutput) => void
1398+
): void;
1399+
public getRevealConfiguration(
1400+
args: GetRevealConfigurationCommandInput,
1401+
options: __HttpHandlerOptions,
1402+
cb: (err: any, data?: GetRevealConfigurationCommandOutput) => void
1403+
): void;
1404+
public getRevealConfiguration(
1405+
args: GetRevealConfigurationCommandInput,
1406+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: GetRevealConfigurationCommandOutput) => void),
1407+
cb?: (err: any, data?: GetRevealConfigurationCommandOutput) => void
1408+
): Promise<GetRevealConfigurationCommandOutput> | void {
1409+
const command = new GetRevealConfigurationCommand(args);
1410+
if (typeof optionsOrCb === "function") {
1411+
this.send(command, optionsOrCb);
1412+
} else if (typeof cb === "function") {
1413+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
1414+
this.send(command, optionsOrCb || {}, cb);
1415+
} else {
1416+
return this.send(command, optionsOrCb);
1417+
}
1418+
}
1419+
1420+
/**
1421+
* <p>Retrieves (reveals) occurrences of sensitive data reported by a finding.</p>
1422+
*/
1423+
public getSensitiveDataOccurrences(
1424+
args: GetSensitiveDataOccurrencesCommandInput,
1425+
options?: __HttpHandlerOptions
1426+
): Promise<GetSensitiveDataOccurrencesCommandOutput>;
1427+
public getSensitiveDataOccurrences(
1428+
args: GetSensitiveDataOccurrencesCommandInput,
1429+
cb: (err: any, data?: GetSensitiveDataOccurrencesCommandOutput) => void
1430+
): void;
1431+
public getSensitiveDataOccurrences(
1432+
args: GetSensitiveDataOccurrencesCommandInput,
1433+
options: __HttpHandlerOptions,
1434+
cb: (err: any, data?: GetSensitiveDataOccurrencesCommandOutput) => void
1435+
): void;
1436+
public getSensitiveDataOccurrences(
1437+
args: GetSensitiveDataOccurrencesCommandInput,
1438+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: GetSensitiveDataOccurrencesCommandOutput) => void),
1439+
cb?: (err: any, data?: GetSensitiveDataOccurrencesCommandOutput) => void
1440+
): Promise<GetSensitiveDataOccurrencesCommandOutput> | void {
1441+
const command = new GetSensitiveDataOccurrencesCommand(args);
1442+
if (typeof optionsOrCb === "function") {
1443+
this.send(command, optionsOrCb);
1444+
} else if (typeof cb === "function") {
1445+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
1446+
this.send(command, optionsOrCb || {}, cb);
1447+
} else {
1448+
return this.send(command, optionsOrCb);
1449+
}
1450+
}
1451+
1452+
/**
1453+
* <p>Checks whether occurrences of sensitive data can be retrieved (revealed) for a finding.</p>
1454+
*/
1455+
public getSensitiveDataOccurrencesAvailability(
1456+
args: GetSensitiveDataOccurrencesAvailabilityCommandInput,
1457+
options?: __HttpHandlerOptions
1458+
): Promise<GetSensitiveDataOccurrencesAvailabilityCommandOutput>;
1459+
public getSensitiveDataOccurrencesAvailability(
1460+
args: GetSensitiveDataOccurrencesAvailabilityCommandInput,
1461+
cb: (err: any, data?: GetSensitiveDataOccurrencesAvailabilityCommandOutput) => void
1462+
): void;
1463+
public getSensitiveDataOccurrencesAvailability(
1464+
args: GetSensitiveDataOccurrencesAvailabilityCommandInput,
1465+
options: __HttpHandlerOptions,
1466+
cb: (err: any, data?: GetSensitiveDataOccurrencesAvailabilityCommandOutput) => void
1467+
): void;
1468+
public getSensitiveDataOccurrencesAvailability(
1469+
args: GetSensitiveDataOccurrencesAvailabilityCommandInput,
1470+
optionsOrCb?:
1471+
| __HttpHandlerOptions
1472+
| ((err: any, data?: GetSensitiveDataOccurrencesAvailabilityCommandOutput) => void),
1473+
cb?: (err: any, data?: GetSensitiveDataOccurrencesAvailabilityCommandOutput) => void
1474+
): Promise<GetSensitiveDataOccurrencesAvailabilityCommandOutput> | void {
1475+
const command = new GetSensitiveDataOccurrencesAvailabilityCommand(args);
1476+
if (typeof optionsOrCb === "function") {
1477+
this.send(command, optionsOrCb);
1478+
} else if (typeof cb === "function") {
1479+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
1480+
this.send(command, optionsOrCb || {}, cb);
1481+
} else {
1482+
return this.send(command, optionsOrCb);
1483+
}
1484+
}
1485+
13681486
/**
13691487
* <p>Retrieves (queries) quotas and aggregated usage data for one or more accounts.</p>
13701488
*/
@@ -2053,4 +2171,36 @@ export class Macie2 extends Macie2Client {
20532171
return this.send(command, optionsOrCb);
20542172
}
20552173
}
2174+
2175+
/**
2176+
* <p>Updates the status and configuration settings for retrieving (revealing) occurrences of sensitive data reported by findings.</p>
2177+
*/
2178+
public updateRevealConfiguration(
2179+
args: UpdateRevealConfigurationCommandInput,
2180+
options?: __HttpHandlerOptions
2181+
): Promise<UpdateRevealConfigurationCommandOutput>;
2182+
public updateRevealConfiguration(
2183+
args: UpdateRevealConfigurationCommandInput,
2184+
cb: (err: any, data?: UpdateRevealConfigurationCommandOutput) => void
2185+
): void;
2186+
public updateRevealConfiguration(
2187+
args: UpdateRevealConfigurationCommandInput,
2188+
options: __HttpHandlerOptions,
2189+
cb: (err: any, data?: UpdateRevealConfigurationCommandOutput) => void
2190+
): void;
2191+
public updateRevealConfiguration(
2192+
args: UpdateRevealConfigurationCommandInput,
2193+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: UpdateRevealConfigurationCommandOutput) => void),
2194+
cb?: (err: any, data?: UpdateRevealConfigurationCommandOutput) => void
2195+
): Promise<UpdateRevealConfigurationCommandOutput> | void {
2196+
const command = new UpdateRevealConfigurationCommand(args);
2197+
if (typeof optionsOrCb === "function") {
2198+
this.send(command, optionsOrCb);
2199+
} else if (typeof cb === "function") {
2200+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
2201+
this.send(command, optionsOrCb || {}, cb);
2202+
} else {
2203+
return this.send(command, optionsOrCb);
2204+
}
2205+
}
20562206
}

clients/client-macie2/src/Macie2Client.ts

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,18 @@ import {
148148
import { GetMacieSessionCommandInput, GetMacieSessionCommandOutput } from "./commands/GetMacieSessionCommand";
149149
import { GetMasterAccountCommandInput, GetMasterAccountCommandOutput } from "./commands/GetMasterAccountCommand";
150150
import { GetMemberCommandInput, GetMemberCommandOutput } from "./commands/GetMemberCommand";
151+
import {
152+
GetRevealConfigurationCommandInput,
153+
GetRevealConfigurationCommandOutput,
154+
} from "./commands/GetRevealConfigurationCommand";
155+
import {
156+
GetSensitiveDataOccurrencesAvailabilityCommandInput,
157+
GetSensitiveDataOccurrencesAvailabilityCommandOutput,
158+
} from "./commands/GetSensitiveDataOccurrencesAvailabilityCommand";
159+
import {
160+
GetSensitiveDataOccurrencesCommandInput,
161+
GetSensitiveDataOccurrencesCommandOutput,
162+
} from "./commands/GetSensitiveDataOccurrencesCommand";
151163
import { GetUsageStatisticsCommandInput, GetUsageStatisticsCommandOutput } from "./commands/GetUsageStatisticsCommand";
152164
import { GetUsageTotalsCommandInput, GetUsageTotalsCommandOutput } from "./commands/GetUsageTotalsCommand";
153165
import {
@@ -209,6 +221,10 @@ import {
209221
UpdateOrganizationConfigurationCommandInput,
210222
UpdateOrganizationConfigurationCommandOutput,
211223
} from "./commands/UpdateOrganizationConfigurationCommand";
224+
import {
225+
UpdateRevealConfigurationCommandInput,
226+
UpdateRevealConfigurationCommandOutput,
227+
} from "./commands/UpdateRevealConfigurationCommand";
212228
import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
213229

214230
export type ServiceInputTypes =
@@ -247,6 +263,9 @@ export type ServiceInputTypes =
247263
| GetMacieSessionCommandInput
248264
| GetMasterAccountCommandInput
249265
| GetMemberCommandInput
266+
| GetRevealConfigurationCommandInput
267+
| GetSensitiveDataOccurrencesAvailabilityCommandInput
268+
| GetSensitiveDataOccurrencesCommandInput
250269
| GetUsageStatisticsCommandInput
251270
| GetUsageTotalsCommandInput
252271
| ListClassificationJobsCommandInput
@@ -268,7 +287,8 @@ export type ServiceInputTypes =
268287
| UpdateFindingsFilterCommandInput
269288
| UpdateMacieSessionCommandInput
270289
| UpdateMemberSessionCommandInput
271-
| UpdateOrganizationConfigurationCommandInput;
290+
| UpdateOrganizationConfigurationCommandInput
291+
| UpdateRevealConfigurationCommandInput;
272292

273293
export type ServiceOutputTypes =
274294
| AcceptInvitationCommandOutput
@@ -306,6 +326,9 @@ export type ServiceOutputTypes =
306326
| GetMacieSessionCommandOutput
307327
| GetMasterAccountCommandOutput
308328
| GetMemberCommandOutput
329+
| GetRevealConfigurationCommandOutput
330+
| GetSensitiveDataOccurrencesAvailabilityCommandOutput
331+
| GetSensitiveDataOccurrencesCommandOutput
309332
| GetUsageStatisticsCommandOutput
310333
| GetUsageTotalsCommandOutput
311334
| ListClassificationJobsCommandOutput
@@ -327,7 +350,8 @@ export type ServiceOutputTypes =
327350
| UpdateFindingsFilterCommandOutput
328351
| UpdateMacieSessionCommandOutput
329352
| UpdateMemberSessionCommandOutput
330-
| UpdateOrganizationConfigurationCommandOutput;
353+
| UpdateOrganizationConfigurationCommandOutput
354+
| UpdateRevealConfigurationCommandOutput;
331355

332356
export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> {
333357
/**
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
// smithy-typescript generated code
2+
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3+
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
4+
import { Command as $Command } from "@aws-sdk/smithy-client";
5+
import {
6+
FinalizeHandlerArguments,
7+
Handler,
8+
HandlerExecutionContext,
9+
HttpHandlerOptions as __HttpHandlerOptions,
10+
MetadataBearer as __MetadataBearer,
11+
MiddlewareStack,
12+
SerdeContext as __SerdeContext,
13+
} from "@aws-sdk/types";
14+
15+
import { Macie2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../Macie2Client";
16+
import {
17+
GetRevealConfigurationRequest,
18+
GetRevealConfigurationRequestFilterSensitiveLog,
19+
GetRevealConfigurationResponse,
20+
GetRevealConfigurationResponseFilterSensitiveLog,
21+
} from "../models/models_0";
22+
import {
23+
deserializeAws_restJson1GetRevealConfigurationCommand,
24+
serializeAws_restJson1GetRevealConfigurationCommand,
25+
} from "../protocols/Aws_restJson1";
26+
27+
export interface GetRevealConfigurationCommandInput extends GetRevealConfigurationRequest {}
28+
export interface GetRevealConfigurationCommandOutput extends GetRevealConfigurationResponse, __MetadataBearer {}
29+
30+
/**
31+
* <p>Retrieves the status and configuration settings for retrieving (revealing) occurrences of sensitive data reported by findings.</p>
32+
* @example
33+
* Use a bare-bones client and the command you need to make an API call.
34+
* ```javascript
35+
* import { Macie2Client, GetRevealConfigurationCommand } from "@aws-sdk/client-macie2"; // ES Modules import
36+
* // const { Macie2Client, GetRevealConfigurationCommand } = require("@aws-sdk/client-macie2"); // CommonJS import
37+
* const client = new Macie2Client(config);
38+
* const command = new GetRevealConfigurationCommand(input);
39+
* const response = await client.send(command);
40+
* ```
41+
*
42+
* @see {@link GetRevealConfigurationCommandInput} for command's `input` shape.
43+
* @see {@link GetRevealConfigurationCommandOutput} for command's `response` shape.
44+
* @see {@link Macie2ClientResolvedConfig | config} for Macie2Client's `config` shape.
45+
*
46+
*/
47+
export class GetRevealConfigurationCommand extends $Command<
48+
GetRevealConfigurationCommandInput,
49+
GetRevealConfigurationCommandOutput,
50+
Macie2ClientResolvedConfig
51+
> {
52+
// Start section: command_properties
53+
// End section: command_properties
54+
55+
constructor(readonly input: GetRevealConfigurationCommandInput) {
56+
// Start section: command_constructor
57+
super();
58+
// End section: command_constructor
59+
}
60+
61+
/**
62+
* @internal
63+
*/
64+
resolveMiddleware(
65+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
66+
configuration: Macie2ClientResolvedConfig,
67+
options?: __HttpHandlerOptions
68+
): Handler<GetRevealConfigurationCommandInput, GetRevealConfigurationCommandOutput> {
69+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
70+
71+
const stack = clientStack.concat(this.middlewareStack);
72+
73+
const { logger } = configuration;
74+
const clientName = "Macie2Client";
75+
const commandName = "GetRevealConfigurationCommand";
76+
const handlerExecutionContext: HandlerExecutionContext = {
77+
logger,
78+
clientName,
79+
commandName,
80+
inputFilterSensitiveLog: GetRevealConfigurationRequestFilterSensitiveLog,
81+
outputFilterSensitiveLog: GetRevealConfigurationResponseFilterSensitiveLog,
82+
};
83+
const { requestHandler } = configuration;
84+
return stack.resolve(
85+
(request: FinalizeHandlerArguments<any>) =>
86+
requestHandler.handle(request.request as __HttpRequest, options || {}),
87+
handlerExecutionContext
88+
);
89+
}
90+
91+
private serialize(input: GetRevealConfigurationCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
92+
return serializeAws_restJson1GetRevealConfigurationCommand(input, context);
93+
}
94+
95+
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<GetRevealConfigurationCommandOutput> {
96+
return deserializeAws_restJson1GetRevealConfigurationCommand(output, context);
97+
}
98+
99+
// Start section: command_body_extra
100+
// End section: command_body_extra
101+
}

0 commit comments

Comments
 (0)