io.github.cdklabs.cdk.ecs.codedeploy.EcsDeploymentProps Maven / Gradle / Ivy
Show all versions of cdk-ecs-codedeploy Show documentation
package io.github.cdklabs.cdk.ecs.codedeploy;
/**
* (experimental) Construction properties of EcsDeployment.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-10-04T18:24:15.168Z")
@software.amazon.jsii.Jsii(module = io.github.cdklabs.cdk.ecs.codedeploy.$Module.class, fqn = "@cdklabs/cdk-ecs-codedeploy.EcsDeploymentProps")
@software.amazon.jsii.Jsii.Proxy(EcsDeploymentProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface EcsDeploymentProps extends software.amazon.jsii.JsiiSerializable {
/**
* (experimental) The deployment group to target for this deployment.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull software.amazon.awscdk.services.codedeploy.IEcsDeploymentGroup getDeploymentGroup();
/**
* (experimental) The ECS service to target for the deployment.
*
* see: https://docs.aws.amazon.com/codedeploy/latest/userguide/reference-appspec-file-structure-resources.html#reference-appspec-file-structure-resources-ecs
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull io.github.cdklabs.cdk.ecs.codedeploy.TargetService getTargetService();
/**
* (experimental) The configuration for rollback in the event that a deployment fails.
*
* Default: : no automatic rollback triggered
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.codedeploy.AutoRollbackConfig getAutoRollback() {
return null;
}
/**
* (experimental) The description for the deployment.
*
* Default: no description
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.String getDescription() {
return null;
}
/**
* (experimental) Optional lifecycle hooks.
*
* Default: - no lifecycle hooks
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable io.github.cdklabs.cdk.ecs.codedeploy.AppSpecHooks getHooks() {
return null;
}
/**
* (experimental) The timeout for the deployment.
*
* If the timeout is reached, it will trigger a rollback of the stack.
*
* Default: 30 minutes
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.Duration getTimeout() {
return null;
}
/**
* @return a {@link Builder} of {@link EcsDeploymentProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link EcsDeploymentProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
software.amazon.awscdk.services.codedeploy.IEcsDeploymentGroup deploymentGroup;
io.github.cdklabs.cdk.ecs.codedeploy.TargetService targetService;
software.amazon.awscdk.services.codedeploy.AutoRollbackConfig autoRollback;
java.lang.String description;
io.github.cdklabs.cdk.ecs.codedeploy.AppSpecHooks hooks;
software.amazon.awscdk.Duration timeout;
/**
* Sets the value of {@link EcsDeploymentProps#getDeploymentGroup}
* @param deploymentGroup The deployment group to target for this deployment. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder deploymentGroup(software.amazon.awscdk.services.codedeploy.IEcsDeploymentGroup deploymentGroup) {
this.deploymentGroup = deploymentGroup;
return this;
}
/**
* Sets the value of {@link EcsDeploymentProps#getTargetService}
* @param targetService The ECS service to target for the deployment. This parameter is required.
* see: https://docs.aws.amazon.com/codedeploy/latest/userguide/reference-appspec-file-structure-resources.html#reference-appspec-file-structure-resources-ecs
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder targetService(io.github.cdklabs.cdk.ecs.codedeploy.TargetService targetService) {
this.targetService = targetService;
return this;
}
/**
* Sets the value of {@link EcsDeploymentProps#getAutoRollback}
* @param autoRollback The configuration for rollback in the event that a deployment fails.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder autoRollback(software.amazon.awscdk.services.codedeploy.AutoRollbackConfig autoRollback) {
this.autoRollback = autoRollback;
return this;
}
/**
* Sets the value of {@link EcsDeploymentProps#getDescription}
* @param description The description for the deployment.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder description(java.lang.String description) {
this.description = description;
return this;
}
/**
* Sets the value of {@link EcsDeploymentProps#getHooks}
* @param hooks Optional lifecycle hooks.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder hooks(io.github.cdklabs.cdk.ecs.codedeploy.AppSpecHooks hooks) {
this.hooks = hooks;
return this;
}
/**
* Sets the value of {@link EcsDeploymentProps#getTimeout}
* @param timeout The timeout for the deployment.
* If the timeout is reached, it will trigger a rollback of the stack.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder timeout(software.amazon.awscdk.Duration timeout) {
this.timeout = timeout;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link EcsDeploymentProps}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public EcsDeploymentProps build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link EcsDeploymentProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements EcsDeploymentProps {
private final software.amazon.awscdk.services.codedeploy.IEcsDeploymentGroup deploymentGroup;
private final io.github.cdklabs.cdk.ecs.codedeploy.TargetService targetService;
private final software.amazon.awscdk.services.codedeploy.AutoRollbackConfig autoRollback;
private final java.lang.String description;
private final io.github.cdklabs.cdk.ecs.codedeploy.AppSpecHooks hooks;
private final software.amazon.awscdk.Duration timeout;
/**
* 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.deploymentGroup = software.amazon.jsii.Kernel.get(this, "deploymentGroup", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.codedeploy.IEcsDeploymentGroup.class));
this.targetService = software.amazon.jsii.Kernel.get(this, "targetService", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.cdk.ecs.codedeploy.TargetService.class));
this.autoRollback = software.amazon.jsii.Kernel.get(this, "autoRollback", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.codedeploy.AutoRollbackConfig.class));
this.description = software.amazon.jsii.Kernel.get(this, "description", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.hooks = software.amazon.jsii.Kernel.get(this, "hooks", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.cdk.ecs.codedeploy.AppSpecHooks.class));
this.timeout = software.amazon.jsii.Kernel.get(this, "timeout", 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.deploymentGroup = java.util.Objects.requireNonNull(builder.deploymentGroup, "deploymentGroup is required");
this.targetService = java.util.Objects.requireNonNull(builder.targetService, "targetService is required");
this.autoRollback = builder.autoRollback;
this.description = builder.description;
this.hooks = builder.hooks;
this.timeout = builder.timeout;
}
@Override
public final software.amazon.awscdk.services.codedeploy.IEcsDeploymentGroup getDeploymentGroup() {
return this.deploymentGroup;
}
@Override
public final io.github.cdklabs.cdk.ecs.codedeploy.TargetService getTargetService() {
return this.targetService;
}
@Override
public final software.amazon.awscdk.services.codedeploy.AutoRollbackConfig getAutoRollback() {
return this.autoRollback;
}
@Override
public final java.lang.String getDescription() {
return this.description;
}
@Override
public final io.github.cdklabs.cdk.ecs.codedeploy.AppSpecHooks getHooks() {
return this.hooks;
}
@Override
public final software.amazon.awscdk.Duration getTimeout() {
return this.timeout;
}
@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("deploymentGroup", om.valueToTree(this.getDeploymentGroup()));
data.set("targetService", om.valueToTree(this.getTargetService()));
if (this.getAutoRollback() != null) {
data.set("autoRollback", om.valueToTree(this.getAutoRollback()));
}
if (this.getDescription() != null) {
data.set("description", om.valueToTree(this.getDescription()));
}
if (this.getHooks() != null) {
data.set("hooks", om.valueToTree(this.getHooks()));
}
if (this.getTimeout() != null) {
data.set("timeout", om.valueToTree(this.getTimeout()));
}
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.EcsDeploymentProps"));
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;
EcsDeploymentProps.Jsii$Proxy that = (EcsDeploymentProps.Jsii$Proxy) o;
if (!deploymentGroup.equals(that.deploymentGroup)) return false;
if (!targetService.equals(that.targetService)) return false;
if (this.autoRollback != null ? !this.autoRollback.equals(that.autoRollback) : that.autoRollback != null) return false;
if (this.description != null ? !this.description.equals(that.description) : that.description != null) return false;
if (this.hooks != null ? !this.hooks.equals(that.hooks) : that.hooks != null) return false;
return this.timeout != null ? this.timeout.equals(that.timeout) : that.timeout == null;
}
@Override
public final int hashCode() {
int result = this.deploymentGroup.hashCode();
result = 31 * result + (this.targetService.hashCode());
result = 31 * result + (this.autoRollback != null ? this.autoRollback.hashCode() : 0);
result = 31 * result + (this.description != null ? this.description.hashCode() : 0);
result = 31 * result + (this.hooks != null ? this.hooks.hashCode() : 0);
result = 31 * result + (this.timeout != null ? this.timeout.hashCode() : 0);
return result;
}
}
}