Skip to content

Commit 238987e

Browse files
author
awstools
committed
feat(client-personalize): This releases ability to update automatic training scheduler for customer solutions
1 parent 3a7b177 commit 238987e

File tree

10 files changed

+478
-27
lines changed

10 files changed

+478
-27
lines changed

clients/client-personalize/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,3 +764,11 @@ UpdateRecommender
764764
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/personalize/command/UpdateRecommenderCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-personalize/Interface/UpdateRecommenderCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-personalize/Interface/UpdateRecommenderCommandOutput/)
765765

766766
</details>
767+
<details>
768+
<summary>
769+
UpdateSolution
770+
</summary>
771+
772+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/personalize/command/UpdateSolutionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-personalize/Interface/UpdateSolutionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-personalize/Interface/UpdateSolutionCommandOutput/)
773+
774+
</details>

clients/client-personalize/src/Personalize.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,11 @@ import {
336336
UpdateRecommenderCommandInput,
337337
UpdateRecommenderCommandOutput,
338338
} from "./commands/UpdateRecommenderCommand";
339+
import {
340+
UpdateSolutionCommand,
341+
UpdateSolutionCommandInput,
342+
UpdateSolutionCommandOutput,
343+
} from "./commands/UpdateSolutionCommand";
339344
import { PersonalizeClient, PersonalizeClientConfig } from "./PersonalizeClient";
340345

341346
const commands = {
@@ -409,6 +414,7 @@ const commands = {
409414
UpdateDatasetCommand,
410415
UpdateMetricAttributionCommand,
411416
UpdateRecommenderCommand,
417+
UpdateSolutionCommand,
412418
};
413419

414420
export interface Personalize {
@@ -1499,6 +1505,20 @@ export interface Personalize {
14991505
options: __HttpHandlerOptions,
15001506
cb: (err: any, data?: UpdateRecommenderCommandOutput) => void
15011507
): void;
1508+
1509+
/**
1510+
* @see {@link UpdateSolutionCommand}
1511+
*/
1512+
updateSolution(
1513+
args: UpdateSolutionCommandInput,
1514+
options?: __HttpHandlerOptions
1515+
): Promise<UpdateSolutionCommandOutput>;
1516+
updateSolution(args: UpdateSolutionCommandInput, cb: (err: any, data?: UpdateSolutionCommandOutput) => void): void;
1517+
updateSolution(
1518+
args: UpdateSolutionCommandInput,
1519+
options: __HttpHandlerOptions,
1520+
cb: (err: any, data?: UpdateSolutionCommandOutput) => void
1521+
): void;
15021522
}
15031523

15041524
/**

clients/client-personalize/src/PersonalizeClient.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ import {
213213
UpdateMetricAttributionCommandOutput,
214214
} from "./commands/UpdateMetricAttributionCommand";
215215
import { UpdateRecommenderCommandInput, UpdateRecommenderCommandOutput } from "./commands/UpdateRecommenderCommand";
216+
import { UpdateSolutionCommandInput, UpdateSolutionCommandOutput } from "./commands/UpdateSolutionCommand";
216217
import {
217218
ClientInputEndpointParameters,
218219
ClientResolvedEndpointParameters,
@@ -297,7 +298,8 @@ export type ServiceInputTypes =
297298
| UpdateCampaignCommandInput
298299
| UpdateDatasetCommandInput
299300
| UpdateMetricAttributionCommandInput
300-
| UpdateRecommenderCommandInput;
301+
| UpdateRecommenderCommandInput
302+
| UpdateSolutionCommandInput;
301303

302304
/**
303305
* @public
@@ -372,7 +374,8 @@ export type ServiceOutputTypes =
372374
| UpdateCampaignCommandOutput
373375
| UpdateDatasetCommandOutput
374376
| UpdateMetricAttributionCommandOutput
375-
| UpdateRecommenderCommandOutput;
377+
| UpdateRecommenderCommandOutput
378+
| UpdateSolutionCommandOutput;
376379

377380
/**
378381
* @public

clients/client-personalize/src/commands/CreateSolutionCommand.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ export interface CreateSolutionCommandOutput extends CreateSolutionResponse, __M
2929

3030
/**
3131
* <important>
32-
* <p>After you create a solution, you can’t change its configuration. By default, all new solutions use automatic training. With automatic training, you incur training costs while
33-
* your solution is active. You can't stop automatic training for a solution. To avoid unnecessary costs, make sure to delete the solution when you are finished. For information about training
32+
* <p>By default, all new solutions use automatic training. With automatic training, you incur training costs while
33+
* your solution is active. To avoid unnecessary costs, when you are finished you can
34+
* <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_UpdateSolution.html">update the solution</a> to turn off automatic training.
35+
* For information about training
3436
* costs, see <a href="https://aws.amazon.com/personalize/pricing/">Amazon Personalize pricing</a>.</p>
3537
* </important>
3638
* <p>Creates the configuration for training a model (creating a solution version). This configuration
@@ -39,7 +41,7 @@ export interface CreateSolutionCommandOutput extends CreateSolutionResponse, __M
3941
* </p>
4042
* <p>
4143
* By default, new solutions use automatic training to create solution versions every 7 days. You can change the training frequency.
42-
* Automatic solution version creation starts one hour after the solution is ACTIVE. If you manually create a solution version within
44+
* Automatic solution version creation starts within one hour after the solution is ACTIVE. If you manually create a solution version within
4345
* the hour, the solution skips the first automatic training. For more information,
4446
* see <a href="https://docs.aws.amazon.com/personalize/latest/dg/solution-config-auto-training.html">Configuring automatic training</a>.</p>
4547
* <p>
@@ -78,6 +80,11 @@ export interface CreateSolutionCommandOutput extends CreateSolutionResponse, __M
7880
* <ul>
7981
* <li>
8082
* <p>
83+
* <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_UpdateSolution.html">UpdateSolution</a>
84+
* </p>
85+
* </li>
86+
* <li>
87+
* <p>
8188
* <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_ListSolutions.html">ListSolutions</a>
8289
* </p>
8390
* </li>

clients/client-personalize/src/commands/DescribeSolutionCommand.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,18 @@ export interface DescribeSolutionCommandOutput extends DescribeSolutionResponse,
130130
* // lastUpdatedDateTime: new Date("TIMESTAMP"),
131131
* // failureReason: "STRING_VALUE",
132132
* // },
133+
* // latestSolutionUpdate: { // SolutionUpdateSummary
134+
* // solutionUpdateConfig: { // SolutionUpdateConfig
135+
* // autoTrainingConfig: {
136+
* // schedulingExpression: "STRING_VALUE",
137+
* // },
138+
* // },
139+
* // status: "STRING_VALUE",
140+
* // performAutoTraining: true || false,
141+
* // creationDateTime: new Date("TIMESTAMP"),
142+
* // lastUpdatedDateTime: new Date("TIMESTAMP"),
143+
* // failureReason: "STRING_VALUE",
144+
* // },
133145
* // },
134146
* // };
135147
*
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
// smithy-typescript generated code
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { Command as $Command } from "@smithy/smithy-client";
5+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
6+
7+
import { commonParams } from "../endpoint/EndpointParameters";
8+
import { UpdateSolutionRequest, UpdateSolutionResponse } from "../models/models_0";
9+
import { PersonalizeClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../PersonalizeClient";
10+
import { de_UpdateSolutionCommand, se_UpdateSolutionCommand } from "../protocols/Aws_json1_1";
11+
12+
/**
13+
* @public
14+
*/
15+
export type { __MetadataBearer };
16+
export { $Command };
17+
/**
18+
* @public
19+
*
20+
* The input for {@link UpdateSolutionCommand}.
21+
*/
22+
export interface UpdateSolutionCommandInput extends UpdateSolutionRequest {}
23+
/**
24+
* @public
25+
*
26+
* The output of {@link UpdateSolutionCommand}.
27+
*/
28+
export interface UpdateSolutionCommandOutput extends UpdateSolutionResponse, __MetadataBearer {}
29+
30+
/**
31+
* <p>Updates an Amazon Personalize solution to use a different automatic training configuration. When you update a solution,
32+
* you can change whether the solution uses
33+
* automatic training, and you can change the training frequency. For more information about updating a solution, see
34+
* <a href="https://docs.aws.amazon.com/personalize/latest/dg/updating-solution.html">Updating a solution</a>.</p>
35+
* <p>A solution update can be in one of the
36+
* following states:</p>
37+
* <p>CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED</p>
38+
* <p>To get the status of a solution update, call the
39+
* <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_DescribeSolution.html">DescribeSolution</a> API operation and find the status
40+
* in the <code>latestSolutionUpdate</code>. </p>
41+
* @example
42+
* Use a bare-bones client and the command you need to make an API call.
43+
* ```javascript
44+
* import { PersonalizeClient, UpdateSolutionCommand } from "@aws-sdk/client-personalize"; // ES Modules import
45+
* // const { PersonalizeClient, UpdateSolutionCommand } = require("@aws-sdk/client-personalize"); // CommonJS import
46+
* const client = new PersonalizeClient(config);
47+
* const input = { // UpdateSolutionRequest
48+
* solutionArn: "STRING_VALUE", // required
49+
* performAutoTraining: true || false,
50+
* solutionUpdateConfig: { // SolutionUpdateConfig
51+
* autoTrainingConfig: { // AutoTrainingConfig
52+
* schedulingExpression: "STRING_VALUE",
53+
* },
54+
* },
55+
* };
56+
* const command = new UpdateSolutionCommand(input);
57+
* const response = await client.send(command);
58+
* // { // UpdateSolutionResponse
59+
* // solutionArn: "STRING_VALUE",
60+
* // };
61+
*
62+
* ```
63+
*
64+
* @param UpdateSolutionCommandInput - {@link UpdateSolutionCommandInput}
65+
* @returns {@link UpdateSolutionCommandOutput}
66+
* @see {@link UpdateSolutionCommandInput} for command's `input` shape.
67+
* @see {@link UpdateSolutionCommandOutput} for command's `response` shape.
68+
* @see {@link PersonalizeClientResolvedConfig | config} for PersonalizeClient's `config` shape.
69+
*
70+
* @throws {@link InvalidInputException} (client fault)
71+
* <p>Provide a valid value for the field or parameter.</p>
72+
*
73+
* @throws {@link LimitExceededException} (client fault)
74+
* <p>The limit on the number of requests per second has been exceeded.</p>
75+
*
76+
* @throws {@link ResourceInUseException} (client fault)
77+
* <p>The specified resource is in use.</p>
78+
*
79+
* @throws {@link ResourceNotFoundException} (client fault)
80+
* <p>Could not find the specified resource.</p>
81+
*
82+
* @throws {@link PersonalizeServiceException}
83+
* <p>Base exception class for all service exceptions from Personalize service.</p>
84+
*
85+
* @public
86+
*/
87+
export class UpdateSolutionCommand extends $Command
88+
.classBuilder<
89+
UpdateSolutionCommandInput,
90+
UpdateSolutionCommandOutput,
91+
PersonalizeClientResolvedConfig,
92+
ServiceInputTypes,
93+
ServiceOutputTypes
94+
>()
95+
.ep({
96+
...commonParams,
97+
})
98+
.m(function (this: any, Command: any, cs: any, config: PersonalizeClientResolvedConfig, o: any) {
99+
return [
100+
getSerdePlugin(config, this.serialize, this.deserialize),
101+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
102+
];
103+
})
104+
.s("AmazonPersonalize", "UpdateSolution", {})
105+
.n("PersonalizeClient", "UpdateSolutionCommand")
106+
.f(void 0, void 0)
107+
.ser(se_UpdateSolutionCommand)
108+
.de(de_UpdateSolutionCommand)
109+
.build() {}

clients/client-personalize/src/commands/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,4 @@ export * from "./UpdateCampaignCommand";
6969
export * from "./UpdateDatasetCommand";
7070
export * from "./UpdateMetricAttributionCommand";
7171
export * from "./UpdateRecommenderCommand";
72+
export * from "./UpdateSolutionCommand";

0 commit comments

Comments
 (0)