// *** 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.gcp.dataproc.outputs;

import com.pulumi.core.annotations.CustomType;
import com.pulumi.gcp.dataproc.outputs.ClusterClusterConfigPreemptibleWorkerConfigDiskConfig;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;

@CustomType
public final class ClusterClusterConfigPreemptibleWorkerConfig {
    /**
     * @return Disk Config
     * 
     */
    private @Nullable ClusterClusterConfigPreemptibleWorkerConfigDiskConfig diskConfig;
    private @Nullable List<String> instanceNames;
    /**
     * @return Specifies the number of preemptible nodes to create.
     * Defaults to 0.
     * 
     */
    private @Nullable Integer numInstances;
    /**
     * @return Specifies the preemptibility of the secondary workers. The default value is `PREEMPTIBLE`
     * Accepted values are:
     * * PREEMPTIBILITY_UNSPECIFIED
     * * NON_PREEMPTIBLE
     * * PREEMPTIBLE
     * 
     */
    private @Nullable String preemptibility;

    private ClusterClusterConfigPreemptibleWorkerConfig() {}
    /**
     * @return Disk Config
     * 
     */
    public Optional<ClusterClusterConfigPreemptibleWorkerConfigDiskConfig> diskConfig() {
        return Optional.ofNullable(this.diskConfig);
    }
    public List<String> instanceNames() {
        return this.instanceNames == null ? List.of() : this.instanceNames;
    }
    /**
     * @return Specifies the number of preemptible nodes to create.
     * Defaults to 0.
     * 
     */
    public Optional<Integer> numInstances() {
        return Optional.ofNullable(this.numInstances);
    }
    /**
     * @return Specifies the preemptibility of the secondary workers. The default value is `PREEMPTIBLE`
     * Accepted values are:
     * * PREEMPTIBILITY_UNSPECIFIED
     * * NON_PREEMPTIBLE
     * * PREEMPTIBLE
     * 
     */
    public Optional<String> preemptibility() {
        return Optional.ofNullable(this.preemptibility);
    }

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

    public static Builder builder(ClusterClusterConfigPreemptibleWorkerConfig defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable ClusterClusterConfigPreemptibleWorkerConfigDiskConfig diskConfig;
        private @Nullable List<String> instanceNames;
        private @Nullable Integer numInstances;
        private @Nullable String preemptibility;
        public Builder() {}
        public Builder(ClusterClusterConfigPreemptibleWorkerConfig defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.diskConfig = defaults.diskConfig;
    	      this.instanceNames = defaults.instanceNames;
    	      this.numInstances = defaults.numInstances;
    	      this.preemptibility = defaults.preemptibility;
        }

        @CustomType.Setter
        public Builder diskConfig(@Nullable ClusterClusterConfigPreemptibleWorkerConfigDiskConfig diskConfig) {
            this.diskConfig = diskConfig;
            return this;
        }
        @CustomType.Setter
        public Builder instanceNames(@Nullable List<String> instanceNames) {
            this.instanceNames = instanceNames;
            return this;
        }
        public Builder instanceNames(String... instanceNames) {
            return instanceNames(List.of(instanceNames));
        }
        @CustomType.Setter
        public Builder numInstances(@Nullable Integer numInstances) {
            this.numInstances = numInstances;
            return this;
        }
        @CustomType.Setter
        public Builder preemptibility(@Nullable String preemptibility) {
            this.preemptibility = preemptibility;
            return this;
        }
        public ClusterClusterConfigPreemptibleWorkerConfig build() {
            final var o = new ClusterClusterConfigPreemptibleWorkerConfig();
            o.diskConfig = diskConfig;
            o.instanceNames = instanceNames;
            o.numInstances = numInstances;
            o.preemptibility = preemptibility;
            return o;
        }
    }
}
