software.amazon.awscdk.services.pipes.sources.alpha.SqsSourceParameters Maven / Gradle / Ivy
Show all versions of pipes-sources-alpha Show documentation
package software.amazon.awscdk.services.pipes.sources.alpha;
/**
* (experimental) Parameters for the SQS source.
*
* Example:
*
*
* Queue sourceQueue;
* Queue targetQueue;
* SqsSource pipeSource = SqsSource.Builder.create(sourceQueue)
* .batchSize(10)
* .maximumBatchingWindow(Duration.seconds(10))
* .build();
* Pipe pipe = Pipe.Builder.create(this, "Pipe")
* .source(pipeSource)
* .target(new SqsTarget(targetQueue))
* .build();
*
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.104.0 (build e79254c)", date = "2024-11-13T21:17:43.522Z")
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.pipes.sources.alpha.$Module.class, fqn = "@aws-cdk/aws-pipes-sources-alpha.SqsSourceParameters")
@software.amazon.jsii.Jsii.Proxy(SqsSourceParameters.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface SqsSourceParameters extends software.amazon.jsii.JsiiSerializable {
/**
* (experimental) The maximum number of records to include in each batch.
*
* Default: 10
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-pipes-pipe-pipesourcesqsqueueparameters.html#cfn-pipes-pipe-pipesourcesqsqueueparameters-batchsize
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.Number getBatchSize() {
return null;
}
/**
* (experimental) The maximum length of a time to wait for events.
*
* Default: 1
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-pipes-pipe-pipesourcesqsqueueparameters.html#cfn-pipes-pipe-pipesourcesqsqueueparameters-maximumbatchingwindowinseconds
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.Duration getMaximumBatchingWindow() {
return null;
}
/**
* @return a {@link Builder} of {@link SqsSourceParameters}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link SqsSourceParameters}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
java.lang.Number batchSize;
software.amazon.awscdk.Duration maximumBatchingWindow;
/**
* Sets the value of {@link SqsSourceParameters#getBatchSize}
* @param batchSize The maximum number of records to include in each batch.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder batchSize(java.lang.Number batchSize) {
this.batchSize = batchSize;
return this;
}
/**
* Sets the value of {@link SqsSourceParameters#getMaximumBatchingWindow}
* @param maximumBatchingWindow The maximum length of a time to wait for events.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder maximumBatchingWindow(software.amazon.awscdk.Duration maximumBatchingWindow) {
this.maximumBatchingWindow = maximumBatchingWindow;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link SqsSourceParameters}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public SqsSourceParameters build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link SqsSourceParameters}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements SqsSourceParameters {
private final java.lang.Number batchSize;
private final software.amazon.awscdk.Duration maximumBatchingWindow;
/**
* 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.batchSize = software.amazon.jsii.Kernel.get(this, "batchSize", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
this.maximumBatchingWindow = software.amazon.jsii.Kernel.get(this, "maximumBatchingWindow", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.Duration.class));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
protected Jsii$Proxy(final Builder builder) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.batchSize = builder.batchSize;
this.maximumBatchingWindow = builder.maximumBatchingWindow;
}
@Override
public final java.lang.Number getBatchSize() {
return this.batchSize;
}
@Override
public final software.amazon.awscdk.Duration getMaximumBatchingWindow() {
return this.maximumBatchingWindow;
}
@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.getBatchSize() != null) {
data.set("batchSize", om.valueToTree(this.getBatchSize()));
}
if (this.getMaximumBatchingWindow() != null) {
data.set("maximumBatchingWindow", om.valueToTree(this.getMaximumBatchingWindow()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@aws-cdk/aws-pipes-sources-alpha.SqsSourceParameters"));
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;
SqsSourceParameters.Jsii$Proxy that = (SqsSourceParameters.Jsii$Proxy) o;
if (this.batchSize != null ? !this.batchSize.equals(that.batchSize) : that.batchSize != null) return false;
return this.maximumBatchingWindow != null ? this.maximumBatchingWindow.equals(that.maximumBatchingWindow) : that.maximumBatchingWindow == null;
}
@Override
public final int hashCode() {
int result = this.batchSize != null ? this.batchSize.hashCode() : 0;
result = 31 * result + (this.maximumBatchingWindow != null ? this.maximumBatchingWindow.hashCode() : 0);
return result;
}
}
}