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

com.pulumi.kubernetes.meta.v1.inputs.LabelSelectorRequirementArgs 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.meta.v1.inputs;

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


/**
 * A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
 * 
 */
public final class LabelSelectorRequirementArgs extends com.pulumi.resources.ResourceArgs {

    public static final LabelSelectorRequirementArgs Empty = new LabelSelectorRequirementArgs();

    /**
     * key is the label key that the selector applies to.
     * 
     */
    @Import(name="key", required=true)
    private Output key;

    /**
     * @return key is the label key that the selector applies to.
     * 
     */
    public Output key() {
        return this.key;
    }

    /**
     * operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
     * 
     */
    @Import(name="operator", required=true)
    private Output operator;

    /**
     * @return operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
     * 
     */
    public Output operator() {
        return this.operator;
    }

    /**
     * values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
     * 
     */
    @Import(name="values")
    private @Nullable Output> values;

    /**
     * @return values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
     * 
     */
    public Optional>> values() {
        return Optional.ofNullable(this.values);
    }

    private LabelSelectorRequirementArgs() {}

    private LabelSelectorRequirementArgs(LabelSelectorRequirementArgs $) {
        this.key = $.key;
        this.operator = $.operator;
        this.values = $.values;
    }

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

    public static final class Builder {
        private LabelSelectorRequirementArgs $;

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

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

        /**
         * @param key key is the label key that the selector applies to.
         * 
         * @return builder
         * 
         */
        public Builder key(Output key) {
            $.key = key;
            return this;
        }

        /**
         * @param key key is the label key that the selector applies to.
         * 
         * @return builder
         * 
         */
        public Builder key(String key) {
            return key(Output.of(key));
        }

        /**
         * @param operator operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
         * 
         * @return builder
         * 
         */
        public Builder operator(Output operator) {
            $.operator = operator;
            return this;
        }

        /**
         * @param operator operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
         * 
         * @return builder
         * 
         */
        public Builder operator(String operator) {
            return operator(Output.of(operator));
        }

        /**
         * @param values values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
         * 
         * @return builder
         * 
         */
        public Builder values(@Nullable Output> values) {
            $.values = values;
            return this;
        }

        /**
         * @param values values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
         * 
         * @return builder
         * 
         */
        public Builder values(List values) {
            return values(Output.of(values));
        }

        /**
         * @param values values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
         * 
         * @return builder
         * 
         */
        public Builder values(String... values) {
            return values(List.of(values));
        }

        public LabelSelectorRequirementArgs build() {
            if ($.key == null) {
                throw new MissingRequiredPropertyException("LabelSelectorRequirementArgs", "key");
            }
            if ($.operator == null) {
                throw new MissingRequiredPropertyException("LabelSelectorRequirementArgs", "operator");
            }
            return $;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy