"use strict";
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.WorkflowTemplate = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * A Workflow Template is a reusable workflow configuration. It defines a graph of jobs with information on where to run those jobs.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const template = new gcp.dataproc.WorkflowTemplate("template", {
 *     name: "template-example",
 *     location: "us-central1",
 *     placement: {
 *         managedCluster: {
 *             clusterName: "my-cluster",
 *             config: {
 *                 gceClusterConfig: {
 *                     zone: "us-central1-a",
 *                     tags: [
 *                         "foo",
 *                         "bar",
 *                     ],
 *                 },
 *                 masterConfig: {
 *                     numInstances: 1,
 *                     machineType: "n1-standard-1",
 *                     diskConfig: {
 *                         bootDiskType: "pd-ssd",
 *                         bootDiskSizeGb: 15,
 *                     },
 *                 },
 *                 workerConfig: {
 *                     numInstances: 3,
 *                     machineType: "n1-standard-2",
 *                     diskConfig: {
 *                         bootDiskSizeGb: 10,
 *                         numLocalSsds: 2,
 *                     },
 *                 },
 *                 secondaryWorkerConfig: {
 *                     numInstances: 2,
 *                 },
 *                 softwareConfig: {
 *                     imageVersion: "2.0.35-debian10",
 *                 },
 *             },
 *         },
 *     },
 *     jobs: [
 *         {
 *             stepId: "someJob",
 *             sparkJob: {
 *                 mainClass: "SomeClass",
 *             },
 *         },
 *         {
 *             stepId: "otherJob",
 *             prerequisiteStepIds: ["someJob"],
 *             prestoJob: {
 *                 queryFileUri: "someuri",
 *             },
 *         },
 *     ],
 * });
 * ```
 *
 * ## Import
 *
 * WorkflowTemplate can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/locations/{{location}}/workflowTemplates/{{name}}`
 *
 * * `{{project}}/{{location}}/{{name}}`
 *
 * * `{{location}}/{{name}}`
 *
 * When using the `pulumi import` command, WorkflowTemplate can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:dataproc/workflowTemplate:WorkflowTemplate default projects/{{project}}/locations/{{location}}/workflowTemplates/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:dataproc/workflowTemplate:WorkflowTemplate default {{project}}/{{location}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:dataproc/workflowTemplate:WorkflowTemplate default {{location}}/{{name}}
 * ```
 */
class WorkflowTemplate extends pulumi.CustomResource {
    /**
     * Get an existing WorkflowTemplate resource's state with the given name, ID, and optional extra
     * properties used to qualify the lookup.
     *
     * @param name The _unique_ name of the resulting resource.
     * @param id The _unique_ provider ID of the resource to lookup.
     * @param state Any extra arguments used during the lookup.
     * @param opts Optional settings to control the behavior of the CustomResource.
     */
    static get(name, id, state, opts) {
        return new WorkflowTemplate(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of WorkflowTemplate.  This is designed to work even
     * when multiple copies of the Pulumi SDK have been loaded into the same process.
     */
    static isInstance(obj) {
        if (obj === undefined || obj === null) {
            return false;
        }
        return obj['__pulumiType'] === WorkflowTemplate.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["createTime"] = state?.createTime;
            resourceInputs["dagTimeout"] = state?.dagTimeout;
            resourceInputs["effectiveLabels"] = state?.effectiveLabels;
            resourceInputs["encryptionConfig"] = state?.encryptionConfig;
            resourceInputs["jobs"] = state?.jobs;
            resourceInputs["labels"] = state?.labels;
            resourceInputs["location"] = state?.location;
            resourceInputs["name"] = state?.name;
            resourceInputs["parameters"] = state?.parameters;
            resourceInputs["placement"] = state?.placement;
            resourceInputs["project"] = state?.project;
            resourceInputs["pulumiLabels"] = state?.pulumiLabels;
            resourceInputs["updateTime"] = state?.updateTime;
            resourceInputs["version"] = state?.version;
        }
        else {
            const args = argsOrState;
            if (args?.jobs === undefined && !opts.urn) {
                throw new Error("Missing required property 'jobs'");
            }
            if (args?.location === undefined && !opts.urn) {
                throw new Error("Missing required property 'location'");
            }
            if (args?.placement === undefined && !opts.urn) {
                throw new Error("Missing required property 'placement'");
            }
            resourceInputs["dagTimeout"] = args?.dagTimeout;
            resourceInputs["encryptionConfig"] = args?.encryptionConfig;
            resourceInputs["jobs"] = args?.jobs;
            resourceInputs["labels"] = args?.labels;
            resourceInputs["location"] = args?.location;
            resourceInputs["name"] = args?.name;
            resourceInputs["parameters"] = args?.parameters;
            resourceInputs["placement"] = args?.placement;
            resourceInputs["project"] = args?.project;
            resourceInputs["version"] = args?.version;
            resourceInputs["createTime"] = undefined /*out*/;
            resourceInputs["effectiveLabels"] = undefined /*out*/;
            resourceInputs["pulumiLabels"] = undefined /*out*/;
            resourceInputs["updateTime"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(WorkflowTemplate.__pulumiType, name, resourceInputs, opts);
    }
}
exports.WorkflowTemplate = WorkflowTemplate;
/** @internal */
WorkflowTemplate.__pulumiType = 'gcp:dataproc/workflowTemplate:WorkflowTemplate';
//# sourceMappingURL=workflowTemplate.js.map