io.github.cdklabs.cdknag.NagLoggerErrorData Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cdknag Show documentation
Show all versions of cdknag Show documentation
Check CDK v2 applications for best practices using a combination on available rule packs.
package io.github.cdklabs.cdknag;
/**
* Data for onError method of an INagLogger.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.102.0 (build e354887)", date = "2024-08-22T00:13:27.106Z")
@software.amazon.jsii.Jsii(module = io.github.cdklabs.cdknag.$Module.class, fqn = "cdk-nag.NagLoggerErrorData")
@software.amazon.jsii.Jsii.Proxy(NagLoggerErrorData.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface NagLoggerErrorData extends software.amazon.jsii.JsiiSerializable, io.github.cdklabs.cdknag.NagLoggerBaseData {
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@org.jetbrains.annotations.NotNull java.lang.String getErrorMessage();
/**
* @return a {@link Builder} of {@link NagLoggerErrorData}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link NagLoggerErrorData}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
java.lang.String errorMessage;
java.lang.String nagPackName;
software.amazon.awscdk.CfnResource resource;
java.lang.String ruleExplanation;
java.lang.String ruleId;
java.lang.String ruleInfo;
io.github.cdklabs.cdknag.NagMessageLevel ruleLevel;
java.lang.String ruleOriginalName;
/**
* Sets the value of {@link NagLoggerErrorData#getErrorMessage}
* @param errorMessage the value to be set. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder errorMessage(java.lang.String errorMessage) {
this.errorMessage = errorMessage;
return this;
}
/**
* Sets the value of {@link NagLoggerErrorData#getNagPackName}
* @param nagPackName the value to be set. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder nagPackName(java.lang.String nagPackName) {
this.nagPackName = nagPackName;
return this;
}
/**
* Sets the value of {@link NagLoggerErrorData#getResource}
* @param resource the value to be set. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder resource(software.amazon.awscdk.CfnResource resource) {
this.resource = resource;
return this;
}
/**
* Sets the value of {@link NagLoggerErrorData#getRuleExplanation}
* @param ruleExplanation the value to be set. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder ruleExplanation(java.lang.String ruleExplanation) {
this.ruleExplanation = ruleExplanation;
return this;
}
/**
* Sets the value of {@link NagLoggerErrorData#getRuleId}
* @param ruleId the value to be set. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder ruleId(java.lang.String ruleId) {
this.ruleId = ruleId;
return this;
}
/**
* Sets the value of {@link NagLoggerErrorData#getRuleInfo}
* @param ruleInfo the value to be set. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder ruleInfo(java.lang.String ruleInfo) {
this.ruleInfo = ruleInfo;
return this;
}
/**
* Sets the value of {@link NagLoggerErrorData#getRuleLevel}
* @param ruleLevel the value to be set. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder ruleLevel(io.github.cdklabs.cdknag.NagMessageLevel ruleLevel) {
this.ruleLevel = ruleLevel;
return this;
}
/**
* Sets the value of {@link NagLoggerErrorData#getRuleOriginalName}
* @param ruleOriginalName the value to be set. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder ruleOriginalName(java.lang.String ruleOriginalName) {
this.ruleOriginalName = ruleOriginalName;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link NagLoggerErrorData}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public NagLoggerErrorData build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link NagLoggerErrorData}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements NagLoggerErrorData {
private final java.lang.String errorMessage;
private final java.lang.String nagPackName;
private final software.amazon.awscdk.CfnResource resource;
private final java.lang.String ruleExplanation;
private final java.lang.String ruleId;
private final java.lang.String ruleInfo;
private final io.github.cdklabs.cdknag.NagMessageLevel ruleLevel;
private final java.lang.String ruleOriginalName;
/**
* 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.errorMessage = software.amazon.jsii.Kernel.get(this, "errorMessage", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.nagPackName = software.amazon.jsii.Kernel.get(this, "nagPackName", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.resource = software.amazon.jsii.Kernel.get(this, "resource", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.CfnResource.class));
this.ruleExplanation = software.amazon.jsii.Kernel.get(this, "ruleExplanation", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.ruleId = software.amazon.jsii.Kernel.get(this, "ruleId", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.ruleInfo = software.amazon.jsii.Kernel.get(this, "ruleInfo", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.ruleLevel = software.amazon.jsii.Kernel.get(this, "ruleLevel", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.cdknag.NagMessageLevel.class));
this.ruleOriginalName = software.amazon.jsii.Kernel.get(this, "ruleOriginalName", 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.errorMessage = java.util.Objects.requireNonNull(builder.errorMessage, "errorMessage is required");
this.nagPackName = java.util.Objects.requireNonNull(builder.nagPackName, "nagPackName is required");
this.resource = java.util.Objects.requireNonNull(builder.resource, "resource is required");
this.ruleExplanation = java.util.Objects.requireNonNull(builder.ruleExplanation, "ruleExplanation is required");
this.ruleId = java.util.Objects.requireNonNull(builder.ruleId, "ruleId is required");
this.ruleInfo = java.util.Objects.requireNonNull(builder.ruleInfo, "ruleInfo is required");
this.ruleLevel = java.util.Objects.requireNonNull(builder.ruleLevel, "ruleLevel is required");
this.ruleOriginalName = java.util.Objects.requireNonNull(builder.ruleOriginalName, "ruleOriginalName is required");
}
@Override
public final java.lang.String getErrorMessage() {
return this.errorMessage;
}
@Override
public final java.lang.String getNagPackName() {
return this.nagPackName;
}
@Override
public final software.amazon.awscdk.CfnResource getResource() {
return this.resource;
}
@Override
public final java.lang.String getRuleExplanation() {
return this.ruleExplanation;
}
@Override
public final java.lang.String getRuleId() {
return this.ruleId;
}
@Override
public final java.lang.String getRuleInfo() {
return this.ruleInfo;
}
@Override
public final io.github.cdklabs.cdknag.NagMessageLevel getRuleLevel() {
return this.ruleLevel;
}
@Override
public final java.lang.String getRuleOriginalName() {
return this.ruleOriginalName;
}
@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("errorMessage", om.valueToTree(this.getErrorMessage()));
data.set("nagPackName", om.valueToTree(this.getNagPackName()));
data.set("resource", om.valueToTree(this.getResource()));
data.set("ruleExplanation", om.valueToTree(this.getRuleExplanation()));
data.set("ruleId", om.valueToTree(this.getRuleId()));
data.set("ruleInfo", om.valueToTree(this.getRuleInfo()));
data.set("ruleLevel", om.valueToTree(this.getRuleLevel()));
data.set("ruleOriginalName", om.valueToTree(this.getRuleOriginalName()));
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("cdk-nag.NagLoggerErrorData"));
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;
NagLoggerErrorData.Jsii$Proxy that = (NagLoggerErrorData.Jsii$Proxy) o;
if (!errorMessage.equals(that.errorMessage)) return false;
if (!nagPackName.equals(that.nagPackName)) return false;
if (!resource.equals(that.resource)) return false;
if (!ruleExplanation.equals(that.ruleExplanation)) return false;
if (!ruleId.equals(that.ruleId)) return false;
if (!ruleInfo.equals(that.ruleInfo)) return false;
if (!ruleLevel.equals(that.ruleLevel)) return false;
return this.ruleOriginalName.equals(that.ruleOriginalName);
}
@Override
public final int hashCode() {
int result = this.errorMessage.hashCode();
result = 31 * result + (this.nagPackName.hashCode());
result = 31 * result + (this.resource.hashCode());
result = 31 * result + (this.ruleExplanation.hashCode());
result = 31 * result + (this.ruleId.hashCode());
result = 31 * result + (this.ruleInfo.hashCode());
result = 31 * result + (this.ruleLevel.hashCode());
result = 31 * result + (this.ruleOriginalName.hashCode());
return result;
}
}
}