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 SendTaskFailureInput {
    /// <p>The token that represents this task. Task tokens are generated by Step Functions when tasks are assigned to a worker, or in the <a href="https://docs.aws.amazon.com/step-functions/latest/dg/input-output-contextobject.html">context object</a> when a workflow enters a task state. See <code>GetActivityTaskOutput$taskToken</code>.</p>
    pub task_token: ::std::option::Option<::std::string::String>,
    /// <p>The error code of the failure.</p>
    pub error: ::std::option::Option<::std::string::String>,
    /// <p>A more detailed explanation of the cause of the failure.</p>
    pub cause: ::std::option::Option<::std::string::String>,
}
impl SendTaskFailureInput {
    /// <p>The token that represents this task. Task tokens are generated by Step Functions when tasks are assigned to a worker, or in the <a href="https://docs.aws.amazon.com/step-functions/latest/dg/input-output-contextobject.html">context object</a> when a workflow enters a task state. See <code>GetActivityTaskOutput$taskToken</code>.</p>
    pub fn task_token(&self) -> ::std::option::Option<&str> {
        self.task_token.as_deref()
    }
    /// <p>The error code of the failure.</p>
    pub fn error(&self) -> ::std::option::Option<&str> {
        self.error.as_deref()
    }
    /// <p>A more detailed explanation of the cause of the failure.</p>
    pub fn cause(&self) -> ::std::option::Option<&str> {
        self.cause.as_deref()
    }
}
impl ::std::fmt::Debug for SendTaskFailureInput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("SendTaskFailureInput");
        formatter.field("task_token", &self.task_token);
        formatter.field("error", &"*** Sensitive Data Redacted ***");
        formatter.field("cause", &"*** Sensitive Data Redacted ***");
        formatter.finish()
    }
}
impl SendTaskFailureInput {
    /// Creates a new builder-style object to manufacture [`SendTaskFailureInput`](crate::operation::send_task_failure::SendTaskFailureInput).
    pub fn builder() -> crate::operation::send_task_failure::builders::SendTaskFailureInputBuilder {
        crate::operation::send_task_failure::builders::SendTaskFailureInputBuilder::default()
    }
}

/// A builder for [`SendTaskFailureInput`](crate::operation::send_task_failure::SendTaskFailureInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct SendTaskFailureInputBuilder {
    pub(crate) task_token: ::std::option::Option<::std::string::String>,
    pub(crate) error: ::std::option::Option<::std::string::String>,
    pub(crate) cause: ::std::option::Option<::std::string::String>,
}
impl SendTaskFailureInputBuilder {
    /// <p>The token that represents this task. Task tokens are generated by Step Functions when tasks are assigned to a worker, or in the <a href="https://docs.aws.amazon.com/step-functions/latest/dg/input-output-contextobject.html">context object</a> when a workflow enters a task state. See <code>GetActivityTaskOutput$taskToken</code>.</p>
    /// This field is required.
    pub fn task_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.task_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The token that represents this task. Task tokens are generated by Step Functions when tasks are assigned to a worker, or in the <a href="https://docs.aws.amazon.com/step-functions/latest/dg/input-output-contextobject.html">context object</a> when a workflow enters a task state. See <code>GetActivityTaskOutput$taskToken</code>.</p>
    pub fn set_task_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.task_token = input;
        self
    }
    /// <p>The token that represents this task. Task tokens are generated by Step Functions when tasks are assigned to a worker, or in the <a href="https://docs.aws.amazon.com/step-functions/latest/dg/input-output-contextobject.html">context object</a> when a workflow enters a task state. See <code>GetActivityTaskOutput$taskToken</code>.</p>
    pub fn get_task_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.task_token
    }
    /// <p>The error code of the failure.</p>
    pub fn error(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.error = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The error code of the failure.</p>
    pub fn set_error(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.error = input;
        self
    }
    /// <p>The error code of the failure.</p>
    pub fn get_error(&self) -> &::std::option::Option<::std::string::String> {
        &self.error
    }
    /// <p>A more detailed explanation of the cause of the failure.</p>
    pub fn cause(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.cause = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A more detailed explanation of the cause of the failure.</p>
    pub fn set_cause(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.cause = input;
        self
    }
    /// <p>A more detailed explanation of the cause of the failure.</p>
    pub fn get_cause(&self) -> &::std::option::Option<::std::string::String> {
        &self.cause
    }
    /// Consumes the builder and constructs a [`SendTaskFailureInput`](crate::operation::send_task_failure::SendTaskFailureInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::send_task_failure::SendTaskFailureInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::send_task_failure::SendTaskFailureInput {
            task_token: self.task_token,
            error: self.error,
            cause: self.cause,
        })
    }
}
impl ::std::fmt::Debug for SendTaskFailureInputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("SendTaskFailureInputBuilder");
        formatter.field("task_token", &self.task_token);
        formatter.field("error", &"*** Sensitive Data Redacted ***");
        formatter.field("cause", &"*** Sensitive Data Redacted ***");
        formatter.finish()
    }
}