// *** 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.ServiceTemplateMetadata;
import com.pulumi.gcp.cloudrun.outputs.ServiceTemplateSpec;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;

@CustomType
public final class ServiceTemplate {
    /**
     * @return Optional metadata for this Revision, including labels and annotations.
     * Name will be generated by the Configuration. To set minimum instances
     * for this revision, use the &#34;autoscaling.knative.dev/minScale&#34; annotation
     * key. To set maximum instances for this revision, use the
     * &#34;autoscaling.knative.dev/maxScale&#34; annotation key. To set Cloud SQL
     * connections for the revision, use the &#34;run.googleapis.com/cloudsql-instances&#34;
     * annotation key.
     * Structure is documented below.
     * 
     */
    private @Nullable ServiceTemplateMetadata metadata;
    /**
     * @return RevisionSpec holds the desired state of the Revision (from the client).
     * Structure is documented below.
     * 
     */
    private @Nullable ServiceTemplateSpec spec;

    private ServiceTemplate() {}
    /**
     * @return Optional metadata for this Revision, including labels and annotations.
     * Name will be generated by the Configuration. To set minimum instances
     * for this revision, use the &#34;autoscaling.knative.dev/minScale&#34; annotation
     * key. To set maximum instances for this revision, use the
     * &#34;autoscaling.knative.dev/maxScale&#34; annotation key. To set Cloud SQL
     * connections for the revision, use the &#34;run.googleapis.com/cloudsql-instances&#34;
     * annotation key.
     * Structure is documented below.
     * 
     */
    public Optional<ServiceTemplateMetadata> metadata() {
        return Optional.ofNullable(this.metadata);
    }
    /**
     * @return RevisionSpec holds the desired state of the Revision (from the client).
     * Structure is documented below.
     * 
     */
    public Optional<ServiceTemplateSpec> spec() {
        return Optional.ofNullable(this.spec);
    }

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

    public static Builder builder(ServiceTemplate defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable ServiceTemplateMetadata metadata;
        private @Nullable ServiceTemplateSpec spec;
        public Builder() {}
        public Builder(ServiceTemplate defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.metadata = defaults.metadata;
    	      this.spec = defaults.spec;
        }

        @CustomType.Setter
        public Builder metadata(@Nullable ServiceTemplateMetadata metadata) {
            this.metadata = metadata;
            return this;
        }
        @CustomType.Setter
        public Builder spec(@Nullable ServiceTemplateSpec spec) {
            this.spec = spec;
            return this;
        }
        public ServiceTemplate build() {
            final var o = new ServiceTemplate();
            o.metadata = metadata;
            o.spec = spec;
            return o;
        }
    }
}
