software.amazon.awscdk.services.iot.actions.alpha.OpenSearchAction Maven / Gradle / Ivy
Show all versions of iot-actions-alpha Show documentation
package software.amazon.awscdk.services.iot.actions.alpha;
/**
* (experimental) The action to write data to an Amazon OpenSearch Service domain.
*
* Example:
*
*
* import software.amazon.awscdk.services.opensearchservice.*;
* Domain domain;
* TopicRule topicRule = TopicRule.Builder.create(this, "TopicRule")
* .sql(IotSql.fromStringAsVer20160323("SELECT topic(2) as device_id, year, month, day FROM 'device/+/data'"))
* .build();
* topicRule.addAction(OpenSearchAction.Builder.create(domain)
* .id("my-id")
* .index("my-index")
* .type("my-type")
* .build());
*
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-10-04T00:39:42.245Z")
@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.OpenSearchAction")
public class OpenSearchAction extends software.amazon.jsii.JsiiObject implements software.amazon.awscdk.services.iot.alpha.IAction {
protected OpenSearchAction(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected OpenSearchAction(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* @param domain This parameter is required.
* @param props This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public OpenSearchAction(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.opensearchservice.Domain domain, final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.iot.actions.alpha.OpenSearchActionProps props) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(domain, "domain is required"), java.util.Objects.requireNonNull(props, "props is required") });
}
/**
* (experimental) A fluent builder for {@link software.amazon.awscdk.services.iot.actions.alpha.OpenSearchAction}.
*/
@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 domain This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static Builder create(final software.amazon.awscdk.services.opensearchservice.Domain domain) {
return new Builder(domain);
}
private final software.amazon.awscdk.services.opensearchservice.Domain domain;
private final software.amazon.awscdk.services.iot.actions.alpha.OpenSearchActionProps.Builder props;
private Builder(final software.amazon.awscdk.services.opensearchservice.Domain domain) {
this.domain = domain;
this.props = new software.amazon.awscdk.services.iot.actions.alpha.OpenSearchActionProps.Builder();
}
/**
* (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;
}
/**
* (experimental) The unique identifier for the document you are storing.
*
* @return {@code this}
* @param id The unique identifier for the document you are storing. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder id(final java.lang.String id) {
this.props.id(id);
return this;
}
/**
* (experimental) The OpenSearch index where you want to store your data.
*
* @return {@code this}
* @param index The OpenSearch index where you want to store your data. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder index(final java.lang.String index) {
this.props.index(index);
return this;
}
/**
* (experimental) The type of document you are storing.
*
* @return {@code this}
* @param type The type of document you are storing. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder type(final java.lang.String type) {
this.props.type(type);
return this;
}
/**
* @return a newly built instance of {@link software.amazon.awscdk.services.iot.actions.alpha.OpenSearchAction}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public software.amazon.awscdk.services.iot.actions.alpha.OpenSearchAction build() {
return new software.amazon.awscdk.services.iot.actions.alpha.OpenSearchAction(
this.domain,
this.props.build()
);
}
}
}