-
Notifications
You must be signed in to change notification settings - Fork 588
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client-sfn): Add new ValidateStateMachineDefinition operation, w…
…hich performs syntax checking on the definition of a Amazon States Language (ASL) state machine.
- Loading branch information
awstools
committed
Apr 25, 2024
1 parent
75febc1
commit b73ebff
Showing
9 changed files
with
465 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
122 changes: 122 additions & 0 deletions
122
clients/client-sfn/src/commands/ValidateStateMachineDefinitionCommand.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
// 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 { | ||
ValidateStateMachineDefinitionInput, | ||
ValidateStateMachineDefinitionInputFilterSensitiveLog, | ||
ValidateStateMachineDefinitionOutput, | ||
} from "../models/models_0"; | ||
import { | ||
de_ValidateStateMachineDefinitionCommand, | ||
se_ValidateStateMachineDefinitionCommand, | ||
} from "../protocols/Aws_json1_0"; | ||
import { ServiceInputTypes, ServiceOutputTypes, SFNClientResolvedConfig } from "../SFNClient"; | ||
|
||
/** | ||
* @public | ||
*/ | ||
export { __MetadataBearer, $Command }; | ||
/** | ||
* @public | ||
* | ||
* The input for {@link ValidateStateMachineDefinitionCommand}. | ||
*/ | ||
export interface ValidateStateMachineDefinitionCommandInput extends ValidateStateMachineDefinitionInput {} | ||
/** | ||
* @public | ||
* | ||
* The output of {@link ValidateStateMachineDefinitionCommand}. | ||
*/ | ||
export interface ValidateStateMachineDefinitionCommandOutput | ||
extends ValidateStateMachineDefinitionOutput, | ||
__MetadataBearer {} | ||
|
||
/** | ||
* <p>Validates the syntax of a state machine definition.</p> | ||
* <p>You can validate that a state machine definition is correct without | ||
* creating a state machine resource. Step Functions will implicitly perform the same | ||
* syntax check when you invoke <code>CreateStateMachine</code> and | ||
* <code>UpdateStateMachine</code>. State machine definitions are specified using a | ||
* JSON-based, structured language. For more information on Amazon States Language see <a href="https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html">Amazon States Language</a> (ASL). </p> | ||
* <p>Suggested uses for <code>ValidateStateMachineDefinition</code>:</p> | ||
* <ul> | ||
* <li> | ||
* <p>Integrate automated checks into your code review or Continuous Integration | ||
* (CI) process to validate state machine definitions before starting | ||
* deployments.</p> | ||
* </li> | ||
* <li> | ||
* <p>Run the validation from a Git pre-commit hook to check your state machine | ||
* definitions before committing them to your source repository.</p> | ||
* </li> | ||
* </ul> | ||
* <note> | ||
* <p>Errors found in the state machine definition will be returned in the response as a list of <b>diagnostic elements</b>, rather than raise an exception.</p> | ||
* </note> | ||
* @example | ||
* Use a bare-bones client and the command you need to make an API call. | ||
* ```javascript | ||
* import { SFNClient, ValidateStateMachineDefinitionCommand } from "@aws-sdk/client-sfn"; // ES Modules import | ||
* // const { SFNClient, ValidateStateMachineDefinitionCommand } = require("@aws-sdk/client-sfn"); // CommonJS import | ||
* const client = new SFNClient(config); | ||
* const input = { // ValidateStateMachineDefinitionInput | ||
* definition: "STRING_VALUE", // required | ||
* type: "STANDARD" || "EXPRESS", | ||
* }; | ||
* const command = new ValidateStateMachineDefinitionCommand(input); | ||
* const response = await client.send(command); | ||
* // { // ValidateStateMachineDefinitionOutput | ||
* // result: "OK" || "FAIL", // required | ||
* // diagnostics: [ // ValidateStateMachineDefinitionDiagnosticList // required | ||
* // { // ValidateStateMachineDefinitionDiagnostic | ||
* // severity: "ERROR", // required | ||
* // code: "STRING_VALUE", // required | ||
* // message: "STRING_VALUE", // required | ||
* // location: "STRING_VALUE", | ||
* // }, | ||
* // ], | ||
* // }; | ||
* | ||
* ``` | ||
* | ||
* @param ValidateStateMachineDefinitionCommandInput - {@link ValidateStateMachineDefinitionCommandInput} | ||
* @returns {@link ValidateStateMachineDefinitionCommandOutput} | ||
* @see {@link ValidateStateMachineDefinitionCommandInput} for command's `input` shape. | ||
* @see {@link ValidateStateMachineDefinitionCommandOutput} for command's `response` shape. | ||
* @see {@link SFNClientResolvedConfig | config} for SFNClient's `config` shape. | ||
* | ||
* @throws {@link ValidationException} (client fault) | ||
* <p>The input does not satisfy the constraints specified by an Amazon Web Services service.</p> | ||
* | ||
* @throws {@link SFNServiceException} | ||
* <p>Base exception class for all service exceptions from SFN service.</p> | ||
* | ||
* @public | ||
*/ | ||
export class ValidateStateMachineDefinitionCommand extends $Command | ||
.classBuilder< | ||
ValidateStateMachineDefinitionCommandInput, | ||
ValidateStateMachineDefinitionCommandOutput, | ||
SFNClientResolvedConfig, | ||
ServiceInputTypes, | ||
ServiceOutputTypes | ||
>() | ||
.ep({ | ||
...commonParams, | ||
}) | ||
.m(function (this: any, Command: any, cs: any, config: SFNClientResolvedConfig, o: any) { | ||
return [ | ||
getSerdePlugin(config, this.serialize, this.deserialize), | ||
getEndpointPlugin(config, Command.getEndpointParameterInstructions()), | ||
]; | ||
}) | ||
.s("AWSStepFunctions", "ValidateStateMachineDefinition", {}) | ||
.n("SFNClient", "ValidateStateMachineDefinitionCommand") | ||
.f(ValidateStateMachineDefinitionInputFilterSensitiveLog, void 0) | ||
.ser(se_ValidateStateMachineDefinitionCommand) | ||
.de(de_ValidateStateMachineDefinitionCommand) | ||
.build() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.