io.github.cdklabs.cdk.cicd.wrapper.PipelineProps Maven / Gradle / Ivy
Show all versions of cdk-cicd-wrapper Show documentation
package io.github.cdklabs.cdk.cicd.wrapper;
/**
* Props for configuring the pipeline.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-09-03T16:35:59.345Z")
@software.amazon.jsii.Jsii(module = io.github.cdklabs.cdk.cicd.wrapper.$Module.class, fqn = "@cdklabs/cdk-cicd-wrapper.PipelineProps")
@software.amazon.jsii.Jsii.Proxy(PipelineProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface PipelineProps extends software.amazon.jsii.JsiiSerializable {
/**
* The branch to be used from the source repository.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@org.jetbrains.annotations.NotNull java.lang.String getBranch();
/**
* The CI commands to be executed as part of the Synth step.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@org.jetbrains.annotations.NotNull software.amazon.awscdk.services.codebuild.BuildSpec getCiBuildSpec();
/**
* Default options for CodeBuild projects in the pipeline.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@org.jetbrains.annotations.NotNull software.amazon.awscdk.pipelines.CodeBuildOptions getCodeBuildDefaults();
/**
* The primary output directory for the synth step.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@org.jetbrains.annotations.NotNull java.lang.String getPrimaryOutputDirectory();
/**
* The source repository for the pipeline.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@org.jetbrains.annotations.NotNull software.amazon.awscdk.pipelines.IFileSetProducer getRepositoryInput();
/**
* The Docker image to be used for the build project.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.codebuild.IBuildImage getBuildImage() {
return null;
}
/**
* The severity threshold for CodeGuru security scans.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable io.github.cdklabs.cdk.cicd.wrapper.CodeGuruSeverityThreshold getCodeGuruScanThreshold() {
return null;
}
/**
* Additional install commands to be executed before the synth step.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.util.List getInstallCommands() {
return null;
}
/**
* Whether Docker should be enabled for synth.
*
* Default: false
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.Boolean getIsDockerEnabledForSynth() {
return null;
}
/**
* Additional Pipeline options.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable io.github.cdklabs.cdk.cicd.wrapper.PipelineOptions getOptions() {
return null;
}
/**
* Pipeline variables to be passed as environment variables.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.util.Map getPipelineVariables() {
return null;
}
/**
* Default options for the synth CodeBuild project.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.pipelines.CodeBuildOptions getSynthCodeBuildDefaults() {
return null;
}
/**
* VPC configuration for the pipeline.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable io.github.cdklabs.cdk.cicd.wrapper.VpcProps getVpcProps() {
return null;
}
/**
* @return a {@link Builder} of {@link PipelineProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link PipelineProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
java.lang.String branch;
software.amazon.awscdk.services.codebuild.BuildSpec ciBuildSpec;
software.amazon.awscdk.pipelines.CodeBuildOptions codeBuildDefaults;
java.lang.String primaryOutputDirectory;
software.amazon.awscdk.pipelines.IFileSetProducer repositoryInput;
software.amazon.awscdk.services.codebuild.IBuildImage buildImage;
io.github.cdklabs.cdk.cicd.wrapper.CodeGuruSeverityThreshold codeGuruScanThreshold;
java.util.List installCommands;
java.lang.Boolean isDockerEnabledForSynth;
io.github.cdklabs.cdk.cicd.wrapper.PipelineOptions options;
java.util.Map pipelineVariables;
software.amazon.awscdk.pipelines.CodeBuildOptions synthCodeBuildDefaults;
io.github.cdklabs.cdk.cicd.wrapper.VpcProps vpcProps;
/**
* Sets the value of {@link PipelineProps#getBranch}
* @param branch The branch to be used from the source repository. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder branch(java.lang.String branch) {
this.branch = branch;
return this;
}
/**
* Sets the value of {@link PipelineProps#getCiBuildSpec}
* @param ciBuildSpec The CI commands to be executed as part of the Synth step. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder ciBuildSpec(software.amazon.awscdk.services.codebuild.BuildSpec ciBuildSpec) {
this.ciBuildSpec = ciBuildSpec;
return this;
}
/**
* Sets the value of {@link PipelineProps#getCodeBuildDefaults}
* @param codeBuildDefaults Default options for CodeBuild projects in the pipeline. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder codeBuildDefaults(software.amazon.awscdk.pipelines.CodeBuildOptions codeBuildDefaults) {
this.codeBuildDefaults = codeBuildDefaults;
return this;
}
/**
* Sets the value of {@link PipelineProps#getPrimaryOutputDirectory}
* @param primaryOutputDirectory The primary output directory for the synth step. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder primaryOutputDirectory(java.lang.String primaryOutputDirectory) {
this.primaryOutputDirectory = primaryOutputDirectory;
return this;
}
/**
* Sets the value of {@link PipelineProps#getRepositoryInput}
* @param repositoryInput The source repository for the pipeline. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder repositoryInput(software.amazon.awscdk.pipelines.IFileSetProducer repositoryInput) {
this.repositoryInput = repositoryInput;
return this;
}
/**
* Sets the value of {@link PipelineProps#getBuildImage}
* @param buildImage The Docker image to be used for the build project.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder buildImage(software.amazon.awscdk.services.codebuild.IBuildImage buildImage) {
this.buildImage = buildImage;
return this;
}
/**
* Sets the value of {@link PipelineProps#getCodeGuruScanThreshold}
* @param codeGuruScanThreshold The severity threshold for CodeGuru security scans.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder codeGuruScanThreshold(io.github.cdklabs.cdk.cicd.wrapper.CodeGuruSeverityThreshold codeGuruScanThreshold) {
this.codeGuruScanThreshold = codeGuruScanThreshold;
return this;
}
/**
* Sets the value of {@link PipelineProps#getInstallCommands}
* @param installCommands Additional install commands to be executed before the synth step.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder installCommands(java.util.List installCommands) {
this.installCommands = installCommands;
return this;
}
/**
* Sets the value of {@link PipelineProps#getIsDockerEnabledForSynth}
* @param isDockerEnabledForSynth Whether Docker should be enabled for synth.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder isDockerEnabledForSynth(java.lang.Boolean isDockerEnabledForSynth) {
this.isDockerEnabledForSynth = isDockerEnabledForSynth;
return this;
}
/**
* Sets the value of {@link PipelineProps#getOptions}
* @param options Additional Pipeline options.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder options(io.github.cdklabs.cdk.cicd.wrapper.PipelineOptions options) {
this.options = options;
return this;
}
/**
* Sets the value of {@link PipelineProps#getPipelineVariables}
* @param pipelineVariables Pipeline variables to be passed as environment variables.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder pipelineVariables(java.util.Map pipelineVariables) {
this.pipelineVariables = pipelineVariables;
return this;
}
/**
* Sets the value of {@link PipelineProps#getSynthCodeBuildDefaults}
* @param synthCodeBuildDefaults Default options for the synth CodeBuild project.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder synthCodeBuildDefaults(software.amazon.awscdk.pipelines.CodeBuildOptions synthCodeBuildDefaults) {
this.synthCodeBuildDefaults = synthCodeBuildDefaults;
return this;
}
/**
* Sets the value of {@link PipelineProps#getVpcProps}
* @param vpcProps VPC configuration for the pipeline.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder vpcProps(io.github.cdklabs.cdk.cicd.wrapper.VpcProps vpcProps) {
this.vpcProps = vpcProps;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link PipelineProps}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public PipelineProps build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link PipelineProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements PipelineProps {
private final java.lang.String branch;
private final software.amazon.awscdk.services.codebuild.BuildSpec ciBuildSpec;
private final software.amazon.awscdk.pipelines.CodeBuildOptions codeBuildDefaults;
private final java.lang.String primaryOutputDirectory;
private final software.amazon.awscdk.pipelines.IFileSetProducer repositoryInput;
private final software.amazon.awscdk.services.codebuild.IBuildImage buildImage;
private final io.github.cdklabs.cdk.cicd.wrapper.CodeGuruSeverityThreshold codeGuruScanThreshold;
private final java.util.List installCommands;
private final java.lang.Boolean isDockerEnabledForSynth;
private final io.github.cdklabs.cdk.cicd.wrapper.PipelineOptions options;
private final java.util.Map pipelineVariables;
private final software.amazon.awscdk.pipelines.CodeBuildOptions synthCodeBuildDefaults;
private final io.github.cdklabs.cdk.cicd.wrapper.VpcProps vpcProps;
/**
* 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.branch = software.amazon.jsii.Kernel.get(this, "branch", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.ciBuildSpec = software.amazon.jsii.Kernel.get(this, "ciBuildSpec", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.codebuild.BuildSpec.class));
this.codeBuildDefaults = software.amazon.jsii.Kernel.get(this, "codeBuildDefaults", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.pipelines.CodeBuildOptions.class));
this.primaryOutputDirectory = software.amazon.jsii.Kernel.get(this, "primaryOutputDirectory", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.repositoryInput = software.amazon.jsii.Kernel.get(this, "repositoryInput", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.pipelines.IFileSetProducer.class));
this.buildImage = software.amazon.jsii.Kernel.get(this, "buildImage", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.codebuild.IBuildImage.class));
this.codeGuruScanThreshold = software.amazon.jsii.Kernel.get(this, "codeGuruScanThreshold", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.cdk.cicd.wrapper.CodeGuruSeverityThreshold.class));
this.installCommands = software.amazon.jsii.Kernel.get(this, "installCommands", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class)));
this.isDockerEnabledForSynth = software.amazon.jsii.Kernel.get(this, "isDockerEnabledForSynth", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.options = software.amazon.jsii.Kernel.get(this, "options", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.cdk.cicd.wrapper.PipelineOptions.class));
this.pipelineVariables = software.amazon.jsii.Kernel.get(this, "pipelineVariables", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class)));
this.synthCodeBuildDefaults = software.amazon.jsii.Kernel.get(this, "synthCodeBuildDefaults", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.pipelines.CodeBuildOptions.class));
this.vpcProps = software.amazon.jsii.Kernel.get(this, "vpcProps", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.cdk.cicd.wrapper.VpcProps.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.branch = java.util.Objects.requireNonNull(builder.branch, "branch is required");
this.ciBuildSpec = java.util.Objects.requireNonNull(builder.ciBuildSpec, "ciBuildSpec is required");
this.codeBuildDefaults = java.util.Objects.requireNonNull(builder.codeBuildDefaults, "codeBuildDefaults is required");
this.primaryOutputDirectory = java.util.Objects.requireNonNull(builder.primaryOutputDirectory, "primaryOutputDirectory is required");
this.repositoryInput = java.util.Objects.requireNonNull(builder.repositoryInput, "repositoryInput is required");
this.buildImage = builder.buildImage;
this.codeGuruScanThreshold = builder.codeGuruScanThreshold;
this.installCommands = builder.installCommands;
this.isDockerEnabledForSynth = builder.isDockerEnabledForSynth;
this.options = builder.options;
this.pipelineVariables = builder.pipelineVariables;
this.synthCodeBuildDefaults = builder.synthCodeBuildDefaults;
this.vpcProps = builder.vpcProps;
}
@Override
public final java.lang.String getBranch() {
return this.branch;
}
@Override
public final software.amazon.awscdk.services.codebuild.BuildSpec getCiBuildSpec() {
return this.ciBuildSpec;
}
@Override
public final software.amazon.awscdk.pipelines.CodeBuildOptions getCodeBuildDefaults() {
return this.codeBuildDefaults;
}
@Override
public final java.lang.String getPrimaryOutputDirectory() {
return this.primaryOutputDirectory;
}
@Override
public final software.amazon.awscdk.pipelines.IFileSetProducer getRepositoryInput() {
return this.repositoryInput;
}
@Override
public final software.amazon.awscdk.services.codebuild.IBuildImage getBuildImage() {
return this.buildImage;
}
@Override
public final io.github.cdklabs.cdk.cicd.wrapper.CodeGuruSeverityThreshold getCodeGuruScanThreshold() {
return this.codeGuruScanThreshold;
}
@Override
public final java.util.List getInstallCommands() {
return this.installCommands;
}
@Override
public final java.lang.Boolean getIsDockerEnabledForSynth() {
return this.isDockerEnabledForSynth;
}
@Override
public final io.github.cdklabs.cdk.cicd.wrapper.PipelineOptions getOptions() {
return this.options;
}
@Override
public final java.util.Map getPipelineVariables() {
return this.pipelineVariables;
}
@Override
public final software.amazon.awscdk.pipelines.CodeBuildOptions getSynthCodeBuildDefaults() {
return this.synthCodeBuildDefaults;
}
@Override
public final io.github.cdklabs.cdk.cicd.wrapper.VpcProps getVpcProps() {
return this.vpcProps;
}
@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("branch", om.valueToTree(this.getBranch()));
data.set("ciBuildSpec", om.valueToTree(this.getCiBuildSpec()));
data.set("codeBuildDefaults", om.valueToTree(this.getCodeBuildDefaults()));
data.set("primaryOutputDirectory", om.valueToTree(this.getPrimaryOutputDirectory()));
data.set("repositoryInput", om.valueToTree(this.getRepositoryInput()));
if (this.getBuildImage() != null) {
data.set("buildImage", om.valueToTree(this.getBuildImage()));
}
if (this.getCodeGuruScanThreshold() != null) {
data.set("codeGuruScanThreshold", om.valueToTree(this.getCodeGuruScanThreshold()));
}
if (this.getInstallCommands() != null) {
data.set("installCommands", om.valueToTree(this.getInstallCommands()));
}
if (this.getIsDockerEnabledForSynth() != null) {
data.set("isDockerEnabledForSynth", om.valueToTree(this.getIsDockerEnabledForSynth()));
}
if (this.getOptions() != null) {
data.set("options", om.valueToTree(this.getOptions()));
}
if (this.getPipelineVariables() != null) {
data.set("pipelineVariables", om.valueToTree(this.getPipelineVariables()));
}
if (this.getSynthCodeBuildDefaults() != null) {
data.set("synthCodeBuildDefaults", om.valueToTree(this.getSynthCodeBuildDefaults()));
}
if (this.getVpcProps() != null) {
data.set("vpcProps", om.valueToTree(this.getVpcProps()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@cdklabs/cdk-cicd-wrapper.PipelineProps"));
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;
PipelineProps.Jsii$Proxy that = (PipelineProps.Jsii$Proxy) o;
if (!branch.equals(that.branch)) return false;
if (!ciBuildSpec.equals(that.ciBuildSpec)) return false;
if (!codeBuildDefaults.equals(that.codeBuildDefaults)) return false;
if (!primaryOutputDirectory.equals(that.primaryOutputDirectory)) return false;
if (!repositoryInput.equals(that.repositoryInput)) return false;
if (this.buildImage != null ? !this.buildImage.equals(that.buildImage) : that.buildImage != null) return false;
if (this.codeGuruScanThreshold != null ? !this.codeGuruScanThreshold.equals(that.codeGuruScanThreshold) : that.codeGuruScanThreshold != null) return false;
if (this.installCommands != null ? !this.installCommands.equals(that.installCommands) : that.installCommands != null) return false;
if (this.isDockerEnabledForSynth != null ? !this.isDockerEnabledForSynth.equals(that.isDockerEnabledForSynth) : that.isDockerEnabledForSynth != null) return false;
if (this.options != null ? !this.options.equals(that.options) : that.options != null) return false;
if (this.pipelineVariables != null ? !this.pipelineVariables.equals(that.pipelineVariables) : that.pipelineVariables != null) return false;
if (this.synthCodeBuildDefaults != null ? !this.synthCodeBuildDefaults.equals(that.synthCodeBuildDefaults) : that.synthCodeBuildDefaults != null) return false;
return this.vpcProps != null ? this.vpcProps.equals(that.vpcProps) : that.vpcProps == null;
}
@Override
public final int hashCode() {
int result = this.branch.hashCode();
result = 31 * result + (this.ciBuildSpec.hashCode());
result = 31 * result + (this.codeBuildDefaults.hashCode());
result = 31 * result + (this.primaryOutputDirectory.hashCode());
result = 31 * result + (this.repositoryInput.hashCode());
result = 31 * result + (this.buildImage != null ? this.buildImage.hashCode() : 0);
result = 31 * result + (this.codeGuruScanThreshold != null ? this.codeGuruScanThreshold.hashCode() : 0);
result = 31 * result + (this.installCommands != null ? this.installCommands.hashCode() : 0);
result = 31 * result + (this.isDockerEnabledForSynth != null ? this.isDockerEnabledForSynth.hashCode() : 0);
result = 31 * result + (this.options != null ? this.options.hashCode() : 0);
result = 31 * result + (this.pipelineVariables != null ? this.pipelineVariables.hashCode() : 0);
result = 31 * result + (this.synthCodeBuildDefaults != null ? this.synthCodeBuildDefaults.hashCode() : 0);
result = 31 * result + (this.vpcProps != null ? this.vpcProps.hashCode() : 0);
return result;
}
}
}