io.github.cdklabs.cdk.codepipeline.extensions.PipelineWithChangeControlProps Maven / Gradle / Ivy
Show all versions of cdk-codepipeline-extensions Show documentation
package io.github.cdklabs.cdk.codepipeline.extensions;
/**
* (experimental) Props for creating a pipeline with a change controller.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.94.0 (build b380f01)", date = "2024-02-26T00:08:15.543Z")
@software.amazon.jsii.Jsii(module = io.github.cdklabs.cdk.codepipeline.extensions.$Module.class, fqn = "@cdklabs/cdk-codepipeline-extensions.PipelineWithChangeControlProps")
@software.amazon.jsii.Jsii.Proxy(PipelineWithChangeControlProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface PipelineWithChangeControlProps extends software.amazon.jsii.JsiiSerializable {
/**
* (experimental) The calendar used for determining time windows.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull io.github.cdklabs.cdk.codepipeline.extensions.Calendar getChangeControlCalendar();
/**
* (experimental) The schedule on which to check the calendar.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull software.amazon.awscdk.services.events.Schedule getChangeControlCheckSchedule();
/**
* (experimental) The name of the pipeline.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull java.lang.String getPipelineName();
/**
* (experimental) The terms in the alarm descriptions to search for.
*
* These if the alarms containing those search terms are in ALARM,
* the stage transition will be closed.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull java.util.List getSearchTerms();
/**
* (experimental) The AWS CodeCommit repository to be used as the source stage.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull software.amazon.awscdk.services.codecommit.IRepository getSourceRepository();
/**
* (experimental) The role used for running the pipeline.
*
* Default: - A new role is created when the pipeline is created.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.iam.IRole getPipelineRole() {
return null;
}
/**
* @return a {@link Builder} of {@link PipelineWithChangeControlProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link PipelineWithChangeControlProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
io.github.cdklabs.cdk.codepipeline.extensions.Calendar changeControlCalendar;
software.amazon.awscdk.services.events.Schedule changeControlCheckSchedule;
java.lang.String pipelineName;
java.util.List searchTerms;
software.amazon.awscdk.services.codecommit.IRepository sourceRepository;
software.amazon.awscdk.services.iam.IRole pipelineRole;
/**
* Sets the value of {@link PipelineWithChangeControlProps#getChangeControlCalendar}
* @param changeControlCalendar The calendar used for determining time windows. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder changeControlCalendar(io.github.cdklabs.cdk.codepipeline.extensions.Calendar changeControlCalendar) {
this.changeControlCalendar = changeControlCalendar;
return this;
}
/**
* Sets the value of {@link PipelineWithChangeControlProps#getChangeControlCheckSchedule}
* @param changeControlCheckSchedule The schedule on which to check the calendar. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder changeControlCheckSchedule(software.amazon.awscdk.services.events.Schedule changeControlCheckSchedule) {
this.changeControlCheckSchedule = changeControlCheckSchedule;
return this;
}
/**
* Sets the value of {@link PipelineWithChangeControlProps#getPipelineName}
* @param pipelineName The name of the pipeline. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder pipelineName(java.lang.String pipelineName) {
this.pipelineName = pipelineName;
return this;
}
/**
* Sets the value of {@link PipelineWithChangeControlProps#getSearchTerms}
* @param searchTerms The terms in the alarm descriptions to search for. This parameter is required.
* These if the alarms containing those search terms are in ALARM,
* the stage transition will be closed.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder searchTerms(java.util.List searchTerms) {
this.searchTerms = searchTerms;
return this;
}
/**
* Sets the value of {@link PipelineWithChangeControlProps#getSourceRepository}
* @param sourceRepository The AWS CodeCommit repository to be used as the source stage. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder sourceRepository(software.amazon.awscdk.services.codecommit.IRepository sourceRepository) {
this.sourceRepository = sourceRepository;
return this;
}
/**
* Sets the value of {@link PipelineWithChangeControlProps#getPipelineRole}
* @param pipelineRole The role used for running the pipeline.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder pipelineRole(software.amazon.awscdk.services.iam.IRole pipelineRole) {
this.pipelineRole = pipelineRole;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link PipelineWithChangeControlProps}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public PipelineWithChangeControlProps build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link PipelineWithChangeControlProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements PipelineWithChangeControlProps {
private final io.github.cdklabs.cdk.codepipeline.extensions.Calendar changeControlCalendar;
private final software.amazon.awscdk.services.events.Schedule changeControlCheckSchedule;
private final java.lang.String pipelineName;
private final java.util.List searchTerms;
private final software.amazon.awscdk.services.codecommit.IRepository sourceRepository;
private final software.amazon.awscdk.services.iam.IRole pipelineRole;
/**
* 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.changeControlCalendar = software.amazon.jsii.Kernel.get(this, "changeControlCalendar", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.cdk.codepipeline.extensions.Calendar.class));
this.changeControlCheckSchedule = software.amazon.jsii.Kernel.get(this, "changeControlCheckSchedule", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.events.Schedule.class));
this.pipelineName = software.amazon.jsii.Kernel.get(this, "pipelineName", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.searchTerms = software.amazon.jsii.Kernel.get(this, "searchTerms", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class)));
this.sourceRepository = software.amazon.jsii.Kernel.get(this, "sourceRepository", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.codecommit.IRepository.class));
this.pipelineRole = software.amazon.jsii.Kernel.get(this, "pipelineRole", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.iam.IRole.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.changeControlCalendar = java.util.Objects.requireNonNull(builder.changeControlCalendar, "changeControlCalendar is required");
this.changeControlCheckSchedule = java.util.Objects.requireNonNull(builder.changeControlCheckSchedule, "changeControlCheckSchedule is required");
this.pipelineName = java.util.Objects.requireNonNull(builder.pipelineName, "pipelineName is required");
this.searchTerms = java.util.Objects.requireNonNull(builder.searchTerms, "searchTerms is required");
this.sourceRepository = java.util.Objects.requireNonNull(builder.sourceRepository, "sourceRepository is required");
this.pipelineRole = builder.pipelineRole;
}
@Override
public final io.github.cdklabs.cdk.codepipeline.extensions.Calendar getChangeControlCalendar() {
return this.changeControlCalendar;
}
@Override
public final software.amazon.awscdk.services.events.Schedule getChangeControlCheckSchedule() {
return this.changeControlCheckSchedule;
}
@Override
public final java.lang.String getPipelineName() {
return this.pipelineName;
}
@Override
public final java.util.List getSearchTerms() {
return this.searchTerms;
}
@Override
public final software.amazon.awscdk.services.codecommit.IRepository getSourceRepository() {
return this.sourceRepository;
}
@Override
public final software.amazon.awscdk.services.iam.IRole getPipelineRole() {
return this.pipelineRole;
}
@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("changeControlCalendar", om.valueToTree(this.getChangeControlCalendar()));
data.set("changeControlCheckSchedule", om.valueToTree(this.getChangeControlCheckSchedule()));
data.set("pipelineName", om.valueToTree(this.getPipelineName()));
data.set("searchTerms", om.valueToTree(this.getSearchTerms()));
data.set("sourceRepository", om.valueToTree(this.getSourceRepository()));
if (this.getPipelineRole() != null) {
data.set("pipelineRole", om.valueToTree(this.getPipelineRole()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@cdklabs/cdk-codepipeline-extensions.PipelineWithChangeControlProps"));
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;
PipelineWithChangeControlProps.Jsii$Proxy that = (PipelineWithChangeControlProps.Jsii$Proxy) o;
if (!changeControlCalendar.equals(that.changeControlCalendar)) return false;
if (!changeControlCheckSchedule.equals(that.changeControlCheckSchedule)) return false;
if (!pipelineName.equals(that.pipelineName)) return false;
if (!searchTerms.equals(that.searchTerms)) return false;
if (!sourceRepository.equals(that.sourceRepository)) return false;
return this.pipelineRole != null ? this.pipelineRole.equals(that.pipelineRole) : that.pipelineRole == null;
}
@Override
public final int hashCode() {
int result = this.changeControlCalendar.hashCode();
result = 31 * result + (this.changeControlCheckSchedule.hashCode());
result = 31 * result + (this.pipelineName.hashCode());
result = 31 * result + (this.searchTerms.hashCode());
result = 31 * result + (this.sourceRepository.hashCode());
result = 31 * result + (this.pipelineRole != null ? this.pipelineRole.hashCode() : 0);
return result;
}
}
}