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

import com.pulumi.core.annotations.CustomType;
import com.pulumi.gcp.cloudrun.outputs.ServiceTemplateSpecContainerEnv;
import com.pulumi.gcp.cloudrun.outputs.ServiceTemplateSpecContainerEnvFrom;
import com.pulumi.gcp.cloudrun.outputs.ServiceTemplateSpecContainerLivenessProbe;
import com.pulumi.gcp.cloudrun.outputs.ServiceTemplateSpecContainerPort;
import com.pulumi.gcp.cloudrun.outputs.ServiceTemplateSpecContainerResources;
import com.pulumi.gcp.cloudrun.outputs.ServiceTemplateSpecContainerStartupProbe;
import com.pulumi.gcp.cloudrun.outputs.ServiceTemplateSpecContainerVolumeMount;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;

@CustomType
public final class ServiceTemplateSpecContainer {
    /**
     * @return Arguments to the entrypoint.
     * The docker image&#39;s CMD is used if this is not provided.
     * 
     */
    private @Nullable List<String> args;
    /**
     * @return Entrypoint array. Not executed within a shell.
     * The docker image&#39;s ENTRYPOINT is used if this is not provided.
     * 
     */
    private @Nullable List<String> commands;
    /**
     * @return (Optional, Deprecated)
     * List of sources to populate environment variables in the container.
     * All invalid keys will be reported as an event when the container is starting.
     * When a key exists in multiple sources, the value associated with the last source will
     * take precedence. Values defined by an Env with a duplicate key will take
     * precedence.
     * Structure is documented below.
     * 
     * @deprecated
     * Not supported by Cloud Run fully managed
     * 
     */
    @Deprecated /* Not supported by Cloud Run fully managed */
    private @Nullable List<ServiceTemplateSpecContainerEnvFrom> envFroms;
    /**
     * @return List of environment variables to set in the container.
     * Structure is documented below.
     * 
     */
    private @Nullable List<ServiceTemplateSpecContainerEnv> envs;
    /**
     * @return Docker image name. This is most often a reference to a container located
     * in the container registry, such as gcr.io/cloudrun/hello
     * 
     */
    private String image;
    /**
     * @return Periodic probe of container liveness. Container will be restarted if the probe fails. More info:
     * https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
     * Structure is documented below.
     * 
     */
    private @Nullable ServiceTemplateSpecContainerLivenessProbe livenessProbe;
    /**
     * @return Name of the container
     * 
     */
    private @Nullable String name;
    /**
     * @return List of open ports in the container.
     * Structure is documented below.
     * 
     */
    private @Nullable List<ServiceTemplateSpecContainerPort> ports;
    /**
     * @return Compute Resources required by this container. Used to set values such as max memory
     * Structure is documented below.
     * 
     */
    private @Nullable ServiceTemplateSpecContainerResources resources;
    /**
     * @return Startup probe of application within the container.
     * All other probes are disabled if a startup probe is provided, until it
     * succeeds. Container will not be added to service endpoints if the probe fails.
     * Structure is documented below.
     * 
     */
    private @Nullable ServiceTemplateSpecContainerStartupProbe startupProbe;
    /**
     * @return Volume to mount into the container&#39;s filesystem.
     * Only supports SecretVolumeSources.
     * Structure is documented below.
     * 
     */
    private @Nullable List<ServiceTemplateSpecContainerVolumeMount> volumeMounts;
    /**
     * @return (Optional, Deprecated)
     * Container&#39;s working directory.
     * If not specified, the container runtime&#39;s default will be used, which
     * might be configured in the container image.
     * 
     * @deprecated
     * Not supported by Cloud Run fully managed
     * 
     */
    @Deprecated /* Not supported by Cloud Run fully managed */
    private @Nullable String workingDir;

    private ServiceTemplateSpecContainer() {}
    /**
     * @return Arguments to the entrypoint.
     * The docker image&#39;s CMD is used if this is not provided.
     * 
     */
    public List<String> args() {
        return this.args == null ? List.of() : this.args;
    }
    /**
     * @return Entrypoint array. Not executed within a shell.
     * The docker image&#39;s ENTRYPOINT is used if this is not provided.
     * 
     */
    public List<String> commands() {
        return this.commands == null ? List.of() : this.commands;
    }
    /**
     * @return (Optional, Deprecated)
     * List of sources to populate environment variables in the container.
     * All invalid keys will be reported as an event when the container is starting.
     * When a key exists in multiple sources, the value associated with the last source will
     * take precedence. Values defined by an Env with a duplicate key will take
     * precedence.
     * Structure is documented below.
     * 
     * @deprecated
     * Not supported by Cloud Run fully managed
     * 
     */
    @Deprecated /* Not supported by Cloud Run fully managed */
    public List<ServiceTemplateSpecContainerEnvFrom> envFroms() {
        return this.envFroms == null ? List.of() : this.envFroms;
    }
    /**
     * @return List of environment variables to set in the container.
     * Structure is documented below.
     * 
     */
    public List<ServiceTemplateSpecContainerEnv> envs() {
        return this.envs == null ? List.of() : this.envs;
    }
    /**
     * @return Docker image name. This is most often a reference to a container located
     * in the container registry, such as gcr.io/cloudrun/hello
     * 
     */
    public String image() {
        return this.image;
    }
    /**
     * @return Periodic probe of container liveness. Container will be restarted if the probe fails. More info:
     * https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
     * Structure is documented below.
     * 
     */
    public Optional<ServiceTemplateSpecContainerLivenessProbe> livenessProbe() {
        return Optional.ofNullable(this.livenessProbe);
    }
    /**
     * @return Name of the container
     * 
     */
    public Optional<String> name() {
        return Optional.ofNullable(this.name);
    }
    /**
     * @return List of open ports in the container.
     * Structure is documented below.
     * 
     */
    public List<ServiceTemplateSpecContainerPort> ports() {
        return this.ports == null ? List.of() : this.ports;
    }
    /**
     * @return Compute Resources required by this container. Used to set values such as max memory
     * Structure is documented below.
     * 
     */
    public Optional<ServiceTemplateSpecContainerResources> resources() {
        return Optional.ofNullable(this.resources);
    }
    /**
     * @return Startup probe of application within the container.
     * All other probes are disabled if a startup probe is provided, until it
     * succeeds. Container will not be added to service endpoints if the probe fails.
     * Structure is documented below.
     * 
     */
    public Optional<ServiceTemplateSpecContainerStartupProbe> startupProbe() {
        return Optional.ofNullable(this.startupProbe);
    }
    /**
     * @return Volume to mount into the container&#39;s filesystem.
     * Only supports SecretVolumeSources.
     * Structure is documented below.
     * 
     */
    public List<ServiceTemplateSpecContainerVolumeMount> volumeMounts() {
        return this.volumeMounts == null ? List.of() : this.volumeMounts;
    }
    /**
     * @return (Optional, Deprecated)
     * Container&#39;s working directory.
     * If not specified, the container runtime&#39;s default will be used, which
     * might be configured in the container image.
     * 
     * @deprecated
     * Not supported by Cloud Run fully managed
     * 
     */
    @Deprecated /* Not supported by Cloud Run fully managed */
    public Optional<String> workingDir() {
        return Optional.ofNullable(this.workingDir);
    }

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

    public static Builder builder(ServiceTemplateSpecContainer defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable List<String> args;
        private @Nullable List<String> commands;
        private @Nullable List<ServiceTemplateSpecContainerEnvFrom> envFroms;
        private @Nullable List<ServiceTemplateSpecContainerEnv> envs;
        private String image;
        private @Nullable ServiceTemplateSpecContainerLivenessProbe livenessProbe;
        private @Nullable String name;
        private @Nullable List<ServiceTemplateSpecContainerPort> ports;
        private @Nullable ServiceTemplateSpecContainerResources resources;
        private @Nullable ServiceTemplateSpecContainerStartupProbe startupProbe;
        private @Nullable List<ServiceTemplateSpecContainerVolumeMount> volumeMounts;
        private @Nullable String workingDir;
        public Builder() {}
        public Builder(ServiceTemplateSpecContainer defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.args = defaults.args;
    	      this.commands = defaults.commands;
    	      this.envFroms = defaults.envFroms;
    	      this.envs = defaults.envs;
    	      this.image = defaults.image;
    	      this.livenessProbe = defaults.livenessProbe;
    	      this.name = defaults.name;
    	      this.ports = defaults.ports;
    	      this.resources = defaults.resources;
    	      this.startupProbe = defaults.startupProbe;
    	      this.volumeMounts = defaults.volumeMounts;
    	      this.workingDir = defaults.workingDir;
        }

        @CustomType.Setter
        public Builder args(@Nullable List<String> args) {
            this.args = args;
            return this;
        }
        public Builder args(String... args) {
            return args(List.of(args));
        }
        @CustomType.Setter
        public Builder commands(@Nullable List<String> commands) {
            this.commands = commands;
            return this;
        }
        public Builder commands(String... commands) {
            return commands(List.of(commands));
        }
        @CustomType.Setter
        public Builder envFroms(@Nullable List<ServiceTemplateSpecContainerEnvFrom> envFroms) {
            this.envFroms = envFroms;
            return this;
        }
        public Builder envFroms(ServiceTemplateSpecContainerEnvFrom... envFroms) {
            return envFroms(List.of(envFroms));
        }
        @CustomType.Setter
        public Builder envs(@Nullable List<ServiceTemplateSpecContainerEnv> envs) {
            this.envs = envs;
            return this;
        }
        public Builder envs(ServiceTemplateSpecContainerEnv... envs) {
            return envs(List.of(envs));
        }
        @CustomType.Setter
        public Builder image(String image) {
            this.image = Objects.requireNonNull(image);
            return this;
        }
        @CustomType.Setter
        public Builder livenessProbe(@Nullable ServiceTemplateSpecContainerLivenessProbe livenessProbe) {
            this.livenessProbe = livenessProbe;
            return this;
        }
        @CustomType.Setter
        public Builder name(@Nullable String name) {
            this.name = name;
            return this;
        }
        @CustomType.Setter
        public Builder ports(@Nullable List<ServiceTemplateSpecContainerPort> ports) {
            this.ports = ports;
            return this;
        }
        public Builder ports(ServiceTemplateSpecContainerPort... ports) {
            return ports(List.of(ports));
        }
        @CustomType.Setter
        public Builder resources(@Nullable ServiceTemplateSpecContainerResources resources) {
            this.resources = resources;
            return this;
        }
        @CustomType.Setter
        public Builder startupProbe(@Nullable ServiceTemplateSpecContainerStartupProbe startupProbe) {
            this.startupProbe = startupProbe;
            return this;
        }
        @CustomType.Setter
        public Builder volumeMounts(@Nullable List<ServiceTemplateSpecContainerVolumeMount> volumeMounts) {
            this.volumeMounts = volumeMounts;
            return this;
        }
        public Builder volumeMounts(ServiceTemplateSpecContainerVolumeMount... volumeMounts) {
            return volumeMounts(List.of(volumeMounts));
        }
        @CustomType.Setter
        public Builder workingDir(@Nullable String workingDir) {
            this.workingDir = workingDir;
            return this;
        }
        public ServiceTemplateSpecContainer build() {
            final var o = new ServiceTemplateSpecContainer();
            o.args = args;
            o.commands = commands;
            o.envFroms = envFroms;
            o.envs = envs;
            o.image = image;
            o.livenessProbe = livenessProbe;
            o.name = name;
            o.ports = ports;
            o.resources = resources;
            o.startupProbe = startupProbe;
            o.volumeMounts = volumeMounts;
            o.workingDir = workingDir;
            return o;
        }
    }
}
