org.cdk8s.plus22.ExposeDeploymentViaIngressOptions Maven / Gradle / Ivy
package org.cdk8s.plus22;
/**
* Options for exposing a deployment via an ingress.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.47.0 (build 86d2c33)", date = "2021-12-08T00:16:55.092Z")
@software.amazon.jsii.Jsii(module = org.cdk8s.plus22.$Module.class, fqn = "cdk8s-plus-22.ExposeDeploymentViaIngressOptions")
@software.amazon.jsii.Jsii.Proxy(ExposeDeploymentViaIngressOptions.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface ExposeDeploymentViaIngressOptions extends software.amazon.jsii.JsiiSerializable, org.cdk8s.plus22.ExposeDeploymentViaServiceOptions, org.cdk8s.plus22.ExposeServiceViaIngressOptions {
/**
* @return a {@link Builder} of {@link ExposeDeploymentViaIngressOptions}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link ExposeDeploymentViaIngressOptions}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
java.lang.String name;
java.lang.Number port;
org.cdk8s.plus22.Protocol protocol;
org.cdk8s.plus22.ServiceType serviceType;
java.lang.Number targetPort;
org.cdk8s.plus22.Ingress ingress;
org.cdk8s.plus22.HttpIngressPathType pathType;
/**
* Sets the value of {@link ExposeDeploymentViaIngressOptions#getName}
* @param name The name of the service to expose.
* This will be set on the Service.metadata and must be a DNS_LABEL
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder name(java.lang.String name) {
this.name = name;
return this;
}
/**
* Sets the value of {@link ExposeDeploymentViaIngressOptions#getPort}
* @param port The port that the service should serve on.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder port(java.lang.Number port) {
this.port = port;
return this;
}
/**
* Sets the value of {@link ExposeDeploymentViaIngressOptions#getProtocol}
* @param protocol The IP protocol for this port.
* Supports "TCP", "UDP", and "SCTP". Default is TCP.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder protocol(org.cdk8s.plus22.Protocol protocol) {
this.protocol = protocol;
return this;
}
/**
* Sets the value of {@link ExposeDeploymentViaIngressOptions#getServiceType}
* @param serviceType The type of the exposed service.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder serviceType(org.cdk8s.plus22.ServiceType serviceType) {
this.serviceType = serviceType;
return this;
}
/**
* Sets the value of {@link ExposeDeploymentViaIngressOptions#getTargetPort}
* @param targetPort The port number the service will redirect to.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder targetPort(java.lang.Number targetPort) {
this.targetPort = targetPort;
return this;
}
/**
* Sets the value of {@link ExposeDeploymentViaIngressOptions#getIngress}
* @param ingress The ingress to add rules to.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder ingress(org.cdk8s.plus22.Ingress ingress) {
this.ingress = ingress;
return this;
}
/**
* Sets the value of {@link ExposeDeploymentViaIngressOptions#getPathType}
* @param pathType The type of the path.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder pathType(org.cdk8s.plus22.HttpIngressPathType pathType) {
this.pathType = pathType;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link ExposeDeploymentViaIngressOptions}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public ExposeDeploymentViaIngressOptions build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link ExposeDeploymentViaIngressOptions}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements ExposeDeploymentViaIngressOptions {
private final java.lang.String name;
private final java.lang.Number port;
private final org.cdk8s.plus22.Protocol protocol;
private final org.cdk8s.plus22.ServiceType serviceType;
private final java.lang.Number targetPort;
private final org.cdk8s.plus22.Ingress ingress;
private final org.cdk8s.plus22.HttpIngressPathType pathType;
/**
* 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.name = software.amazon.jsii.Kernel.get(this, "name", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.port = software.amazon.jsii.Kernel.get(this, "port", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
this.protocol = software.amazon.jsii.Kernel.get(this, "protocol", software.amazon.jsii.NativeType.forClass(org.cdk8s.plus22.Protocol.class));
this.serviceType = software.amazon.jsii.Kernel.get(this, "serviceType", software.amazon.jsii.NativeType.forClass(org.cdk8s.plus22.ServiceType.class));
this.targetPort = software.amazon.jsii.Kernel.get(this, "targetPort", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
this.ingress = software.amazon.jsii.Kernel.get(this, "ingress", software.amazon.jsii.NativeType.forClass(org.cdk8s.plus22.Ingress.class));
this.pathType = software.amazon.jsii.Kernel.get(this, "pathType", software.amazon.jsii.NativeType.forClass(org.cdk8s.plus22.HttpIngressPathType.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.name = builder.name;
this.port = builder.port;
this.protocol = builder.protocol;
this.serviceType = builder.serviceType;
this.targetPort = builder.targetPort;
this.ingress = builder.ingress;
this.pathType = builder.pathType;
}
@Override
public final java.lang.String getName() {
return this.name;
}
@Override
public final java.lang.Number getPort() {
return this.port;
}
@Override
public final org.cdk8s.plus22.Protocol getProtocol() {
return this.protocol;
}
@Override
public final org.cdk8s.plus22.ServiceType getServiceType() {
return this.serviceType;
}
@Override
public final java.lang.Number getTargetPort() {
return this.targetPort;
}
@Override
public final org.cdk8s.plus22.Ingress getIngress() {
return this.ingress;
}
@Override
public final org.cdk8s.plus22.HttpIngressPathType getPathType() {
return this.pathType;
}
@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.getName() != null) {
data.set("name", om.valueToTree(this.getName()));
}
if (this.getPort() != null) {
data.set("port", om.valueToTree(this.getPort()));
}
if (this.getProtocol() != null) {
data.set("protocol", om.valueToTree(this.getProtocol()));
}
if (this.getServiceType() != null) {
data.set("serviceType", om.valueToTree(this.getServiceType()));
}
if (this.getTargetPort() != null) {
data.set("targetPort", om.valueToTree(this.getTargetPort()));
}
if (this.getIngress() != null) {
data.set("ingress", om.valueToTree(this.getIngress()));
}
if (this.getPathType() != null) {
data.set("pathType", om.valueToTree(this.getPathType()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("cdk8s-plus-22.ExposeDeploymentViaIngressOptions"));
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;
ExposeDeploymentViaIngressOptions.Jsii$Proxy that = (ExposeDeploymentViaIngressOptions.Jsii$Proxy) o;
if (this.name != null ? !this.name.equals(that.name) : that.name != null) return false;
if (this.port != null ? !this.port.equals(that.port) : that.port != null) return false;
if (this.protocol != null ? !this.protocol.equals(that.protocol) : that.protocol != null) return false;
if (this.serviceType != null ? !this.serviceType.equals(that.serviceType) : that.serviceType != null) return false;
if (this.targetPort != null ? !this.targetPort.equals(that.targetPort) : that.targetPort != null) return false;
if (this.ingress != null ? !this.ingress.equals(that.ingress) : that.ingress != null) return false;
return this.pathType != null ? this.pathType.equals(that.pathType) : that.pathType == null;
}
@Override
public final int hashCode() {
int result = this.name != null ? this.name.hashCode() : 0;
result = 31 * result + (this.port != null ? this.port.hashCode() : 0);
result = 31 * result + (this.protocol != null ? this.protocol.hashCode() : 0);
result = 31 * result + (this.serviceType != null ? this.serviceType.hashCode() : 0);
result = 31 * result + (this.targetPort != null ? this.targetPort.hashCode() : 0);
result = 31 * result + (this.ingress != null ? this.ingress.hashCode() : 0);
result = 31 * result + (this.pathType != null ? this.pathType.hashCode() : 0);
return result;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy