software.aws.awsprototypingsdk.staticwebsite.CloudFrontWebAclProps Maven / Gradle / Ivy
Show all versions of static-website Show documentation
package software.aws.awsprototypingsdk.staticwebsite;
/**
* (experimental) Properties to configure the web acl.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.82.0 (build 2d2ddd7)", date = "2023-08-02T06:21:04.218Z")
@software.amazon.jsii.Jsii(module = software.aws.awsprototypingsdk.staticwebsite.$Module.class, fqn = "@aws-prototyping-sdk/static-website.CloudFrontWebAclProps")
@software.amazon.jsii.Jsii.Proxy(CloudFrontWebAclProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface CloudFrontWebAclProps extends software.amazon.jsii.JsiiSerializable {
/**
* (experimental) List of cidr ranges to allow.
*
* Default: - undefined
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable software.aws.awsprototypingsdk.staticwebsite.CidrAllowList getCidrAllowList() {
return null;
}
/**
* (experimental) Set to true to prevent creation of a web acl for the static website.
*
* Default: false
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.Boolean getDisable() {
return null;
}
/**
* (experimental) List of managed rules to apply to the web acl.
*
* Default: - [{ vendor: "AWS", name: "AWSManagedRulesCommonRuleSet" }]
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.util.List getManagedRules() {
return null;
}
/**
* @return a {@link Builder} of {@link CloudFrontWebAclProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link CloudFrontWebAclProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
software.aws.awsprototypingsdk.staticwebsite.CidrAllowList cidrAllowList;
java.lang.Boolean disable;
java.util.List managedRules;
/**
* Sets the value of {@link CloudFrontWebAclProps#getCidrAllowList}
* @param cidrAllowList List of cidr ranges to allow.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder cidrAllowList(software.aws.awsprototypingsdk.staticwebsite.CidrAllowList cidrAllowList) {
this.cidrAllowList = cidrAllowList;
return this;
}
/**
* Sets the value of {@link CloudFrontWebAclProps#getDisable}
* @param disable Set to true to prevent creation of a web acl for the static website.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder disable(java.lang.Boolean disable) {
this.disable = disable;
return this;
}
/**
* Sets the value of {@link CloudFrontWebAclProps#getManagedRules}
* @param managedRules List of managed rules to apply to the web acl.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@SuppressWarnings("unchecked")
public Builder managedRules(java.util.List extends software.aws.awsprototypingsdk.staticwebsite.ManagedRule> managedRules) {
this.managedRules = (java.util.List)managedRules;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link CloudFrontWebAclProps}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public CloudFrontWebAclProps build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link CloudFrontWebAclProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements CloudFrontWebAclProps {
private final software.aws.awsprototypingsdk.staticwebsite.CidrAllowList cidrAllowList;
private final java.lang.Boolean disable;
private final java.util.List managedRules;
/**
* 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.cidrAllowList = software.amazon.jsii.Kernel.get(this, "cidrAllowList", software.amazon.jsii.NativeType.forClass(software.aws.awsprototypingsdk.staticwebsite.CidrAllowList.class));
this.disable = software.amazon.jsii.Kernel.get(this, "disable", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.managedRules = software.amazon.jsii.Kernel.get(this, "managedRules", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(software.aws.awsprototypingsdk.staticwebsite.ManagedRule.class)));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
@SuppressWarnings("unchecked")
protected Jsii$Proxy(final Builder builder) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.cidrAllowList = builder.cidrAllowList;
this.disable = builder.disable;
this.managedRules = (java.util.List)builder.managedRules;
}
@Override
public final software.aws.awsprototypingsdk.staticwebsite.CidrAllowList getCidrAllowList() {
return this.cidrAllowList;
}
@Override
public final java.lang.Boolean getDisable() {
return this.disable;
}
@Override
public final java.util.List getManagedRules() {
return this.managedRules;
}
@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();
if (this.getCidrAllowList() != null) {
data.set("cidrAllowList", om.valueToTree(this.getCidrAllowList()));
}
if (this.getDisable() != null) {
data.set("disable", om.valueToTree(this.getDisable()));
}
if (this.getManagedRules() != null) {
data.set("managedRules", om.valueToTree(this.getManagedRules()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@aws-prototyping-sdk/static-website.CloudFrontWebAclProps"));
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;
CloudFrontWebAclProps.Jsii$Proxy that = (CloudFrontWebAclProps.Jsii$Proxy) o;
if (this.cidrAllowList != null ? !this.cidrAllowList.equals(that.cidrAllowList) : that.cidrAllowList != null) return false;
if (this.disable != null ? !this.disable.equals(that.disable) : that.disable != null) return false;
return this.managedRules != null ? this.managedRules.equals(that.managedRules) : that.managedRules == null;
}
@Override
public final int hashCode() {
int result = this.cidrAllowList != null ? this.cidrAllowList.hashCode() : 0;
result = 31 * result + (this.disable != null ? this.disable.hashCode() : 0);
result = 31 * result + (this.managedRules != null ? this.managedRules.hashCode() : 0);
return result;
}
}
}