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

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.gcp.cloudrunv2.inputs.JobTemplateTemplateVolumeSecretItemArgs;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


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

    public static final JobTemplateTemplateVolumeSecretArgs Empty = new JobTemplateTemplateVolumeSecretArgs();

    /**
     * Integer representation of mode bits to use on created files by default. Must be a value between 0000 and 0777 (octal), defaulting to 0444. Directories within the path are not affected by this setting.
     * 
     */
    @Import(name="defaultMode")
    private @Nullable Output<Integer> defaultMode;

    /**
     * @return Integer representation of mode bits to use on created files by default. Must be a value between 0000 and 0777 (octal), defaulting to 0444. Directories within the path are not affected by this setting.
     * 
     */
    public Optional<Output<Integer>> defaultMode() {
        return Optional.ofNullable(this.defaultMode);
    }

    /**
     * If unspecified, the volume will expose a file whose name is the secret, relative to VolumeMount.mount_path. If specified, the key will be used as the version to fetch from Cloud Secret Manager and the path will be the name of the file exposed in the volume. When items are defined, they must specify a path and a version.
     * Structure is documented below.
     * 
     */
    @Import(name="items")
    private @Nullable Output<List<JobTemplateTemplateVolumeSecretItemArgs>> items;

    /**
     * @return If unspecified, the volume will expose a file whose name is the secret, relative to VolumeMount.mount_path. If specified, the key will be used as the version to fetch from Cloud Secret Manager and the path will be the name of the file exposed in the volume. When items are defined, they must specify a path and a version.
     * Structure is documented below.
     * 
     */
    public Optional<Output<List<JobTemplateTemplateVolumeSecretItemArgs>>> items() {
        return Optional.ofNullable(this.items);
    }

    /**
     * The name of the secret in Cloud Secret Manager. Format: {secret} if the secret is in the same project. projects/{project}/secrets/{secret} if the secret is in a different project.
     * 
     */
    @Import(name="secret", required=true)
    private Output<String> secret;

    /**
     * @return The name of the secret in Cloud Secret Manager. Format: {secret} if the secret is in the same project. projects/{project}/secrets/{secret} if the secret is in a different project.
     * 
     */
    public Output<String> secret() {
        return this.secret;
    }

    private JobTemplateTemplateVolumeSecretArgs() {}

    private JobTemplateTemplateVolumeSecretArgs(JobTemplateTemplateVolumeSecretArgs $) {
        this.defaultMode = $.defaultMode;
        this.items = $.items;
        this.secret = $.secret;
    }

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

    public static final class Builder {
        private JobTemplateTemplateVolumeSecretArgs $;

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

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

        /**
         * @param defaultMode Integer representation of mode bits to use on created files by default. Must be a value between 0000 and 0777 (octal), defaulting to 0444. Directories within the path are not affected by this setting.
         * 
         * @return builder
         * 
         */
        public Builder defaultMode(@Nullable Output<Integer> defaultMode) {
            $.defaultMode = defaultMode;
            return this;
        }

        /**
         * @param defaultMode Integer representation of mode bits to use on created files by default. Must be a value between 0000 and 0777 (octal), defaulting to 0444. Directories within the path are not affected by this setting.
         * 
         * @return builder
         * 
         */
        public Builder defaultMode(Integer defaultMode) {
            return defaultMode(Output.of(defaultMode));
        }

        /**
         * @param items If unspecified, the volume will expose a file whose name is the secret, relative to VolumeMount.mount_path. If specified, the key will be used as the version to fetch from Cloud Secret Manager and the path will be the name of the file exposed in the volume. When items are defined, they must specify a path and a version.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder items(@Nullable Output<List<JobTemplateTemplateVolumeSecretItemArgs>> items) {
            $.items = items;
            return this;
        }

        /**
         * @param items If unspecified, the volume will expose a file whose name is the secret, relative to VolumeMount.mount_path. If specified, the key will be used as the version to fetch from Cloud Secret Manager and the path will be the name of the file exposed in the volume. When items are defined, they must specify a path and a version.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder items(List<JobTemplateTemplateVolumeSecretItemArgs> items) {
            return items(Output.of(items));
        }

        /**
         * @param items If unspecified, the volume will expose a file whose name is the secret, relative to VolumeMount.mount_path. If specified, the key will be used as the version to fetch from Cloud Secret Manager and the path will be the name of the file exposed in the volume. When items are defined, they must specify a path and a version.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder items(JobTemplateTemplateVolumeSecretItemArgs... items) {
            return items(List.of(items));
        }

        /**
         * @param secret The name of the secret in Cloud Secret Manager. Format: {secret} if the secret is in the same project. projects/{project}/secrets/{secret} if the secret is in a different project.
         * 
         * @return builder
         * 
         */
        public Builder secret(Output<String> secret) {
            $.secret = secret;
            return this;
        }

        /**
         * @param secret The name of the secret in Cloud Secret Manager. Format: {secret} if the secret is in the same project. projects/{project}/secrets/{secret} if the secret is in a different project.
         * 
         * @return builder
         * 
         */
        public Builder secret(String secret) {
            return secret(Output.of(secret));
        }

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

}
