io.github.cdklabs.cdkecsserviceextensions.QueueExtensionProps Maven / Gradle / Ivy
Show all versions of cdk-ecs-service-extensions Show documentation
package io.github.cdklabs.cdkecsserviceextensions;
/**
* (experimental) The settings for the Queue extension.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-09-28T00:28:59.617Z")
@software.amazon.jsii.Jsii(module = io.github.cdklabs.cdkecsserviceextensions.$Module.class, fqn = "@aws-cdk-containers/ecs-service-extensions.QueueExtensionProps")
@software.amazon.jsii.Jsii.Proxy(QueueExtensionProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface QueueExtensionProps extends software.amazon.jsii.JsiiSerializable {
/**
* (experimental) The user-provided default queue for this service.
*
* If the eventsQueue
is not provided, a default SQS Queue is created for the service.
*
* Default: none
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.sqs.IQueue getEventsQueue() {
return null;
}
/**
* (experimental) The user-provided queue delay fields to configure auto scaling for the default queue.
*
* Default: none
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable io.github.cdklabs.cdkecsserviceextensions.QueueAutoScalingOptions getScaleOnLatency() {
return null;
}
/**
* (experimental) The list of subscriptions for this service.
*
* Default: none
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.util.List getSubscriptions() {
return null;
}
/**
* @return a {@link Builder} of {@link QueueExtensionProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link QueueExtensionProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
software.amazon.awscdk.services.sqs.IQueue eventsQueue;
io.github.cdklabs.cdkecsserviceextensions.QueueAutoScalingOptions scaleOnLatency;
java.util.List subscriptions;
/**
* Sets the value of {@link QueueExtensionProps#getEventsQueue}
* @param eventsQueue The user-provided default queue for this service.
* If the eventsQueue
is not provided, a default SQS Queue is created for the service.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder eventsQueue(software.amazon.awscdk.services.sqs.IQueue eventsQueue) {
this.eventsQueue = eventsQueue;
return this;
}
/**
* Sets the value of {@link QueueExtensionProps#getScaleOnLatency}
* @param scaleOnLatency The user-provided queue delay fields to configure auto scaling for the default queue.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder scaleOnLatency(io.github.cdklabs.cdkecsserviceextensions.QueueAutoScalingOptions scaleOnLatency) {
this.scaleOnLatency = scaleOnLatency;
return this;
}
/**
* Sets the value of {@link QueueExtensionProps#getSubscriptions}
* @param subscriptions The list of subscriptions for this service.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@SuppressWarnings("unchecked")
public Builder subscriptions(java.util.List extends io.github.cdklabs.cdkecsserviceextensions.ISubscribable> subscriptions) {
this.subscriptions = (java.util.List)subscriptions;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link QueueExtensionProps}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public QueueExtensionProps build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link QueueExtensionProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements QueueExtensionProps {
private final software.amazon.awscdk.services.sqs.IQueue eventsQueue;
private final io.github.cdklabs.cdkecsserviceextensions.QueueAutoScalingOptions scaleOnLatency;
private final java.util.List subscriptions;
/**
* 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.eventsQueue = software.amazon.jsii.Kernel.get(this, "eventsQueue", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.sqs.IQueue.class));
this.scaleOnLatency = software.amazon.jsii.Kernel.get(this, "scaleOnLatency", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.cdkecsserviceextensions.QueueAutoScalingOptions.class));
this.subscriptions = software.amazon.jsii.Kernel.get(this, "subscriptions", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(io.github.cdklabs.cdkecsserviceextensions.ISubscribable.class)));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
@SuppressWarnings("unchecked")
protected Jsii$Proxy(final Builder builder) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.eventsQueue = builder.eventsQueue;
this.scaleOnLatency = builder.scaleOnLatency;
this.subscriptions = (java.util.List)builder.subscriptions;
}
@Override
public final software.amazon.awscdk.services.sqs.IQueue getEventsQueue() {
return this.eventsQueue;
}
@Override
public final io.github.cdklabs.cdkecsserviceextensions.QueueAutoScalingOptions getScaleOnLatency() {
return this.scaleOnLatency;
}
@Override
public final java.util.List getSubscriptions() {
return this.subscriptions;
}
@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.getEventsQueue() != null) {
data.set("eventsQueue", om.valueToTree(this.getEventsQueue()));
}
if (this.getScaleOnLatency() != null) {
data.set("scaleOnLatency", om.valueToTree(this.getScaleOnLatency()));
}
if (this.getSubscriptions() != null) {
data.set("subscriptions", om.valueToTree(this.getSubscriptions()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@aws-cdk-containers/ecs-service-extensions.QueueExtensionProps"));
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;
QueueExtensionProps.Jsii$Proxy that = (QueueExtensionProps.Jsii$Proxy) o;
if (this.eventsQueue != null ? !this.eventsQueue.equals(that.eventsQueue) : that.eventsQueue != null) return false;
if (this.scaleOnLatency != null ? !this.scaleOnLatency.equals(that.scaleOnLatency) : that.scaleOnLatency != null) return false;
return this.subscriptions != null ? this.subscriptions.equals(that.subscriptions) : that.subscriptions == null;
}
@Override
public final int hashCode() {
int result = this.eventsQueue != null ? this.eventsQueue.hashCode() : 0;
result = 31 * result + (this.scaleOnLatency != null ? this.scaleOnLatency.hashCode() : 0);
result = 31 * result + (this.subscriptions != null ? this.subscriptions.hashCode() : 0);
return result;
}
}
}