io.github.cdklabs.cdkecsserviceextensions.EnvironmentAttributes Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cdk-ecs-service-extensions Show documentation
Show all versions of cdk-ecs-service-extensions Show documentation
The CDK Construct Library that helps you build ECS services using simple extensions
package io.github.cdklabs.cdkecsserviceextensions;
/**
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-09-25T00:29:02.301Z")
@software.amazon.jsii.Jsii(module = io.github.cdklabs.cdkecsserviceextensions.$Module.class, fqn = "@aws-cdk-containers/ecs-service-extensions.EnvironmentAttributes")
@software.amazon.jsii.Jsii.Proxy(EnvironmentAttributes.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface EnvironmentAttributes extends software.amazon.jsii.JsiiSerializable {
/**
* (experimental) The capacity type used by the service's cluster.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull io.github.cdklabs.cdkecsserviceextensions.EnvironmentCapacityType getCapacityType();
/**
* (experimental) The cluster that is providing capacity for this service.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull software.amazon.awscdk.services.ecs.ICluster getCluster();
/**
* @return a {@link Builder} of {@link EnvironmentAttributes}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link EnvironmentAttributes}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
io.github.cdklabs.cdkecsserviceextensions.EnvironmentCapacityType capacityType;
software.amazon.awscdk.services.ecs.ICluster cluster;
/**
* Sets the value of {@link EnvironmentAttributes#getCapacityType}
* @param capacityType The capacity type used by the service's cluster. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder capacityType(io.github.cdklabs.cdkecsserviceextensions.EnvironmentCapacityType capacityType) {
this.capacityType = capacityType;
return this;
}
/**
* Sets the value of {@link EnvironmentAttributes#getCluster}
* @param cluster The cluster that is providing capacity for this service. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder cluster(software.amazon.awscdk.services.ecs.ICluster cluster) {
this.cluster = cluster;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link EnvironmentAttributes}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public EnvironmentAttributes build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link EnvironmentAttributes}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements EnvironmentAttributes {
private final io.github.cdklabs.cdkecsserviceextensions.EnvironmentCapacityType capacityType;
private final software.amazon.awscdk.services.ecs.ICluster cluster;
/**
* 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.capacityType = software.amazon.jsii.Kernel.get(this, "capacityType", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.cdkecsserviceextensions.EnvironmentCapacityType.class));
this.cluster = software.amazon.jsii.Kernel.get(this, "cluster", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ecs.ICluster.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.capacityType = java.util.Objects.requireNonNull(builder.capacityType, "capacityType is required");
this.cluster = java.util.Objects.requireNonNull(builder.cluster, "cluster is required");
}
@Override
public final io.github.cdklabs.cdkecsserviceextensions.EnvironmentCapacityType getCapacityType() {
return this.capacityType;
}
@Override
public final software.amazon.awscdk.services.ecs.ICluster getCluster() {
return this.cluster;
}
@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();
data.set("capacityType", om.valueToTree(this.getCapacityType()));
data.set("cluster", om.valueToTree(this.getCluster()));
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.EnvironmentAttributes"));
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;
EnvironmentAttributes.Jsii$Proxy that = (EnvironmentAttributes.Jsii$Proxy) o;
if (!capacityType.equals(that.capacityType)) return false;
return this.cluster.equals(that.cluster);
}
@Override
public final int hashCode() {
int result = this.capacityType.hashCode();
result = 31 * result + (this.cluster.hashCode());
return result;
}
}
}