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

import com.pulumi.core.annotations.CustomType;
import com.pulumi.gcp.cloudfunctionsv2.outputs.FunctionBuildConfigSource;
import java.lang.String;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;

@CustomType
public final class FunctionBuildConfig {
    /**
     * @return (Output)
     * The Cloud Build name of the latest successful
     * deployment of the function.
     * 
     */
    private @Nullable String build;
    /**
     * @return User managed repository created in Artifact Registry optionally with a customer managed encryption key.
     * 
     */
    private @Nullable String dockerRepository;
    /**
     * @return The name of the function (as defined in source code) that will be executed.
     * Defaults to the resource name suffix, if not specified. For backward
     * compatibility, if function with given name is not found, then the system
     * will try to use function named &#34;function&#34;. For Node.js this is name of a
     * function exported by the module specified in source_location.
     * 
     */
    private @Nullable String entryPoint;
    /**
     * @return User-provided build-time environment variables for the function.
     * 
     */
    private @Nullable Map<String,String> environmentVariables;
    /**
     * @return The runtime in which to run the function. Required when deploying a new
     * function, optional when updating an existing function.
     * 
     */
    private @Nullable String runtime;
    /**
     * @return The location of the function source code.
     * Structure is documented below.
     * 
     */
    private @Nullable FunctionBuildConfigSource source;
    /**
     * @return Name of the Cloud Build Custom Worker Pool that should be used to build the function.
     * 
     */
    private @Nullable String workerPool;

    private FunctionBuildConfig() {}
    /**
     * @return (Output)
     * The Cloud Build name of the latest successful
     * deployment of the function.
     * 
     */
    public Optional<String> build() {
        return Optional.ofNullable(this.build);
    }
    /**
     * @return User managed repository created in Artifact Registry optionally with a customer managed encryption key.
     * 
     */
    public Optional<String> dockerRepository() {
        return Optional.ofNullable(this.dockerRepository);
    }
    /**
     * @return The name of the function (as defined in source code) that will be executed.
     * Defaults to the resource name suffix, if not specified. For backward
     * compatibility, if function with given name is not found, then the system
     * will try to use function named &#34;function&#34;. For Node.js this is name of a
     * function exported by the module specified in source_location.
     * 
     */
    public Optional<String> entryPoint() {
        return Optional.ofNullable(this.entryPoint);
    }
    /**
     * @return User-provided build-time environment variables for the function.
     * 
     */
    public Map<String,String> environmentVariables() {
        return this.environmentVariables == null ? Map.of() : this.environmentVariables;
    }
    /**
     * @return The runtime in which to run the function. Required when deploying a new
     * function, optional when updating an existing function.
     * 
     */
    public Optional<String> runtime() {
        return Optional.ofNullable(this.runtime);
    }
    /**
     * @return The location of the function source code.
     * Structure is documented below.
     * 
     */
    public Optional<FunctionBuildConfigSource> source() {
        return Optional.ofNullable(this.source);
    }
    /**
     * @return Name of the Cloud Build Custom Worker Pool that should be used to build the function.
     * 
     */
    public Optional<String> workerPool() {
        return Optional.ofNullable(this.workerPool);
    }

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

    public static Builder builder(FunctionBuildConfig defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable String build;
        private @Nullable String dockerRepository;
        private @Nullable String entryPoint;
        private @Nullable Map<String,String> environmentVariables;
        private @Nullable String runtime;
        private @Nullable FunctionBuildConfigSource source;
        private @Nullable String workerPool;
        public Builder() {}
        public Builder(FunctionBuildConfig defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.build = defaults.build;
    	      this.dockerRepository = defaults.dockerRepository;
    	      this.entryPoint = defaults.entryPoint;
    	      this.environmentVariables = defaults.environmentVariables;
    	      this.runtime = defaults.runtime;
    	      this.source = defaults.source;
    	      this.workerPool = defaults.workerPool;
        }

        @CustomType.Setter
        public Builder build(@Nullable String build) {
            this.build = build;
            return this;
        }
        @CustomType.Setter
        public Builder dockerRepository(@Nullable String dockerRepository) {
            this.dockerRepository = dockerRepository;
            return this;
        }
        @CustomType.Setter
        public Builder entryPoint(@Nullable String entryPoint) {
            this.entryPoint = entryPoint;
            return this;
        }
        @CustomType.Setter
        public Builder environmentVariables(@Nullable Map<String,String> environmentVariables) {
            this.environmentVariables = environmentVariables;
            return this;
        }
        @CustomType.Setter
        public Builder runtime(@Nullable String runtime) {
            this.runtime = runtime;
            return this;
        }
        @CustomType.Setter
        public Builder source(@Nullable FunctionBuildConfigSource source) {
            this.source = source;
            return this;
        }
        @CustomType.Setter
        public Builder workerPool(@Nullable String workerPool) {
            this.workerPool = workerPool;
            return this;
        }
        public FunctionBuildConfig build() {
            final var o = new FunctionBuildConfig();
            o.build = build;
            o.dockerRepository = dockerRepository;
            o.entryPoint = entryPoint;
            o.environmentVariables = environmentVariables;
            o.runtime = runtime;
            o.source = source;
            o.workerPool = workerPool;
            return o;
        }
    }
}
