aws-sdk-sfn 1.97.0

AWS SDK for AWS Step Functions
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::validate_state_machine_definition::_validate_state_machine_definition_output::ValidateStateMachineDefinitionOutputBuilder;

pub use crate::operation::validate_state_machine_definition::_validate_state_machine_definition_input::ValidateStateMachineDefinitionInputBuilder;

impl crate::operation::validate_state_machine_definition::builders::ValidateStateMachineDefinitionInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::validate_state_machine_definition::ValidateStateMachineDefinitionOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::validate_state_machine_definition::ValidateStateMachineDefinitionError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.validate_state_machine_definition();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `ValidateStateMachineDefinition`.
///
/// <p>Validates the syntax of a state machine definition specified in <a href="https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html">Amazon States Language</a> (ASL), a JSON-based, structured language.</p>
/// <p>You can validate that a state machine definition is correct without creating a state machine resource.</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 check state machine definitions before starting deployments.</p></li>
/// <li>
/// <p>Run validation from a Git pre-commit hook to verify the definition before committing to your source repository.</p></li>
/// </ul>
/// <p>Validation will look for problems in your state machine definition and return a <b>result</b> and a list of <b>diagnostic elements</b>.</p>
/// <p>The <b>result</b> value will be <code>OK</code> when your workflow definition can be successfully created or updated. Note the result can be <code>OK</code> even when diagnostic warnings are present in the response. The <b>result</b> value will be <code>FAIL</code> when the workflow definition contains errors that would prevent you from creating or updating your state machine.</p>
/// <p>The list of <a href="https://docs.aws.amazon.com/step-functions/latest/apireference/API_ValidateStateMachineDefinitionDiagnostic.html">ValidateStateMachineDefinitionDiagnostic</a> data elements can contain zero or more <b>WARNING</b> and/or <b>ERROR</b> elements.</p><note>
/// <p>The <b>ValidateStateMachineDefinition API</b> might add new diagnostics in the future, adjust diagnostic codes, or change the message wording. Your automated processes should only rely on the value of the <b>result</b> field value (OK, FAIL). Do <b>not</b> rely on the exact order, count, or wording of diagnostic messages.</p>
/// </note>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct ValidateStateMachineDefinitionFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::validate_state_machine_definition::builders::ValidateStateMachineDefinitionInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::validate_state_machine_definition::ValidateStateMachineDefinitionOutput,
        crate::operation::validate_state_machine_definition::ValidateStateMachineDefinitionError,
    > for ValidateStateMachineDefinitionFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::validate_state_machine_definition::ValidateStateMachineDefinitionOutput,
            crate::operation::validate_state_machine_definition::ValidateStateMachineDefinitionError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl ValidateStateMachineDefinitionFluentBuilder {
    /// Creates a new `ValidateStateMachineDefinitionFluentBuilder`.
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: ::std::default::Default::default(),
            config_override: ::std::option::Option::None,
        }
    }
    /// Access the ValidateStateMachineDefinition as a reference.
    pub fn as_input(&self) -> &crate::operation::validate_state_machine_definition::builders::ValidateStateMachineDefinitionInputBuilder {
        &self.inner
    }
    /// Sends the request and returns the response.
    ///
    /// If an error occurs, an `SdkError` will be returned with additional details that
    /// can be matched against.
    ///
    /// By default, any retryable failures will be retried twice. Retry behavior
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
    /// set when configuring the client.
    pub async fn send(
        self,
    ) -> ::std::result::Result<
        crate::operation::validate_state_machine_definition::ValidateStateMachineDefinitionOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::validate_state_machine_definition::ValidateStateMachineDefinitionError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let input = self
            .inner
            .build()
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
        let runtime_plugins = crate::operation::validate_state_machine_definition::ValidateStateMachineDefinition::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::validate_state_machine_definition::ValidateStateMachineDefinition::orchestrate(&runtime_plugins, input).await
    }

    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
    pub fn customize(
        self,
    ) -> crate::client::customize::CustomizableOperation<
        crate::operation::validate_state_machine_definition::ValidateStateMachineDefinitionOutput,
        crate::operation::validate_state_machine_definition::ValidateStateMachineDefinitionError,
        Self,
    > {
        crate::client::customize::CustomizableOperation::new(self)
    }
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
        self.set_config_override(::std::option::Option::Some(config_override.into()));
        self
    }

    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
        self.config_override = config_override;
        self
    }
    /// <p>The Amazon States Language definition of the state machine. For more information, see <a href="https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html">Amazon States Language</a> (ASL).</p>
    pub fn definition(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.definition(input.into());
        self
    }
    /// <p>The Amazon States Language definition of the state machine. For more information, see <a href="https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html">Amazon States Language</a> (ASL).</p>
    pub fn set_definition(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_definition(input);
        self
    }
    /// <p>The Amazon States Language definition of the state machine. For more information, see <a href="https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html">Amazon States Language</a> (ASL).</p>
    pub fn get_definition(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_definition()
    }
    /// <p>The target type of state machine for this definition. The default is <code>STANDARD</code>.</p>
    pub fn r#type(mut self, input: crate::types::StateMachineType) -> Self {
        self.inner = self.inner.r#type(input);
        self
    }
    /// <p>The target type of state machine for this definition. The default is <code>STANDARD</code>.</p>
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::StateMachineType>) -> Self {
        self.inner = self.inner.set_type(input);
        self
    }
    /// <p>The target type of state machine for this definition. The default is <code>STANDARD</code>.</p>
    pub fn get_type(&self) -> &::std::option::Option<crate::types::StateMachineType> {
        self.inner.get_type()
    }
    /// <p>Minimum level of diagnostics to return. <code>ERROR</code> returns only <code>ERROR</code> diagnostics, whereas <code>WARNING</code> returns both <code>WARNING</code> and <code>ERROR</code> diagnostics. The default is <code>ERROR</code>.</p>
    pub fn severity(mut self, input: crate::types::ValidateStateMachineDefinitionSeverity) -> Self {
        self.inner = self.inner.severity(input);
        self
    }
    /// <p>Minimum level of diagnostics to return. <code>ERROR</code> returns only <code>ERROR</code> diagnostics, whereas <code>WARNING</code> returns both <code>WARNING</code> and <code>ERROR</code> diagnostics. The default is <code>ERROR</code>.</p>
    pub fn set_severity(mut self, input: ::std::option::Option<crate::types::ValidateStateMachineDefinitionSeverity>) -> Self {
        self.inner = self.inner.set_severity(input);
        self
    }
    /// <p>Minimum level of diagnostics to return. <code>ERROR</code> returns only <code>ERROR</code> diagnostics, whereas <code>WARNING</code> returns both <code>WARNING</code> and <code>ERROR</code> diagnostics. The default is <code>ERROR</code>.</p>
    pub fn get_severity(&self) -> &::std::option::Option<crate::types::ValidateStateMachineDefinitionSeverity> {
        self.inner.get_severity()
    }
    /// <p>The maximum number of diagnostics that are returned per call. The default and maximum value is 100. Setting the value to 0 will also use the default of 100.</p>
    /// <p>If the number of diagnostics returned in the response exceeds <code>maxResults</code>, the value of the <code>truncated</code> field in the response will be set to <code>true</code>.</p>
    pub fn max_results(mut self, input: i32) -> Self {
        self.inner = self.inner.max_results(input);
        self
    }
    /// <p>The maximum number of diagnostics that are returned per call. The default and maximum value is 100. Setting the value to 0 will also use the default of 100.</p>
    /// <p>If the number of diagnostics returned in the response exceeds <code>maxResults</code>, the value of the <code>truncated</code> field in the response will be set to <code>true</code>.</p>
    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
        self.inner = self.inner.set_max_results(input);
        self
    }
    /// <p>The maximum number of diagnostics that are returned per call. The default and maximum value is 100. Setting the value to 0 will also use the default of 100.</p>
    /// <p>If the number of diagnostics returned in the response exceeds <code>maxResults</code>, the value of the <code>truncated</code> field in the response will be set to <code>true</code>.</p>
    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
        self.inner.get_max_results()
    }
}