com.pulumi.kubernetes.extensions.v1beta1.outputs.NetworkPolicyPortPatch Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kubernetes Show documentation
Show all versions of kubernetes Show documentation
A Pulumi package for creating and managing Kubernetes resources.
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.kubernetes.extensions.v1beta1.outputs;
import com.pulumi.core.Either;
import com.pulumi.core.annotations.CustomType;
import java.lang.Integer;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;
@CustomType
public final class NetworkPolicyPortPatch {
/**
* @return If specified, the port on the given protocol. This can either be a numerical or named port on a pod. If this field is not provided, this matches all port names and numbers. If present, only traffic on the specified protocol AND port will be matched.
*
*/
private @Nullable Either port;
/**
* @return Optional. The protocol (TCP, UDP, or SCTP) which traffic must match. If not specified, this field defaults to TCP.
*
*/
private @Nullable String protocol;
private NetworkPolicyPortPatch() {}
/**
* @return If specified, the port on the given protocol. This can either be a numerical or named port on a pod. If this field is not provided, this matches all port names and numbers. If present, only traffic on the specified protocol AND port will be matched.
*
*/
public Optional> port() {
return Optional.ofNullable(this.port);
}
/**
* @return Optional. The protocol (TCP, UDP, or SCTP) which traffic must match. If not specified, this field defaults to TCP.
*
*/
public Optional protocol() {
return Optional.ofNullable(this.protocol);
}
public static Builder builder() {
return new Builder();
}
public static Builder builder(NetworkPolicyPortPatch defaults) {
return new Builder(defaults);
}
@CustomType.Builder
public static final class Builder {
private @Nullable Either port;
private @Nullable String protocol;
public Builder() {}
public Builder(NetworkPolicyPortPatch defaults) {
Objects.requireNonNull(defaults);
this.port = defaults.port;
this.protocol = defaults.protocol;
}
@CustomType.Setter
public Builder port(@Nullable Either port) {
this.port = port;
return this;
}
@CustomType.Setter
public Builder protocol(@Nullable String protocol) {
this.protocol = protocol;
return this;
}
public NetworkPolicyPortPatch build() {
final var _resultValue = new NetworkPolicyPortPatch();
_resultValue.port = port;
_resultValue.protocol = protocol;
return _resultValue;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy