com.pulumi.kubernetes.extensions.v1beta1.outputs.NetworkPolicyIngressRulePatch 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.annotations.CustomType;
import com.pulumi.kubernetes.extensions.v1beta1.outputs.NetworkPolicyPeerPatch;
import com.pulumi.kubernetes.extensions.v1beta1.outputs.NetworkPolicyPortPatch;
import java.util.List;
import java.util.Objects;
import javax.annotation.Nullable;
@CustomType
public final class NetworkPolicyIngressRulePatch {
/**
* @return List of sources which should be able to access the pods selected for this rule. Items in this list are combined using a logical OR operation. If this field is empty or missing, this rule matches all sources (traffic not restricted by source). If this field is present and contains at least one item, this rule allows traffic only if the traffic matches at least one item in the from list.
*
*/
private @Nullable List from;
/**
* @return List of ports which should be made accessible on the pods selected for this rule. Each item in this list is combined using a logical OR. If this field is empty or missing, this rule matches all ports (traffic not restricted by port). If this field is present and contains at least one item, then this rule allows traffic only if the traffic matches at least one port in the list.
*
*/
private @Nullable List ports;
private NetworkPolicyIngressRulePatch() {}
/**
* @return List of sources which should be able to access the pods selected for this rule. Items in this list are combined using a logical OR operation. If this field is empty or missing, this rule matches all sources (traffic not restricted by source). If this field is present and contains at least one item, this rule allows traffic only if the traffic matches at least one item in the from list.
*
*/
public List from() {
return this.from == null ? List.of() : this.from;
}
/**
* @return List of ports which should be made accessible on the pods selected for this rule. Each item in this list is combined using a logical OR. If this field is empty or missing, this rule matches all ports (traffic not restricted by port). If this field is present and contains at least one item, then this rule allows traffic only if the traffic matches at least one port in the list.
*
*/
public List ports() {
return this.ports == null ? List.of() : this.ports;
}
public static Builder builder() {
return new Builder();
}
public static Builder builder(NetworkPolicyIngressRulePatch defaults) {
return new Builder(defaults);
}
@CustomType.Builder
public static final class Builder {
private @Nullable List from;
private @Nullable List ports;
public Builder() {}
public Builder(NetworkPolicyIngressRulePatch defaults) {
Objects.requireNonNull(defaults);
this.from = defaults.from;
this.ports = defaults.ports;
}
@CustomType.Setter
public Builder from(@Nullable List from) {
this.from = from;
return this;
}
public Builder from(NetworkPolicyPeerPatch... from) {
return from(List.of(from));
}
@CustomType.Setter
public Builder ports(@Nullable List ports) {
this.ports = ports;
return this;
}
public Builder ports(NetworkPolicyPortPatch... ports) {
return ports(List.of(ports));
}
public NetworkPolicyIngressRulePatch build() {
final var _resultValue = new NetworkPolicyIngressRulePatch();
_resultValue.from = from;
_resultValue.ports = ports;
return _resultValue;
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy