aws-sdk-lambda 1.119.0

AWS SDK for AWS Lambda
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, ::std::fmt::Debug)]
pub struct CheckpointDurableExecutionInput {
    /// <p>The Amazon Resource Name (ARN) of the durable execution.</p>
    pub durable_execution_arn: ::std::option::Option<::std::string::String>,
    /// <p>A unique token that identifies the current checkpoint state. This token is provided by the Lambda runtime and must be used to ensure checkpoints are applied in the correct order. Each checkpoint operation consumes this token and returns a new one.</p>
    pub checkpoint_token: ::std::option::Option<::std::string::String>,
    /// <p>An array of state updates to apply during this checkpoint. Each update represents a change to the execution state, such as completing a step, starting a callback, or scheduling a timer. Updates are applied atomically as part of the checkpoint operation.</p>
    pub updates: ::std::option::Option<::std::vec::Vec<crate::types::OperationUpdate>>,
    /// <p>An optional idempotency token to ensure that duplicate checkpoint requests are handled correctly. If provided, Lambda uses this token to detect and handle duplicate requests within a 15-minute window.</p>
    pub client_token: ::std::option::Option<::std::string::String>,
}
impl CheckpointDurableExecutionInput {
    /// <p>The Amazon Resource Name (ARN) of the durable execution.</p>
    pub fn durable_execution_arn(&self) -> ::std::option::Option<&str> {
        self.durable_execution_arn.as_deref()
    }
    /// <p>A unique token that identifies the current checkpoint state. This token is provided by the Lambda runtime and must be used to ensure checkpoints are applied in the correct order. Each checkpoint operation consumes this token and returns a new one.</p>
    pub fn checkpoint_token(&self) -> ::std::option::Option<&str> {
        self.checkpoint_token.as_deref()
    }
    /// <p>An array of state updates to apply during this checkpoint. Each update represents a change to the execution state, such as completing a step, starting a callback, or scheduling a timer. Updates are applied atomically as part of the checkpoint operation.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.updates.is_none()`.
    pub fn updates(&self) -> &[crate::types::OperationUpdate] {
        self.updates.as_deref().unwrap_or_default()
    }
    /// <p>An optional idempotency token to ensure that duplicate checkpoint requests are handled correctly. If provided, Lambda uses this token to detect and handle duplicate requests within a 15-minute window.</p>
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
}
impl CheckpointDurableExecutionInput {
    /// Creates a new builder-style object to manufacture [`CheckpointDurableExecutionInput`](crate::operation::checkpoint_durable_execution::CheckpointDurableExecutionInput).
    pub fn builder() -> crate::operation::checkpoint_durable_execution::builders::CheckpointDurableExecutionInputBuilder {
        crate::operation::checkpoint_durable_execution::builders::CheckpointDurableExecutionInputBuilder::default()
    }
}

/// A builder for [`CheckpointDurableExecutionInput`](crate::operation::checkpoint_durable_execution::CheckpointDurableExecutionInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CheckpointDurableExecutionInputBuilder {
    pub(crate) durable_execution_arn: ::std::option::Option<::std::string::String>,
    pub(crate) checkpoint_token: ::std::option::Option<::std::string::String>,
    pub(crate) updates: ::std::option::Option<::std::vec::Vec<crate::types::OperationUpdate>>,
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
}
impl CheckpointDurableExecutionInputBuilder {
    /// <p>The Amazon Resource Name (ARN) of the durable execution.</p>
    /// This field is required.
    pub fn durable_execution_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.durable_execution_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the durable execution.</p>
    pub fn set_durable_execution_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.durable_execution_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the durable execution.</p>
    pub fn get_durable_execution_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.durable_execution_arn
    }
    /// <p>A unique token that identifies the current checkpoint state. This token is provided by the Lambda runtime and must be used to ensure checkpoints are applied in the correct order. Each checkpoint operation consumes this token and returns a new one.</p>
    /// This field is required.
    pub fn checkpoint_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.checkpoint_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A unique token that identifies the current checkpoint state. This token is provided by the Lambda runtime and must be used to ensure checkpoints are applied in the correct order. Each checkpoint operation consumes this token and returns a new one.</p>
    pub fn set_checkpoint_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.checkpoint_token = input;
        self
    }
    /// <p>A unique token that identifies the current checkpoint state. This token is provided by the Lambda runtime and must be used to ensure checkpoints are applied in the correct order. Each checkpoint operation consumes this token and returns a new one.</p>
    pub fn get_checkpoint_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.checkpoint_token
    }
    /// Appends an item to `updates`.
    ///
    /// To override the contents of this collection use [`set_updates`](Self::set_updates).
    ///
    /// <p>An array of state updates to apply during this checkpoint. Each update represents a change to the execution state, such as completing a step, starting a callback, or scheduling a timer. Updates are applied atomically as part of the checkpoint operation.</p>
    pub fn updates(mut self, input: crate::types::OperationUpdate) -> Self {
        let mut v = self.updates.unwrap_or_default();
        v.push(input);
        self.updates = ::std::option::Option::Some(v);
        self
    }
    /// <p>An array of state updates to apply during this checkpoint. Each update represents a change to the execution state, such as completing a step, starting a callback, or scheduling a timer. Updates are applied atomically as part of the checkpoint operation.</p>
    pub fn set_updates(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::OperationUpdate>>) -> Self {
        self.updates = input;
        self
    }
    /// <p>An array of state updates to apply during this checkpoint. Each update represents a change to the execution state, such as completing a step, starting a callback, or scheduling a timer. Updates are applied atomically as part of the checkpoint operation.</p>
    pub fn get_updates(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::OperationUpdate>> {
        &self.updates
    }
    /// <p>An optional idempotency token to ensure that duplicate checkpoint requests are handled correctly. If provided, Lambda uses this token to detect and handle duplicate requests within a 15-minute window.</p>
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.client_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>An optional idempotency token to ensure that duplicate checkpoint requests are handled correctly. If provided, Lambda uses this token to detect and handle duplicate requests within a 15-minute window.</p>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// <p>An optional idempotency token to ensure that duplicate checkpoint requests are handled correctly. If provided, Lambda uses this token to detect and handle duplicate requests within a 15-minute window.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// Consumes the builder and constructs a [`CheckpointDurableExecutionInput`](crate::operation::checkpoint_durable_execution::CheckpointDurableExecutionInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::checkpoint_durable_execution::CheckpointDurableExecutionInput,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(crate::operation::checkpoint_durable_execution::CheckpointDurableExecutionInput {
            durable_execution_arn: self.durable_execution_arn,
            checkpoint_token: self.checkpoint_token,
            updates: self.updates,
            client_token: self.client_token,
        })
    }
}