diff --git a/clients/client-fis/README.md b/clients/client-fis/README.md index f086de9e92f0..c3fa7986ba8e 100644 --- a/clients/client-fis/README.md +++ b/clients/client-fis/README.md @@ -267,6 +267,14 @@ GetExperimentTemplate [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/fis/command/GetExperimentTemplateCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-fis/Interface/GetExperimentTemplateCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-fis/Interface/GetExperimentTemplateCommandOutput/) + +
+ +GetSafetyLever + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/fis/command/GetSafetyLeverCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-fis/Interface/GetSafetyLeverCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-fis/Interface/GetSafetyLeverCommandOutput/) +
@@ -387,6 +395,14 @@ UpdateExperimentTemplate [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/fis/command/UpdateExperimentTemplateCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-fis/Interface/UpdateExperimentTemplateCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-fis/Interface/UpdateExperimentTemplateCommandOutput/) +
+
+ +UpdateSafetyLeverState + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/fis/command/UpdateSafetyLeverStateCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-fis/Interface/UpdateSafetyLeverStateCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-fis/Interface/UpdateSafetyLeverStateCommandOutput/) +
diff --git a/clients/client-fis/src/Fis.ts b/clients/client-fis/src/Fis.ts index a63ad5b2aa22..0e0c2806d624 100644 --- a/clients/client-fis/src/Fis.ts +++ b/clients/client-fis/src/Fis.ts @@ -38,6 +38,11 @@ import { GetExperimentTemplateCommandInput, GetExperimentTemplateCommandOutput, } from "./commands/GetExperimentTemplateCommand"; +import { + GetSafetyLeverCommand, + GetSafetyLeverCommandInput, + GetSafetyLeverCommandOutput, +} from "./commands/GetSafetyLeverCommand"; import { GetTargetAccountConfigurationCommand, GetTargetAccountConfigurationCommandInput, @@ -105,6 +110,11 @@ import { UpdateExperimentTemplateCommandInput, UpdateExperimentTemplateCommandOutput, } from "./commands/UpdateExperimentTemplateCommand"; +import { + UpdateSafetyLeverStateCommand, + UpdateSafetyLeverStateCommandInput, + UpdateSafetyLeverStateCommandOutput, +} from "./commands/UpdateSafetyLeverStateCommand"; import { UpdateTargetAccountConfigurationCommand, UpdateTargetAccountConfigurationCommandInput, @@ -121,6 +131,7 @@ const commands = { GetExperimentCommand, GetExperimentTargetAccountConfigurationCommand, GetExperimentTemplateCommand, + GetSafetyLeverCommand, GetTargetAccountConfigurationCommand, GetTargetResourceTypeCommand, ListActionsCommand, @@ -136,6 +147,7 @@ const commands = { TagResourceCommand, UntagResourceCommand, UpdateExperimentTemplateCommand, + UpdateSafetyLeverStateCommand, UpdateTargetAccountConfigurationCommand, }; @@ -264,6 +276,20 @@ export interface Fis { cb: (err: any, data?: GetExperimentTemplateCommandOutput) => void ): void; + /** + * @see {@link GetSafetyLeverCommand} + */ + getSafetyLever( + args: GetSafetyLeverCommandInput, + options?: __HttpHandlerOptions + ): Promise; + getSafetyLever(args: GetSafetyLeverCommandInput, cb: (err: any, data?: GetSafetyLeverCommandOutput) => void): void; + getSafetyLever( + args: GetSafetyLeverCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetSafetyLeverCommandOutput) => void + ): void; + /** * @see {@link GetTargetAccountConfigurationCommand} */ @@ -496,6 +522,23 @@ export interface Fis { cb: (err: any, data?: UpdateExperimentTemplateCommandOutput) => void ): void; + /** + * @see {@link UpdateSafetyLeverStateCommand} + */ + updateSafetyLeverState( + args: UpdateSafetyLeverStateCommandInput, + options?: __HttpHandlerOptions + ): Promise; + updateSafetyLeverState( + args: UpdateSafetyLeverStateCommandInput, + cb: (err: any, data?: UpdateSafetyLeverStateCommandOutput) => void + ): void; + updateSafetyLeverState( + args: UpdateSafetyLeverStateCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UpdateSafetyLeverStateCommandOutput) => void + ): void; + /** * @see {@link UpdateTargetAccountConfigurationCommand} */ diff --git a/clients/client-fis/src/FisClient.ts b/clients/client-fis/src/FisClient.ts index 4758e3a66c43..ec24a4fad569 100644 --- a/clients/client-fis/src/FisClient.ts +++ b/clients/client-fis/src/FisClient.ts @@ -79,6 +79,7 @@ import { GetExperimentTemplateCommandInput, GetExperimentTemplateCommandOutput, } from "./commands/GetExperimentTemplateCommand"; +import { GetSafetyLeverCommandInput, GetSafetyLeverCommandOutput } from "./commands/GetSafetyLeverCommand"; import { GetTargetAccountConfigurationCommandInput, GetTargetAccountConfigurationCommandOutput, @@ -121,6 +122,10 @@ import { UpdateExperimentTemplateCommandInput, UpdateExperimentTemplateCommandOutput, } from "./commands/UpdateExperimentTemplateCommand"; +import { + UpdateSafetyLeverStateCommandInput, + UpdateSafetyLeverStateCommandOutput, +} from "./commands/UpdateSafetyLeverStateCommand"; import { UpdateTargetAccountConfigurationCommandInput, UpdateTargetAccountConfigurationCommandOutput, @@ -148,6 +153,7 @@ export type ServiceInputTypes = | GetExperimentCommandInput | GetExperimentTargetAccountConfigurationCommandInput | GetExperimentTemplateCommandInput + | GetSafetyLeverCommandInput | GetTargetAccountConfigurationCommandInput | GetTargetResourceTypeCommandInput | ListActionsCommandInput @@ -163,6 +169,7 @@ export type ServiceInputTypes = | TagResourceCommandInput | UntagResourceCommandInput | UpdateExperimentTemplateCommandInput + | UpdateSafetyLeverStateCommandInput | UpdateTargetAccountConfigurationCommandInput; /** @@ -177,6 +184,7 @@ export type ServiceOutputTypes = | GetExperimentCommandOutput | GetExperimentTargetAccountConfigurationCommandOutput | GetExperimentTemplateCommandOutput + | GetSafetyLeverCommandOutput | GetTargetAccountConfigurationCommandOutput | GetTargetResourceTypeCommandOutput | ListActionsCommandOutput @@ -192,6 +200,7 @@ export type ServiceOutputTypes = | TagResourceCommandOutput | UntagResourceCommandOutput | UpdateExperimentTemplateCommandOutput + | UpdateSafetyLeverStateCommandOutput | UpdateTargetAccountConfigurationCommandOutput; /** diff --git a/clients/client-fis/src/commands/GetExperimentCommand.ts b/clients/client-fis/src/commands/GetExperimentCommand.ts index e62c8a001388..eff898691a04 100644 --- a/clients/client-fis/src/commands/GetExperimentCommand.ts +++ b/clients/client-fis/src/commands/GetExperimentCommand.ts @@ -47,7 +47,7 @@ export interface GetExperimentCommandOutput extends GetExperimentResponse, __Met * // experimentTemplateId: "STRING_VALUE", * // roleArn: "STRING_VALUE", * // state: { // ExperimentState - * // status: "pending" || "initiating" || "running" || "completed" || "stopping" || "stopped" || "failed", + * // status: "pending" || "initiating" || "running" || "completed" || "stopping" || "stopped" || "failed" || "cancelled", * // reason: "STRING_VALUE", * // error: { // ExperimentError * // accountId: "STRING_VALUE", diff --git a/clients/client-fis/src/commands/GetSafetyLeverCommand.ts b/clients/client-fis/src/commands/GetSafetyLeverCommand.ts new file mode 100644 index 000000000000..8d5a6e222856 --- /dev/null +++ b/clients/client-fis/src/commands/GetSafetyLeverCommand.ts @@ -0,0 +1,94 @@ +// 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 { FisClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../FisClient"; +import { GetSafetyLeverRequest, GetSafetyLeverResponse } from "../models/models_0"; +import { de_GetSafetyLeverCommand, se_GetSafetyLeverCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link GetSafetyLeverCommand}. + */ +export interface GetSafetyLeverCommandInput extends GetSafetyLeverRequest {} +/** + * @public + * + * The output of {@link GetSafetyLeverCommand}. + */ +export interface GetSafetyLeverCommandOutput extends GetSafetyLeverResponse, __MetadataBearer {} + +/** + *

+ * Gets information about the specified safety lever. + *

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { FisClient, GetSafetyLeverCommand } from "@aws-sdk/client-fis"; // ES Modules import + * // const { FisClient, GetSafetyLeverCommand } = require("@aws-sdk/client-fis"); // CommonJS import + * const client = new FisClient(config); + * const input = { // GetSafetyLeverRequest + * id: "STRING_VALUE", // required + * }; + * const command = new GetSafetyLeverCommand(input); + * const response = await client.send(command); + * // { // GetSafetyLeverResponse + * // safetyLever: { // SafetyLever + * // id: "STRING_VALUE", + * // arn: "STRING_VALUE", + * // state: { // SafetyLeverState + * // status: "disengaged" || "engaged" || "engaging", + * // reason: "STRING_VALUE", + * // }, + * // }, + * // }; + * + * ``` + * + * @param GetSafetyLeverCommandInput - {@link GetSafetyLeverCommandInput} + * @returns {@link GetSafetyLeverCommandOutput} + * @see {@link GetSafetyLeverCommandInput} for command's `input` shape. + * @see {@link GetSafetyLeverCommandOutput} for command's `response` shape. + * @see {@link FisClientResolvedConfig | config} for FisClient's `config` shape. + * + * @throws {@link ResourceNotFoundException} (client fault) + *

The specified resource cannot be found.

+ * + * @throws {@link FisServiceException} + *

Base exception class for all service exceptions from Fis service.

+ * + * @public + */ +export class GetSafetyLeverCommand extends $Command + .classBuilder< + GetSafetyLeverCommandInput, + GetSafetyLeverCommandOutput, + FisClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep({ + ...commonParams, + }) + .m(function (this: any, Command: any, cs: any, config: FisClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("FaultInjectionSimulator", "GetSafetyLever", {}) + .n("FisClient", "GetSafetyLeverCommand") + .f(void 0, void 0) + .ser(se_GetSafetyLeverCommand) + .de(de_GetSafetyLeverCommand) + .build() {} diff --git a/clients/client-fis/src/commands/ListExperimentsCommand.ts b/clients/client-fis/src/commands/ListExperimentsCommand.ts index 9568fc21d6cc..ccf60b00d016 100644 --- a/clients/client-fis/src/commands/ListExperimentsCommand.ts +++ b/clients/client-fis/src/commands/ListExperimentsCommand.ts @@ -49,7 +49,7 @@ export interface ListExperimentsCommandOutput extends ListExperimentsResponse, _ * // arn: "STRING_VALUE", * // experimentTemplateId: "STRING_VALUE", * // state: { // ExperimentState - * // status: "pending" || "initiating" || "running" || "completed" || "stopping" || "stopped" || "failed", + * // status: "pending" || "initiating" || "running" || "completed" || "stopping" || "stopped" || "failed" || "cancelled", * // reason: "STRING_VALUE", * // error: { // ExperimentError * // accountId: "STRING_VALUE", diff --git a/clients/client-fis/src/commands/StartExperimentCommand.ts b/clients/client-fis/src/commands/StartExperimentCommand.ts index c9e5f24146fb..fd8da8328bf4 100644 --- a/clients/client-fis/src/commands/StartExperimentCommand.ts +++ b/clients/client-fis/src/commands/StartExperimentCommand.ts @@ -54,7 +54,7 @@ export interface StartExperimentCommandOutput extends StartExperimentResponse, _ * // experimentTemplateId: "STRING_VALUE", * // roleArn: "STRING_VALUE", * // state: { // ExperimentState - * // status: "pending" || "initiating" || "running" || "completed" || "stopping" || "stopped" || "failed", + * // status: "pending" || "initiating" || "running" || "completed" || "stopping" || "stopped" || "failed" || "cancelled", * // reason: "STRING_VALUE", * // error: { // ExperimentError * // accountId: "STRING_VALUE", diff --git a/clients/client-fis/src/commands/StopExperimentCommand.ts b/clients/client-fis/src/commands/StopExperimentCommand.ts index 973af5e3cd5d..24e6cb64aa18 100644 --- a/clients/client-fis/src/commands/StopExperimentCommand.ts +++ b/clients/client-fis/src/commands/StopExperimentCommand.ts @@ -47,7 +47,7 @@ export interface StopExperimentCommandOutput extends StopExperimentResponse, __M * // experimentTemplateId: "STRING_VALUE", * // roleArn: "STRING_VALUE", * // state: { // ExperimentState - * // status: "pending" || "initiating" || "running" || "completed" || "stopping" || "stopped" || "failed", + * // status: "pending" || "initiating" || "running" || "completed" || "stopping" || "stopped" || "failed" || "cancelled", * // reason: "STRING_VALUE", * // error: { // ExperimentError * // accountId: "STRING_VALUE", diff --git a/clients/client-fis/src/commands/UpdateSafetyLeverStateCommand.ts b/clients/client-fis/src/commands/UpdateSafetyLeverStateCommand.ts new file mode 100644 index 000000000000..9bf7bb140a69 --- /dev/null +++ b/clients/client-fis/src/commands/UpdateSafetyLeverStateCommand.ts @@ -0,0 +1,104 @@ +// 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 { FisClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../FisClient"; +import { UpdateSafetyLeverStateRequest, UpdateSafetyLeverStateResponse } from "../models/models_0"; +import { de_UpdateSafetyLeverStateCommand, se_UpdateSafetyLeverStateCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link UpdateSafetyLeverStateCommand}. + */ +export interface UpdateSafetyLeverStateCommandInput extends UpdateSafetyLeverStateRequest {} +/** + * @public + * + * The output of {@link UpdateSafetyLeverStateCommand}. + */ +export interface UpdateSafetyLeverStateCommandOutput extends UpdateSafetyLeverStateResponse, __MetadataBearer {} + +/** + *

+ * Updates the specified safety lever state. + *

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { FisClient, UpdateSafetyLeverStateCommand } from "@aws-sdk/client-fis"; // ES Modules import + * // const { FisClient, UpdateSafetyLeverStateCommand } = require("@aws-sdk/client-fis"); // CommonJS import + * const client = new FisClient(config); + * const input = { // UpdateSafetyLeverStateRequest + * id: "STRING_VALUE", // required + * state: { // UpdateSafetyLeverStateInput + * status: "disengaged" || "engaged", // required + * reason: "STRING_VALUE", // required + * }, + * }; + * const command = new UpdateSafetyLeverStateCommand(input); + * const response = await client.send(command); + * // { // UpdateSafetyLeverStateResponse + * // safetyLever: { // SafetyLever + * // id: "STRING_VALUE", + * // arn: "STRING_VALUE", + * // state: { // SafetyLeverState + * // status: "disengaged" || "engaged" || "engaging", + * // reason: "STRING_VALUE", + * // }, + * // }, + * // }; + * + * ``` + * + * @param UpdateSafetyLeverStateCommandInput - {@link UpdateSafetyLeverStateCommandInput} + * @returns {@link UpdateSafetyLeverStateCommandOutput} + * @see {@link UpdateSafetyLeverStateCommandInput} for command's `input` shape. + * @see {@link UpdateSafetyLeverStateCommandOutput} for command's `response` shape. + * @see {@link FisClientResolvedConfig | config} for FisClient's `config` shape. + * + * @throws {@link ConflictException} (client fault) + *

The request could not be processed because of a conflict.

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

The specified resource cannot be found.

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

The specified input is not valid, or fails to satisfy the constraints for the request.

+ * + * @throws {@link FisServiceException} + *

Base exception class for all service exceptions from Fis service.

+ * + * @public + */ +export class UpdateSafetyLeverStateCommand extends $Command + .classBuilder< + UpdateSafetyLeverStateCommandInput, + UpdateSafetyLeverStateCommandOutput, + FisClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep({ + ...commonParams, + }) + .m(function (this: any, Command: any, cs: any, config: FisClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("FaultInjectionSimulator", "UpdateSafetyLeverState", {}) + .n("FisClient", "UpdateSafetyLeverStateCommand") + .f(void 0, void 0) + .ser(se_UpdateSafetyLeverStateCommand) + .de(de_UpdateSafetyLeverStateCommand) + .build() {} diff --git a/clients/client-fis/src/commands/index.ts b/clients/client-fis/src/commands/index.ts index 6ad213f1bb07..bafb3456f2ba 100644 --- a/clients/client-fis/src/commands/index.ts +++ b/clients/client-fis/src/commands/index.ts @@ -7,6 +7,7 @@ export * from "./GetActionCommand"; export * from "./GetExperimentCommand"; export * from "./GetExperimentTargetAccountConfigurationCommand"; export * from "./GetExperimentTemplateCommand"; +export * from "./GetSafetyLeverCommand"; export * from "./GetTargetAccountConfigurationCommand"; export * from "./GetTargetResourceTypeCommand"; export * from "./ListActionsCommand"; @@ -22,4 +23,5 @@ export * from "./StopExperimentCommand"; export * from "./TagResourceCommand"; export * from "./UntagResourceCommand"; export * from "./UpdateExperimentTemplateCommand"; +export * from "./UpdateSafetyLeverStateCommand"; export * from "./UpdateTargetAccountConfigurationCommand"; diff --git a/clients/client-fis/src/models/models_0.ts b/clients/client-fis/src/models/models_0.ts index e28bf5fc843c..b7c00b29e321 100644 --- a/clients/client-fis/src/models/models_0.ts +++ b/clients/client-fis/src/models/models_0.ts @@ -1103,6 +1103,7 @@ export interface ExperimentError { * @enum */ export const ExperimentStatus = { + cancelled: "cancelled", completed: "completed", failed: "failed", initiating: "initiating", @@ -1547,6 +1548,103 @@ export interface GetExperimentTemplateResponse { experimentTemplate?: ExperimentTemplate; } +/** + * @public + */ +export interface GetSafetyLeverRequest { + /** + *

+ * The ID of the safety lever. + *

+ * @public + */ + id: string | undefined; +} + +/** + * @public + * @enum + */ +export const SafetyLeverStatus = { + DISENGAGED: "disengaged", + ENGAGED: "engaged", + ENGAGING: "engaging", +} as const; + +/** + * @public + */ +export type SafetyLeverStatus = (typeof SafetyLeverStatus)[keyof typeof SafetyLeverStatus]; + +/** + *

+ * Describes the state of the safety lever. + *

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

+ * The state of the safety lever. + *

+ * @public + */ + status?: SafetyLeverStatus; + + /** + *

+ * The reason for the state of the safety lever. + *

+ * @public + */ + reason?: string; +} + +/** + *

+ * Describes a safety lever. + *

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

+ * The ID of the safety lever. + *

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

+ * The Amazon Resource Name (ARN) of the safety lever. + *

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

+ * The state of the safety lever. + *

+ * @public + */ + state?: SafetyLeverState; +} + +/** + * @public + */ +export interface GetSafetyLeverResponse { + /** + *

+ * Information about the safety lever. + *

+ * @public + */ + safetyLever?: SafetyLever; +} + /** * @public */ @@ -2311,6 +2409,78 @@ export interface UpdateExperimentTemplateResponse { experimentTemplate?: ExperimentTemplate; } +/** + * @public + * @enum + */ +export const SafetyLeverStatusInput = { + DISENGAGED: "disengaged", + ENGAGED: "engaged", +} as const; + +/** + * @public + */ +export type SafetyLeverStatusInput = (typeof SafetyLeverStatusInput)[keyof typeof SafetyLeverStatusInput]; + +/** + *

+ * Specifies a state for a safety lever. + *

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

+ * The updated state of the safety lever. + *

+ * @public + */ + status: SafetyLeverStatusInput | undefined; + + /** + *

+ * The reason for updating the state of the safety lever. + *

+ * @public + */ + reason: string | undefined; +} + +/** + * @public + */ +export interface UpdateSafetyLeverStateRequest { + /** + *

+ * The ID of the safety lever. + *

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

+ * The state of the safety lever. + *

+ * @public + */ + state: UpdateSafetyLeverStateInput | undefined; +} + +/** + * @public + */ +export interface UpdateSafetyLeverStateResponse { + /** + *

+ * Information about the safety lever. + *

+ * @public + */ + safetyLever?: SafetyLever; +} + /** * @public */ diff --git a/clients/client-fis/src/protocols/Aws_restJson1.ts b/clients/client-fis/src/protocols/Aws_restJson1.ts index 228dd7d7ec35..ca8d700d545d 100644 --- a/clients/client-fis/src/protocols/Aws_restJson1.ts +++ b/clients/client-fis/src/protocols/Aws_restJson1.ts @@ -51,6 +51,7 @@ import { GetExperimentTemplateCommandInput, GetExperimentTemplateCommandOutput, } from "../commands/GetExperimentTemplateCommand"; +import { GetSafetyLeverCommandInput, GetSafetyLeverCommandOutput } from "../commands/GetSafetyLeverCommand"; import { GetTargetAccountConfigurationCommandInput, GetTargetAccountConfigurationCommandOutput, @@ -93,6 +94,10 @@ import { UpdateExperimentTemplateCommandInput, UpdateExperimentTemplateCommandOutput, } from "../commands/UpdateExperimentTemplateCommand"; +import { + UpdateSafetyLeverStateCommandInput, + UpdateSafetyLeverStateCommandOutput, +} from "../commands/UpdateSafetyLeverStateCommand"; import { UpdateTargetAccountConfigurationCommandInput, UpdateTargetAccountConfigurationCommandOutput, @@ -121,6 +126,7 @@ import { UpdateExperimentTemplateLogConfigurationInput, UpdateExperimentTemplateStopConditionInput, UpdateExperimentTemplateTargetInput, + UpdateSafetyLeverStateInput, ValidationException, } from "../models/models_0"; @@ -278,6 +284,22 @@ export const se_GetExperimentTemplateCommand = async ( return b.build(); }; +/** + * serializeAws_restJson1GetSafetyLeverCommand + */ +export const se_GetSafetyLeverCommand = async ( + input: GetSafetyLeverCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/safetyLevers/{id}"); + b.p("id", () => input.id!, "{id}", false); + let body: any; + b.m("GET").h(headers).b(body); + return b.build(); +}; + /** * serializeAws_restJson1GetTargetAccountConfigurationCommand */ @@ -576,6 +598,29 @@ export const se_UpdateExperimentTemplateCommand = async ( return b.build(); }; +/** + * serializeAws_restJson1UpdateSafetyLeverStateCommand + */ +export const se_UpdateSafetyLeverStateCommand = async ( + input: UpdateSafetyLeverStateCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/safetyLevers/{id}/state"); + b.p("id", () => input.id!, "{id}", false); + let body: any; + body = JSON.stringify( + take(input, { + state: (_) => _json(_), + }) + ); + b.m("PATCH").h(headers).b(body); + return b.build(); +}; + /** * serializeAws_restJson1UpdateTargetAccountConfigurationCommand */ @@ -769,6 +814,27 @@ export const de_GetExperimentTemplateCommand = async ( return contents; }; +/** + * deserializeAws_restJson1GetSafetyLeverCommand + */ +export const de_GetSafetyLeverCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + safetyLever: _json, + }); + Object.assign(contents, doc); + return contents; +}; + /** * deserializeAws_restJson1GetTargetAccountConfigurationCommand */ @@ -1083,6 +1149,27 @@ export const de_UpdateExperimentTemplateCommand = async ( return contents; }; +/** + * deserializeAws_restJson1UpdateSafetyLeverStateCommand + */ +export const de_UpdateSafetyLeverStateCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + safetyLever: _json, + }); + Object.assign(contents, doc); + return contents; +}; + /** * deserializeAws_restJson1UpdateTargetAccountConfigurationCommand */ @@ -1267,6 +1354,8 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont // se_UpdateExperimentTemplateTargetInputMap omitted. +// se_UpdateSafetyLeverStateInput omitted. + // de_Action omitted. // de_ActionParameter omitted. @@ -1489,6 +1578,10 @@ const de_ExperimentTemplateSummaryList = (output: any, context: __SerdeContext): // de_ResourceArnList omitted. +// de_SafetyLever omitted. + +// de_SafetyLeverState omitted. + // de_TagMap omitted. // de_TargetAccountConfiguration omitted.