@Generated(value="com.amazonaws:aws-java-sdk-code-generator") public class DynamoDBAction extends Object implements Serializable, Cloneable, StructuredPojo
Defines an action to write to the Amazon DynamoDB table that you created. The standard action payload contains all the information about the detector model instance and the event that triggered the action. You can customize the payload. One column of the DynamoDB table receives all attribute-value pairs in the payload that you specify.
You must use expressions for all parameters in DynamoDBAction
. The expressions accept literals,
operators, functions, references, and substitution templates.
Examples
For literal values, the expressions must contain single quotes. For example, the value for the
hashKeyType
parameter can be 'STRING'
.
For references, you must specify either variables or input values. For example, the value for the
hashKeyField
parameter can be $input.GreenhouseInput.name
.
For a substitution template, you must use ${}
, and the template must be in single quotes. A substitution
template can also contain a combination of literals, operators, functions, references, and substitution templates.
In the following example, the value for the hashKeyValue
parameter uses a substitution template.
'${$input.GreenhouseInput.temperature * 6 / 5 + 32} in Fahrenheit'
For a string concatenation, you must use +
. A string concatenation can also contain a combination of
literals, operators, functions, references, and substitution templates.
In the following example, the value for the tableName
parameter uses a string concatenation.
'GreenhouseTemperatureTable ' + $input.GreenhouseInput.date
For more information, see Expressions in the AWS IoT Events Developer Guide.
If the defined payload type is a string, DynamoDBAction
writes non-JSON data to the DynamoDB table as
binary data. The DynamoDB console displays the data as Base64-encoded text. The value for the
payloadField
parameter is <payload-field>_raw
.
Constructor and Description |
---|
DynamoDBAction() |
Modifier and Type | Method and Description |
---|---|
DynamoDBAction |
clone() |
boolean |
equals(Object obj) |
String |
getHashKeyField()
The name of the hash key (also called the partition key).
|
String |
getHashKeyType()
The data type for the hash key (also called the partition key).
|
String |
getHashKeyValue()
The value of the hash key (also called the partition key).
|
String |
getOperation()
The type of operation to perform.
|
Payload |
getPayload() |
String |
getPayloadField()
The name of the DynamoDB column that receives the action payload.
|
String |
getRangeKeyField()
The name of the range key (also called the sort key).
|
String |
getRangeKeyType()
The data type for the range key (also called the sort key), You can specify the following values:
|
String |
getRangeKeyValue()
The value of the range key (also called the sort key).
|
String |
getTableName()
The name of the DynamoDB table.
|
int |
hashCode() |
void |
marshall(ProtocolMarshaller protocolMarshaller)
Marshalls this structured data using the given
ProtocolMarshaller . |
void |
setHashKeyField(String hashKeyField)
The name of the hash key (also called the partition key).
|
void |
setHashKeyType(String hashKeyType)
The data type for the hash key (also called the partition key).
|
void |
setHashKeyValue(String hashKeyValue)
The value of the hash key (also called the partition key).
|
void |
setOperation(String operation)
The type of operation to perform.
|
void |
setPayload(Payload payload) |
void |
setPayloadField(String payloadField)
The name of the DynamoDB column that receives the action payload.
|
void |
setRangeKeyField(String rangeKeyField)
The name of the range key (also called the sort key).
|
void |
setRangeKeyType(String rangeKeyType)
The data type for the range key (also called the sort key), You can specify the following values:
|
void |
setRangeKeyValue(String rangeKeyValue)
The value of the range key (also called the sort key).
|
void |
setTableName(String tableName)
The name of the DynamoDB table.
|
String |
toString()
Returns a string representation of this object.
|
DynamoDBAction |
withHashKeyField(String hashKeyField)
The name of the hash key (also called the partition key).
|
DynamoDBAction |
withHashKeyType(String hashKeyType)
The data type for the hash key (also called the partition key).
|
DynamoDBAction |
withHashKeyValue(String hashKeyValue)
The value of the hash key (also called the partition key).
|
DynamoDBAction |
withOperation(String operation)
The type of operation to perform.
|
DynamoDBAction |
withPayload(Payload payload) |
DynamoDBAction |
withPayloadField(String payloadField)
The name of the DynamoDB column that receives the action payload.
|
DynamoDBAction |
withRangeKeyField(String rangeKeyField)
The name of the range key (also called the sort key).
|
DynamoDBAction |
withRangeKeyType(String rangeKeyType)
The data type for the range key (also called the sort key), You can specify the following values:
|
DynamoDBAction |
withRangeKeyValue(String rangeKeyValue)
The value of the range key (also called the sort key).
|
DynamoDBAction |
withTableName(String tableName)
The name of the DynamoDB table.
|
public void setHashKeyType(String hashKeyType)
The data type for the hash key (also called the partition key). You can specify the following values:
'STRING'
- The hash key is a string.
'NUMBER'
- The hash key is a number.
If you don't specify hashKeyType
, the default value is 'STRING'
.
hashKeyType
- The data type for the hash key (also called the partition key). You can specify the following values:
'STRING'
- The hash key is a string.
'NUMBER'
- The hash key is a number.
If you don't specify hashKeyType
, the default value is 'STRING'
.
public String getHashKeyType()
The data type for the hash key (also called the partition key). You can specify the following values:
'STRING'
- The hash key is a string.
'NUMBER'
- The hash key is a number.
If you don't specify hashKeyType
, the default value is 'STRING'
.
'STRING'
- The hash key is a string.
'NUMBER'
- The hash key is a number.
If you don't specify hashKeyType
, the default value is 'STRING'
.
public DynamoDBAction withHashKeyType(String hashKeyType)
The data type for the hash key (also called the partition key). You can specify the following values:
'STRING'
- The hash key is a string.
'NUMBER'
- The hash key is a number.
If you don't specify hashKeyType
, the default value is 'STRING'
.
hashKeyType
- The data type for the hash key (also called the partition key). You can specify the following values:
'STRING'
- The hash key is a string.
'NUMBER'
- The hash key is a number.
If you don't specify hashKeyType
, the default value is 'STRING'
.
public void setHashKeyField(String hashKeyField)
The name of the hash key (also called the partition key). The hashKeyField
value must match the
partition key of the target DynamoDB table.
hashKeyField
- The name of the hash key (also called the partition key). The hashKeyField
value must match
the partition key of the target DynamoDB table.public String getHashKeyField()
The name of the hash key (also called the partition key). The hashKeyField
value must match the
partition key of the target DynamoDB table.
hashKeyField
value must match
the partition key of the target DynamoDB table.public DynamoDBAction withHashKeyField(String hashKeyField)
The name of the hash key (also called the partition key). The hashKeyField
value must match the
partition key of the target DynamoDB table.
hashKeyField
- The name of the hash key (also called the partition key). The hashKeyField
value must match
the partition key of the target DynamoDB table.public void setHashKeyValue(String hashKeyValue)
The value of the hash key (also called the partition key).
hashKeyValue
- The value of the hash key (also called the partition key).public String getHashKeyValue()
The value of the hash key (also called the partition key).
public DynamoDBAction withHashKeyValue(String hashKeyValue)
The value of the hash key (also called the partition key).
hashKeyValue
- The value of the hash key (also called the partition key).public void setRangeKeyType(String rangeKeyType)
The data type for the range key (also called the sort key), You can specify the following values:
'STRING'
- The range key is a string.
'NUMBER'
- The range key is number.
If you don't specify rangeKeyField
, the default value is 'STRING'
.
rangeKeyType
- The data type for the range key (also called the sort key), You can specify the following values:
'STRING'
- The range key is a string.
'NUMBER'
- The range key is number.
If you don't specify rangeKeyField
, the default value is 'STRING'
.
public String getRangeKeyType()
The data type for the range key (also called the sort key), You can specify the following values:
'STRING'
- The range key is a string.
'NUMBER'
- The range key is number.
If you don't specify rangeKeyField
, the default value is 'STRING'
.
'STRING'
- The range key is a string.
'NUMBER'
- The range key is number.
If you don't specify rangeKeyField
, the default value is 'STRING'
.
public DynamoDBAction withRangeKeyType(String rangeKeyType)
The data type for the range key (also called the sort key), You can specify the following values:
'STRING'
- The range key is a string.
'NUMBER'
- The range key is number.
If you don't specify rangeKeyField
, the default value is 'STRING'
.
rangeKeyType
- The data type for the range key (also called the sort key), You can specify the following values:
'STRING'
- The range key is a string.
'NUMBER'
- The range key is number.
If you don't specify rangeKeyField
, the default value is 'STRING'
.
public void setRangeKeyField(String rangeKeyField)
The name of the range key (also called the sort key). The rangeKeyField
value must match the sort
key of the target DynamoDB table.
rangeKeyField
- The name of the range key (also called the sort key). The rangeKeyField
value must match the
sort key of the target DynamoDB table.public String getRangeKeyField()
The name of the range key (also called the sort key). The rangeKeyField
value must match the sort
key of the target DynamoDB table.
rangeKeyField
value must match the
sort key of the target DynamoDB table.public DynamoDBAction withRangeKeyField(String rangeKeyField)
The name of the range key (also called the sort key). The rangeKeyField
value must match the sort
key of the target DynamoDB table.
rangeKeyField
- The name of the range key (also called the sort key). The rangeKeyField
value must match the
sort key of the target DynamoDB table.public void setRangeKeyValue(String rangeKeyValue)
The value of the range key (also called the sort key).
rangeKeyValue
- The value of the range key (also called the sort key).public String getRangeKeyValue()
The value of the range key (also called the sort key).
public DynamoDBAction withRangeKeyValue(String rangeKeyValue)
The value of the range key (also called the sort key).
rangeKeyValue
- The value of the range key (also called the sort key).public void setOperation(String operation)
The type of operation to perform. You can specify the following values:
'INSERT'
- Insert data as a new item into the DynamoDB table. This item uses the specified hash key
as a partition key. If you specified a range key, the item uses the range key as a sort key.
'UPDATE'
- Update an existing item of the DynamoDB table with new data. This item's partition key
must match the specified hash key. If you specified a range key, the range key must match the item's sort key.
'DELETE'
- Delete an existing item of the DynamoDB table. This item's partition key must match the
specified hash key. If you specified a range key, the range key must match the item's sort key.
If you don't specify this parameter, AWS IoT Events triggers the 'INSERT'
operation.
operation
- The type of operation to perform. You can specify the following values:
'INSERT'
- Insert data as a new item into the DynamoDB table. This item uses the specified
hash key as a partition key. If you specified a range key, the item uses the range key as a sort key.
'UPDATE'
- Update an existing item of the DynamoDB table with new data. This item's partition
key must match the specified hash key. If you specified a range key, the range key must match the item's
sort key.
'DELETE'
- Delete an existing item of the DynamoDB table. This item's partition key must
match the specified hash key. If you specified a range key, the range key must match the item's sort key.
If you don't specify this parameter, AWS IoT Events triggers the 'INSERT'
operation.
public String getOperation()
The type of operation to perform. You can specify the following values:
'INSERT'
- Insert data as a new item into the DynamoDB table. This item uses the specified hash key
as a partition key. If you specified a range key, the item uses the range key as a sort key.
'UPDATE'
- Update an existing item of the DynamoDB table with new data. This item's partition key
must match the specified hash key. If you specified a range key, the range key must match the item's sort key.
'DELETE'
- Delete an existing item of the DynamoDB table. This item's partition key must match the
specified hash key. If you specified a range key, the range key must match the item's sort key.
If you don't specify this parameter, AWS IoT Events triggers the 'INSERT'
operation.
'INSERT'
- Insert data as a new item into the DynamoDB table. This item uses the specified
hash key as a partition key. If you specified a range key, the item uses the range key as a sort key.
'UPDATE'
- Update an existing item of the DynamoDB table with new data. This item's
partition key must match the specified hash key. If you specified a range key, the range key must match
the item's sort key.
'DELETE'
- Delete an existing item of the DynamoDB table. This item's partition key must
match the specified hash key. If you specified a range key, the range key must match the item's sort key.
If you don't specify this parameter, AWS IoT Events triggers the 'INSERT'
operation.
public DynamoDBAction withOperation(String operation)
The type of operation to perform. You can specify the following values:
'INSERT'
- Insert data as a new item into the DynamoDB table. This item uses the specified hash key
as a partition key. If you specified a range key, the item uses the range key as a sort key.
'UPDATE'
- Update an existing item of the DynamoDB table with new data. This item's partition key
must match the specified hash key. If you specified a range key, the range key must match the item's sort key.
'DELETE'
- Delete an existing item of the DynamoDB table. This item's partition key must match the
specified hash key. If you specified a range key, the range key must match the item's sort key.
If you don't specify this parameter, AWS IoT Events triggers the 'INSERT'
operation.
operation
- The type of operation to perform. You can specify the following values:
'INSERT'
- Insert data as a new item into the DynamoDB table. This item uses the specified
hash key as a partition key. If you specified a range key, the item uses the range key as a sort key.
'UPDATE'
- Update an existing item of the DynamoDB table with new data. This item's partition
key must match the specified hash key. If you specified a range key, the range key must match the item's
sort key.
'DELETE'
- Delete an existing item of the DynamoDB table. This item's partition key must
match the specified hash key. If you specified a range key, the range key must match the item's sort key.
If you don't specify this parameter, AWS IoT Events triggers the 'INSERT'
operation.
public void setPayloadField(String payloadField)
The name of the DynamoDB column that receives the action payload.
If you don't specify this parameter, the name of the DynamoDB column is payload
.
payloadField
- The name of the DynamoDB column that receives the action payload.
If you don't specify this parameter, the name of the DynamoDB column is payload
.
public String getPayloadField()
The name of the DynamoDB column that receives the action payload.
If you don't specify this parameter, the name of the DynamoDB column is payload
.
If you don't specify this parameter, the name of the DynamoDB column is payload
.
public DynamoDBAction withPayloadField(String payloadField)
The name of the DynamoDB column that receives the action payload.
If you don't specify this parameter, the name of the DynamoDB column is payload
.
payloadField
- The name of the DynamoDB column that receives the action payload.
If you don't specify this parameter, the name of the DynamoDB column is payload
.
public void setTableName(String tableName)
The name of the DynamoDB table. The tableName
value must match the table name of the target DynamoDB
table.
tableName
- The name of the DynamoDB table. The tableName
value must match the table name of the target
DynamoDB table.public String getTableName()
The name of the DynamoDB table. The tableName
value must match the table name of the target DynamoDB
table.
tableName
value must match the table name of the target
DynamoDB table.public DynamoDBAction withTableName(String tableName)
The name of the DynamoDB table. The tableName
value must match the table name of the target DynamoDB
table.
tableName
- The name of the DynamoDB table. The tableName
value must match the table name of the target
DynamoDB table.public void setPayload(Payload payload)
payload
- public Payload getPayload()
public DynamoDBAction withPayload(Payload payload)
payload
- public String toString()
toString
in class Object
Object.toString()
public DynamoDBAction clone()
public void marshall(ProtocolMarshaller protocolMarshaller)
StructuredPojo
ProtocolMarshaller
.marshall
in interface StructuredPojo
protocolMarshaller
- Implementation of ProtocolMarshaller
used to marshall this object's data.