software.amazon.awscdk.services.events.targets.KinesisStreamProps Maven / Gradle / Ivy
Show all versions of events-targets Show documentation
package software.amazon.awscdk.services.events.targets;
/**
* Customize the Kinesis Stream Event Target.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.21.0 (build 4262b22)", date = "2021-02-23T11:52:46.769Z")
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.events.targets.$Module.class, fqn = "@aws-cdk/aws-events-targets.KinesisStreamProps")
@software.amazon.jsii.Jsii.Proxy(KinesisStreamProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface KinesisStreamProps extends software.amazon.jsii.JsiiSerializable {
/**
* The message to send to the stream.
*
* Must be a valid JSON text passed to the target stream.
*
* Default: - the entire CloudWatch event
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.events.RuleTargetInput getMessage() {
return null;
}
/**
* Partition Key Path for records sent to this stream.
*
* Default: - eventId as the partition key
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getPartitionKeyPath() {
return null;
}
/**
* @return a {@link Builder} of {@link KinesisStreamProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link KinesisStreamProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
private software.amazon.awscdk.services.events.RuleTargetInput message;
private java.lang.String partitionKeyPath;
/**
* Sets the value of {@link KinesisStreamProps#getMessage}
* @param message The message to send to the stream.
* Must be a valid JSON text passed to the target stream.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder message(software.amazon.awscdk.services.events.RuleTargetInput message) {
this.message = message;
return this;
}
/**
* Sets the value of {@link KinesisStreamProps#getPartitionKeyPath}
* @param partitionKeyPath Partition Key Path for records sent to this stream.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder partitionKeyPath(java.lang.String partitionKeyPath) {
this.partitionKeyPath = partitionKeyPath;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link KinesisStreamProps}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public KinesisStreamProps build() {
return new Jsii$Proxy(message, partitionKeyPath);
}
}
/**
* An implementation for {@link KinesisStreamProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements KinesisStreamProps {
private final software.amazon.awscdk.services.events.RuleTargetInput message;
private final java.lang.String partitionKeyPath;
/**
* Constructor that initializes the object based on values retrieved from the JsiiObject.
* @param objRef Reference to the JSII managed object.
*/
protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
this.message = software.amazon.jsii.Kernel.get(this, "message", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.events.RuleTargetInput.class));
this.partitionKeyPath = software.amazon.jsii.Kernel.get(this, "partitionKeyPath", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
protected Jsii$Proxy(final software.amazon.awscdk.services.events.RuleTargetInput message, final java.lang.String partitionKeyPath) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.message = message;
this.partitionKeyPath = partitionKeyPath;
}
@Override
public final software.amazon.awscdk.services.events.RuleTargetInput getMessage() {
return this.message;
}
@Override
public final java.lang.String getPartitionKeyPath() {
return this.partitionKeyPath;
}
@Override
@software.amazon.jsii.Internal
public com.fasterxml.jackson.databind.JsonNode $jsii$toJson() {
final com.fasterxml.jackson.databind.ObjectMapper om = software.amazon.jsii.JsiiObjectMapper.INSTANCE;
final com.fasterxml.jackson.databind.node.ObjectNode data = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
if (this.getMessage() != null) {
data.set("message", om.valueToTree(this.getMessage()));
}
if (this.getPartitionKeyPath() != null) {
data.set("partitionKeyPath", om.valueToTree(this.getPartitionKeyPath()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@aws-cdk/aws-events-targets.KinesisStreamProps"));
struct.set("data", data);
final com.fasterxml.jackson.databind.node.ObjectNode obj = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
obj.set("$jsii.struct", struct);
return obj;
}
@Override
public final boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
KinesisStreamProps.Jsii$Proxy that = (KinesisStreamProps.Jsii$Proxy) o;
if (this.message != null ? !this.message.equals(that.message) : that.message != null) return false;
return this.partitionKeyPath != null ? this.partitionKeyPath.equals(that.partitionKeyPath) : that.partitionKeyPath == null;
}
@Override
public final int hashCode() {
int result = this.message != null ? this.message.hashCode() : 0;
result = 31 * result + (this.partitionKeyPath != null ? this.partitionKeyPath.hashCode() : 0);
return result;
}
}
}