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

com.pulumi.kubernetes.networking.v1.inputs.NetworkPolicyPeerPatchArgs 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.inputs;

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.kubernetes.meta.v1.inputs.LabelSelectorPatchArgs;
import com.pulumi.kubernetes.networking.v1.inputs.IPBlockPatchArgs;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


/**
 * NetworkPolicyPeer describes a peer to allow traffic to/from. Only certain combinations of fields are allowed
 * 
 */
public final class NetworkPolicyPeerPatchArgs extends com.pulumi.resources.ResourceArgs {

    public static final NetworkPolicyPeerPatchArgs Empty = new NetworkPolicyPeerPatchArgs();

    /**
     * ipBlock defines policy on a particular IPBlock. If this field is set then neither of the other fields can be.
     * 
     */
    @Import(name="ipBlock")
    private @Nullable Output ipBlock;

    /**
     * @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);
    }

    /**
     * namespaceSelector 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.
     * 
     */
    @Import(name="namespaceSelector")
    private @Nullable Output namespaceSelector;

    /**
     * @return namespaceSelector 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);
    }

    /**
     * podSelector 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.
     * 
     */
    @Import(name="podSelector")
    private @Nullable Output podSelector;

    /**
     * @return podSelector 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);
    }

    private NetworkPolicyPeerPatchArgs() {}

    private NetworkPolicyPeerPatchArgs(NetworkPolicyPeerPatchArgs $) {
        this.ipBlock = $.ipBlock;
        this.namespaceSelector = $.namespaceSelector;
        this.podSelector = $.podSelector;
    }

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

    public static final class Builder {
        private NetworkPolicyPeerPatchArgs $;

        public Builder() {
            $ = new NetworkPolicyPeerPatchArgs();
        }

        public Builder(NetworkPolicyPeerPatchArgs defaults) {
            $ = new NetworkPolicyPeerPatchArgs(Objects.requireNonNull(defaults));
        }

        /**
         * @param ipBlock ipBlock defines policy on a particular IPBlock. If this field is set then neither of the other fields can be.
         * 
         * @return builder
         * 
         */
        public Builder ipBlock(@Nullable Output ipBlock) {
            $.ipBlock = ipBlock;
            return this;
        }

        /**
         * @param ipBlock ipBlock defines policy on a particular IPBlock. If this field is set then neither of the other fields can be.
         * 
         * @return builder
         * 
         */
        public Builder ipBlock(IPBlockPatchArgs ipBlock) {
            return ipBlock(Output.of(ipBlock));
        }

        /**
         * @param namespaceSelector namespaceSelector 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.
         * 
         * @return builder
         * 
         */
        public Builder namespaceSelector(@Nullable Output namespaceSelector) {
            $.namespaceSelector = namespaceSelector;
            return this;
        }

        /**
         * @param namespaceSelector namespaceSelector 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.
         * 
         * @return builder
         * 
         */
        public Builder namespaceSelector(LabelSelectorPatchArgs namespaceSelector) {
            return namespaceSelector(Output.of(namespaceSelector));
        }

        /**
         * @param podSelector podSelector 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.
         * 
         * @return builder
         * 
         */
        public Builder podSelector(@Nullable Output podSelector) {
            $.podSelector = podSelector;
            return this;
        }

        /**
         * @param podSelector podSelector 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.
         * 
         * @return builder
         * 
         */
        public Builder podSelector(LabelSelectorPatchArgs podSelector) {
            return podSelector(Output.of(podSelector));
        }

        public NetworkPolicyPeerPatchArgs build() {
            return $;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy