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

com.pulumi.kubernetes.extensions.v1beta1.outputs.NetworkPolicyPeer Maven / Gradle / Ivy

There is a newer version: 4.19.0
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.extensions.v1beta1.outputs;

import com.pulumi.core.annotations.CustomType;
import com.pulumi.kubernetes.extensions.v1beta1.outputs.IPBlock;
import com.pulumi.kubernetes.meta.v1.outputs.LabelSelector;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;

@CustomType
public final class NetworkPolicyPeer {
    /**
     * @return IPBlock defines policy on a particular IPBlock. If this field is set then neither of the other fields can be.
     * 
     */
    private @Nullable IPBlock ipBlock;
    /**
     * @return Selects Namespaces using cluster-scoped labels. This field follows standard label selector semantics; if present but empty, it selects all namespaces.
     * 
     * If PodSelector is also set, then the NetworkPolicyPeer as a whole selects the Pods matching PodSelector in the Namespaces selected by NamespaceSelector. Otherwise it selects all Pods in the Namespaces selected by NamespaceSelector.
     * 
     */
    private @Nullable LabelSelector namespaceSelector;
    /**
     * @return This is a label selector which selects Pods. This field follows standard label selector semantics; if present but empty, it selects all pods.
     * 
     * If NamespaceSelector is also set, then the NetworkPolicyPeer as a whole selects the Pods matching PodSelector in the Namespaces selected by NamespaceSelector. Otherwise it selects the Pods matching PodSelector in the policy's own Namespace.
     * 
     */
    private @Nullable LabelSelector podSelector;

    private NetworkPolicyPeer() {}
    /**
     * @return IPBlock defines policy on a particular IPBlock. If this field is set then neither of the other fields can be.
     * 
     */
    public Optional ipBlock() {
        return Optional.ofNullable(this.ipBlock);
    }
    /**
     * @return Selects Namespaces using cluster-scoped labels. This field follows standard label selector semantics; if present but empty, it selects all namespaces.
     * 
     * If PodSelector is also set, then the NetworkPolicyPeer as a whole selects the Pods matching PodSelector in the Namespaces selected by NamespaceSelector. Otherwise it selects all Pods in the Namespaces selected by NamespaceSelector.
     * 
     */
    public Optional namespaceSelector() {
        return Optional.ofNullable(this.namespaceSelector);
    }
    /**
     * @return This is a label selector which selects Pods. This field follows standard label selector semantics; if present but empty, it selects all pods.
     * 
     * If NamespaceSelector is also set, then the NetworkPolicyPeer as a whole selects the Pods matching PodSelector in the Namespaces selected by NamespaceSelector. Otherwise it selects the Pods matching PodSelector in the policy's own Namespace.
     * 
     */
    public Optional podSelector() {
        return Optional.ofNullable(this.podSelector);
    }

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

    public static Builder builder(NetworkPolicyPeer defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable IPBlock ipBlock;
        private @Nullable LabelSelector namespaceSelector;
        private @Nullable LabelSelector podSelector;
        public Builder() {}
        public Builder(NetworkPolicyPeer defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.ipBlock = defaults.ipBlock;
    	      this.namespaceSelector = defaults.namespaceSelector;
    	      this.podSelector = defaults.podSelector;
        }

        @CustomType.Setter
        public Builder ipBlock(@Nullable IPBlock ipBlock) {

            this.ipBlock = ipBlock;
            return this;
        }
        @CustomType.Setter
        public Builder namespaceSelector(@Nullable LabelSelector namespaceSelector) {

            this.namespaceSelector = namespaceSelector;
            return this;
        }
        @CustomType.Setter
        public Builder podSelector(@Nullable LabelSelector podSelector) {

            this.podSelector = podSelector;
            return this;
        }
        public NetworkPolicyPeer build() {
            final var _resultValue = new NetworkPolicyPeer();
            _resultValue.ipBlock = ipBlock;
            _resultValue.namespaceSelector = namespaceSelector;
            _resultValue.podSelector = podSelector;
            return _resultValue;
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy