io.github.cdklabs.cdk.ecs.codedeploy.AppSpecHooks Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cdk-ecs-codedeploy Show documentation
Show all versions of cdk-ecs-codedeploy Show documentation
CDK Constructs for performing ECS Deployments with CodeDeploy
package io.github.cdklabs.cdk.ecs.codedeploy;
/**
* (experimental) Lifecycle hooks configuration.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-10-05T18:15:38.103Z")
@software.amazon.jsii.Jsii(module = io.github.cdklabs.cdk.ecs.codedeploy.$Module.class, fqn = "@cdklabs/cdk-ecs-codedeploy.AppSpecHooks")
@software.amazon.jsii.Jsii.Proxy(AppSpecHooks.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface AppSpecHooks extends software.amazon.jsii.JsiiSerializable {
/**
* (experimental) Lambda or ARN of a lambda to run tasks after the test listener serves traffic to the replacement task set.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.Object getAfterAllowTestTraffic() {
return null;
}
/**
* (experimental) Lambda or ARN of a lambda to run tasks after the second target group serves traffic to the replacement task set.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.Object getAfterAllowTraffic() {
return null;
}
/**
* (experimental) Lambda or ARN of a lambda to run tasks after the replacement task set is created and one of the target groups is associated with it.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.Object getAfterInstall() {
return null;
}
/**
* (experimental) Lambda or ARN of a lambda to run tasks after the second target group is associated with the replacement task set, but before traffic is shifted to the replacement task set.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.Object getBeforeAllowTraffic() {
return null;
}
/**
* (experimental) Lambda or ARN of a lambda to run tasks before the replacement task set is created.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.Object getBeforeInstall() {
return null;
}
/**
* @return a {@link Builder} of {@link AppSpecHooks}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link AppSpecHooks}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
java.lang.Object afterAllowTestTraffic;
java.lang.Object afterAllowTraffic;
java.lang.Object afterInstall;
java.lang.Object beforeAllowTraffic;
java.lang.Object beforeInstall;
/**
* Sets the value of {@link AppSpecHooks#getAfterAllowTestTraffic}
* @param afterAllowTestTraffic Lambda or ARN of a lambda to run tasks after the test listener serves traffic to the replacement task set.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder afterAllowTestTraffic(java.lang.String afterAllowTestTraffic) {
this.afterAllowTestTraffic = afterAllowTestTraffic;
return this;
}
/**
* Sets the value of {@link AppSpecHooks#getAfterAllowTestTraffic}
* @param afterAllowTestTraffic Lambda or ARN of a lambda to run tasks after the test listener serves traffic to the replacement task set.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder afterAllowTestTraffic(software.amazon.awscdk.services.lambda.IFunction afterAllowTestTraffic) {
this.afterAllowTestTraffic = afterAllowTestTraffic;
return this;
}
/**
* Sets the value of {@link AppSpecHooks#getAfterAllowTraffic}
* @param afterAllowTraffic Lambda or ARN of a lambda to run tasks after the second target group serves traffic to the replacement task set.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder afterAllowTraffic(java.lang.String afterAllowTraffic) {
this.afterAllowTraffic = afterAllowTraffic;
return this;
}
/**
* Sets the value of {@link AppSpecHooks#getAfterAllowTraffic}
* @param afterAllowTraffic Lambda or ARN of a lambda to run tasks after the second target group serves traffic to the replacement task set.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder afterAllowTraffic(software.amazon.awscdk.services.lambda.IFunction afterAllowTraffic) {
this.afterAllowTraffic = afterAllowTraffic;
return this;
}
/**
* Sets the value of {@link AppSpecHooks#getAfterInstall}
* @param afterInstall Lambda or ARN of a lambda to run tasks after the replacement task set is created and one of the target groups is associated with it.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder afterInstall(java.lang.String afterInstall) {
this.afterInstall = afterInstall;
return this;
}
/**
* Sets the value of {@link AppSpecHooks#getAfterInstall}
* @param afterInstall Lambda or ARN of a lambda to run tasks after the replacement task set is created and one of the target groups is associated with it.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder afterInstall(software.amazon.awscdk.services.lambda.IFunction afterInstall) {
this.afterInstall = afterInstall;
return this;
}
/**
* Sets the value of {@link AppSpecHooks#getBeforeAllowTraffic}
* @param beforeAllowTraffic Lambda or ARN of a lambda to run tasks after the second target group is associated with the replacement task set, but before traffic is shifted to the replacement task set.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder beforeAllowTraffic(java.lang.String beforeAllowTraffic) {
this.beforeAllowTraffic = beforeAllowTraffic;
return this;
}
/**
* Sets the value of {@link AppSpecHooks#getBeforeAllowTraffic}
* @param beforeAllowTraffic Lambda or ARN of a lambda to run tasks after the second target group is associated with the replacement task set, but before traffic is shifted to the replacement task set.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder beforeAllowTraffic(software.amazon.awscdk.services.lambda.IFunction beforeAllowTraffic) {
this.beforeAllowTraffic = beforeAllowTraffic;
return this;
}
/**
* Sets the value of {@link AppSpecHooks#getBeforeInstall}
* @param beforeInstall Lambda or ARN of a lambda to run tasks before the replacement task set is created.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder beforeInstall(java.lang.String beforeInstall) {
this.beforeInstall = beforeInstall;
return this;
}
/**
* Sets the value of {@link AppSpecHooks#getBeforeInstall}
* @param beforeInstall Lambda or ARN of a lambda to run tasks before the replacement task set is created.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder beforeInstall(software.amazon.awscdk.services.lambda.IFunction beforeInstall) {
this.beforeInstall = beforeInstall;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link AppSpecHooks}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public AppSpecHooks build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link AppSpecHooks}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements AppSpecHooks {
private final java.lang.Object afterAllowTestTraffic;
private final java.lang.Object afterAllowTraffic;
private final java.lang.Object afterInstall;
private final java.lang.Object beforeAllowTraffic;
private final java.lang.Object beforeInstall;
/**
* 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.afterAllowTestTraffic = software.amazon.jsii.Kernel.get(this, "afterAllowTestTraffic", software.amazon.jsii.NativeType.forClass(java.lang.Object.class));
this.afterAllowTraffic = software.amazon.jsii.Kernel.get(this, "afterAllowTraffic", software.amazon.jsii.NativeType.forClass(java.lang.Object.class));
this.afterInstall = software.amazon.jsii.Kernel.get(this, "afterInstall", software.amazon.jsii.NativeType.forClass(java.lang.Object.class));
this.beforeAllowTraffic = software.amazon.jsii.Kernel.get(this, "beforeAllowTraffic", software.amazon.jsii.NativeType.forClass(java.lang.Object.class));
this.beforeInstall = software.amazon.jsii.Kernel.get(this, "beforeInstall", software.amazon.jsii.NativeType.forClass(java.lang.Object.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.afterAllowTestTraffic = builder.afterAllowTestTraffic;
this.afterAllowTraffic = builder.afterAllowTraffic;
this.afterInstall = builder.afterInstall;
this.beforeAllowTraffic = builder.beforeAllowTraffic;
this.beforeInstall = builder.beforeInstall;
}
@Override
public final java.lang.Object getAfterAllowTestTraffic() {
return this.afterAllowTestTraffic;
}
@Override
public final java.lang.Object getAfterAllowTraffic() {
return this.afterAllowTraffic;
}
@Override
public final java.lang.Object getAfterInstall() {
return this.afterInstall;
}
@Override
public final java.lang.Object getBeforeAllowTraffic() {
return this.beforeAllowTraffic;
}
@Override
public final java.lang.Object getBeforeInstall() {
return this.beforeInstall;
}
@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.getAfterAllowTestTraffic() != null) {
data.set("afterAllowTestTraffic", om.valueToTree(this.getAfterAllowTestTraffic()));
}
if (this.getAfterAllowTraffic() != null) {
data.set("afterAllowTraffic", om.valueToTree(this.getAfterAllowTraffic()));
}
if (this.getAfterInstall() != null) {
data.set("afterInstall", om.valueToTree(this.getAfterInstall()));
}
if (this.getBeforeAllowTraffic() != null) {
data.set("beforeAllowTraffic", om.valueToTree(this.getBeforeAllowTraffic()));
}
if (this.getBeforeInstall() != null) {
data.set("beforeInstall", om.valueToTree(this.getBeforeInstall()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@cdklabs/cdk-ecs-codedeploy.AppSpecHooks"));
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;
AppSpecHooks.Jsii$Proxy that = (AppSpecHooks.Jsii$Proxy) o;
if (this.afterAllowTestTraffic != null ? !this.afterAllowTestTraffic.equals(that.afterAllowTestTraffic) : that.afterAllowTestTraffic != null) return false;
if (this.afterAllowTraffic != null ? !this.afterAllowTraffic.equals(that.afterAllowTraffic) : that.afterAllowTraffic != null) return false;
if (this.afterInstall != null ? !this.afterInstall.equals(that.afterInstall) : that.afterInstall != null) return false;
if (this.beforeAllowTraffic != null ? !this.beforeAllowTraffic.equals(that.beforeAllowTraffic) : that.beforeAllowTraffic != null) return false;
return this.beforeInstall != null ? this.beforeInstall.equals(that.beforeInstall) : that.beforeInstall == null;
}
@Override
public final int hashCode() {
int result = this.afterAllowTestTraffic != null ? this.afterAllowTestTraffic.hashCode() : 0;
result = 31 * result + (this.afterAllowTraffic != null ? this.afterAllowTraffic.hashCode() : 0);
result = 31 * result + (this.afterInstall != null ? this.afterInstall.hashCode() : 0);
result = 31 * result + (this.beforeAllowTraffic != null ? this.beforeAllowTraffic.hashCode() : 0);
result = 31 * result + (this.beforeInstall != null ? this.beforeInstall.hashCode() : 0);
return result;
}
}
}