Skip to content

Commit

Permalink
feat(client-macie2): This release adds support for retrieving (reveal…
Browse files Browse the repository at this point in the history
…ing) sample occurrences of sensitive data that Amazon Macie detects and reports in findings.
  • Loading branch information
awstools committed Jul 26, 2022
1 parent 34e5ab6 commit 00eeecb
Show file tree
Hide file tree
Showing 14 changed files with 1,809 additions and 22 deletions.
1 change: 1 addition & 0 deletions clients/client-macie2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"@aws-sdk/util-user-agent-node": "*",
"@aws-sdk/util-utf8-browser": "*",
"@aws-sdk/util-utf8-node": "*",
"@aws-sdk/util-waiter": "*",
"tslib": "^2.3.1",
"uuid": "^8.3.2"
},
Expand Down
150 changes: 150 additions & 0 deletions clients/client-macie2/src/Macie2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,21 @@ import {
GetMasterAccountCommandOutput,
} from "./commands/GetMasterAccountCommand";
import { GetMemberCommand, GetMemberCommandInput, GetMemberCommandOutput } from "./commands/GetMemberCommand";
import {
GetRevealConfigurationCommand,
GetRevealConfigurationCommandInput,
GetRevealConfigurationCommandOutput,
} from "./commands/GetRevealConfigurationCommand";
import {
GetSensitiveDataOccurrencesAvailabilityCommand,
GetSensitiveDataOccurrencesAvailabilityCommandInput,
GetSensitiveDataOccurrencesAvailabilityCommandOutput,
} from "./commands/GetSensitiveDataOccurrencesAvailabilityCommand";
import {
GetSensitiveDataOccurrencesCommand,
GetSensitiveDataOccurrencesCommandInput,
GetSensitiveDataOccurrencesCommandOutput,
} from "./commands/GetSensitiveDataOccurrencesCommand";
import {
GetUsageStatisticsCommand,
GetUsageStatisticsCommandInput,
Expand Down Expand Up @@ -266,6 +281,11 @@ import {
UpdateOrganizationConfigurationCommandInput,
UpdateOrganizationConfigurationCommandOutput,
} from "./commands/UpdateOrganizationConfigurationCommand";
import {
UpdateRevealConfigurationCommand,
UpdateRevealConfigurationCommandInput,
UpdateRevealConfigurationCommandOutput,
} from "./commands/UpdateRevealConfigurationCommand";
import { Macie2Client } from "./Macie2Client";

/**
Expand Down Expand Up @@ -1365,6 +1385,104 @@ export class Macie2 extends Macie2Client {
}
}

/**
* <p>Retrieves the status and configuration settings for retrieving (revealing) occurrences of sensitive data reported by findings.</p>
*/
public getRevealConfiguration(
args: GetRevealConfigurationCommandInput,
options?: __HttpHandlerOptions
): Promise<GetRevealConfigurationCommandOutput>;
public getRevealConfiguration(
args: GetRevealConfigurationCommandInput,
cb: (err: any, data?: GetRevealConfigurationCommandOutput) => void
): void;
public getRevealConfiguration(
args: GetRevealConfigurationCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: GetRevealConfigurationCommandOutput) => void
): void;
public getRevealConfiguration(
args: GetRevealConfigurationCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: GetRevealConfigurationCommandOutput) => void),
cb?: (err: any, data?: GetRevealConfigurationCommandOutput) => void
): Promise<GetRevealConfigurationCommandOutput> | void {
const command = new GetRevealConfigurationCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}

/**
* <p>Retrieves (reveals) occurrences of sensitive data reported by a finding.</p>
*/
public getSensitiveDataOccurrences(
args: GetSensitiveDataOccurrencesCommandInput,
options?: __HttpHandlerOptions
): Promise<GetSensitiveDataOccurrencesCommandOutput>;
public getSensitiveDataOccurrences(
args: GetSensitiveDataOccurrencesCommandInput,
cb: (err: any, data?: GetSensitiveDataOccurrencesCommandOutput) => void
): void;
public getSensitiveDataOccurrences(
args: GetSensitiveDataOccurrencesCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: GetSensitiveDataOccurrencesCommandOutput) => void
): void;
public getSensitiveDataOccurrences(
args: GetSensitiveDataOccurrencesCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: GetSensitiveDataOccurrencesCommandOutput) => void),
cb?: (err: any, data?: GetSensitiveDataOccurrencesCommandOutput) => void
): Promise<GetSensitiveDataOccurrencesCommandOutput> | void {
const command = new GetSensitiveDataOccurrencesCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}

/**
* <p>Checks whether occurrences of sensitive data can be retrieved (revealed) for a finding.</p>
*/
public getSensitiveDataOccurrencesAvailability(
args: GetSensitiveDataOccurrencesAvailabilityCommandInput,
options?: __HttpHandlerOptions
): Promise<GetSensitiveDataOccurrencesAvailabilityCommandOutput>;
public getSensitiveDataOccurrencesAvailability(
args: GetSensitiveDataOccurrencesAvailabilityCommandInput,
cb: (err: any, data?: GetSensitiveDataOccurrencesAvailabilityCommandOutput) => void
): void;
public getSensitiveDataOccurrencesAvailability(
args: GetSensitiveDataOccurrencesAvailabilityCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: GetSensitiveDataOccurrencesAvailabilityCommandOutput) => void
): void;
public getSensitiveDataOccurrencesAvailability(
args: GetSensitiveDataOccurrencesAvailabilityCommandInput,
optionsOrCb?:
| __HttpHandlerOptions
| ((err: any, data?: GetSensitiveDataOccurrencesAvailabilityCommandOutput) => void),
cb?: (err: any, data?: GetSensitiveDataOccurrencesAvailabilityCommandOutput) => void
): Promise<GetSensitiveDataOccurrencesAvailabilityCommandOutput> | void {
const command = new GetSensitiveDataOccurrencesAvailabilityCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}

/**
* <p>Retrieves (queries) quotas and aggregated usage data for one or more accounts.</p>
*/
Expand Down Expand Up @@ -2053,4 +2171,36 @@ export class Macie2 extends Macie2Client {
return this.send(command, optionsOrCb);
}
}

/**
* <p>Updates the status and configuration settings for retrieving (revealing) occurrences of sensitive data reported by findings.</p>
*/
public updateRevealConfiguration(
args: UpdateRevealConfigurationCommandInput,
options?: __HttpHandlerOptions
): Promise<UpdateRevealConfigurationCommandOutput>;
public updateRevealConfiguration(
args: UpdateRevealConfigurationCommandInput,
cb: (err: any, data?: UpdateRevealConfigurationCommandOutput) => void
): void;
public updateRevealConfiguration(
args: UpdateRevealConfigurationCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: UpdateRevealConfigurationCommandOutput) => void
): void;
public updateRevealConfiguration(
args: UpdateRevealConfigurationCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: UpdateRevealConfigurationCommandOutput) => void),
cb?: (err: any, data?: UpdateRevealConfigurationCommandOutput) => void
): Promise<UpdateRevealConfigurationCommandOutput> | void {
const command = new UpdateRevealConfigurationCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}
}
28 changes: 26 additions & 2 deletions clients/client-macie2/src/Macie2Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,18 @@ import {
import { GetMacieSessionCommandInput, GetMacieSessionCommandOutput } from "./commands/GetMacieSessionCommand";
import { GetMasterAccountCommandInput, GetMasterAccountCommandOutput } from "./commands/GetMasterAccountCommand";
import { GetMemberCommandInput, GetMemberCommandOutput } from "./commands/GetMemberCommand";
import {
GetRevealConfigurationCommandInput,
GetRevealConfigurationCommandOutput,
} from "./commands/GetRevealConfigurationCommand";
import {
GetSensitiveDataOccurrencesAvailabilityCommandInput,
GetSensitiveDataOccurrencesAvailabilityCommandOutput,
} from "./commands/GetSensitiveDataOccurrencesAvailabilityCommand";
import {
GetSensitiveDataOccurrencesCommandInput,
GetSensitiveDataOccurrencesCommandOutput,
} from "./commands/GetSensitiveDataOccurrencesCommand";
import { GetUsageStatisticsCommandInput, GetUsageStatisticsCommandOutput } from "./commands/GetUsageStatisticsCommand";
import { GetUsageTotalsCommandInput, GetUsageTotalsCommandOutput } from "./commands/GetUsageTotalsCommand";
import {
Expand Down Expand Up @@ -209,6 +221,10 @@ import {
UpdateOrganizationConfigurationCommandInput,
UpdateOrganizationConfigurationCommandOutput,
} from "./commands/UpdateOrganizationConfigurationCommand";
import {
UpdateRevealConfigurationCommandInput,
UpdateRevealConfigurationCommandOutput,
} from "./commands/UpdateRevealConfigurationCommand";
import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";

export type ServiceInputTypes =
Expand Down Expand Up @@ -247,6 +263,9 @@ export type ServiceInputTypes =
| GetMacieSessionCommandInput
| GetMasterAccountCommandInput
| GetMemberCommandInput
| GetRevealConfigurationCommandInput
| GetSensitiveDataOccurrencesAvailabilityCommandInput
| GetSensitiveDataOccurrencesCommandInput
| GetUsageStatisticsCommandInput
| GetUsageTotalsCommandInput
| ListClassificationJobsCommandInput
Expand All @@ -268,7 +287,8 @@ export type ServiceInputTypes =
| UpdateFindingsFilterCommandInput
| UpdateMacieSessionCommandInput
| UpdateMemberSessionCommandInput
| UpdateOrganizationConfigurationCommandInput;
| UpdateOrganizationConfigurationCommandInput
| UpdateRevealConfigurationCommandInput;

export type ServiceOutputTypes =
| AcceptInvitationCommandOutput
Expand Down Expand Up @@ -306,6 +326,9 @@ export type ServiceOutputTypes =
| GetMacieSessionCommandOutput
| GetMasterAccountCommandOutput
| GetMemberCommandOutput
| GetRevealConfigurationCommandOutput
| GetSensitiveDataOccurrencesAvailabilityCommandOutput
| GetSensitiveDataOccurrencesCommandOutput
| GetUsageStatisticsCommandOutput
| GetUsageTotalsCommandOutput
| ListClassificationJobsCommandOutput
Expand All @@ -327,7 +350,8 @@ export type ServiceOutputTypes =
| UpdateFindingsFilterCommandOutput
| UpdateMacieSessionCommandOutput
| UpdateMemberSessionCommandOutput
| UpdateOrganizationConfigurationCommandOutput;
| UpdateOrganizationConfigurationCommandOutput
| UpdateRevealConfigurationCommandOutput;

export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> {
/**
Expand Down
101 changes: 101 additions & 0 deletions clients/client-macie2/src/commands/GetRevealConfigurationCommand.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
// smithy-typescript generated code
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
import { Command as $Command } from "@aws-sdk/smithy-client";
import {
FinalizeHandlerArguments,
Handler,
HandlerExecutionContext,
HttpHandlerOptions as __HttpHandlerOptions,
MetadataBearer as __MetadataBearer,
MiddlewareStack,
SerdeContext as __SerdeContext,
} from "@aws-sdk/types";

import { Macie2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../Macie2Client";
import {
GetRevealConfigurationRequest,
GetRevealConfigurationRequestFilterSensitiveLog,
GetRevealConfigurationResponse,
GetRevealConfigurationResponseFilterSensitiveLog,
} from "../models/models_0";
import {
deserializeAws_restJson1GetRevealConfigurationCommand,
serializeAws_restJson1GetRevealConfigurationCommand,
} from "../protocols/Aws_restJson1";

export interface GetRevealConfigurationCommandInput extends GetRevealConfigurationRequest {}
export interface GetRevealConfigurationCommandOutput extends GetRevealConfigurationResponse, __MetadataBearer {}

/**
* <p>Retrieves the status and configuration settings for retrieving (revealing) occurrences of sensitive data reported by findings.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { Macie2Client, GetRevealConfigurationCommand } from "@aws-sdk/client-macie2"; // ES Modules import
* // const { Macie2Client, GetRevealConfigurationCommand } = require("@aws-sdk/client-macie2"); // CommonJS import
* const client = new Macie2Client(config);
* const command = new GetRevealConfigurationCommand(input);
* const response = await client.send(command);
* ```
*
* @see {@link GetRevealConfigurationCommandInput} for command's `input` shape.
* @see {@link GetRevealConfigurationCommandOutput} for command's `response` shape.
* @see {@link Macie2ClientResolvedConfig | config} for Macie2Client's `config` shape.
*
*/
export class GetRevealConfigurationCommand extends $Command<
GetRevealConfigurationCommandInput,
GetRevealConfigurationCommandOutput,
Macie2ClientResolvedConfig
> {
// Start section: command_properties
// End section: command_properties

constructor(readonly input: GetRevealConfigurationCommandInput) {
// Start section: command_constructor
super();
// End section: command_constructor
}

/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: Macie2ClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<GetRevealConfigurationCommandInput, GetRevealConfigurationCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));

const stack = clientStack.concat(this.middlewareStack);

const { logger } = configuration;
const clientName = "Macie2Client";
const commandName = "GetRevealConfigurationCommand";
const handlerExecutionContext: HandlerExecutionContext = {
logger,
clientName,
commandName,
inputFilterSensitiveLog: GetRevealConfigurationRequestFilterSensitiveLog,
outputFilterSensitiveLog: GetRevealConfigurationResponseFilterSensitiveLog,
};
const { requestHandler } = configuration;
return stack.resolve(
(request: FinalizeHandlerArguments<any>) =>
requestHandler.handle(request.request as __HttpRequest, options || {}),
handlerExecutionContext
);
}

private serialize(input: GetRevealConfigurationCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
return serializeAws_restJson1GetRevealConfigurationCommand(input, context);
}

private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<GetRevealConfigurationCommandOutput> {
return deserializeAws_restJson1GetRevealConfigurationCommand(output, context);
}

// Start section: command_body_extra
// End section: command_body_extra
}
Loading

0 comments on commit 00eeecb

Please sign in to comment.