software.amazon.awscdk.services.iot.actions.alpha.DynamoDBv2PutItemAction Maven / Gradle / Ivy
Show all versions of iot-actions-alpha Show documentation
package software.amazon.awscdk.services.iot.actions.alpha;
/**
* (experimental) The action to put the record from an MQTT message to the DynamoDB table.
*
* Example:
*
*
* import software.amazon.awscdk.services.dynamodb.*;
* Table table;
* TopicRule topicRule = TopicRule.Builder.create(this, "TopicRule")
* .sql(IotSql.fromStringAsVer20160323("SELECT * FROM 'device/+/data'"))
* .actions(List.of(
* new DynamoDBv2PutItemAction(table)))
* .build();
*
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.102.0 (build e354887)", date = "2024-09-06T01:36:38.334Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.iot.actions.alpha.$Module.class, fqn = "@aws-cdk/aws-iot-actions-alpha.DynamoDBv2PutItemAction")
public class DynamoDBv2PutItemAction extends software.amazon.jsii.JsiiObject implements software.amazon.awscdk.services.iot.alpha.IAction {
protected DynamoDBv2PutItemAction(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected DynamoDBv2PutItemAction(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* @param table the DynamoDB table in which to put the items. This parameter is required.
* @param props Optional properties to not use default.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public DynamoDBv2PutItemAction(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.dynamodb.ITable table, final @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.iot.actions.alpha.DynamoDBv2PutItemActionProps props) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(table, "table is required"), props });
}
/**
* @param table the DynamoDB table in which to put the items. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public DynamoDBv2PutItemAction(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.dynamodb.ITable table) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(table, "table is required") });
}
/**
* (experimental) A fluent builder for {@link software.amazon.awscdk.services.iot.actions.alpha.DynamoDBv2PutItemAction}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
/**
* @return a new instance of {@link Builder}.
* @param table the DynamoDB table in which to put the items. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static Builder create(final software.amazon.awscdk.services.dynamodb.ITable table) {
return new Builder(table);
}
private final software.amazon.awscdk.services.dynamodb.ITable table;
private software.amazon.awscdk.services.iot.actions.alpha.DynamoDBv2PutItemActionProps.Builder props;
private Builder(final software.amazon.awscdk.services.dynamodb.ITable table) {
this.table = table;
}
/**
* (experimental) The IAM role that allows access to AWS service.
*
* Default: a new role will be created
*
* @return {@code this}
* @param role The IAM role that allows access to AWS service. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder role(final software.amazon.awscdk.services.iam.IRole role) {
this.props().role(role);
return this;
}
/**
* @return a newly built instance of {@link software.amazon.awscdk.services.iot.actions.alpha.DynamoDBv2PutItemAction}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public software.amazon.awscdk.services.iot.actions.alpha.DynamoDBv2PutItemAction build() {
return new software.amazon.awscdk.services.iot.actions.alpha.DynamoDBv2PutItemAction(
this.table,
this.props != null ? this.props.build() : null
);
}
private software.amazon.awscdk.services.iot.actions.alpha.DynamoDBv2PutItemActionProps.Builder props() {
if (this.props == null) {
this.props = new software.amazon.awscdk.services.iot.actions.alpha.DynamoDBv2PutItemActionProps.Builder();
}
return this.props;
}
}
}