io.cloudshiftdev.awscdk.services.stepfunctions.tasks.DynamoDeleteItem.kt Maven / Gradle / Ivy
The newest version!
@file:Suppress("RedundantVisibilityModifier","RedundantUnitReturnType","RemoveRedundantQualifierName","unused","UnusedImport","ClassName","REDUNDANT_PROJECTION","DEPRECATION")
package io.cloudshiftdev.awscdk.services.stepfunctions.tasks
import io.cloudshiftdev.awscdk.Duration
import io.cloudshiftdev.awscdk.common.CdkDslMarker
import io.cloudshiftdev.awscdk.common.CdkObjectWrappers
import io.cloudshiftdev.awscdk.services.dynamodb.ITable
import io.cloudshiftdev.awscdk.services.stepfunctions.Credentials
import io.cloudshiftdev.awscdk.services.stepfunctions.IntegrationPattern
import io.cloudshiftdev.awscdk.services.stepfunctions.TaskStateBase
import io.cloudshiftdev.awscdk.services.stepfunctions.Timeout
import kotlin.Any
import kotlin.Deprecated
import kotlin.String
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName
import io.cloudshiftdev.constructs.Construct as CloudshiftdevConstructsConstruct
import software.constructs.Construct as SoftwareConstructsConstruct
/**
* A StepFunctions task to call DynamoDeleteItem.
*
* Example:
*
* ```
* Table myTable;
* DynamoDeleteItem.Builder.create(this, "DeleteItem")
* .key(Map.of("MessageId", DynamoAttributeValue.fromString("message-007")))
* .table(myTable)
* .resultPath(JsonPath.DISCARD)
* .build();
* ```
*/
public open class DynamoDeleteItem(
cdkObject: software.amazon.awscdk.services.stepfunctions.tasks.DynamoDeleteItem,
) : TaskStateBase(cdkObject) {
public constructor(
scope: CloudshiftdevConstructsConstruct,
id: String,
props: DynamoDeleteItemProps,
) :
this(software.amazon.awscdk.services.stepfunctions.tasks.DynamoDeleteItem(scope.let(CloudshiftdevConstructsConstruct.Companion::unwrap),
id, props.let(DynamoDeleteItemProps.Companion::unwrap))
)
public constructor(
scope: CloudshiftdevConstructsConstruct,
id: String,
props: DynamoDeleteItemProps.Builder.() -> Unit,
) : this(scope, id, DynamoDeleteItemProps(props)
)
/**
* A fluent builder for [io.cloudshiftdev.awscdk.services.stepfunctions.tasks.DynamoDeleteItem].
*/
@CdkDslMarker
public interface Builder {
/**
* An optional description for this state.
*
* Default: - No comment
*
* @param comment An optional description for this state.
*/
public fun comment(comment: String)
/**
* A condition that must be satisfied in order for a conditional DeleteItem to succeed.
*
* Default: - No condition expression
*
* [Documentation](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DeleteItem.html#DDB-DeleteItem-request-ConditionExpression)
* @param conditionExpression A condition that must be satisfied in order for a conditional
* DeleteItem to succeed.
*/
public fun conditionExpression(conditionExpression: String)
/**
* Credentials for an IAM Role that the State Machine assumes for executing the task.
*
* This enables cross-account resource invocations.
*
* Default: - None (Task is executed using the State Machine's execution role)
*
* [Documentation](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-access-cross-acct-resources.html)
* @param credentials Credentials for an IAM Role that the State Machine assumes for executing
* the task.
*/
public fun credentials(credentials: Credentials)
/**
* Credentials for an IAM Role that the State Machine assumes for executing the task.
*
* This enables cross-account resource invocations.
*
* Default: - None (Task is executed using the State Machine's execution role)
*
* [Documentation](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-access-cross-acct-resources.html)
* @param credentials Credentials for an IAM Role that the State Machine assumes for executing
* the task.
*/
@kotlin.Suppress("INAPPLICABLE_JVM_NAME")
@JvmName("4661912b88e1e1a504d3cc97252bb5dd9bec3c42ea52630c1772d5de57d50b64")
public fun credentials(credentials: Credentials.Builder.() -> Unit)
/**
* One or more substitution tokens for attribute names in an expression.
*
* Default: - No expression attribute names
*
* [Documentation](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DeleteItem.html#DDB-DeleteItem-request-ExpressionAttributeNames)
* @param expressionAttributeNames One or more substitution tokens for attribute names in an
* expression.
*/
public fun expressionAttributeNames(expressionAttributeNames: Map)
/**
* One or more values that can be substituted in an expression.
*
* Default: - No expression attribute values
*
* [Documentation](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DeleteItem.html#DDB-DeleteItem-request-ExpressionAttributeValues)
* @param expressionAttributeValues One or more values that can be substituted in an expression.
*
*/
public
fun expressionAttributeValues(expressionAttributeValues: Map)
/**
* (deprecated) Timeout for the heartbeat.
*
* Default: - None
*
* @deprecated use `heartbeatTimeout`
* @param heartbeat Timeout for the heartbeat.
*/
@Deprecated(message = "deprecated in CDK")
public fun heartbeat(heartbeat: Duration)
/**
* Timeout for the heartbeat.
*
* [disable-awslint:duration-prop-type] is needed because all props interface in
* aws-stepfunctions-tasks extend this interface
*
* Default: - None
*
* @param heartbeatTimeout Timeout for the heartbeat.
*/
public fun heartbeatTimeout(heartbeatTimeout: Timeout)
/**
* JSONPath expression to select part of the state to be the input to this state.
*
* May also be the special value JsonPath.DISCARD, which will cause the effective
* input to be the empty object {}.
*
* Default: - The entire task input (JSON path '$')
*
* @param inputPath JSONPath expression to select part of the state to be the input to this
* state.
*/
public fun inputPath(inputPath: String)
/**
* AWS Step Functions integrates with services directly in the Amazon States Language.
*
* You can control these AWS services using service integration patterns.
*
* Depending on the AWS Service, the Service Integration Pattern availability will vary.
*
* Default: - `IntegrationPattern.REQUEST_RESPONSE` for most tasks.
* `IntegrationPattern.RUN_JOB` for the following exceptions:
* `BatchSubmitJob`, `EmrAddStep`, `EmrCreateCluster`, `EmrTerminationCluster`, and
* `EmrContainersStartJobRun`.
*
* [Documentation](https://docs.aws.amazon.com/step-functions/latest/dg/connect-supported-services.html)
* @param integrationPattern AWS Step Functions integrates with services directly in the Amazon
* States Language.
*/
public fun integrationPattern(integrationPattern: IntegrationPattern)
/**
* Primary key of the item to retrieve.
*
* For the primary key, you must provide all of the attributes.
* For example, with a simple primary key, you only need to provide a value for the partition
* key.
* For a composite primary key, you must provide values for both the partition key and the sort
* key.
*
* [Documentation](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_GetItem.html#DDB-GetItem-request-Key)
* @param key Primary key of the item to retrieve.
*/
public fun key(key: Map)
/**
* JSONPath expression to select select a portion of the state output to pass to the next state.
*
* May also be the special value JsonPath.DISCARD, which will cause the effective
* output to be the empty object {}.
*
* Default: - The entire JSON node determined by the state input, the task result,
* and resultPath is passed to the next state (JSON path '$')
*
* @param outputPath JSONPath expression to select select a portion of the state output to pass
* to the next state.
*/
public fun outputPath(outputPath: String)
/**
* JSONPath expression to indicate where to inject the state's output.
*
* May also be the special value JsonPath.DISCARD, which will cause the state's
* input to become its output.
*
* Default: - Replaces the entire input with the result (JSON path '$')
*
* @param resultPath JSONPath expression to indicate where to inject the state's output.
*/
public fun resultPath(resultPath: String)
/**
* The JSON that will replace the state's raw result and become the effective result before
* ResultPath is applied.
*
* You can use ResultSelector to create a payload with values that are static
* or selected from the state's raw result.
*
* Default: - None
*
* [Documentation](https://docs.aws.amazon.com/step-functions/latest/dg/input-output-inputpath-params.html#input-output-resultselector)
* @param resultSelector The JSON that will replace the state's raw result and become the
* effective result before ResultPath is applied.
*/
public fun resultSelector(resultSelector: Map)
/**
* Determines the level of detail about provisioned throughput consumption that is returned in
* the response.
*
* Default: DynamoConsumedCapacity.NONE
*
* [Documentation](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DeleteItem.html#DDB-DeleteItem-request-ReturnConsumedCapacity)
* @param returnConsumedCapacity Determines the level of detail about provisioned throughput
* consumption that is returned in the response.
*/
public fun returnConsumedCapacity(returnConsumedCapacity: DynamoConsumedCapacity)
/**
* Determines whether item collection metrics are returned.
*
* If set to SIZE, the response includes statistics about item collections, if any,
* that were modified during the operation are returned in the response.
* If set to NONE (the default), no statistics are returned.
*
* Default: DynamoItemCollectionMetrics.NONE
*
* @param returnItemCollectionMetrics Determines whether item collection metrics are returned.
*/
public fun returnItemCollectionMetrics(returnItemCollectionMetrics: DynamoItemCollectionMetrics)
/**
* Use ReturnValues if you want to get the item attributes as they appeared before they were
* deleted.
*
* Default: DynamoReturnValues.NONE
*
* [Documentation](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DeleteItem.html#DDB-DeleteItem-request-ReturnValues)
* @param returnValues Use ReturnValues if you want to get the item attributes as they appeared
* before they were deleted.
*/
public fun returnValues(returnValues: DynamoReturnValues)
/**
* Optional name for this state.
*
* Default: - The construct ID will be used as state name
*
* @param stateName Optional name for this state.
*/
public fun stateName(stateName: String)
/**
* The name of the table containing the requested item.
*
* @param table The name of the table containing the requested item.
*/
public fun table(table: ITable)
/**
* Timeout for the task.
*
* [disable-awslint:duration-prop-type] is needed because all props interface in
* aws-stepfunctions-tasks extend this interface
*
* Default: - None
*
* @param taskTimeout Timeout for the task.
*/
public fun taskTimeout(taskTimeout: Timeout)
/**
* (deprecated) Timeout for the task.
*
* Default: - None
*
* @deprecated use `taskTimeout`
* @param timeout Timeout for the task.
*/
@Deprecated(message = "deprecated in CDK")
public fun timeout(timeout: Duration)
}
private class BuilderImpl(
scope: SoftwareConstructsConstruct,
id: String,
) : Builder {
private val cdkBuilder:
software.amazon.awscdk.services.stepfunctions.tasks.DynamoDeleteItem.Builder =
software.amazon.awscdk.services.stepfunctions.tasks.DynamoDeleteItem.Builder.create(scope,
id)
/**
* An optional description for this state.
*
* Default: - No comment
*
* @param comment An optional description for this state.
*/
override fun comment(comment: String) {
cdkBuilder.comment(comment)
}
/**
* A condition that must be satisfied in order for a conditional DeleteItem to succeed.
*
* Default: - No condition expression
*
* [Documentation](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DeleteItem.html#DDB-DeleteItem-request-ConditionExpression)
* @param conditionExpression A condition that must be satisfied in order for a conditional
* DeleteItem to succeed.
*/
override fun conditionExpression(conditionExpression: String) {
cdkBuilder.conditionExpression(conditionExpression)
}
/**
* Credentials for an IAM Role that the State Machine assumes for executing the task.
*
* This enables cross-account resource invocations.
*
* Default: - None (Task is executed using the State Machine's execution role)
*
* [Documentation](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-access-cross-acct-resources.html)
* @param credentials Credentials for an IAM Role that the State Machine assumes for executing
* the task.
*/
override fun credentials(credentials: Credentials) {
cdkBuilder.credentials(credentials.let(Credentials.Companion::unwrap))
}
/**
* Credentials for an IAM Role that the State Machine assumes for executing the task.
*
* This enables cross-account resource invocations.
*
* Default: - None (Task is executed using the State Machine's execution role)
*
* [Documentation](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-access-cross-acct-resources.html)
* @param credentials Credentials for an IAM Role that the State Machine assumes for executing
* the task.
*/
@kotlin.Suppress("INAPPLICABLE_JVM_NAME")
@JvmName("4661912b88e1e1a504d3cc97252bb5dd9bec3c42ea52630c1772d5de57d50b64")
override fun credentials(credentials: Credentials.Builder.() -> Unit): Unit =
credentials(Credentials(credentials))
/**
* One or more substitution tokens for attribute names in an expression.
*
* Default: - No expression attribute names
*
* [Documentation](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DeleteItem.html#DDB-DeleteItem-request-ExpressionAttributeNames)
* @param expressionAttributeNames One or more substitution tokens for attribute names in an
* expression.
*/
override fun expressionAttributeNames(expressionAttributeNames: Map) {
cdkBuilder.expressionAttributeNames(expressionAttributeNames)
}
/**
* One or more values that can be substituted in an expression.
*
* Default: - No expression attribute values
*
* [Documentation](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DeleteItem.html#DDB-DeleteItem-request-ExpressionAttributeValues)
* @param expressionAttributeValues One or more values that can be substituted in an expression.
*
*/
override
fun expressionAttributeValues(expressionAttributeValues: Map) {
cdkBuilder.expressionAttributeValues(expressionAttributeValues.mapValues{DynamoAttributeValue.unwrap(it.value)})
}
/**
* (deprecated) Timeout for the heartbeat.
*
* Default: - None
*
* @deprecated use `heartbeatTimeout`
* @param heartbeat Timeout for the heartbeat.
*/
@Deprecated(message = "deprecated in CDK")
override fun heartbeat(heartbeat: Duration) {
cdkBuilder.heartbeat(heartbeat.let(Duration.Companion::unwrap))
}
/**
* Timeout for the heartbeat.
*
* [disable-awslint:duration-prop-type] is needed because all props interface in
* aws-stepfunctions-tasks extend this interface
*
* Default: - None
*
* @param heartbeatTimeout Timeout for the heartbeat.
*/
override fun heartbeatTimeout(heartbeatTimeout: Timeout) {
cdkBuilder.heartbeatTimeout(heartbeatTimeout.let(Timeout.Companion::unwrap))
}
/**
* JSONPath expression to select part of the state to be the input to this state.
*
* May also be the special value JsonPath.DISCARD, which will cause the effective
* input to be the empty object {}.
*
* Default: - The entire task input (JSON path '$')
*
* @param inputPath JSONPath expression to select part of the state to be the input to this
* state.
*/
override fun inputPath(inputPath: String) {
cdkBuilder.inputPath(inputPath)
}
/**
* AWS Step Functions integrates with services directly in the Amazon States Language.
*
* You can control these AWS services using service integration patterns.
*
* Depending on the AWS Service, the Service Integration Pattern availability will vary.
*
* Default: - `IntegrationPattern.REQUEST_RESPONSE` for most tasks.
* `IntegrationPattern.RUN_JOB` for the following exceptions:
* `BatchSubmitJob`, `EmrAddStep`, `EmrCreateCluster`, `EmrTerminationCluster`, and
* `EmrContainersStartJobRun`.
*
* [Documentation](https://docs.aws.amazon.com/step-functions/latest/dg/connect-supported-services.html)
* @param integrationPattern AWS Step Functions integrates with services directly in the Amazon
* States Language.
*/
override fun integrationPattern(integrationPattern: IntegrationPattern) {
cdkBuilder.integrationPattern(integrationPattern.let(IntegrationPattern.Companion::unwrap))
}
/**
* Primary key of the item to retrieve.
*
* For the primary key, you must provide all of the attributes.
* For example, with a simple primary key, you only need to provide a value for the partition
* key.
* For a composite primary key, you must provide values for both the partition key and the sort
* key.
*
* [Documentation](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_GetItem.html#DDB-GetItem-request-Key)
* @param key Primary key of the item to retrieve.
*/
override fun key(key: Map) {
cdkBuilder.key(key.mapValues{DynamoAttributeValue.unwrap(it.value)})
}
/**
* JSONPath expression to select select a portion of the state output to pass to the next state.
*
* May also be the special value JsonPath.DISCARD, which will cause the effective
* output to be the empty object {}.
*
* Default: - The entire JSON node determined by the state input, the task result,
* and resultPath is passed to the next state (JSON path '$')
*
* @param outputPath JSONPath expression to select select a portion of the state output to pass
* to the next state.
*/
override fun outputPath(outputPath: String) {
cdkBuilder.outputPath(outputPath)
}
/**
* JSONPath expression to indicate where to inject the state's output.
*
* May also be the special value JsonPath.DISCARD, which will cause the state's
* input to become its output.
*
* Default: - Replaces the entire input with the result (JSON path '$')
*
* @param resultPath JSONPath expression to indicate where to inject the state's output.
*/
override fun resultPath(resultPath: String) {
cdkBuilder.resultPath(resultPath)
}
/**
* The JSON that will replace the state's raw result and become the effective result before
* ResultPath is applied.
*
* You can use ResultSelector to create a payload with values that are static
* or selected from the state's raw result.
*
* Default: - None
*
* [Documentation](https://docs.aws.amazon.com/step-functions/latest/dg/input-output-inputpath-params.html#input-output-resultselector)
* @param resultSelector The JSON that will replace the state's raw result and become the
* effective result before ResultPath is applied.
*/
override fun resultSelector(resultSelector: Map) {
cdkBuilder.resultSelector(resultSelector.mapValues{CdkObjectWrappers.unwrap(it.value)})
}
/**
* Determines the level of detail about provisioned throughput consumption that is returned in
* the response.
*
* Default: DynamoConsumedCapacity.NONE
*
* [Documentation](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DeleteItem.html#DDB-DeleteItem-request-ReturnConsumedCapacity)
* @param returnConsumedCapacity Determines the level of detail about provisioned throughput
* consumption that is returned in the response.
*/
override fun returnConsumedCapacity(returnConsumedCapacity: DynamoConsumedCapacity) {
cdkBuilder.returnConsumedCapacity(returnConsumedCapacity.let(DynamoConsumedCapacity.Companion::unwrap))
}
/**
* Determines whether item collection metrics are returned.
*
* If set to SIZE, the response includes statistics about item collections, if any,
* that were modified during the operation are returned in the response.
* If set to NONE (the default), no statistics are returned.
*
* Default: DynamoItemCollectionMetrics.NONE
*
* @param returnItemCollectionMetrics Determines whether item collection metrics are returned.
*/
override
fun returnItemCollectionMetrics(returnItemCollectionMetrics: DynamoItemCollectionMetrics) {
cdkBuilder.returnItemCollectionMetrics(returnItemCollectionMetrics.let(DynamoItemCollectionMetrics.Companion::unwrap))
}
/**
* Use ReturnValues if you want to get the item attributes as they appeared before they were
* deleted.
*
* Default: DynamoReturnValues.NONE
*
* [Documentation](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DeleteItem.html#DDB-DeleteItem-request-ReturnValues)
* @param returnValues Use ReturnValues if you want to get the item attributes as they appeared
* before they were deleted.
*/
override fun returnValues(returnValues: DynamoReturnValues) {
cdkBuilder.returnValues(returnValues.let(DynamoReturnValues.Companion::unwrap))
}
/**
* Optional name for this state.
*
* Default: - The construct ID will be used as state name
*
* @param stateName Optional name for this state.
*/
override fun stateName(stateName: String) {
cdkBuilder.stateName(stateName)
}
/**
* The name of the table containing the requested item.
*
* @param table The name of the table containing the requested item.
*/
override fun table(table: ITable) {
cdkBuilder.table(table.let(ITable.Companion::unwrap))
}
/**
* Timeout for the task.
*
* [disable-awslint:duration-prop-type] is needed because all props interface in
* aws-stepfunctions-tasks extend this interface
*
* Default: - None
*
* @param taskTimeout Timeout for the task.
*/
override fun taskTimeout(taskTimeout: Timeout) {
cdkBuilder.taskTimeout(taskTimeout.let(Timeout.Companion::unwrap))
}
/**
* (deprecated) Timeout for the task.
*
* Default: - None
*
* @deprecated use `taskTimeout`
* @param timeout Timeout for the task.
*/
@Deprecated(message = "deprecated in CDK")
override fun timeout(timeout: Duration) {
cdkBuilder.timeout(timeout.let(Duration.Companion::unwrap))
}
public fun build(): software.amazon.awscdk.services.stepfunctions.tasks.DynamoDeleteItem =
cdkBuilder.build()
}
public companion object {
public operator fun invoke(
scope: CloudshiftdevConstructsConstruct,
id: String,
block: Builder.() -> Unit = {},
): DynamoDeleteItem {
val builderImpl = BuilderImpl(CloudshiftdevConstructsConstruct.unwrap(scope), id)
return DynamoDeleteItem(builderImpl.apply(block).build())
}
internal
fun wrap(cdkObject: software.amazon.awscdk.services.stepfunctions.tasks.DynamoDeleteItem):
DynamoDeleteItem = DynamoDeleteItem(cdkObject)
internal fun unwrap(wrapped: DynamoDeleteItem):
software.amazon.awscdk.services.stepfunctions.tasks.DynamoDeleteItem = wrapped.cdkObject as
software.amazon.awscdk.services.stepfunctions.tasks.DynamoDeleteItem
}
}