software.aws.awsprototypingsdk.staticwebsite.CidrAllowList Maven / Gradle / Ivy
Show all versions of static-website Show documentation
package software.aws.awsprototypingsdk.staticwebsite;
/**
* (experimental) Representation of a CIDR range.
*/
@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.CidrAllowList")
@software.amazon.jsii.Jsii.Proxy(CidrAllowList.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface CidrAllowList extends software.amazon.jsii.JsiiSerializable {
/**
* (experimental) Specify an IPv4 address by using CIDR notation.
*
* For example:
* To configure AWS WAF to allow, block, or count requests that originated from the IP address 192.0.2.44, specify 192.0.2.44/32 .
* To configure AWS WAF to allow, block, or count requests that originated from IP addresses from 192.0.2.0 to 192.0.2.255, specify 192.0.2.0/24 .
*
* For more information about CIDR notation, see the Wikipedia entry Classless Inter-Domain Routing .
*
* Specify an IPv6 address by using CIDR notation. For example:
* To configure AWS WAF to allow, block, or count requests that originated from the IP address 1111:0000:0000:0000:0000:0000:0000:0111, specify 1111:0000:0000:0000:0000:0000:0000:0111/128 .
* To configure AWS WAF to allow, block, or count requests that originated from IP addresses 1111:0000:0000:0000:0000:0000:0000:0000 to 1111:0000:0000:0000:ffff:ffff:ffff:ffff, specify 1111:0000:0000:0000:0000:0000:0000:0000/64 .
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull java.util.List getCidrRanges();
/**
* (experimental) Type of CIDR range.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull java.lang.String getCidrType();
/**
* @return a {@link Builder} of {@link CidrAllowList}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link CidrAllowList}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
java.util.List cidrRanges;
java.lang.String cidrType;
/**
* Sets the value of {@link CidrAllowList#getCidrRanges}
* @param cidrRanges Specify an IPv4 address by using CIDR notation. This parameter is required.
* For example:
* To configure AWS WAF to allow, block, or count requests that originated from the IP address 192.0.2.44, specify 192.0.2.44/32 .
* To configure AWS WAF to allow, block, or count requests that originated from IP addresses from 192.0.2.0 to 192.0.2.255, specify 192.0.2.0/24 .
*
* For more information about CIDR notation, see the Wikipedia entry Classless Inter-Domain Routing .
*
* Specify an IPv6 address by using CIDR notation. For example:
* To configure AWS WAF to allow, block, or count requests that originated from the IP address 1111:0000:0000:0000:0000:0000:0000:0111, specify 1111:0000:0000:0000:0000:0000:0000:0111/128 .
* To configure AWS WAF to allow, block, or count requests that originated from IP addresses 1111:0000:0000:0000:0000:0000:0000:0000 to 1111:0000:0000:0000:ffff:ffff:ffff:ffff, specify 1111:0000:0000:0000:0000:0000:0000:0000/64 .
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder cidrRanges(java.util.List cidrRanges) {
this.cidrRanges = cidrRanges;
return this;
}
/**
* Sets the value of {@link CidrAllowList#getCidrType}
* @param cidrType Type of CIDR range. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder cidrType(java.lang.String cidrType) {
this.cidrType = cidrType;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link CidrAllowList}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public CidrAllowList build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link CidrAllowList}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements CidrAllowList {
private final java.util.List cidrRanges;
private final java.lang.String cidrType;
/**
* 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.cidrRanges = software.amazon.jsii.Kernel.get(this, "cidrRanges", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class)));
this.cidrType = software.amazon.jsii.Kernel.get(this, "cidrType", 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.cidrRanges = java.util.Objects.requireNonNull(builder.cidrRanges, "cidrRanges is required");
this.cidrType = java.util.Objects.requireNonNull(builder.cidrType, "cidrType is required");
}
@Override
public final java.util.List getCidrRanges() {
return this.cidrRanges;
}
@Override
public final java.lang.String getCidrType() {
return this.cidrType;
}
@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("cidrRanges", om.valueToTree(this.getCidrRanges()));
data.set("cidrType", om.valueToTree(this.getCidrType()));
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.CidrAllowList"));
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;
CidrAllowList.Jsii$Proxy that = (CidrAllowList.Jsii$Proxy) o;
if (!cidrRanges.equals(that.cidrRanges)) return false;
return this.cidrType.equals(that.cidrType);
}
@Override
public final int hashCode() {
int result = this.cidrRanges.hashCode();
result = 31 * result + (this.cidrType.hashCode());
return result;
}
}
}