
org.cdk8s.plus31.k8s.NonResourcePolicyRule Maven / Gradle / Ivy
package org.cdk8s.plus31.k8s;
/**
* NonResourcePolicyRule is a predicate that matches non-resource requests according to their verb and the target non-resource URL.
*
* A NonResourcePolicyRule matches a request if and only if both (a) at least one member of verbs matches the request and (b) at least one member of nonResourceURLs matches the request.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.105.0 (build 0a2adcb)", date = "2024-11-15T12:15:25.119Z")
@software.amazon.jsii.Jsii(module = org.cdk8s.plus31.$Module.class, fqn = "cdk8s-plus-31.k8s.NonResourcePolicyRule")
@software.amazon.jsii.Jsii.Proxy(NonResourcePolicyRule.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface NonResourcePolicyRule extends software.amazon.jsii.JsiiSerializable {
/**
* nonResourceURLs
is a set of url prefixes that a user should have access to and may not be empty.
*
* For example:
*
*
* - "/healthz" is legal
* - "/hea*" is illegal
* - "/hea" is legal but matches nothing
* - "/hea/*" also matches nothing
* - "/healthz/" matches all per-component health checks.
* "" matches all non-resource urls. if it is present, it must be the only entry. Required.
*
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@org.jetbrains.annotations.NotNull java.util.List getNonResourceUrLs();
/**
* verbs
is a list of matching verbs and may not be empty.
*
* "*" matches all verbs. If it is present, it must be the only entry. Required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@org.jetbrains.annotations.NotNull java.util.List getVerbs();
/**
* @return a {@link Builder} of {@link NonResourcePolicyRule}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link NonResourcePolicyRule}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
java.util.List nonResourceUrLs;
java.util.List verbs;
/**
* Sets the value of {@link NonResourcePolicyRule#getNonResourceUrLs}
* @param nonResourceUrLs nonResourceURLs
is a set of url prefixes that a user should have access to and may not be empty. This parameter is required.
* For example:
*
*
* - "/healthz" is legal
* - "/hea*" is illegal
* - "/hea" is legal but matches nothing
* - "/hea/*" also matches nothing
* - "/healthz/" matches all per-component health checks.
* "" matches all non-resource urls. if it is present, it must be the only entry. Required.
*
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder nonResourceUrLs(java.util.List nonResourceUrLs) {
this.nonResourceUrLs = nonResourceUrLs;
return this;
}
/**
* Sets the value of {@link NonResourcePolicyRule#getVerbs}
* @param verbs verbs
is a list of matching verbs and may not be empty. This parameter is required.
* "*" matches all verbs. If it is present, it must be the only entry. Required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder verbs(java.util.List verbs) {
this.verbs = verbs;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link NonResourcePolicyRule}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public NonResourcePolicyRule build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link NonResourcePolicyRule}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements NonResourcePolicyRule {
private final java.util.List nonResourceUrLs;
private final java.util.List verbs;
/**
* 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.nonResourceUrLs = software.amazon.jsii.Kernel.get(this, "nonResourceUrLs", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class)));
this.verbs = software.amazon.jsii.Kernel.get(this, "verbs", 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.nonResourceUrLs = java.util.Objects.requireNonNull(builder.nonResourceUrLs, "nonResourceUrLs is required");
this.verbs = java.util.Objects.requireNonNull(builder.verbs, "verbs is required");
}
@Override
public final java.util.List getNonResourceUrLs() {
return this.nonResourceUrLs;
}
@Override
public final java.util.List getVerbs() {
return this.verbs;
}
@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("nonResourceUrLs", om.valueToTree(this.getNonResourceUrLs()));
data.set("verbs", om.valueToTree(this.getVerbs()));
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("cdk8s-plus-31.k8s.NonResourcePolicyRule"));
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;
NonResourcePolicyRule.Jsii$Proxy that = (NonResourcePolicyRule.Jsii$Proxy) o;
if (!nonResourceUrLs.equals(that.nonResourceUrLs)) return false;
return this.verbs.equals(that.verbs);
}
@Override
public final int hashCode() {
int result = this.nonResourceUrLs.hashCode();
result = 31 * result + (this.verbs.hashCode());
return result;
}
}
}