software.aws.awsprototypingsdk.pipeline.SonarCodeScannerConfig Maven / Gradle / Ivy
package software.aws.awsprototypingsdk.pipeline;
/**
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.71.0 (build f1f58ae)", date = "2022-12-07T01:30:43.878Z")
@software.amazon.jsii.Jsii(module = software.aws.awsprototypingsdk.$Module.class, fqn = "aws-prototyping-sdk.pipeline.SonarCodeScannerConfig")
@software.amazon.jsii.Jsii.Proxy(SonarCodeScannerConfig.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface SonarCodeScannerConfig extends software.amazon.jsii.JsiiSerializable {
/**
* Group name in Sonarqube with access to administer this project.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@org.jetbrains.annotations.NotNull java.lang.String getSonarqubeAuthorizedGroup();
/**
* Default profile/gate name i.e: your org profile.
*
* Note: These need to be set up in Sonarqube manually.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@org.jetbrains.annotations.NotNull java.lang.String getSonarqubeDefaultProfileOrGateName();
/**
* endpoint of the sonarqube instance i.e: https://.
*
* Note: Ensure a trailing '/' is not included.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@org.jetbrains.annotations.NotNull java.lang.String getSonarqubeEndpoint();
/**
* Name of the project to create in Sonarqube.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@org.jetbrains.annotations.NotNull java.lang.String getSonarqubeProjectName();
/**
* directory containing the synthesized cdk resources.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getCdkOutDir() {
return null;
}
/**
* path to a file containing the cfn nag suppression rules.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getCfnNagIgnorePath() {
return null;
}
/**
* glob patterns to exclude from sonar scan.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.util.List getExcludeGlobsForScan() {
return null;
}
/**
* glob patterns to include from sonar scan.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.util.List getIncludeGlobsForScan() {
return null;
}
/**
* Hook which allows custom commands to be executed before the process commences the archival process.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.util.List getPreArchiveCommands() {
return null;
}
/**
* Specific profile/gate name i.e: language specific.
*
* Note: These need to be set up in Sonarqube manually.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getSonarqubeSpecificProfileOrGateName() {
return null;
}
/**
* Tags to associate with this project.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.util.List getSonarqubeTags() {
return null;
}
/**
* @return a {@link Builder} of {@link SonarCodeScannerConfig}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link SonarCodeScannerConfig}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
java.lang.String sonarqubeAuthorizedGroup;
java.lang.String sonarqubeDefaultProfileOrGateName;
java.lang.String sonarqubeEndpoint;
java.lang.String sonarqubeProjectName;
java.lang.String cdkOutDir;
java.lang.String cfnNagIgnorePath;
java.util.List excludeGlobsForScan;
java.util.List includeGlobsForScan;
java.util.List preArchiveCommands;
java.lang.String sonarqubeSpecificProfileOrGateName;
java.util.List sonarqubeTags;
/**
* Sets the value of {@link SonarCodeScannerConfig#getSonarqubeAuthorizedGroup}
* @param sonarqubeAuthorizedGroup Group name in Sonarqube with access to administer this project. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder sonarqubeAuthorizedGroup(java.lang.String sonarqubeAuthorizedGroup) {
this.sonarqubeAuthorizedGroup = sonarqubeAuthorizedGroup;
return this;
}
/**
* Sets the value of {@link SonarCodeScannerConfig#getSonarqubeDefaultProfileOrGateName}
* @param sonarqubeDefaultProfileOrGateName Default profile/gate name i.e: your org profile. This parameter is required.
* Note: These need to be set up in Sonarqube manually.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder sonarqubeDefaultProfileOrGateName(java.lang.String sonarqubeDefaultProfileOrGateName) {
this.sonarqubeDefaultProfileOrGateName = sonarqubeDefaultProfileOrGateName;
return this;
}
/**
* Sets the value of {@link SonarCodeScannerConfig#getSonarqubeEndpoint}
* @param sonarqubeEndpoint endpoint of the sonarqube instance i.e: https://. This parameter is required.
* Note: Ensure a trailing '/' is not included.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder sonarqubeEndpoint(java.lang.String sonarqubeEndpoint) {
this.sonarqubeEndpoint = sonarqubeEndpoint;
return this;
}
/**
* Sets the value of {@link SonarCodeScannerConfig#getSonarqubeProjectName}
* @param sonarqubeProjectName Name of the project to create in Sonarqube. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder sonarqubeProjectName(java.lang.String sonarqubeProjectName) {
this.sonarqubeProjectName = sonarqubeProjectName;
return this;
}
/**
* Sets the value of {@link SonarCodeScannerConfig#getCdkOutDir}
* @param cdkOutDir directory containing the synthesized cdk resources.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder cdkOutDir(java.lang.String cdkOutDir) {
this.cdkOutDir = cdkOutDir;
return this;
}
/**
* Sets the value of {@link SonarCodeScannerConfig#getCfnNagIgnorePath}
* @param cfnNagIgnorePath path to a file containing the cfn nag suppression rules.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder cfnNagIgnorePath(java.lang.String cfnNagIgnorePath) {
this.cfnNagIgnorePath = cfnNagIgnorePath;
return this;
}
/**
* Sets the value of {@link SonarCodeScannerConfig#getExcludeGlobsForScan}
* @param excludeGlobsForScan glob patterns to exclude from sonar scan.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder excludeGlobsForScan(java.util.List excludeGlobsForScan) {
this.excludeGlobsForScan = excludeGlobsForScan;
return this;
}
/**
* Sets the value of {@link SonarCodeScannerConfig#getIncludeGlobsForScan}
* @param includeGlobsForScan glob patterns to include from sonar scan.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder includeGlobsForScan(java.util.List includeGlobsForScan) {
this.includeGlobsForScan = includeGlobsForScan;
return this;
}
/**
* Sets the value of {@link SonarCodeScannerConfig#getPreArchiveCommands}
* @param preArchiveCommands Hook which allows custom commands to be executed before the process commences the archival process.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder preArchiveCommands(java.util.List preArchiveCommands) {
this.preArchiveCommands = preArchiveCommands;
return this;
}
/**
* Sets the value of {@link SonarCodeScannerConfig#getSonarqubeSpecificProfileOrGateName}
* @param sonarqubeSpecificProfileOrGateName Specific profile/gate name i.e: language specific.
* Note: These need to be set up in Sonarqube manually.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder sonarqubeSpecificProfileOrGateName(java.lang.String sonarqubeSpecificProfileOrGateName) {
this.sonarqubeSpecificProfileOrGateName = sonarqubeSpecificProfileOrGateName;
return this;
}
/**
* Sets the value of {@link SonarCodeScannerConfig#getSonarqubeTags}
* @param sonarqubeTags Tags to associate with this project.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder sonarqubeTags(java.util.List sonarqubeTags) {
this.sonarqubeTags = sonarqubeTags;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link SonarCodeScannerConfig}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public SonarCodeScannerConfig build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link SonarCodeScannerConfig}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements SonarCodeScannerConfig {
private final java.lang.String sonarqubeAuthorizedGroup;
private final java.lang.String sonarqubeDefaultProfileOrGateName;
private final java.lang.String sonarqubeEndpoint;
private final java.lang.String sonarqubeProjectName;
private final java.lang.String cdkOutDir;
private final java.lang.String cfnNagIgnorePath;
private final java.util.List excludeGlobsForScan;
private final java.util.List includeGlobsForScan;
private final java.util.List preArchiveCommands;
private final java.lang.String sonarqubeSpecificProfileOrGateName;
private final java.util.List sonarqubeTags;
/**
* 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.sonarqubeAuthorizedGroup = software.amazon.jsii.Kernel.get(this, "sonarqubeAuthorizedGroup", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.sonarqubeDefaultProfileOrGateName = software.amazon.jsii.Kernel.get(this, "sonarqubeDefaultProfileOrGateName", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.sonarqubeEndpoint = software.amazon.jsii.Kernel.get(this, "sonarqubeEndpoint", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.sonarqubeProjectName = software.amazon.jsii.Kernel.get(this, "sonarqubeProjectName", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.cdkOutDir = software.amazon.jsii.Kernel.get(this, "cdkOutDir", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.cfnNagIgnorePath = software.amazon.jsii.Kernel.get(this, "cfnNagIgnorePath", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.excludeGlobsForScan = software.amazon.jsii.Kernel.get(this, "excludeGlobsForScan", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class)));
this.includeGlobsForScan = software.amazon.jsii.Kernel.get(this, "includeGlobsForScan", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class)));
this.preArchiveCommands = software.amazon.jsii.Kernel.get(this, "preArchiveCommands", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class)));
this.sonarqubeSpecificProfileOrGateName = software.amazon.jsii.Kernel.get(this, "sonarqubeSpecificProfileOrGateName", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.sonarqubeTags = software.amazon.jsii.Kernel.get(this, "sonarqubeTags", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(java.lang.String.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.sonarqubeAuthorizedGroup = java.util.Objects.requireNonNull(builder.sonarqubeAuthorizedGroup, "sonarqubeAuthorizedGroup is required");
this.sonarqubeDefaultProfileOrGateName = java.util.Objects.requireNonNull(builder.sonarqubeDefaultProfileOrGateName, "sonarqubeDefaultProfileOrGateName is required");
this.sonarqubeEndpoint = java.util.Objects.requireNonNull(builder.sonarqubeEndpoint, "sonarqubeEndpoint is required");
this.sonarqubeProjectName = java.util.Objects.requireNonNull(builder.sonarqubeProjectName, "sonarqubeProjectName is required");
this.cdkOutDir = builder.cdkOutDir;
this.cfnNagIgnorePath = builder.cfnNagIgnorePath;
this.excludeGlobsForScan = builder.excludeGlobsForScan;
this.includeGlobsForScan = builder.includeGlobsForScan;
this.preArchiveCommands = builder.preArchiveCommands;
this.sonarqubeSpecificProfileOrGateName = builder.sonarqubeSpecificProfileOrGateName;
this.sonarqubeTags = builder.sonarqubeTags;
}
@Override
public final java.lang.String getSonarqubeAuthorizedGroup() {
return this.sonarqubeAuthorizedGroup;
}
@Override
public final java.lang.String getSonarqubeDefaultProfileOrGateName() {
return this.sonarqubeDefaultProfileOrGateName;
}
@Override
public final java.lang.String getSonarqubeEndpoint() {
return this.sonarqubeEndpoint;
}
@Override
public final java.lang.String getSonarqubeProjectName() {
return this.sonarqubeProjectName;
}
@Override
public final java.lang.String getCdkOutDir() {
return this.cdkOutDir;
}
@Override
public final java.lang.String getCfnNagIgnorePath() {
return this.cfnNagIgnorePath;
}
@Override
public final java.util.List getExcludeGlobsForScan() {
return this.excludeGlobsForScan;
}
@Override
public final java.util.List getIncludeGlobsForScan() {
return this.includeGlobsForScan;
}
@Override
public final java.util.List getPreArchiveCommands() {
return this.preArchiveCommands;
}
@Override
public final java.lang.String getSonarqubeSpecificProfileOrGateName() {
return this.sonarqubeSpecificProfileOrGateName;
}
@Override
public final java.util.List getSonarqubeTags() {
return this.sonarqubeTags;
}
@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("sonarqubeAuthorizedGroup", om.valueToTree(this.getSonarqubeAuthorizedGroup()));
data.set("sonarqubeDefaultProfileOrGateName", om.valueToTree(this.getSonarqubeDefaultProfileOrGateName()));
data.set("sonarqubeEndpoint", om.valueToTree(this.getSonarqubeEndpoint()));
data.set("sonarqubeProjectName", om.valueToTree(this.getSonarqubeProjectName()));
if (this.getCdkOutDir() != null) {
data.set("cdkOutDir", om.valueToTree(this.getCdkOutDir()));
}
if (this.getCfnNagIgnorePath() != null) {
data.set("cfnNagIgnorePath", om.valueToTree(this.getCfnNagIgnorePath()));
}
if (this.getExcludeGlobsForScan() != null) {
data.set("excludeGlobsForScan", om.valueToTree(this.getExcludeGlobsForScan()));
}
if (this.getIncludeGlobsForScan() != null) {
data.set("includeGlobsForScan", om.valueToTree(this.getIncludeGlobsForScan()));
}
if (this.getPreArchiveCommands() != null) {
data.set("preArchiveCommands", om.valueToTree(this.getPreArchiveCommands()));
}
if (this.getSonarqubeSpecificProfileOrGateName() != null) {
data.set("sonarqubeSpecificProfileOrGateName", om.valueToTree(this.getSonarqubeSpecificProfileOrGateName()));
}
if (this.getSonarqubeTags() != null) {
data.set("sonarqubeTags", om.valueToTree(this.getSonarqubeTags()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("aws-prototyping-sdk.pipeline.SonarCodeScannerConfig"));
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;
SonarCodeScannerConfig.Jsii$Proxy that = (SonarCodeScannerConfig.Jsii$Proxy) o;
if (!sonarqubeAuthorizedGroup.equals(that.sonarqubeAuthorizedGroup)) return false;
if (!sonarqubeDefaultProfileOrGateName.equals(that.sonarqubeDefaultProfileOrGateName)) return false;
if (!sonarqubeEndpoint.equals(that.sonarqubeEndpoint)) return false;
if (!sonarqubeProjectName.equals(that.sonarqubeProjectName)) return false;
if (this.cdkOutDir != null ? !this.cdkOutDir.equals(that.cdkOutDir) : that.cdkOutDir != null) return false;
if (this.cfnNagIgnorePath != null ? !this.cfnNagIgnorePath.equals(that.cfnNagIgnorePath) : that.cfnNagIgnorePath != null) return false;
if (this.excludeGlobsForScan != null ? !this.excludeGlobsForScan.equals(that.excludeGlobsForScan) : that.excludeGlobsForScan != null) return false;
if (this.includeGlobsForScan != null ? !this.includeGlobsForScan.equals(that.includeGlobsForScan) : that.includeGlobsForScan != null) return false;
if (this.preArchiveCommands != null ? !this.preArchiveCommands.equals(that.preArchiveCommands) : that.preArchiveCommands != null) return false;
if (this.sonarqubeSpecificProfileOrGateName != null ? !this.sonarqubeSpecificProfileOrGateName.equals(that.sonarqubeSpecificProfileOrGateName) : that.sonarqubeSpecificProfileOrGateName != null) return false;
return this.sonarqubeTags != null ? this.sonarqubeTags.equals(that.sonarqubeTags) : that.sonarqubeTags == null;
}
@Override
public final int hashCode() {
int result = this.sonarqubeAuthorizedGroup.hashCode();
result = 31 * result + (this.sonarqubeDefaultProfileOrGateName.hashCode());
result = 31 * result + (this.sonarqubeEndpoint.hashCode());
result = 31 * result + (this.sonarqubeProjectName.hashCode());
result = 31 * result + (this.cdkOutDir != null ? this.cdkOutDir.hashCode() : 0);
result = 31 * result + (this.cfnNagIgnorePath != null ? this.cfnNagIgnorePath.hashCode() : 0);
result = 31 * result + (this.excludeGlobsForScan != null ? this.excludeGlobsForScan.hashCode() : 0);
result = 31 * result + (this.includeGlobsForScan != null ? this.includeGlobsForScan.hashCode() : 0);
result = 31 * result + (this.preArchiveCommands != null ? this.preArchiveCommands.hashCode() : 0);
result = 31 * result + (this.sonarqubeSpecificProfileOrGateName != null ? this.sonarqubeSpecificProfileOrGateName.hashCode() : 0);
result = 31 * result + (this.sonarqubeTags != null ? this.sonarqubeTags.hashCode() : 0);
return result;
}
}
}