Update a dataset to replace its schema with a new or existing one. For more information, see Replacing a dataset's schema.
+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { PersonalizeClient, UpdateDatasetCommand } from "@aws-sdk/client-personalize"; // ES Modules import + * // const { PersonalizeClient, UpdateDatasetCommand } = require("@aws-sdk/client-personalize"); // CommonJS import + * const client = new PersonalizeClient(config); + * const input = { // UpdateDatasetRequest + * datasetArn: "STRING_VALUE", // required + * schemaArn: "STRING_VALUE", // required + * }; + * const command = new UpdateDatasetCommand(input); + * const response = await client.send(command); + * // { // UpdateDatasetResponse + * // datasetArn: "STRING_VALUE", + * // }; + * + * ``` + * + * @param UpdateDatasetCommandInput - {@link UpdateDatasetCommandInput} + * @returns {@link UpdateDatasetCommandOutput} + * @see {@link UpdateDatasetCommandInput} for command's `input` shape. + * @see {@link UpdateDatasetCommandOutput} 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 ResourceInUseException} (client fault) + *The specified resource is in use.
+ * + * @throws {@link ResourceNotFoundException} (client fault) + *Could not find the specified resource.
+ * + * @throws {@link PersonalizeServiceException} + *Base exception class for all service exceptions from Personalize service.
+ * + */ +export class UpdateDatasetCommand extends $Command< + UpdateDatasetCommandInput, + UpdateDatasetCommandOutput, + PersonalizeClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: UpdateDatasetCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStackThe ARN of the recipe to use for model training. Only specified when + *
The ARN of the recipe to use for model training. This is required when
* performAutoML
is false.
Describes an update to a dataset.
+ */ +export interface DatasetUpdateSummary { + /** + *The Amazon Resource Name (ARN) of the schema that replaced the previous schema of the dataset.
+ */ + schemaArn?: string; + + /** + *The status of the dataset update.
+ */ + status?: string; + + /** + *If updating a dataset fails, provides the reason why.
+ */ + failureReason?: string; + + /** + *The creation date and time (in Unix time) of the dataset update.
+ */ + creationDateTime?: Date; + + /** + *The last update date and time (in Unix time) of the dataset.
+ */ + lastUpdatedDateTime?: Date; +} + /** * @public *Provides metadata for a dataset.
@@ -2059,6 +2090,11 @@ export interface Dataset { *A time stamp that shows when the dataset was updated.
*/ lastUpdatedDateTime?: Date; + + /** + *Describes the latest update to the dataset.
+ */ + latestDatasetUpdate?: DatasetUpdateSummary; } /** @@ -3052,7 +3088,8 @@ export interface Solution { performAutoML?: boolean; /** - *The ARN of the recipe used to create the solution.
+ *The ARN of the recipe used to create the solution. This is required when
+ * performAutoML
is false.
The Amazon Resource Name (ARN) of the dataset that you want to update.
+ */ + datasetArn: string | undefined; + + /** + *The Amazon Resource Name (ARN) of the new schema you want use.
+ */ + schemaArn: string | undefined; +} + +/** + * @public + */ +export interface UpdateDatasetResponse { + /** + *The Amazon Resource Name (ARN) of the dataset you updated.
+ */ + datasetArn?: 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 e276a658b038..bab3178ed62a 100644 --- a/clients/client-personalize/src/protocols/Aws_json1_1.ts +++ b/clients/client-personalize/src/protocols/Aws_json1_1.ts @@ -164,6 +164,7 @@ import { import { TagResourceCommandInput, TagResourceCommandOutput } from "../commands/TagResourceCommand"; import { UntagResourceCommandInput, UntagResourceCommandOutput } from "../commands/UntagResourceCommand"; import { UpdateCampaignCommandInput, UpdateCampaignCommandOutput } from "../commands/UpdateCampaignCommand"; +import { UpdateDatasetCommandInput, UpdateDatasetCommandOutput } from "../commands/UpdateDatasetCommand"; import { UpdateMetricAttributionCommandInput, UpdateMetricAttributionCommandOutput, @@ -212,6 +213,7 @@ import { DatasetSchema, DatasetSchemaSummary, DatasetSummary, + DatasetUpdateSummary, DataSource, DefaultContinuousHyperParameterRange, DefaultHyperParameterRanges, @@ -335,6 +337,7 @@ import { TrainingDataConfig, UntagResourceRequest, UpdateCampaignRequest, + UpdateDatasetRequest, UpdateMetricAttributionRequest, UpdateRecommenderRequest, } from "../models/models_0"; @@ -1172,6 +1175,19 @@ export const se_UpdateCampaignCommand = async ( return buildHttpRpcRequest(context, headers, "/", undefined, body); }; +/** + * serializeAws_json1_1UpdateDatasetCommand + */ +export const se_UpdateDatasetCommand = async ( + input: UpdateDatasetCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("UpdateDataset"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + /** * serializeAws_json1_1UpdateMetricAttributionCommand */ @@ -4508,6 +4524,58 @@ const de_UpdateCampaignCommandError = async ( } }; +/** + * deserializeAws_json1_1UpdateDatasetCommand + */ +export const de_UpdateDatasetCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): PromiseThe ARN of the recipe to use for model training. Only specified when\n performAutoML
is false.
The ARN of the recipe to use for model training. This is required when\n performAutoML
is false.
A time stamp that shows when the dataset was updated.
" } + }, + "latestDatasetUpdate": { + "target": "com.amazonaws.personalize#DatasetUpdateSummary", + "traits": { + "smithy.api#documentation": "Describes the latest update to the dataset.
" + } } }, "traits": { @@ -3739,6 +3748,44 @@ } } }, + "com.amazonaws.personalize#DatasetUpdateSummary": { + "type": "structure", + "members": { + "schemaArn": { + "target": "com.amazonaws.personalize#Arn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of the schema that replaced the previous schema of the dataset.
" + } + }, + "status": { + "target": "com.amazonaws.personalize#Status", + "traits": { + "smithy.api#documentation": "The status of the dataset update.
" + } + }, + "failureReason": { + "target": "com.amazonaws.personalize#FailureReason", + "traits": { + "smithy.api#documentation": "If updating a dataset fails, provides the reason why.
" + } + }, + "creationDateTime": { + "target": "com.amazonaws.personalize#Date", + "traits": { + "smithy.api#documentation": "The creation date and time (in Unix time) of the dataset update.
" + } + }, + "lastUpdatedDateTime": { + "target": "com.amazonaws.personalize#Date", + "traits": { + "smithy.api#documentation": "The last update date and time (in Unix time) of the dataset.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Describes an update to a dataset.
" + } + }, "com.amazonaws.personalize#Datasets": { "type": "list", "member": { @@ -7868,7 +7915,7 @@ "recipeArn": { "target": "com.amazonaws.personalize#Arn", "traits": { - "smithy.api#documentation": "The ARN of the recipe used to create the solution.
" + "smithy.api#documentation": "The ARN of the recipe used to create the solution. This is required when\n performAutoML
is false.
Update a dataset to replace its schema with a new or existing one. For more information, see Replacing a dataset's schema.
", + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.personalize#UpdateDatasetRequest": { + "type": "structure", + "members": { + "datasetArn": { + "target": "com.amazonaws.personalize#Arn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of the dataset that you want to update.
", + "smithy.api#required": {} + } + }, + "schemaArn": { + "target": "com.amazonaws.personalize#Arn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of the new schema you want use.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.personalize#UpdateDatasetResponse": { + "type": "structure", + "members": { + "datasetArn": { + "target": "com.amazonaws.personalize#Arn", + "traits": { + "smithy.api#documentation": "The Amazon Resource Name (ARN) of the dataset you updated.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.personalize#UpdateMetricAttribution": { "type": "operation", "input": {