aws-sdk-sfn 1.107.0

AWS SDK for AWS Step Functions
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct TestStateInput {
    /// <p>The <a href="https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html">Amazon States Language</a> (ASL) definition of the state or state machine.</p>
    pub definition: ::std::option::Option<::std::string::String>,
    /// <p>The Amazon Resource Name (ARN) of the execution role with the required IAM permissions for the state.</p>
    pub role_arn: ::std::option::Option<::std::string::String>,
    /// <p>A string that contains the JSON input data for the state.</p>
    pub input: ::std::option::Option<::std::string::String>,
    /// <p>Determines the values to return when a state is tested. You can specify one of the following types:</p>
    /// <ul>
    /// <li>
    /// <p><code>INFO</code>: Shows the final state output. By default, Step Functions sets <code>inspectionLevel</code> to <code>INFO</code> if you don't specify a level.</p></li>
    /// <li>
    /// <p><code>DEBUG</code>: Shows the final state output along with the input and output data processing result.</p></li>
    /// <li>
    /// <p><code>TRACE</code>: Shows the HTTP request and response for an HTTP Task. This level also shows the final state output along with the input and output data processing result.</p></li>
    /// </ul>
    /// <p>Each of these levels also provide information about the status of the state execution and the next state to transition to.</p>
    pub inspection_level: ::std::option::Option<crate::types::InspectionLevel>,
    /// <p>Specifies whether or not to include secret information in the test result. For HTTP Tasks, a secret includes the data that an EventBridge connection adds to modify the HTTP request headers, query parameters, and body. Step Functions doesn't omit any information included in the state definition or the HTTP response.</p>
    /// <p>If you set <code>revealSecrets</code> to <code>true</code>, you must make sure that the IAM user that calls the <code>TestState</code> API has permission for the <code>states:RevealSecrets</code> action. For an example of IAM policy that sets the <code>states:RevealSecrets</code> permission, see <a href="https://docs.aws.amazon.com/step-functions/latest/dg/test-state-isolation.html#test-state-permissions">IAM permissions to test a state</a>. Without this permission, Step Functions throws an access denied error.</p>
    /// <p>By default, <code>revealSecrets</code> is set to <code>false</code>.</p>
    pub reveal_secrets: ::std::option::Option<bool>,
    /// <p>JSON object literal that sets variables used in the state under test. Object keys are the variable names and values are the variable values.</p>
    pub variables: ::std::option::Option<::std::string::String>,
    /// <p>Denotes the particular state within a state machine definition to be tested. If this field is specified, the <code>definition</code> must contain a fully-formed state machine definition.</p>
    pub state_name: ::std::option::Option<::std::string::String>,
    /// <p>Defines a mocked result or error for the state under test.</p>
    /// <p>A mock can only be specified for Task, Map, or Parallel states. If it is specified for another state type, an exception will be thrown.</p>
    pub mock: ::std::option::Option<crate::types::MockInput>,
    /// <p>A JSON string representing a valid Context object for the state under test. This field may only be specified if a mock is specified in the same request.</p>
    pub context: ::std::option::Option<::std::string::String>,
    /// <p>Contains configurations for the state under test.</p>
    pub state_configuration: ::std::option::Option<crate::types::TestStateConfiguration>,
}
impl TestStateInput {
    /// <p>The <a href="https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html">Amazon States Language</a> (ASL) definition of the state or state machine.</p>
    pub fn definition(&self) -> ::std::option::Option<&str> {
        self.definition.as_deref()
    }
    /// <p>The Amazon Resource Name (ARN) of the execution role with the required IAM permissions for the state.</p>
    pub fn role_arn(&self) -> ::std::option::Option<&str> {
        self.role_arn.as_deref()
    }
    /// <p>A string that contains the JSON input data for the state.</p>
    pub fn input(&self) -> ::std::option::Option<&str> {
        self.input.as_deref()
    }
    /// <p>Determines the values to return when a state is tested. You can specify one of the following types:</p>
    /// <ul>
    /// <li>
    /// <p><code>INFO</code>: Shows the final state output. By default, Step Functions sets <code>inspectionLevel</code> to <code>INFO</code> if you don't specify a level.</p></li>
    /// <li>
    /// <p><code>DEBUG</code>: Shows the final state output along with the input and output data processing result.</p></li>
    /// <li>
    /// <p><code>TRACE</code>: Shows the HTTP request and response for an HTTP Task. This level also shows the final state output along with the input and output data processing result.</p></li>
    /// </ul>
    /// <p>Each of these levels also provide information about the status of the state execution and the next state to transition to.</p>
    pub fn inspection_level(&self) -> ::std::option::Option<&crate::types::InspectionLevel> {
        self.inspection_level.as_ref()
    }
    /// <p>Specifies whether or not to include secret information in the test result. For HTTP Tasks, a secret includes the data that an EventBridge connection adds to modify the HTTP request headers, query parameters, and body. Step Functions doesn't omit any information included in the state definition or the HTTP response.</p>
    /// <p>If you set <code>revealSecrets</code> to <code>true</code>, you must make sure that the IAM user that calls the <code>TestState</code> API has permission for the <code>states:RevealSecrets</code> action. For an example of IAM policy that sets the <code>states:RevealSecrets</code> permission, see <a href="https://docs.aws.amazon.com/step-functions/latest/dg/test-state-isolation.html#test-state-permissions">IAM permissions to test a state</a>. Without this permission, Step Functions throws an access denied error.</p>
    /// <p>By default, <code>revealSecrets</code> is set to <code>false</code>.</p>
    pub fn reveal_secrets(&self) -> ::std::option::Option<bool> {
        self.reveal_secrets
    }
    /// <p>JSON object literal that sets variables used in the state under test. Object keys are the variable names and values are the variable values.</p>
    pub fn variables(&self) -> ::std::option::Option<&str> {
        self.variables.as_deref()
    }
    /// <p>Denotes the particular state within a state machine definition to be tested. If this field is specified, the <code>definition</code> must contain a fully-formed state machine definition.</p>
    pub fn state_name(&self) -> ::std::option::Option<&str> {
        self.state_name.as_deref()
    }
    /// <p>Defines a mocked result or error for the state under test.</p>
    /// <p>A mock can only be specified for Task, Map, or Parallel states. If it is specified for another state type, an exception will be thrown.</p>
    pub fn mock(&self) -> ::std::option::Option<&crate::types::MockInput> {
        self.mock.as_ref()
    }
    /// <p>A JSON string representing a valid Context object for the state under test. This field may only be specified if a mock is specified in the same request.</p>
    pub fn context(&self) -> ::std::option::Option<&str> {
        self.context.as_deref()
    }
    /// <p>Contains configurations for the state under test.</p>
    pub fn state_configuration(&self) -> ::std::option::Option<&crate::types::TestStateConfiguration> {
        self.state_configuration.as_ref()
    }
}
impl ::std::fmt::Debug for TestStateInput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("TestStateInput");
        formatter.field("definition", &"*** Sensitive Data Redacted ***");
        formatter.field("role_arn", &self.role_arn);
        formatter.field("input", &"*** Sensitive Data Redacted ***");
        formatter.field("inspection_level", &self.inspection_level);
        formatter.field("reveal_secrets", &self.reveal_secrets);
        formatter.field("variables", &"*** Sensitive Data Redacted ***");
        formatter.field("state_name", &"*** Sensitive Data Redacted ***");
        formatter.field("mock", &self.mock);
        formatter.field("context", &"*** Sensitive Data Redacted ***");
        formatter.field("state_configuration", &self.state_configuration);
        formatter.finish()
    }
}
impl TestStateInput {
    /// Creates a new builder-style object to manufacture [`TestStateInput`](crate::operation::test_state::TestStateInput).
    pub fn builder() -> crate::operation::test_state::builders::TestStateInputBuilder {
        crate::operation::test_state::builders::TestStateInputBuilder::default()
    }
}

/// A builder for [`TestStateInput`](crate::operation::test_state::TestStateInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct TestStateInputBuilder {
    pub(crate) definition: ::std::option::Option<::std::string::String>,
    pub(crate) role_arn: ::std::option::Option<::std::string::String>,
    pub(crate) input: ::std::option::Option<::std::string::String>,
    pub(crate) inspection_level: ::std::option::Option<crate::types::InspectionLevel>,
    pub(crate) reveal_secrets: ::std::option::Option<bool>,
    pub(crate) variables: ::std::option::Option<::std::string::String>,
    pub(crate) state_name: ::std::option::Option<::std::string::String>,
    pub(crate) mock: ::std::option::Option<crate::types::MockInput>,
    pub(crate) context: ::std::option::Option<::std::string::String>,
    pub(crate) state_configuration: ::std::option::Option<crate::types::TestStateConfiguration>,
}
impl TestStateInputBuilder {
    /// <p>The <a href="https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html">Amazon States Language</a> (ASL) definition of the state or state machine.</p>
    /// This field is required.
    pub fn definition(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.definition = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The <a href="https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html">Amazon States Language</a> (ASL) definition of the state or state machine.</p>
    pub fn set_definition(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.definition = input;
        self
    }
    /// <p>The <a href="https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html">Amazon States Language</a> (ASL) definition of the state or state machine.</p>
    pub fn get_definition(&self) -> &::std::option::Option<::std::string::String> {
        &self.definition
    }
    /// <p>The Amazon Resource Name (ARN) of the execution role with the required IAM permissions for the state.</p>
    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.role_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the execution role with the required IAM permissions for the state.</p>
    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.role_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the execution role with the required IAM permissions for the state.</p>
    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.role_arn
    }
    /// <p>A string that contains the JSON input data for the state.</p>
    pub fn input(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.input = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A string that contains the JSON input data for the state.</p>
    pub fn set_input(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.input = input;
        self
    }
    /// <p>A string that contains the JSON input data for the state.</p>
    pub fn get_input(&self) -> &::std::option::Option<::std::string::String> {
        &self.input
    }
    /// <p>Determines the values to return when a state is tested. You can specify one of the following types:</p>
    /// <ul>
    /// <li>
    /// <p><code>INFO</code>: Shows the final state output. By default, Step Functions sets <code>inspectionLevel</code> to <code>INFO</code> if you don't specify a level.</p></li>
    /// <li>
    /// <p><code>DEBUG</code>: Shows the final state output along with the input and output data processing result.</p></li>
    /// <li>
    /// <p><code>TRACE</code>: Shows the HTTP request and response for an HTTP Task. This level also shows the final state output along with the input and output data processing result.</p></li>
    /// </ul>
    /// <p>Each of these levels also provide information about the status of the state execution and the next state to transition to.</p>
    pub fn inspection_level(mut self, input: crate::types::InspectionLevel) -> Self {
        self.inspection_level = ::std::option::Option::Some(input);
        self
    }
    /// <p>Determines the values to return when a state is tested. You can specify one of the following types:</p>
    /// <ul>
    /// <li>
    /// <p><code>INFO</code>: Shows the final state output. By default, Step Functions sets <code>inspectionLevel</code> to <code>INFO</code> if you don't specify a level.</p></li>
    /// <li>
    /// <p><code>DEBUG</code>: Shows the final state output along with the input and output data processing result.</p></li>
    /// <li>
    /// <p><code>TRACE</code>: Shows the HTTP request and response for an HTTP Task. This level also shows the final state output along with the input and output data processing result.</p></li>
    /// </ul>
    /// <p>Each of these levels also provide information about the status of the state execution and the next state to transition to.</p>
    pub fn set_inspection_level(mut self, input: ::std::option::Option<crate::types::InspectionLevel>) -> Self {
        self.inspection_level = input;
        self
    }
    /// <p>Determines the values to return when a state is tested. You can specify one of the following types:</p>
    /// <ul>
    /// <li>
    /// <p><code>INFO</code>: Shows the final state output. By default, Step Functions sets <code>inspectionLevel</code> to <code>INFO</code> if you don't specify a level.</p></li>
    /// <li>
    /// <p><code>DEBUG</code>: Shows the final state output along with the input and output data processing result.</p></li>
    /// <li>
    /// <p><code>TRACE</code>: Shows the HTTP request and response for an HTTP Task. This level also shows the final state output along with the input and output data processing result.</p></li>
    /// </ul>
    /// <p>Each of these levels also provide information about the status of the state execution and the next state to transition to.</p>
    pub fn get_inspection_level(&self) -> &::std::option::Option<crate::types::InspectionLevel> {
        &self.inspection_level
    }
    /// <p>Specifies whether or not to include secret information in the test result. For HTTP Tasks, a secret includes the data that an EventBridge connection adds to modify the HTTP request headers, query parameters, and body. Step Functions doesn't omit any information included in the state definition or the HTTP response.</p>
    /// <p>If you set <code>revealSecrets</code> to <code>true</code>, you must make sure that the IAM user that calls the <code>TestState</code> API has permission for the <code>states:RevealSecrets</code> action. For an example of IAM policy that sets the <code>states:RevealSecrets</code> permission, see <a href="https://docs.aws.amazon.com/step-functions/latest/dg/test-state-isolation.html#test-state-permissions">IAM permissions to test a state</a>. Without this permission, Step Functions throws an access denied error.</p>
    /// <p>By default, <code>revealSecrets</code> is set to <code>false</code>.</p>
    pub fn reveal_secrets(mut self, input: bool) -> Self {
        self.reveal_secrets = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies whether or not to include secret information in the test result. For HTTP Tasks, a secret includes the data that an EventBridge connection adds to modify the HTTP request headers, query parameters, and body. Step Functions doesn't omit any information included in the state definition or the HTTP response.</p>
    /// <p>If you set <code>revealSecrets</code> to <code>true</code>, you must make sure that the IAM user that calls the <code>TestState</code> API has permission for the <code>states:RevealSecrets</code> action. For an example of IAM policy that sets the <code>states:RevealSecrets</code> permission, see <a href="https://docs.aws.amazon.com/step-functions/latest/dg/test-state-isolation.html#test-state-permissions">IAM permissions to test a state</a>. Without this permission, Step Functions throws an access denied error.</p>
    /// <p>By default, <code>revealSecrets</code> is set to <code>false</code>.</p>
    pub fn set_reveal_secrets(mut self, input: ::std::option::Option<bool>) -> Self {
        self.reveal_secrets = input;
        self
    }
    /// <p>Specifies whether or not to include secret information in the test result. For HTTP Tasks, a secret includes the data that an EventBridge connection adds to modify the HTTP request headers, query parameters, and body. Step Functions doesn't omit any information included in the state definition or the HTTP response.</p>
    /// <p>If you set <code>revealSecrets</code> to <code>true</code>, you must make sure that the IAM user that calls the <code>TestState</code> API has permission for the <code>states:RevealSecrets</code> action. For an example of IAM policy that sets the <code>states:RevealSecrets</code> permission, see <a href="https://docs.aws.amazon.com/step-functions/latest/dg/test-state-isolation.html#test-state-permissions">IAM permissions to test a state</a>. Without this permission, Step Functions throws an access denied error.</p>
    /// <p>By default, <code>revealSecrets</code> is set to <code>false</code>.</p>
    pub fn get_reveal_secrets(&self) -> &::std::option::Option<bool> {
        &self.reveal_secrets
    }
    /// <p>JSON object literal that sets variables used in the state under test. Object keys are the variable names and values are the variable values.</p>
    pub fn variables(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.variables = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>JSON object literal that sets variables used in the state under test. Object keys are the variable names and values are the variable values.</p>
    pub fn set_variables(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.variables = input;
        self
    }
    /// <p>JSON object literal that sets variables used in the state under test. Object keys are the variable names and values are the variable values.</p>
    pub fn get_variables(&self) -> &::std::option::Option<::std::string::String> {
        &self.variables
    }
    /// <p>Denotes the particular state within a state machine definition to be tested. If this field is specified, the <code>definition</code> must contain a fully-formed state machine definition.</p>
    pub fn state_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.state_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Denotes the particular state within a state machine definition to be tested. If this field is specified, the <code>definition</code> must contain a fully-formed state machine definition.</p>
    pub fn set_state_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.state_name = input;
        self
    }
    /// <p>Denotes the particular state within a state machine definition to be tested. If this field is specified, the <code>definition</code> must contain a fully-formed state machine definition.</p>
    pub fn get_state_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.state_name
    }
    /// <p>Defines a mocked result or error for the state under test.</p>
    /// <p>A mock can only be specified for Task, Map, or Parallel states. If it is specified for another state type, an exception will be thrown.</p>
    pub fn mock(mut self, input: crate::types::MockInput) -> Self {
        self.mock = ::std::option::Option::Some(input);
        self
    }
    /// <p>Defines a mocked result or error for the state under test.</p>
    /// <p>A mock can only be specified for Task, Map, or Parallel states. If it is specified for another state type, an exception will be thrown.</p>
    pub fn set_mock(mut self, input: ::std::option::Option<crate::types::MockInput>) -> Self {
        self.mock = input;
        self
    }
    /// <p>Defines a mocked result or error for the state under test.</p>
    /// <p>A mock can only be specified for Task, Map, or Parallel states. If it is specified for another state type, an exception will be thrown.</p>
    pub fn get_mock(&self) -> &::std::option::Option<crate::types::MockInput> {
        &self.mock
    }
    /// <p>A JSON string representing a valid Context object for the state under test. This field may only be specified if a mock is specified in the same request.</p>
    pub fn context(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.context = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A JSON string representing a valid Context object for the state under test. This field may only be specified if a mock is specified in the same request.</p>
    pub fn set_context(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.context = input;
        self
    }
    /// <p>A JSON string representing a valid Context object for the state under test. This field may only be specified if a mock is specified in the same request.</p>
    pub fn get_context(&self) -> &::std::option::Option<::std::string::String> {
        &self.context
    }
    /// <p>Contains configurations for the state under test.</p>
    pub fn state_configuration(mut self, input: crate::types::TestStateConfiguration) -> Self {
        self.state_configuration = ::std::option::Option::Some(input);
        self
    }
    /// <p>Contains configurations for the state under test.</p>
    pub fn set_state_configuration(mut self, input: ::std::option::Option<crate::types::TestStateConfiguration>) -> Self {
        self.state_configuration = input;
        self
    }
    /// <p>Contains configurations for the state under test.</p>
    pub fn get_state_configuration(&self) -> &::std::option::Option<crate::types::TestStateConfiguration> {
        &self.state_configuration
    }
    /// Consumes the builder and constructs a [`TestStateInput`](crate::operation::test_state::TestStateInput).
    pub fn build(self) -> ::std::result::Result<crate::operation::test_state::TestStateInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::test_state::TestStateInput {
            definition: self.definition,
            role_arn: self.role_arn,
            input: self.input,
            inspection_level: self.inspection_level,
            reveal_secrets: self.reveal_secrets,
            variables: self.variables,
            state_name: self.state_name,
            mock: self.mock,
            context: self.context,
            state_configuration: self.state_configuration,
        })
    }
}
impl ::std::fmt::Debug for TestStateInputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("TestStateInputBuilder");
        formatter.field("definition", &"*** Sensitive Data Redacted ***");
        formatter.field("role_arn", &self.role_arn);
        formatter.field("input", &"*** Sensitive Data Redacted ***");
        formatter.field("inspection_level", &self.inspection_level);
        formatter.field("reveal_secrets", &self.reveal_secrets);
        formatter.field("variables", &"*** Sensitive Data Redacted ***");
        formatter.field("state_name", &"*** Sensitive Data Redacted ***");
        formatter.field("mock", &self.mock);
        formatter.field("context", &"*** Sensitive Data Redacted ***");
        formatter.field("state_configuration", &self.state_configuration);
        formatter.finish()
    }
}