// *** 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.ServiceTemplateSpecContainer;
import com.pulumi.gcp.cloudrun.outputs.ServiceTemplateSpecVolume;
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 ServiceTemplateSpec {
    /**
     * @return ContainerConcurrency specifies the maximum allowed in-flight (concurrent)
     * requests per container of the Revision. Values are:
     * 
     */
    private @Nullable Integer containerConcurrency;
    /**
     * @return Containers defines the unit of execution for this Revision.
     * Structure is documented below.
     * 
     */
    private @Nullable List<ServiceTemplateSpecContainer> containers;
    /**
     * @return Email address of the IAM service account associated with the revision of the
     * service. The service account represents the identity of the running revision,
     * and determines what permissions the revision has. If not provided, the revision
     * will use the project&#39;s default service account.
     * 
     */
    private @Nullable String serviceAccountName;
    /**
     * @return (Output, Deprecated)
     * ServingState holds a value describing the state the resources
     * are in for this Revision.
     * It is expected
     * that the system will manipulate this based on routability and load.
     * 
     * @deprecated
     * Not supported by Cloud Run fully managed
     * 
     */
    @Deprecated /* Not supported by Cloud Run fully managed */
    private @Nullable String servingState;
    /**
     * @return TimeoutSeconds holds the max duration the instance is allowed for responding to a request.
     * 
     */
    private @Nullable Integer timeoutSeconds;
    /**
     * @return Volume represents a named volume in a container.
     * Structure is documented below.
     * 
     */
    private @Nullable List<ServiceTemplateSpecVolume> volumes;

    private ServiceTemplateSpec() {}
    /**
     * @return ContainerConcurrency specifies the maximum allowed in-flight (concurrent)
     * requests per container of the Revision. Values are:
     * 
     */
    public Optional<Integer> containerConcurrency() {
        return Optional.ofNullable(this.containerConcurrency);
    }
    /**
     * @return Containers defines the unit of execution for this Revision.
     * Structure is documented below.
     * 
     */
    public List<ServiceTemplateSpecContainer> containers() {
        return this.containers == null ? List.of() : this.containers;
    }
    /**
     * @return Email address of the IAM service account associated with the revision of the
     * service. The service account represents the identity of the running revision,
     * and determines what permissions the revision has. If not provided, the revision
     * will use the project&#39;s default service account.
     * 
     */
    public Optional<String> serviceAccountName() {
        return Optional.ofNullable(this.serviceAccountName);
    }
    /**
     * @return (Output, Deprecated)
     * ServingState holds a value describing the state the resources
     * are in for this Revision.
     * It is expected
     * that the system will manipulate this based on routability and load.
     * 
     * @deprecated
     * Not supported by Cloud Run fully managed
     * 
     */
    @Deprecated /* Not supported by Cloud Run fully managed */
    public Optional<String> servingState() {
        return Optional.ofNullable(this.servingState);
    }
    /**
     * @return TimeoutSeconds holds the max duration the instance is allowed for responding to a request.
     * 
     */
    public Optional<Integer> timeoutSeconds() {
        return Optional.ofNullable(this.timeoutSeconds);
    }
    /**
     * @return Volume represents a named volume in a container.
     * Structure is documented below.
     * 
     */
    public List<ServiceTemplateSpecVolume> volumes() {
        return this.volumes == null ? List.of() : this.volumes;
    }

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

    public static Builder builder(ServiceTemplateSpec defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable Integer containerConcurrency;
        private @Nullable List<ServiceTemplateSpecContainer> containers;
        private @Nullable String serviceAccountName;
        private @Nullable String servingState;
        private @Nullable Integer timeoutSeconds;
        private @Nullable List<ServiceTemplateSpecVolume> volumes;
        public Builder() {}
        public Builder(ServiceTemplateSpec defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.containerConcurrency = defaults.containerConcurrency;
    	      this.containers = defaults.containers;
    	      this.serviceAccountName = defaults.serviceAccountName;
    	      this.servingState = defaults.servingState;
    	      this.timeoutSeconds = defaults.timeoutSeconds;
    	      this.volumes = defaults.volumes;
        }

        @CustomType.Setter
        public Builder containerConcurrency(@Nullable Integer containerConcurrency) {
            this.containerConcurrency = containerConcurrency;
            return this;
        }
        @CustomType.Setter
        public Builder containers(@Nullable List<ServiceTemplateSpecContainer> containers) {
            this.containers = containers;
            return this;
        }
        public Builder containers(ServiceTemplateSpecContainer... containers) {
            return containers(List.of(containers));
        }
        @CustomType.Setter
        public Builder serviceAccountName(@Nullable String serviceAccountName) {
            this.serviceAccountName = serviceAccountName;
            return this;
        }
        @CustomType.Setter
        public Builder servingState(@Nullable String servingState) {
            this.servingState = servingState;
            return this;
        }
        @CustomType.Setter
        public Builder timeoutSeconds(@Nullable Integer timeoutSeconds) {
            this.timeoutSeconds = timeoutSeconds;
            return this;
        }
        @CustomType.Setter
        public Builder volumes(@Nullable List<ServiceTemplateSpecVolume> volumes) {
            this.volumes = volumes;
            return this;
        }
        public Builder volumes(ServiceTemplateSpecVolume... volumes) {
            return volumes(List.of(volumes));
        }
        public ServiceTemplateSpec build() {
            final var o = new ServiceTemplateSpec();
            o.containerConcurrency = containerConcurrency;
            o.containers = containers;
            o.serviceAccountName = serviceAccountName;
            o.servingState = servingState;
            o.timeoutSeconds = timeoutSeconds;
            o.volumes = volumes;
            return o;
        }
    }
}
