Class DynamoDBAction

  • All Implemented Interfaces:
    Serializable, SdkPojo, ToCopyableBuilder<DynamoDBAction.Builder,​DynamoDBAction>

    @Generated("software.amazon.awssdk:codegen")
    public final class DynamoDBAction
    extends Object
    implements SdkPojo, Serializable, ToCopyableBuilder<DynamoDBAction.Builder,​DynamoDBAction>

    Describes an action to write to a DynamoDB table.

    The tableName, hashKeyField, and rangeKeyField values must match the values used when you created the table.

    The hashKeyValue and rangeKeyvalue fields use a substitution template syntax. These templates provide data at runtime. The syntax is as follows: ${sql-expression}.

    You can specify any valid expression in a WHERE or SELECT clause, including JSON properties, comparisons, calculations, and functions. For example, the following field uses the third level of the topic:

    "hashKeyValue": "${topic(3)}"

    The following field uses the timestamp:

    "rangeKeyValue": "${timestamp()}"

    See Also:
    Serialized Form
    • Method Detail

      • tableName

        public final String tableName()

        The name of the DynamoDB table.

        Returns:
        The name of the DynamoDB table.
      • roleArn

        public final String roleArn()

        The ARN of the IAM role that grants access to the DynamoDB table.

        Returns:
        The ARN of the IAM role that grants access to the DynamoDB table.
      • operation

        public final String operation()

        The type of operation to be performed. This follows the substitution template, so it can be ${operation}, but the substitution must result in one of the following: INSERT, UPDATE, or DELETE.

        Returns:
        The type of operation to be performed. This follows the substitution template, so it can be ${operation}, but the substitution must result in one of the following: INSERT, UPDATE, or DELETE.
      • hashKeyField

        public final String hashKeyField()

        The hash key name.

        Returns:
        The hash key name.
      • hashKeyValue

        public final String hashKeyValue()

        The hash key value.

        Returns:
        The hash key value.
      • hashKeyTypeAsString

        public final String hashKeyTypeAsString()

        The hash key type. Valid values are "STRING" or "NUMBER"

        If the service returns an enum value that is not available in the current SDK version, hashKeyType will return DynamoKeyType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from hashKeyTypeAsString().

        Returns:
        The hash key type. Valid values are "STRING" or "NUMBER"
        See Also:
        DynamoKeyType
      • rangeKeyField

        public final String rangeKeyField()

        The range key name.

        Returns:
        The range key name.
      • rangeKeyValue

        public final String rangeKeyValue()

        The range key value.

        Returns:
        The range key value.
      • rangeKeyTypeAsString

        public final String rangeKeyTypeAsString()

        The range key type. Valid values are "STRING" or "NUMBER"

        If the service returns an enum value that is not available in the current SDK version, rangeKeyType will return DynamoKeyType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from rangeKeyTypeAsString().

        Returns:
        The range key type. Valid values are "STRING" or "NUMBER"
        See Also:
        DynamoKeyType
      • payloadField

        public final String payloadField()

        The action payload. This name can be customized.

        Returns:
        The action payload. This name can be customized.
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class Object
      • equals

        public final boolean equals​(Object obj)
        Overrides:
        equals in class Object
      • toString

        public final String toString()
        Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
        Overrides:
        toString in class Object
      • getValueForField

        public final <T> Optional<T> getValueForField​(String fieldName,
                                                      Class<T> clazz)