// *** 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.cloudbuild.inputs;

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.gcp.cloudbuild.inputs.TriggerBuildArtifactsArgs;
import com.pulumi.gcp.cloudbuild.inputs.TriggerBuildAvailableSecretsArgs;
import com.pulumi.gcp.cloudbuild.inputs.TriggerBuildOptionsArgs;
import com.pulumi.gcp.cloudbuild.inputs.TriggerBuildSecretArgs;
import com.pulumi.gcp.cloudbuild.inputs.TriggerBuildSourceArgs;
import com.pulumi.gcp.cloudbuild.inputs.TriggerBuildStepArgs;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


public final class TriggerBuildArgs extends com.pulumi.resources.ResourceArgs {

    public static final TriggerBuildArgs Empty = new TriggerBuildArgs();

    /**
     * Artifacts produced by the build that should be uploaded upon successful completion of all build steps.
     * Structure is documented below.
     * 
     */
    @Import(name="artifacts")
    private @Nullable Output<TriggerBuildArtifactsArgs> artifacts;

    /**
     * @return Artifacts produced by the build that should be uploaded upon successful completion of all build steps.
     * Structure is documented below.
     * 
     */
    public Optional<Output<TriggerBuildArtifactsArgs>> artifacts() {
        return Optional.ofNullable(this.artifacts);
    }

    /**
     * Secrets and secret environment variables.
     * Structure is documented below.
     * 
     */
    @Import(name="availableSecrets")
    private @Nullable Output<TriggerBuildAvailableSecretsArgs> availableSecrets;

    /**
     * @return Secrets and secret environment variables.
     * Structure is documented below.
     * 
     */
    public Optional<Output<TriggerBuildAvailableSecretsArgs>> availableSecrets() {
        return Optional.ofNullable(this.availableSecrets);
    }

    /**
     * A list of images to be pushed upon the successful completion of all build steps.
     * The images are pushed using the builder service account&#39;s credentials.
     * The digests of the pushed images will be stored in the Build resource&#39;s results field.
     * If any of the images fail to be pushed, the build status is marked FAILURE.
     * 
     */
    @Import(name="images")
    private @Nullable Output<List<String>> images;

    /**
     * @return A list of images to be pushed upon the successful completion of all build steps.
     * The images are pushed using the builder service account&#39;s credentials.
     * The digests of the pushed images will be stored in the Build resource&#39;s results field.
     * If any of the images fail to be pushed, the build status is marked FAILURE.
     * 
     */
    public Optional<Output<List<String>>> images() {
        return Optional.ofNullable(this.images);
    }

    /**
     * Google Cloud Storage bucket where logs should be written.
     * Logs file names will be of the format ${logsBucket}/log-${build_id}.txt.
     * 
     */
    @Import(name="logsBucket")
    private @Nullable Output<String> logsBucket;

    /**
     * @return Google Cloud Storage bucket where logs should be written.
     * Logs file names will be of the format ${logsBucket}/log-${build_id}.txt.
     * 
     */
    public Optional<Output<String>> logsBucket() {
        return Optional.ofNullable(this.logsBucket);
    }

    /**
     * Special options for this build.
     * Structure is documented below.
     * 
     */
    @Import(name="options")
    private @Nullable Output<TriggerBuildOptionsArgs> options;

    /**
     * @return Special options for this build.
     * Structure is documented below.
     * 
     */
    public Optional<Output<TriggerBuildOptionsArgs>> options() {
        return Optional.ofNullable(this.options);
    }

    /**
     * TTL in queue for this build. If provided and the build is enqueued longer than this value,
     * the build will expire and the build status will be EXPIRED.
     * The TTL starts ticking from createTime.
     * A duration in seconds with up to nine fractional digits, terminated by &#39;s&#39;. Example: &#34;3.5s&#34;.
     * 
     */
    @Import(name="queueTtl")
    private @Nullable Output<String> queueTtl;

    /**
     * @return TTL in queue for this build. If provided and the build is enqueued longer than this value,
     * the build will expire and the build status will be EXPIRED.
     * The TTL starts ticking from createTime.
     * A duration in seconds with up to nine fractional digits, terminated by &#39;s&#39;. Example: &#34;3.5s&#34;.
     * 
     */
    public Optional<Output<String>> queueTtl() {
        return Optional.ofNullable(this.queueTtl);
    }

    /**
     * Secrets to decrypt using Cloud Key Management Service.
     * Structure is documented below.
     * 
     */
    @Import(name="secrets")
    private @Nullable Output<List<TriggerBuildSecretArgs>> secrets;

    /**
     * @return Secrets to decrypt using Cloud Key Management Service.
     * Structure is documented below.
     * 
     */
    public Optional<Output<List<TriggerBuildSecretArgs>>> secrets() {
        return Optional.ofNullable(this.secrets);
    }

    /**
     * The location of the source files to build.
     * One of `storageSource` or `repoSource` must be provided.
     * Structure is documented below.
     * 
     */
    @Import(name="source")
    private @Nullable Output<TriggerBuildSourceArgs> source;

    /**
     * @return The location of the source files to build.
     * One of `storageSource` or `repoSource` must be provided.
     * Structure is documented below.
     * 
     */
    public Optional<Output<TriggerBuildSourceArgs>> source() {
        return Optional.ofNullable(this.source);
    }

    /**
     * The operations to be performed on the workspace.
     * Structure is documented below.
     * 
     */
    @Import(name="steps", required=true)
    private Output<List<TriggerBuildStepArgs>> steps;

    /**
     * @return The operations to be performed on the workspace.
     * Structure is documented below.
     * 
     */
    public Output<List<TriggerBuildStepArgs>> steps() {
        return this.steps;
    }

    /**
     * Substitutions data for Build resource.
     * 
     */
    @Import(name="substitutions")
    private @Nullable Output<Map<String,String>> substitutions;

    /**
     * @return Substitutions data for Build resource.
     * 
     */
    public Optional<Output<Map<String,String>>> substitutions() {
        return Optional.ofNullable(this.substitutions);
    }

    /**
     * Tags for annotation of a Build. These are not docker tags.
     * 
     */
    @Import(name="tags")
    private @Nullable Output<List<String>> tags;

    /**
     * @return Tags for annotation of a Build. These are not docker tags.
     * 
     */
    public Optional<Output<List<String>>> tags() {
        return Optional.ofNullable(this.tags);
    }

    /**
     * Amount of time that this build should be allowed to run, to second granularity.
     * If this amount of time elapses, work on the build will cease and the build status will be TIMEOUT.
     * This timeout must be equal to or greater than the sum of the timeouts for build steps within the build.
     * The expected format is the number of seconds followed by s.
     * Default time is ten minutes (600s).
     * 
     */
    @Import(name="timeout")
    private @Nullable Output<String> timeout;

    /**
     * @return Amount of time that this build should be allowed to run, to second granularity.
     * If this amount of time elapses, work on the build will cease and the build status will be TIMEOUT.
     * This timeout must be equal to or greater than the sum of the timeouts for build steps within the build.
     * The expected format is the number of seconds followed by s.
     * Default time is ten minutes (600s).
     * 
     */
    public Optional<Output<String>> timeout() {
        return Optional.ofNullable(this.timeout);
    }

    private TriggerBuildArgs() {}

    private TriggerBuildArgs(TriggerBuildArgs $) {
        this.artifacts = $.artifacts;
        this.availableSecrets = $.availableSecrets;
        this.images = $.images;
        this.logsBucket = $.logsBucket;
        this.options = $.options;
        this.queueTtl = $.queueTtl;
        this.secrets = $.secrets;
        this.source = $.source;
        this.steps = $.steps;
        this.substitutions = $.substitutions;
        this.tags = $.tags;
        this.timeout = $.timeout;
    }

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

    public static final class Builder {
        private TriggerBuildArgs $;

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

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

        /**
         * @param artifacts Artifacts produced by the build that should be uploaded upon successful completion of all build steps.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder artifacts(@Nullable Output<TriggerBuildArtifactsArgs> artifacts) {
            $.artifacts = artifacts;
            return this;
        }

        /**
         * @param artifacts Artifacts produced by the build that should be uploaded upon successful completion of all build steps.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder artifacts(TriggerBuildArtifactsArgs artifacts) {
            return artifacts(Output.of(artifacts));
        }

        /**
         * @param availableSecrets Secrets and secret environment variables.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder availableSecrets(@Nullable Output<TriggerBuildAvailableSecretsArgs> availableSecrets) {
            $.availableSecrets = availableSecrets;
            return this;
        }

        /**
         * @param availableSecrets Secrets and secret environment variables.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder availableSecrets(TriggerBuildAvailableSecretsArgs availableSecrets) {
            return availableSecrets(Output.of(availableSecrets));
        }

        /**
         * @param images A list of images to be pushed upon the successful completion of all build steps.
         * The images are pushed using the builder service account&#39;s credentials.
         * The digests of the pushed images will be stored in the Build resource&#39;s results field.
         * If any of the images fail to be pushed, the build status is marked FAILURE.
         * 
         * @return builder
         * 
         */
        public Builder images(@Nullable Output<List<String>> images) {
            $.images = images;
            return this;
        }

        /**
         * @param images A list of images to be pushed upon the successful completion of all build steps.
         * The images are pushed using the builder service account&#39;s credentials.
         * The digests of the pushed images will be stored in the Build resource&#39;s results field.
         * If any of the images fail to be pushed, the build status is marked FAILURE.
         * 
         * @return builder
         * 
         */
        public Builder images(List<String> images) {
            return images(Output.of(images));
        }

        /**
         * @param images A list of images to be pushed upon the successful completion of all build steps.
         * The images are pushed using the builder service account&#39;s credentials.
         * The digests of the pushed images will be stored in the Build resource&#39;s results field.
         * If any of the images fail to be pushed, the build status is marked FAILURE.
         * 
         * @return builder
         * 
         */
        public Builder images(String... images) {
            return images(List.of(images));
        }

        /**
         * @param logsBucket Google Cloud Storage bucket where logs should be written.
         * Logs file names will be of the format ${logsBucket}/log-${build_id}.txt.
         * 
         * @return builder
         * 
         */
        public Builder logsBucket(@Nullable Output<String> logsBucket) {
            $.logsBucket = logsBucket;
            return this;
        }

        /**
         * @param logsBucket Google Cloud Storage bucket where logs should be written.
         * Logs file names will be of the format ${logsBucket}/log-${build_id}.txt.
         * 
         * @return builder
         * 
         */
        public Builder logsBucket(String logsBucket) {
            return logsBucket(Output.of(logsBucket));
        }

        /**
         * @param options Special options for this build.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder options(@Nullable Output<TriggerBuildOptionsArgs> options) {
            $.options = options;
            return this;
        }

        /**
         * @param options Special options for this build.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder options(TriggerBuildOptionsArgs options) {
            return options(Output.of(options));
        }

        /**
         * @param queueTtl TTL in queue for this build. If provided and the build is enqueued longer than this value,
         * the build will expire and the build status will be EXPIRED.
         * The TTL starts ticking from createTime.
         * A duration in seconds with up to nine fractional digits, terminated by &#39;s&#39;. Example: &#34;3.5s&#34;.
         * 
         * @return builder
         * 
         */
        public Builder queueTtl(@Nullable Output<String> queueTtl) {
            $.queueTtl = queueTtl;
            return this;
        }

        /**
         * @param queueTtl TTL in queue for this build. If provided and the build is enqueued longer than this value,
         * the build will expire and the build status will be EXPIRED.
         * The TTL starts ticking from createTime.
         * A duration in seconds with up to nine fractional digits, terminated by &#39;s&#39;. Example: &#34;3.5s&#34;.
         * 
         * @return builder
         * 
         */
        public Builder queueTtl(String queueTtl) {
            return queueTtl(Output.of(queueTtl));
        }

        /**
         * @param secrets Secrets to decrypt using Cloud Key Management Service.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder secrets(@Nullable Output<List<TriggerBuildSecretArgs>> secrets) {
            $.secrets = secrets;
            return this;
        }

        /**
         * @param secrets Secrets to decrypt using Cloud Key Management Service.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder secrets(List<TriggerBuildSecretArgs> secrets) {
            return secrets(Output.of(secrets));
        }

        /**
         * @param secrets Secrets to decrypt using Cloud Key Management Service.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder secrets(TriggerBuildSecretArgs... secrets) {
            return secrets(List.of(secrets));
        }

        /**
         * @param source The location of the source files to build.
         * One of `storageSource` or `repoSource` must be provided.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder source(@Nullable Output<TriggerBuildSourceArgs> source) {
            $.source = source;
            return this;
        }

        /**
         * @param source The location of the source files to build.
         * One of `storageSource` or `repoSource` must be provided.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder source(TriggerBuildSourceArgs source) {
            return source(Output.of(source));
        }

        /**
         * @param steps The operations to be performed on the workspace.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder steps(Output<List<TriggerBuildStepArgs>> steps) {
            $.steps = steps;
            return this;
        }

        /**
         * @param steps The operations to be performed on the workspace.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder steps(List<TriggerBuildStepArgs> steps) {
            return steps(Output.of(steps));
        }

        /**
         * @param steps The operations to be performed on the workspace.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder steps(TriggerBuildStepArgs... steps) {
            return steps(List.of(steps));
        }

        /**
         * @param substitutions Substitutions data for Build resource.
         * 
         * @return builder
         * 
         */
        public Builder substitutions(@Nullable Output<Map<String,String>> substitutions) {
            $.substitutions = substitutions;
            return this;
        }

        /**
         * @param substitutions Substitutions data for Build resource.
         * 
         * @return builder
         * 
         */
        public Builder substitutions(Map<String,String> substitutions) {
            return substitutions(Output.of(substitutions));
        }

        /**
         * @param tags Tags for annotation of a Build. These are not docker tags.
         * 
         * @return builder
         * 
         */
        public Builder tags(@Nullable Output<List<String>> tags) {
            $.tags = tags;
            return this;
        }

        /**
         * @param tags Tags for annotation of a Build. These are not docker tags.
         * 
         * @return builder
         * 
         */
        public Builder tags(List<String> tags) {
            return tags(Output.of(tags));
        }

        /**
         * @param tags Tags for annotation of a Build. These are not docker tags.
         * 
         * @return builder
         * 
         */
        public Builder tags(String... tags) {
            return tags(List.of(tags));
        }

        /**
         * @param timeout Amount of time that this build should be allowed to run, to second granularity.
         * If this amount of time elapses, work on the build will cease and the build status will be TIMEOUT.
         * This timeout must be equal to or greater than the sum of the timeouts for build steps within the build.
         * The expected format is the number of seconds followed by s.
         * Default time is ten minutes (600s).
         * 
         * @return builder
         * 
         */
        public Builder timeout(@Nullable Output<String> timeout) {
            $.timeout = timeout;
            return this;
        }

        /**
         * @param timeout Amount of time that this build should be allowed to run, to second granularity.
         * If this amount of time elapses, work on the build will cease and the build status will be TIMEOUT.
         * This timeout must be equal to or greater than the sum of the timeouts for build steps within the build.
         * The expected format is the number of seconds followed by s.
         * Default time is ten minutes (600s).
         * 
         * @return builder
         * 
         */
        public Builder timeout(String timeout) {
            return timeout(Output.of(timeout));
        }

        public TriggerBuildArgs build() {
            $.steps = Objects.requireNonNull($.steps, "expected parameter 'steps' to be non-null");
            return $;
        }
    }

}
