From 3c7432b9c89e34db96247cf5227a9ec1686944ea Mon Sep 17 00:00:00 2001 From: awstools Date: Thu, 2 May 2024 18:33:36 +0000 Subject: [PATCH] feat(client-personalize): This releases ability to delete users and their data, including their metadata and interactions data, from a dataset group. --- clients/client-personalize/README.md | 24 ++ clients/client-personalize/src/Personalize.ts | 70 ++++ .../src/PersonalizeClient.ts | 18 + .../commands/CreateDataDeletionJobCommand.ts | 160 ++++++++ .../DescribeDataDeletionJobCommand.ts | 100 +++++ .../commands/ListDataDeletionJobsCommand.ts | 106 ++++++ .../client-personalize/src/commands/index.ts | 3 + .../client-personalize/src/models/models_0.ts | 303 ++++++++++++++- .../src/protocols/Aws_json1_1.ts | 190 ++++++++++ .../sdk-codegen/aws-models/personalize.json | 348 +++++++++++++++++- 10 files changed, 1303 insertions(+), 19 deletions(-) create mode 100644 clients/client-personalize/src/commands/CreateDataDeletionJobCommand.ts create mode 100644 clients/client-personalize/src/commands/DescribeDataDeletionJobCommand.ts create mode 100644 clients/client-personalize/src/commands/ListDataDeletionJobsCommand.ts diff --git a/clients/client-personalize/README.md b/clients/client-personalize/README.md index c3e734565832..3da815443b3f 100644 --- a/clients/client-personalize/README.md +++ b/clients/client-personalize/README.md @@ -227,6 +227,14 @@ CreateCampaign [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/personalize/command/CreateCampaignCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-personalize/Interface/CreateCampaignCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-personalize/Interface/CreateCampaignCommandOutput/) + +
+ +CreateDataDeletionJob + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/personalize/command/CreateDataDeletionJobCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-personalize/Interface/CreateDataDeletionJobCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-personalize/Interface/CreateDataDeletionJobCommandOutput/) +
@@ -419,6 +427,14 @@ DescribeCampaign [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/personalize/command/DescribeCampaignCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-personalize/Interface/DescribeCampaignCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-personalize/Interface/DescribeCampaignCommandOutput/) +
+
+ +DescribeDataDeletionJob + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/personalize/command/DescribeDataDeletionJobCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-personalize/Interface/DescribeDataDeletionJobCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-personalize/Interface/DescribeDataDeletionJobCommandOutput/) +
@@ -555,6 +571,14 @@ ListCampaigns [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/personalize/command/ListCampaignsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-personalize/Interface/ListCampaignsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-personalize/Interface/ListCampaignsCommandOutput/) +
+
+ +ListDataDeletionJobs + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/personalize/command/ListDataDeletionJobsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-personalize/Interface/ListDataDeletionJobsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-personalize/Interface/ListDataDeletionJobsCommandOutput/) +
diff --git a/clients/client-personalize/src/Personalize.ts b/clients/client-personalize/src/Personalize.ts index 151dcdfe86c8..cba94a8a3799 100644 --- a/clients/client-personalize/src/Personalize.ts +++ b/clients/client-personalize/src/Personalize.ts @@ -17,6 +17,11 @@ import { CreateCampaignCommandInput, CreateCampaignCommandOutput, } from "./commands/CreateCampaignCommand"; +import { + CreateDataDeletionJobCommand, + CreateDataDeletionJobCommandInput, + CreateDataDeletionJobCommandOutput, +} from "./commands/CreateDataDeletionJobCommand"; import { CreateDatasetCommand, CreateDatasetCommandInput, @@ -137,6 +142,11 @@ import { DescribeCampaignCommandInput, DescribeCampaignCommandOutput, } from "./commands/DescribeCampaignCommand"; +import { + DescribeDataDeletionJobCommand, + DescribeDataDeletionJobCommandInput, + DescribeDataDeletionJobCommandOutput, +} from "./commands/DescribeDataDeletionJobCommand"; import { DescribeDatasetCommand, DescribeDatasetCommandInput, @@ -222,6 +232,11 @@ import { ListCampaignsCommandInput, ListCampaignsCommandOutput, } from "./commands/ListCampaignsCommand"; +import { + ListDataDeletionJobsCommand, + ListDataDeletionJobsCommandInput, + ListDataDeletionJobsCommandOutput, +} from "./commands/ListDataDeletionJobsCommand"; import { ListDatasetExportJobsCommand, ListDatasetExportJobsCommandInput, @@ -327,6 +342,7 @@ const commands = { CreateBatchInferenceJobCommand, CreateBatchSegmentJobCommand, CreateCampaignCommand, + CreateDataDeletionJobCommand, CreateDatasetCommand, CreateDatasetExportJobCommand, CreateDatasetGroupCommand, @@ -351,6 +367,7 @@ const commands = { DescribeBatchInferenceJobCommand, DescribeBatchSegmentJobCommand, DescribeCampaignCommand, + DescribeDataDeletionJobCommand, DescribeDatasetCommand, DescribeDatasetExportJobCommand, DescribeDatasetGroupCommand, @@ -368,6 +385,7 @@ const commands = { ListBatchInferenceJobsCommand, ListBatchSegmentJobsCommand, ListCampaignsCommand, + ListDataDeletionJobsCommand, ListDatasetExportJobsCommand, ListDatasetGroupsCommand, ListDatasetImportJobsCommand, @@ -442,6 +460,23 @@ export interface Personalize { cb: (err: any, data?: CreateCampaignCommandOutput) => void ): void; + /** + * @see {@link CreateDataDeletionJobCommand} + */ + createDataDeletionJob( + args: CreateDataDeletionJobCommandInput, + options?: __HttpHandlerOptions + ): Promise; + createDataDeletionJob( + args: CreateDataDeletionJobCommandInput, + cb: (err: any, data?: CreateDataDeletionJobCommandOutput) => void + ): void; + createDataDeletionJob( + args: CreateDataDeletionJobCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: CreateDataDeletionJobCommandOutput) => void + ): void; + /** * @see {@link CreateDatasetCommand} */ @@ -805,6 +840,23 @@ export interface Personalize { cb: (err: any, data?: DescribeCampaignCommandOutput) => void ): void; + /** + * @see {@link DescribeDataDeletionJobCommand} + */ + describeDataDeletionJob( + args: DescribeDataDeletionJobCommandInput, + options?: __HttpHandlerOptions + ): Promise; + describeDataDeletionJob( + args: DescribeDataDeletionJobCommandInput, + cb: (err: any, data?: DescribeDataDeletionJobCommandOutput) => void + ): void; + describeDataDeletionJob( + args: DescribeDataDeletionJobCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DescribeDataDeletionJobCommandOutput) => void + ): void; + /** * @see {@link DescribeDatasetCommand} */ @@ -1079,6 +1131,24 @@ export interface Personalize { cb: (err: any, data?: ListCampaignsCommandOutput) => void ): void; + /** + * @see {@link ListDataDeletionJobsCommand} + */ + listDataDeletionJobs(): Promise; + listDataDeletionJobs( + args: ListDataDeletionJobsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + listDataDeletionJobs( + args: ListDataDeletionJobsCommandInput, + cb: (err: any, data?: ListDataDeletionJobsCommandOutput) => void + ): void; + listDataDeletionJobs( + args: ListDataDeletionJobsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListDataDeletionJobsCommandOutput) => void + ): void; + /** * @see {@link ListDatasetExportJobsCommand} */ diff --git a/clients/client-personalize/src/PersonalizeClient.ts b/clients/client-personalize/src/PersonalizeClient.ts index 6a05468f4597..114aa5d7235c 100644 --- a/clients/client-personalize/src/PersonalizeClient.ts +++ b/clients/client-personalize/src/PersonalizeClient.ts @@ -62,6 +62,10 @@ import { CreateBatchSegmentJobCommandOutput, } from "./commands/CreateBatchSegmentJobCommand"; import { CreateCampaignCommandInput, CreateCampaignCommandOutput } from "./commands/CreateCampaignCommand"; +import { + CreateDataDeletionJobCommandInput, + CreateDataDeletionJobCommandOutput, +} from "./commands/CreateDataDeletionJobCommand"; import { CreateDatasetCommandInput, CreateDatasetCommandOutput } from "./commands/CreateDatasetCommand"; import { CreateDatasetExportJobCommandInput, @@ -107,6 +111,10 @@ import { DescribeBatchSegmentJobCommandOutput, } from "./commands/DescribeBatchSegmentJobCommand"; import { DescribeCampaignCommandInput, DescribeCampaignCommandOutput } from "./commands/DescribeCampaignCommand"; +import { + DescribeDataDeletionJobCommandInput, + DescribeDataDeletionJobCommandOutput, +} from "./commands/DescribeDataDeletionJobCommand"; import { DescribeDatasetCommandInput, DescribeDatasetCommandOutput } from "./commands/DescribeDatasetCommand"; import { DescribeDatasetExportJobCommandInput, @@ -154,6 +162,10 @@ import { ListBatchSegmentJobsCommandOutput, } from "./commands/ListBatchSegmentJobsCommand"; import { ListCampaignsCommandInput, ListCampaignsCommandOutput } from "./commands/ListCampaignsCommand"; +import { + ListDataDeletionJobsCommandInput, + ListDataDeletionJobsCommandOutput, +} from "./commands/ListDataDeletionJobsCommand"; import { ListDatasetExportJobsCommandInput, ListDatasetExportJobsCommandOutput, @@ -219,6 +231,7 @@ export type ServiceInputTypes = | CreateBatchInferenceJobCommandInput | CreateBatchSegmentJobCommandInput | CreateCampaignCommandInput + | CreateDataDeletionJobCommandInput | CreateDatasetCommandInput | CreateDatasetExportJobCommandInput | CreateDatasetGroupCommandInput @@ -243,6 +256,7 @@ export type ServiceInputTypes = | DescribeBatchInferenceJobCommandInput | DescribeBatchSegmentJobCommandInput | DescribeCampaignCommandInput + | DescribeDataDeletionJobCommandInput | DescribeDatasetCommandInput | DescribeDatasetExportJobCommandInput | DescribeDatasetGroupCommandInput @@ -260,6 +274,7 @@ export type ServiceInputTypes = | ListBatchInferenceJobsCommandInput | ListBatchSegmentJobsCommandInput | ListCampaignsCommandInput + | ListDataDeletionJobsCommandInput | ListDatasetExportJobsCommandInput | ListDatasetGroupsCommandInput | ListDatasetImportJobsCommandInput @@ -291,6 +306,7 @@ export type ServiceOutputTypes = | CreateBatchInferenceJobCommandOutput | CreateBatchSegmentJobCommandOutput | CreateCampaignCommandOutput + | CreateDataDeletionJobCommandOutput | CreateDatasetCommandOutput | CreateDatasetExportJobCommandOutput | CreateDatasetGroupCommandOutput @@ -315,6 +331,7 @@ export type ServiceOutputTypes = | DescribeBatchInferenceJobCommandOutput | DescribeBatchSegmentJobCommandOutput | DescribeCampaignCommandOutput + | DescribeDataDeletionJobCommandOutput | DescribeDatasetCommandOutput | DescribeDatasetExportJobCommandOutput | DescribeDatasetGroupCommandOutput @@ -332,6 +349,7 @@ export type ServiceOutputTypes = | ListBatchInferenceJobsCommandOutput | ListBatchSegmentJobsCommandOutput | ListCampaignsCommandOutput + | ListDataDeletionJobsCommandOutput | ListDatasetExportJobsCommandOutput | ListDatasetGroupsCommandOutput | ListDatasetImportJobsCommandOutput diff --git a/clients/client-personalize/src/commands/CreateDataDeletionJobCommand.ts b/clients/client-personalize/src/commands/CreateDataDeletionJobCommand.ts new file mode 100644 index 000000000000..101c845d6029 --- /dev/null +++ b/clients/client-personalize/src/commands/CreateDataDeletionJobCommand.ts @@ -0,0 +1,160 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { CreateDataDeletionJobRequest, CreateDataDeletionJobResponse } from "../models/models_0"; +import { PersonalizeClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../PersonalizeClient"; +import { de_CreateDataDeletionJobCommand, se_CreateDataDeletionJobCommand } from "../protocols/Aws_json1_1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link CreateDataDeletionJobCommand}. + */ +export interface CreateDataDeletionJobCommandInput extends CreateDataDeletionJobRequest {} +/** + * @public + * + * The output of {@link CreateDataDeletionJobCommand}. + */ +export interface CreateDataDeletionJobCommandOutput extends CreateDataDeletionJobResponse, __MetadataBearer {} + +/** + *

Creates a batch job that deletes all + * references to specific users from an Amazon Personalize dataset group in batches. You specify the users to delete in a CSV file of userIds in + * an Amazon S3 bucket. After a job completes, Amazon Personalize no longer trains + * on the users’ data and no longer considers the users when generating user segments. + * For more information about creating a data deletion job, see Deleting users.

+ *
    + *
  • + *

    Your input file must be a CSV file with a single USER_ID column that lists the users IDs. For more information + * about preparing the CSV file, see Preparing your data deletion file and uploading it to Amazon S3.

    + *
  • + *
  • + *

    To give Amazon Personalize permission to access your input CSV file of userIds, you must specify an IAM service role that has permission to + * read from the data source. This role + * needs GetObject and ListBucket permissions for the bucket and its content. + * These permissions are the same as importing data. For information on granting access to your Amazon S3 + * bucket, see Giving + * Amazon Personalize Access to Amazon S3 Resources.

    + *
  • + *
+ *

+ * After you create a job, it can take up to a day to delete all references to the users from datasets and models. Until the job completes, + * Amazon Personalize continues to use the data when training. And if you use a User Segmentation recipe, the users might appear in user segments. + *

+ *

+ * Status + *

+ *

A data deletion job can have one of the following statuses:

+ *
    + *
  • + *

    PENDING > IN_PROGRESS > COMPLETED -or- FAILED

    + *
  • + *
+ *

To get the status of the data deletion job, call DescribeDataDeletionJob API operation and specify the Amazon Resource Name + * (ARN) of the job. If the status is FAILED, the response + * includes a failureReason key, which describes why the job + * failed.

+ *

+ * Related APIs + *

+ * + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { PersonalizeClient, CreateDataDeletionJobCommand } from "@aws-sdk/client-personalize"; // ES Modules import + * // const { PersonalizeClient, CreateDataDeletionJobCommand } = require("@aws-sdk/client-personalize"); // CommonJS import + * const client = new PersonalizeClient(config); + * const input = { // CreateDataDeletionJobRequest + * jobName: "STRING_VALUE", // required + * datasetGroupArn: "STRING_VALUE", // required + * dataSource: { // DataSource + * dataLocation: "STRING_VALUE", + * }, + * roleArn: "STRING_VALUE", // required + * tags: [ // Tags + * { // Tag + * tagKey: "STRING_VALUE", // required + * tagValue: "STRING_VALUE", // required + * }, + * ], + * }; + * const command = new CreateDataDeletionJobCommand(input); + * const response = await client.send(command); + * // { // CreateDataDeletionJobResponse + * // dataDeletionJobArn: "STRING_VALUE", + * // }; + * + * ``` + * + * @param CreateDataDeletionJobCommandInput - {@link CreateDataDeletionJobCommandInput} + * @returns {@link CreateDataDeletionJobCommandOutput} + * @see {@link CreateDataDeletionJobCommandInput} for command's `input` shape. + * @see {@link CreateDataDeletionJobCommandOutput} for command's `response` shape. + * @see {@link PersonalizeClientResolvedConfig | config} for PersonalizeClient's `config` shape. + * + * @throws {@link InvalidInputException} (client fault) + *

Provide a valid value for the field or parameter.

+ * + * @throws {@link LimitExceededException} (client fault) + *

The limit on the number of requests per second has been exceeded.

+ * + * @throws {@link ResourceAlreadyExistsException} (client fault) + *

The specified resource already exists.

+ * + * @throws {@link ResourceInUseException} (client fault) + *

The specified resource is in use.

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

Could not find the specified resource.

+ * + * @throws {@link TooManyTagsException} (client fault) + *

You have exceeded the maximum number of tags you can apply to this resource.

+ * + * @throws {@link PersonalizeServiceException} + *

Base exception class for all service exceptions from Personalize service.

+ * + * @public + */ +export class CreateDataDeletionJobCommand extends $Command + .classBuilder< + CreateDataDeletionJobCommandInput, + CreateDataDeletionJobCommandOutput, + PersonalizeClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep({ + ...commonParams, + }) + .m(function (this: any, Command: any, cs: any, config: PersonalizeClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonPersonalize", "CreateDataDeletionJob", {}) + .n("PersonalizeClient", "CreateDataDeletionJobCommand") + .f(void 0, void 0) + .ser(se_CreateDataDeletionJobCommand) + .de(de_CreateDataDeletionJobCommand) + .build() {} diff --git a/clients/client-personalize/src/commands/DescribeDataDeletionJobCommand.ts b/clients/client-personalize/src/commands/DescribeDataDeletionJobCommand.ts new file mode 100644 index 000000000000..364798ef9293 --- /dev/null +++ b/clients/client-personalize/src/commands/DescribeDataDeletionJobCommand.ts @@ -0,0 +1,100 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { DescribeDataDeletionJobRequest, DescribeDataDeletionJobResponse } from "../models/models_0"; +import { PersonalizeClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../PersonalizeClient"; +import { de_DescribeDataDeletionJobCommand, se_DescribeDataDeletionJobCommand } from "../protocols/Aws_json1_1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link DescribeDataDeletionJobCommand}. + */ +export interface DescribeDataDeletionJobCommandInput extends DescribeDataDeletionJobRequest {} +/** + * @public + * + * The output of {@link DescribeDataDeletionJobCommand}. + */ +export interface DescribeDataDeletionJobCommandOutput extends DescribeDataDeletionJobResponse, __MetadataBearer {} + +/** + *

Describes the data deletion job created by CreateDataDeletionJob, including the job status.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { PersonalizeClient, DescribeDataDeletionJobCommand } from "@aws-sdk/client-personalize"; // ES Modules import + * // const { PersonalizeClient, DescribeDataDeletionJobCommand } = require("@aws-sdk/client-personalize"); // CommonJS import + * const client = new PersonalizeClient(config); + * const input = { // DescribeDataDeletionJobRequest + * dataDeletionJobArn: "STRING_VALUE", // required + * }; + * const command = new DescribeDataDeletionJobCommand(input); + * const response = await client.send(command); + * // { // DescribeDataDeletionJobResponse + * // dataDeletionJob: { // DataDeletionJob + * // jobName: "STRING_VALUE", + * // dataDeletionJobArn: "STRING_VALUE", + * // datasetGroupArn: "STRING_VALUE", + * // dataSource: { // DataSource + * // dataLocation: "STRING_VALUE", + * // }, + * // roleArn: "STRING_VALUE", + * // status: "STRING_VALUE", + * // numDeleted: Number("int"), + * // creationDateTime: new Date("TIMESTAMP"), + * // lastUpdatedDateTime: new Date("TIMESTAMP"), + * // failureReason: "STRING_VALUE", + * // }, + * // }; + * + * ``` + * + * @param DescribeDataDeletionJobCommandInput - {@link DescribeDataDeletionJobCommandInput} + * @returns {@link DescribeDataDeletionJobCommandOutput} + * @see {@link DescribeDataDeletionJobCommandInput} for command's `input` shape. + * @see {@link DescribeDataDeletionJobCommandOutput} for command's `response` shape. + * @see {@link PersonalizeClientResolvedConfig | config} for PersonalizeClient's `config` shape. + * + * @throws {@link InvalidInputException} (client fault) + *

Provide a valid value for the field or parameter.

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

Could not find the specified resource.

+ * + * @throws {@link PersonalizeServiceException} + *

Base exception class for all service exceptions from Personalize service.

+ * + * @public + */ +export class DescribeDataDeletionJobCommand extends $Command + .classBuilder< + DescribeDataDeletionJobCommandInput, + DescribeDataDeletionJobCommandOutput, + PersonalizeClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep({ + ...commonParams, + }) + .m(function (this: any, Command: any, cs: any, config: PersonalizeClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonPersonalize", "DescribeDataDeletionJob", {}) + .n("PersonalizeClient", "DescribeDataDeletionJobCommand") + .f(void 0, void 0) + .ser(se_DescribeDataDeletionJobCommand) + .de(de_DescribeDataDeletionJobCommand) + .build() {} diff --git a/clients/client-personalize/src/commands/ListDataDeletionJobsCommand.ts b/clients/client-personalize/src/commands/ListDataDeletionJobsCommand.ts new file mode 100644 index 000000000000..188ba294cb58 --- /dev/null +++ b/clients/client-personalize/src/commands/ListDataDeletionJobsCommand.ts @@ -0,0 +1,106 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { ListDataDeletionJobsRequest, ListDataDeletionJobsResponse } from "../models/models_0"; +import { PersonalizeClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../PersonalizeClient"; +import { de_ListDataDeletionJobsCommand, se_ListDataDeletionJobsCommand } from "../protocols/Aws_json1_1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link ListDataDeletionJobsCommand}. + */ +export interface ListDataDeletionJobsCommandInput extends ListDataDeletionJobsRequest {} +/** + * @public + * + * The output of {@link ListDataDeletionJobsCommand}. + */ +export interface ListDataDeletionJobsCommandOutput extends ListDataDeletionJobsResponse, __MetadataBearer {} + +/** + *

Returns a list of data deletion jobs for a dataset group ordered by creation time, + * with the most recent first. + * When + * a dataset group is not specified, all the data deletion jobs associated with + * the account are listed. The response provides the properties for each + * job, including the Amazon Resource Name (ARN). For more + * information on data deletion jobs, see Deleting users.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { PersonalizeClient, ListDataDeletionJobsCommand } from "@aws-sdk/client-personalize"; // ES Modules import + * // const { PersonalizeClient, ListDataDeletionJobsCommand } = require("@aws-sdk/client-personalize"); // CommonJS import + * const client = new PersonalizeClient(config); + * const input = { // ListDataDeletionJobsRequest + * datasetGroupArn: "STRING_VALUE", + * nextToken: "STRING_VALUE", + * maxResults: Number("int"), + * }; + * const command = new ListDataDeletionJobsCommand(input); + * const response = await client.send(command); + * // { // ListDataDeletionJobsResponse + * // dataDeletionJobs: [ // DataDeletionJobs + * // { // DataDeletionJobSummary + * // dataDeletionJobArn: "STRING_VALUE", + * // datasetGroupArn: "STRING_VALUE", + * // jobName: "STRING_VALUE", + * // status: "STRING_VALUE", + * // creationDateTime: new Date("TIMESTAMP"), + * // lastUpdatedDateTime: new Date("TIMESTAMP"), + * // failureReason: "STRING_VALUE", + * // }, + * // ], + * // nextToken: "STRING_VALUE", + * // }; + * + * ``` + * + * @param ListDataDeletionJobsCommandInput - {@link ListDataDeletionJobsCommandInput} + * @returns {@link ListDataDeletionJobsCommandOutput} + * @see {@link ListDataDeletionJobsCommandInput} for command's `input` shape. + * @see {@link ListDataDeletionJobsCommandOutput} for command's `response` shape. + * @see {@link PersonalizeClientResolvedConfig | config} for PersonalizeClient's `config` shape. + * + * @throws {@link InvalidInputException} (client fault) + *

Provide a valid value for the field or parameter.

+ * + * @throws {@link InvalidNextTokenException} (client fault) + *

The token is not valid.

+ * + * @throws {@link PersonalizeServiceException} + *

Base exception class for all service exceptions from Personalize service.

+ * + * @public + */ +export class ListDataDeletionJobsCommand extends $Command + .classBuilder< + ListDataDeletionJobsCommandInput, + ListDataDeletionJobsCommandOutput, + PersonalizeClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep({ + ...commonParams, + }) + .m(function (this: any, Command: any, cs: any, config: PersonalizeClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonPersonalize", "ListDataDeletionJobs", {}) + .n("PersonalizeClient", "ListDataDeletionJobsCommand") + .f(void 0, void 0) + .ser(se_ListDataDeletionJobsCommand) + .de(de_ListDataDeletionJobsCommand) + .build() {} diff --git a/clients/client-personalize/src/commands/index.ts b/clients/client-personalize/src/commands/index.ts index c2e3721815e9..1558cc4b67b7 100644 --- a/clients/client-personalize/src/commands/index.ts +++ b/clients/client-personalize/src/commands/index.ts @@ -2,6 +2,7 @@ export * from "./CreateBatchInferenceJobCommand"; export * from "./CreateBatchSegmentJobCommand"; export * from "./CreateCampaignCommand"; +export * from "./CreateDataDeletionJobCommand"; export * from "./CreateDatasetCommand"; export * from "./CreateDatasetExportJobCommand"; export * from "./CreateDatasetGroupCommand"; @@ -26,6 +27,7 @@ export * from "./DescribeAlgorithmCommand"; export * from "./DescribeBatchInferenceJobCommand"; export * from "./DescribeBatchSegmentJobCommand"; export * from "./DescribeCampaignCommand"; +export * from "./DescribeDataDeletionJobCommand"; export * from "./DescribeDatasetCommand"; export * from "./DescribeDatasetExportJobCommand"; export * from "./DescribeDatasetGroupCommand"; @@ -43,6 +45,7 @@ export * from "./GetSolutionMetricsCommand"; export * from "./ListBatchInferenceJobsCommand"; export * from "./ListBatchSegmentJobsCommand"; export * from "./ListCampaignsCommand"; +export * from "./ListDataDeletionJobsCommand"; export * from "./ListDatasetExportJobsCommand"; export * from "./ListDatasetGroupsCommand"; export * from "./ListDatasetImportJobsCommand"; diff --git a/clients/client-personalize/src/models/models_0.ts b/clients/client-personalize/src/models/models_0.ts index 0ce36812af41..9c313e926ba4 100644 --- a/clients/client-personalize/src/models/models_0.ts +++ b/clients/client-personalize/src/models/models_0.ts @@ -722,6 +722,80 @@ export interface CreateCampaignResponse { campaignArn?: string; } +/** + *

Describes the data source that contains the data to upload to a dataset, or the list of + * records to delete from Amazon Personalize.

+ * @public + */ +export interface DataSource { + /** + *

For dataset import jobs, the path to the Amazon S3 bucket where the data that you want to upload to + * your dataset is stored. For data deletion jobs, the path to the Amazon S3 bucket that stores the list of records to delete. + *

+ *

+ * For example:

+ *

+ * s3://bucket-name/folder-name/fileName.csv + *

+ *

If your CSV files are in a folder in your Amazon S3 bucket and you want your import job or data deletion job + * to consider multiple files, you can specify the path to the folder. With a data deletion job, Amazon Personalize uses all files in the folder and any sub folder. Use the following syntax with a / after the folder + * name:

+ *

+ * s3://bucket-name/folder-name/ + *

+ * @public + */ + dataLocation?: string; +} + +/** + * @public + */ +export interface CreateDataDeletionJobRequest { + /** + *

The name for the data deletion job.

+ * @public + */ + jobName: string | undefined; + + /** + *

The Amazon Resource Name (ARN) of the dataset group that has the datasets you want to + * delete records from.

+ * @public + */ + datasetGroupArn: string | undefined; + + /** + *

The Amazon S3 bucket that contains the list of userIds of the users to delete.

+ * @public + */ + dataSource: DataSource | undefined; + + /** + *

The Amazon Resource Name (ARN) of the IAM role that has permissions to read from the Amazon S3 + * data source.

+ * @public + */ + roleArn: string | undefined; + + /** + *

A list of tags to apply to the data deletion job.

+ * @public + */ + tags?: Tag[]; +} + +/** + * @public + */ +export interface CreateDataDeletionJobResponse { + /** + *

The Amazon Resource Name (ARN) of the data deletion job.

+ * @public + */ + dataDeletionJobArn?: string; +} + /** * @public */ @@ -947,23 +1021,6 @@ export interface CreateDatasetGroupResponse { domain?: Domain; } -/** - *

Describes the data source that contains the data to upload to a - * dataset.

- * @public - */ -export interface DataSource { - /** - *

The path to the Amazon S3 bucket where the data that you want to upload to - * your dataset is stored. For example:

- *

- * s3://bucket-name/folder-name/ - *

- * @public - */ - dataLocation?: string; -} - /** * @public * @enum @@ -2380,6 +2437,120 @@ export interface DescribeCampaignResponse { campaign?: Campaign; } +/** + * @public + */ +export interface DescribeDataDeletionJobRequest { + /** + *

The Amazon Resource Name (ARN) of the data deletion job.

+ * @public + */ + dataDeletionJobArn: string | undefined; +} + +/** + *

Describes a job that deletes all + * references to specific users from an Amazon Personalize dataset group in batches. For information about creating a data deletion job, + * see Deleting users.

+ * @public + */ +export interface DataDeletionJob { + /** + *

The name of the data deletion job.

+ * @public + */ + jobName?: string; + + /** + *

The Amazon Resource Name (ARN) of the data deletion job.

+ * @public + */ + dataDeletionJobArn?: string; + + /** + *

The Amazon Resource Name (ARN) of the dataset group the job deletes records from.

+ * @public + */ + datasetGroupArn?: string; + + /** + *

Describes the data source that contains the data to upload to a dataset, or the list of + * records to delete from Amazon Personalize.

+ * @public + */ + dataSource?: DataSource; + + /** + *

The Amazon Resource Name (ARN) of the IAM role that has permissions to read from the Amazon S3 + * data source.

+ * @public + */ + roleArn?: string; + + /** + *

The status of the data deletion job.

+ *

A data deletion job can have one of the following statuses:

+ *
    + *
  • + *

    PENDING > IN_PROGRESS > COMPLETED -or- FAILED

    + *
  • + *
+ * @public + */ + status?: string; + + /** + *

The number of records deleted by a COMPLETED job.

+ * @public + */ + numDeleted?: number; + + /** + *

The creation date and time (in Unix time) of the data deletion + * job.

+ * @public + */ + creationDateTime?: Date; + + /** + *

The date and time (in Unix time) the data deletion job was last updated.

+ * @public + */ + lastUpdatedDateTime?: Date; + + /** + *

If a data deletion job fails, provides the reason why.

+ * @public + */ + failureReason?: string; +} + +/** + * @public + */ +export interface DescribeDataDeletionJobResponse { + /** + *

Information about the data deletion job, including the status.

+ *

The status is one of the following values:

+ *
    + *
  • + *

    PENDING

    + *
  • + *
  • + *

    IN_PROGRESS

    + *
  • + *
  • + *

    COMPLETED

    + *
  • + *
  • + *

    FAILED

    + *
  • + *
+ * @public + */ + dataDeletionJob?: DataDeletionJob; +} + /** * @public */ @@ -4302,6 +4473,104 @@ export interface ListCampaignsResponse { nextToken?: string; } +/** + * @public + */ +export interface ListDataDeletionJobsRequest { + /** + *

The Amazon Resource Name (ARN) of the dataset group to list data deletion jobs for.

+ * @public + */ + datasetGroupArn?: string; + + /** + *

A token returned from the previous call to + * ListDataDeletionJobs for getting the next set of jobs (if they exist).

+ * @public + */ + nextToken?: string; + + /** + *

The maximum number of data deletion jobs to return.

+ * @public + */ + maxResults?: number; +} + +/** + *

Provides a summary of the properties of a data deletion job. For a complete listing, call the DescribeDataDeletionJob + * API operation.

+ * @public + */ +export interface DataDeletionJobSummary { + /** + *

The Amazon Resource Name (ARN) of the data deletion job.

+ * @public + */ + dataDeletionJobArn?: string; + + /** + *

The Amazon Resource Name (ARN) of the dataset group the job deleted records from.

+ * @public + */ + datasetGroupArn?: string; + + /** + *

The name of the data deletion job.

+ * @public + */ + jobName?: string; + + /** + *

The status of the data deletion job.

+ *

A data deletion job can have one of the following statuses:

+ *
    + *
  • + *

    PENDING > IN_PROGRESS > COMPLETED -or- FAILED

    + *
  • + *
+ * @public + */ + status?: string; + + /** + *

The creation date and time (in Unix time) of the data deletion + * job.

+ * @public + */ + creationDateTime?: Date; + + /** + *

The date and time (in Unix time) the data deletion job was last updated.

+ * @public + */ + lastUpdatedDateTime?: Date; + + /** + *

If a data deletion job fails, provides the reason why.

+ * @public + */ + failureReason?: string; +} + +/** + * @public + */ +export interface ListDataDeletionJobsResponse { + /** + *

The list of data deletion jobs.

+ * @public + */ + dataDeletionJobs?: DataDeletionJobSummary[]; + + /** + *

A token for getting the next set of data deletion jobs (if they + * exist).

+ * @public + */ + nextToken?: string; +} + /** * @public */ diff --git a/clients/client-personalize/src/protocols/Aws_json1_1.ts b/clients/client-personalize/src/protocols/Aws_json1_1.ts index 4b45300b20df..742528090b99 100644 --- a/clients/client-personalize/src/protocols/Aws_json1_1.ts +++ b/clients/client-personalize/src/protocols/Aws_json1_1.ts @@ -32,6 +32,10 @@ import { CreateBatchSegmentJobCommandOutput, } from "../commands/CreateBatchSegmentJobCommand"; import { CreateCampaignCommandInput, CreateCampaignCommandOutput } from "../commands/CreateCampaignCommand"; +import { + CreateDataDeletionJobCommandInput, + CreateDataDeletionJobCommandOutput, +} from "../commands/CreateDataDeletionJobCommand"; import { CreateDatasetCommandInput, CreateDatasetCommandOutput } from "../commands/CreateDatasetCommand"; import { CreateDatasetExportJobCommandInput, @@ -77,6 +81,10 @@ import { DescribeBatchSegmentJobCommandOutput, } from "../commands/DescribeBatchSegmentJobCommand"; import { DescribeCampaignCommandInput, DescribeCampaignCommandOutput } from "../commands/DescribeCampaignCommand"; +import { + DescribeDataDeletionJobCommandInput, + DescribeDataDeletionJobCommandOutput, +} from "../commands/DescribeDataDeletionJobCommand"; import { DescribeDatasetCommandInput, DescribeDatasetCommandOutput } from "../commands/DescribeDatasetCommand"; import { DescribeDatasetExportJobCommandInput, @@ -124,6 +132,10 @@ import { ListBatchSegmentJobsCommandOutput, } from "../commands/ListBatchSegmentJobsCommand"; import { ListCampaignsCommandInput, ListCampaignsCommandOutput } from "../commands/ListCampaignsCommand"; +import { + ListDataDeletionJobsCommandInput, + ListDataDeletionJobsCommandOutput, +} from "../commands/ListDataDeletionJobsCommand"; import { ListDatasetExportJobsCommandInput, ListDatasetExportJobsCommandOutput, @@ -193,6 +205,7 @@ import { CreateBatchInferenceJobRequest, CreateBatchSegmentJobRequest, CreateCampaignRequest, + CreateDataDeletionJobRequest, CreateDatasetExportJobRequest, CreateDatasetGroupRequest, CreateDatasetImportJobRequest, @@ -204,6 +217,8 @@ import { CreateSchemaRequest, CreateSolutionRequest, CreateSolutionVersionRequest, + DataDeletionJob, + DataDeletionJobSummary, Dataset, DatasetExportJob, DatasetExportJobOutput, @@ -236,6 +251,8 @@ import { DescribeBatchSegmentJobResponse, DescribeCampaignRequest, DescribeCampaignResponse, + DescribeDataDeletionJobRequest, + DescribeDataDeletionJobResponse, DescribeDatasetExportJobRequest, DescribeDatasetExportJobResponse, DescribeDatasetGroupRequest, @@ -284,6 +301,8 @@ import { ListBatchSegmentJobsResponse, ListCampaignsRequest, ListCampaignsResponse, + ListDataDeletionJobsRequest, + ListDataDeletionJobsResponse, ListDatasetExportJobsRequest, ListDatasetExportJobsResponse, ListDatasetGroupsRequest, @@ -386,6 +405,19 @@ export const se_CreateCampaignCommand = async ( return buildHttpRpcRequest(context, headers, "/", undefined, body); }; +/** + * serializeAws_json1_1CreateDataDeletionJobCommand + */ +export const se_CreateDataDeletionJobCommand = async ( + input: CreateDataDeletionJobCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("CreateDataDeletionJob"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + /** * serializeAws_json1_1CreateDatasetCommand */ @@ -698,6 +730,19 @@ export const se_DescribeCampaignCommand = async ( return buildHttpRpcRequest(context, headers, "/", undefined, body); }; +/** + * serializeAws_json1_1DescribeDataDeletionJobCommand + */ +export const se_DescribeDataDeletionJobCommand = async ( + input: DescribeDataDeletionJobCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("DescribeDataDeletionJob"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + /** * serializeAws_json1_1DescribeDatasetCommand */ @@ -919,6 +964,19 @@ export const se_ListCampaignsCommand = async ( return buildHttpRpcRequest(context, headers, "/", undefined, body); }; +/** + * serializeAws_json1_1ListDataDeletionJobsCommand + */ +export const se_ListDataDeletionJobsCommand = async ( + input: ListDataDeletionJobsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("ListDataDeletionJobs"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + /** * serializeAws_json1_1ListDatasetExportJobsCommand */ @@ -1278,6 +1336,26 @@ export const de_CreateCampaignCommand = async ( return response; }; +/** + * deserializeAws_json1_1CreateDataDeletionJobCommand + */ +export const de_CreateDataDeletionJobCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateDataDeletionJobCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + /** * deserializeAws_json1_1CreateDatasetCommand */ @@ -1731,6 +1809,26 @@ export const de_DescribeCampaignCommand = async ( return response; }; +/** + * deserializeAws_json1_1DescribeDataDeletionJobCommand + */ +export const de_DescribeDataDeletionJobCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeDataDeletionJobResponse(data, context); + const response: DescribeDataDeletionJobCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + /** * deserializeAws_json1_1DescribeDatasetCommand */ @@ -2071,6 +2169,26 @@ export const de_ListCampaignsCommand = async ( return response; }; +/** + * deserializeAws_json1_1ListDataDeletionJobsCommand + */ +export const de_ListDataDeletionJobsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListDataDeletionJobsResponse(data, context); + const response: ListDataDeletionJobsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + /** * deserializeAws_json1_1ListDatasetExportJobsCommand */ @@ -2754,6 +2872,8 @@ const se_ContinuousHyperParameterRanges = (input: ContinuousHyperParameterRange[ // se_CreateCampaignRequest omitted. +// se_CreateDataDeletionJobRequest omitted. + // se_CreateDatasetExportJobRequest omitted. // se_CreateDatasetGroupRequest omitted. @@ -2821,6 +2941,8 @@ const se_CreateSolutionRequest = (input: CreateSolutionRequest, context: __Serde // se_DescribeCampaignRequest omitted. +// se_DescribeDataDeletionJobRequest omitted. + // se_DescribeDatasetExportJobRequest omitted. // se_DescribeDatasetGroupRequest omitted. @@ -2893,6 +3015,8 @@ const se_HyperParameterRanges = (input: HyperParameterRanges, context: __SerdeCo // se_ListCampaignsRequest omitted. +// se_ListDataDeletionJobsRequest omitted. + // se_ListDatasetExportJobsRequest omitted. // se_ListDatasetGroupsRequest omitted. @@ -3213,6 +3337,8 @@ const de_ContinuousHyperParameterRanges = (output: any, context: __SerdeContext) // de_CreateCampaignResponse omitted. +// de_CreateDataDeletionJobResponse omitted. + // de_CreateDatasetExportJobResponse omitted. // de_CreateDatasetGroupResponse omitted. @@ -3235,6 +3361,51 @@ const de_ContinuousHyperParameterRanges = (output: any, context: __SerdeContext) // de_CreateSolutionVersionResponse omitted. +/** + * deserializeAws_json1_1DataDeletionJob + */ +const de_DataDeletionJob = (output: any, context: __SerdeContext): DataDeletionJob => { + return take(output, { + creationDateTime: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + dataDeletionJobArn: __expectString, + dataSource: _json, + datasetGroupArn: __expectString, + failureReason: __expectString, + jobName: __expectString, + lastUpdatedDateTime: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + numDeleted: __expectInt32, + roleArn: __expectString, + status: __expectString, + }) as any; +}; + +/** + * deserializeAws_json1_1DataDeletionJobs + */ +const de_DataDeletionJobs = (output: any, context: __SerdeContext): DataDeletionJobSummary[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_DataDeletionJobSummary(entry, context); + }); + return retVal; +}; + +/** + * deserializeAws_json1_1DataDeletionJobSummary + */ +const de_DataDeletionJobSummary = (output: any, context: __SerdeContext): DataDeletionJobSummary => { + return take(output, { + creationDateTime: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + dataDeletionJobArn: __expectString, + datasetGroupArn: __expectString, + failureReason: __expectString, + jobName: __expectString, + lastUpdatedDateTime: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + status: __expectString, + }) as any; +}; + /** * deserializeAws_json1_1Dataset */ @@ -3545,6 +3716,15 @@ const de_DescribeCampaignResponse = (output: any, context: __SerdeContext): Desc }) as any; }; +/** + * deserializeAws_json1_1DescribeDataDeletionJobResponse + */ +const de_DescribeDataDeletionJobResponse = (output: any, context: __SerdeContext): DescribeDataDeletionJobResponse => { + return take(output, { + dataDeletionJob: (_: any) => de_DataDeletionJob(_, context), + }) as any; +}; + /** * deserializeAws_json1_1DescribeDatasetExportJobResponse */ @@ -3858,6 +4038,16 @@ const de_ListCampaignsResponse = (output: any, context: __SerdeContext): ListCam }) as any; }; +/** + * deserializeAws_json1_1ListDataDeletionJobsResponse + */ +const de_ListDataDeletionJobsResponse = (output: any, context: __SerdeContext): ListDataDeletionJobsResponse => { + return take(output, { + dataDeletionJobs: (_: any) => de_DataDeletionJobs(_, context), + nextToken: __expectString, + }) as any; +}; + /** * deserializeAws_json1_1ListDatasetExportJobsResponse */ diff --git a/codegen/sdk-codegen/aws-models/personalize.json b/codegen/sdk-codegen/aws-models/personalize.json index a3296ef4fa19..f656158806cc 100644 --- a/codegen/sdk-codegen/aws-models/personalize.json +++ b/codegen/sdk-codegen/aws-models/personalize.json @@ -140,6 +140,9 @@ { "target": "com.amazonaws.personalize#CreateCampaign" }, + { + "target": "com.amazonaws.personalize#CreateDataDeletionJob" + }, { "target": "com.amazonaws.personalize#CreateDataset" }, @@ -212,6 +215,9 @@ { "target": "com.amazonaws.personalize#DescribeCampaign" }, + { + "target": "com.amazonaws.personalize#DescribeDataDeletionJob" + }, { "target": "com.amazonaws.personalize#DescribeDataset" }, @@ -263,6 +269,9 @@ { "target": "com.amazonaws.personalize#ListCampaigns" }, + { + "target": "com.amazonaws.personalize#ListDataDeletionJobs" + }, { "target": "com.amazonaws.personalize#ListDatasetExportJobs" }, @@ -2231,6 +2240,94 @@ "smithy.api#output": {} } }, + "com.amazonaws.personalize#CreateDataDeletionJob": { + "type": "operation", + "input": { + "target": "com.amazonaws.personalize#CreateDataDeletionJobRequest" + }, + "output": { + "target": "com.amazonaws.personalize#CreateDataDeletionJobResponse" + }, + "errors": [ + { + "target": "com.amazonaws.personalize#InvalidInputException" + }, + { + "target": "com.amazonaws.personalize#LimitExceededException" + }, + { + "target": "com.amazonaws.personalize#ResourceAlreadyExistsException" + }, + { + "target": "com.amazonaws.personalize#ResourceInUseException" + }, + { + "target": "com.amazonaws.personalize#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.personalize#TooManyTagsException" + } + ], + "traits": { + "smithy.api#documentation": "

Creates a batch job that deletes all\n references to specific users from an Amazon Personalize dataset group in batches. You specify the users to delete in a CSV file of userIds in \n an Amazon S3 bucket. After a job completes, Amazon Personalize no longer trains\n on the users’ data and no longer considers the users when generating user segments. \n For more information about creating a data deletion job, see Deleting users.

\n
    \n
  • \n

    Your input file must be a CSV file with a single USER_ID column that lists the users IDs. For more information\n about preparing the CSV file, see Preparing your data deletion file and uploading it to Amazon S3.

    \n
  • \n
  • \n

    To give Amazon Personalize permission to access your input CSV file of userIds, you must specify an IAM service role that has permission to\n read from the data source. This role \n needs GetObject and ListBucket permissions for the bucket and its content.\n These permissions are the same as importing data. For information on granting access to your Amazon S3\n bucket, see Giving\n Amazon Personalize Access to Amazon S3 Resources.

    \n
  • \n
\n

\n After you create a job, it can take up to a day to delete all references to the users from datasets and models. Until the job completes, \n Amazon Personalize continues to use the data when training. And if you use a User Segmentation recipe, the users might appear in user segments. \n

\n

\n Status\n

\n

A data deletion job can have one of the following statuses:

\n
    \n
  • \n

    PENDING > IN_PROGRESS > COMPLETED -or- FAILED

    \n
  • \n
\n

To get the status of the data deletion job, call DescribeDataDeletionJob API operation and specify the Amazon Resource Name\n (ARN) of the job. If the status is FAILED, the response\n includes a failureReason key, which describes why the job\n failed.

\n

\n Related APIs\n

\n " + } + }, + "com.amazonaws.personalize#CreateDataDeletionJobRequest": { + "type": "structure", + "members": { + "jobName": { + "target": "com.amazonaws.personalize#Name", + "traits": { + "smithy.api#documentation": "

The name for the data deletion job.

", + "smithy.api#required": {} + } + }, + "datasetGroupArn": { + "target": "com.amazonaws.personalize#Arn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the dataset group that has the datasets you want to\n delete records from.

", + "smithy.api#required": {} + } + }, + "dataSource": { + "target": "com.amazonaws.personalize#DataSource", + "traits": { + "smithy.api#documentation": "

The Amazon S3 bucket that contains the list of userIds of the users to delete.

", + "smithy.api#required": {} + } + }, + "roleArn": { + "target": "com.amazonaws.personalize#RoleArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the IAM role that has permissions to read from the Amazon S3\n data source.

", + "smithy.api#required": {} + } + }, + "tags": { + "target": "com.amazonaws.personalize#Tags", + "traits": { + "smithy.api#documentation": "

A list of tags to apply to the data deletion job.

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.personalize#CreateDataDeletionJobResponse": { + "type": "structure", + "members": { + "dataDeletionJobArn": { + "target": "com.amazonaws.personalize#Arn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the data deletion job.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.personalize#CreateDataset": { "type": "operation", "input": { @@ -3182,18 +3279,145 @@ "smithy.api#output": {} } }, + "com.amazonaws.personalize#DataDeletionJob": { + "type": "structure", + "members": { + "jobName": { + "target": "com.amazonaws.personalize#Name", + "traits": { + "smithy.api#documentation": "

The name of the data deletion job.

" + } + }, + "dataDeletionJobArn": { + "target": "com.amazonaws.personalize#Arn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the data deletion job.

" + } + }, + "datasetGroupArn": { + "target": "com.amazonaws.personalize#Arn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the dataset group the job deletes records from.

" + } + }, + "dataSource": { + "target": "com.amazonaws.personalize#DataSource" + }, + "roleArn": { + "target": "com.amazonaws.personalize#RoleArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the IAM role that has permissions to read from the Amazon S3\n data source.

" + } + }, + "status": { + "target": "com.amazonaws.personalize#Status", + "traits": { + "smithy.api#documentation": "

The status of the data deletion job.

\n

A data deletion job can have one of the following statuses:

\n
    \n
  • \n

    PENDING > IN_PROGRESS > COMPLETED -or- FAILED

    \n
  • \n
" + } + }, + "numDeleted": { + "target": "com.amazonaws.personalize#Integer", + "traits": { + "smithy.api#documentation": "

The number of records deleted by a COMPLETED job.

" + } + }, + "creationDateTime": { + "target": "com.amazonaws.personalize#Date", + "traits": { + "smithy.api#documentation": "

The creation date and time (in Unix time) of the data deletion\n job.

" + } + }, + "lastUpdatedDateTime": { + "target": "com.amazonaws.personalize#Date", + "traits": { + "smithy.api#documentation": "

The date and time (in Unix time) the data deletion job was last updated.

" + } + }, + "failureReason": { + "target": "com.amazonaws.personalize#FailureReason", + "traits": { + "smithy.api#documentation": "

If a data deletion job fails, provides the reason why.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Describes a job that deletes all\n references to specific users from an Amazon Personalize dataset group in batches. For information about creating a data deletion job, \n see Deleting users.

" + } + }, + "com.amazonaws.personalize#DataDeletionJobSummary": { + "type": "structure", + "members": { + "dataDeletionJobArn": { + "target": "com.amazonaws.personalize#Arn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the data deletion job.

" + } + }, + "datasetGroupArn": { + "target": "com.amazonaws.personalize#Arn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the dataset group the job deleted records from.

" + } + }, + "jobName": { + "target": "com.amazonaws.personalize#Name", + "traits": { + "smithy.api#documentation": "

The name of the data deletion job.

" + } + }, + "status": { + "target": "com.amazonaws.personalize#Status", + "traits": { + "smithy.api#documentation": "

The status of the data deletion job.

\n

A data deletion job can have one of the following statuses:

\n
    \n
  • \n

    PENDING > IN_PROGRESS > COMPLETED -or- FAILED

    \n
  • \n
" + } + }, + "creationDateTime": { + "target": "com.amazonaws.personalize#Date", + "traits": { + "smithy.api#documentation": "

The creation date and time (in Unix time) of the data deletion\n job.

" + } + }, + "lastUpdatedDateTime": { + "target": "com.amazonaws.personalize#Date", + "traits": { + "smithy.api#documentation": "

The date and time (in Unix time) the data deletion job was last updated.

" + } + }, + "failureReason": { + "target": "com.amazonaws.personalize#FailureReason", + "traits": { + "smithy.api#documentation": "

If a data deletion job fails, provides the reason why.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Provides a summary of the properties of a data deletion job. For a complete listing, call the DescribeDataDeletionJob\n API operation.

" + } + }, + "com.amazonaws.personalize#DataDeletionJobs": { + "type": "list", + "member": { + "target": "com.amazonaws.personalize#DataDeletionJobSummary" + }, + "traits": { + "smithy.api#length": { + "min": 0, + "max": 100 + } + } + }, "com.amazonaws.personalize#DataSource": { "type": "structure", "members": { "dataLocation": { "target": "com.amazonaws.personalize#S3Location", "traits": { - "smithy.api#documentation": "

The path to the Amazon S3 bucket where the data that you want to upload to\n your dataset is stored. For example:

\n

\n s3://bucket-name/folder-name/\n

" + "smithy.api#documentation": "

For dataset import jobs, the path to the Amazon S3 bucket where the data that you want to upload to\n your dataset is stored. For data deletion jobs, the path to the Amazon S3 bucket that stores the list of records to delete.\n

\n

\n For example:

\n

\n s3://bucket-name/folder-name/fileName.csv\n

\n

If your CSV files are in a folder in your Amazon S3 bucket and you want your import job or data deletion job\n to consider multiple files, you can specify the path to the folder. With a data deletion job, Amazon Personalize uses all files in the folder and any sub folder. Use the following syntax with a / after the folder\n name:

\n

\n s3://bucket-name/folder-name/\n

" } } }, "traits": { - "smithy.api#documentation": "

Describes the data source that contains the data to upload to a\n dataset.

" + "smithy.api#documentation": "

Describes the data source that contains the data to upload to a dataset, or the list of \n records to delete from Amazon Personalize.

" } }, "com.amazonaws.personalize#Dataset": { @@ -4559,6 +4783,56 @@ "smithy.api#output": {} } }, + "com.amazonaws.personalize#DescribeDataDeletionJob": { + "type": "operation", + "input": { + "target": "com.amazonaws.personalize#DescribeDataDeletionJobRequest" + }, + "output": { + "target": "com.amazonaws.personalize#DescribeDataDeletionJobResponse" + }, + "errors": [ + { + "target": "com.amazonaws.personalize#InvalidInputException" + }, + { + "target": "com.amazonaws.personalize#ResourceNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

Describes the data deletion job created by CreateDataDeletionJob, including the job status.

", + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.personalize#DescribeDataDeletionJobRequest": { + "type": "structure", + "members": { + "dataDeletionJobArn": { + "target": "com.amazonaws.personalize#Arn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the data deletion job.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.personalize#DescribeDataDeletionJobResponse": { + "type": "structure", + "members": { + "dataDeletionJob": { + "target": "com.amazonaws.personalize#DataDeletionJob", + "traits": { + "smithy.api#documentation": "

Information about the data deletion job, including the status.

\n

The status is one of the following values:

\n
    \n
  • \n

    PENDING

    \n
  • \n
  • \n

    IN_PROGRESS

    \n
  • \n
  • \n

    COMPLETED

    \n
  • \n
  • \n

    FAILED

    \n
  • \n
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.personalize#DescribeDataset": { "type": "operation", "input": { @@ -5828,6 +6102,9 @@ } } }, + "com.amazonaws.personalize#Integer": { + "type": "integer" + }, "com.amazonaws.personalize#IntegerHyperParameterRange": { "type": "structure", "members": { @@ -6163,6 +6440,73 @@ "smithy.api#output": {} } }, + "com.amazonaws.personalize#ListDataDeletionJobs": { + "type": "operation", + "input": { + "target": "com.amazonaws.personalize#ListDataDeletionJobsRequest" + }, + "output": { + "target": "com.amazonaws.personalize#ListDataDeletionJobsResponse" + }, + "errors": [ + { + "target": "com.amazonaws.personalize#InvalidInputException" + }, + { + "target": "com.amazonaws.personalize#InvalidNextTokenException" + } + ], + "traits": { + "smithy.api#documentation": "

Returns a list of data deletion jobs for a dataset group ordered by creation time,\n with the most recent first.\n When\n a dataset group is not specified, all the data deletion jobs associated with\n the account are listed. The response provides the properties for each\n job, including the Amazon Resource Name (ARN). For more\n information on data deletion jobs, see Deleting users.

", + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.personalize#ListDataDeletionJobsRequest": { + "type": "structure", + "members": { + "datasetGroupArn": { + "target": "com.amazonaws.personalize#Arn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the dataset group to list data deletion jobs for.

" + } + }, + "nextToken": { + "target": "com.amazonaws.personalize#NextToken", + "traits": { + "smithy.api#documentation": "

A token returned from the previous call to\n ListDataDeletionJobs for getting the next set of jobs (if they exist).

" + } + }, + "maxResults": { + "target": "com.amazonaws.personalize#MaxResults", + "traits": { + "smithy.api#documentation": "

The maximum number of data deletion jobs to return.

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.personalize#ListDataDeletionJobsResponse": { + "type": "structure", + "members": { + "dataDeletionJobs": { + "target": "com.amazonaws.personalize#DataDeletionJobs", + "traits": { + "smithy.api#documentation": "

The list of data deletion jobs.

" + } + }, + "nextToken": { + "target": "com.amazonaws.personalize#NextToken", + "traits": { + "smithy.api#documentation": "

A token for getting the next set of data deletion jobs (if they\n exist).

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.personalize#ListDatasetExportJobs": { "type": "operation", "input": {