All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.kubernetes.networking.v1.outputs.NetworkPolicyEgressRule Maven / Gradle / Ivy

There is a newer version: 4.19.0-alpha.1730750641
Show newest version
// *** 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.networking.v1.outputs;

import com.pulumi.core.annotations.CustomType;
import com.pulumi.kubernetes.networking.v1.outputs.NetworkPolicyPeer;
import com.pulumi.kubernetes.networking.v1.outputs.NetworkPolicyPort;
import java.util.List;
import java.util.Objects;
import javax.annotation.Nullable;

@CustomType
public final class NetworkPolicyEgressRule {
    /**
     * @return ports is a list of destination ports for outgoing traffic. 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;
    /**
     * @return to is a list of destinations for outgoing traffic of 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 destinations (traffic not restricted by destination). 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 to list.
     * 
     */
    private @Nullable List to;

    private NetworkPolicyEgressRule() {}
    /**
     * @return ports is a list of destination ports for outgoing traffic. 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;
    }
    /**
     * @return to is a list of destinations for outgoing traffic of 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 destinations (traffic not restricted by destination). 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 to list.
     * 
     */
    public List to() {
        return this.to == null ? List.of() : this.to;
    }

    public static Builder builder() {
        return new Builder();
    }

    public static Builder builder(NetworkPolicyEgressRule defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable List ports;
        private @Nullable List to;
        public Builder() {}
        public Builder(NetworkPolicyEgressRule defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.ports = defaults.ports;
    	      this.to = defaults.to;
        }

        @CustomType.Setter
        public Builder ports(@Nullable List ports) {

            this.ports = ports;
            return this;
        }
        public Builder ports(NetworkPolicyPort... ports) {
            return ports(List.of(ports));
        }
        @CustomType.Setter
        public Builder to(@Nullable List to) {

            this.to = to;
            return this;
        }
        public Builder to(NetworkPolicyPeer... to) {
            return to(List.of(to));
        }
        public NetworkPolicyEgressRule build() {
            final var _resultValue = new NetworkPolicyEgressRule();
            _resultValue.ports = ports;
            _resultValue.to = to;
            return _resultValue;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy