"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.Pipeline = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * The main pipeline entity and all the necessary metadata for launching and managing linked jobs.
 *
 * To get more information about Pipeline, see:
 *
 * * [API documentation](https://cloud.google.com/dataflow/docs/reference/data-pipelines/rest/v1/projects.locations.pipelines)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/dataflow)
 *
 * ## Example Usage
 *
 * ### Data Pipeline Pipeline
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const serviceAccount = new gcp.serviceaccount.Account("service_account", {
 *     accountId: "my-account",
 *     displayName: "Service Account",
 * });
 * const primary = new gcp.dataflow.Pipeline("primary", {
 *     name: "my-pipeline",
 *     displayName: "my-pipeline",
 *     type: "PIPELINE_TYPE_BATCH",
 *     state: "STATE_ACTIVE",
 *     region: "us-central1",
 *     workload: {
 *         dataflowLaunchTemplateRequest: {
 *             projectId: "my-project",
 *             gcsPath: "gs://my-bucket/path",
 *             launchParameters: {
 *                 jobName: "my-job",
 *                 parameters: {
 *                     name: "wrench",
 *                 },
 *                 environment: {
 *                     numWorkers: 5,
 *                     maxWorkers: 5,
 *                     zone: "us-centra1-a",
 *                     serviceAccountEmail: serviceAccount.email,
 *                     network: "default",
 *                     tempLocation: "gs://my-bucket/tmp_dir",
 *                     bypassTempDirValidation: false,
 *                     machineType: "E2",
 *                     additionalUserLabels: {
 *                         context: "test",
 *                     },
 *                     workerRegion: "us-central1",
 *                     workerZone: "us-central1-a",
 *                     enableStreamingEngine: false,
 *                 },
 *                 update: false,
 *                 transformNameMapping: {
 *                     name: "wrench",
 *                 },
 *             },
 *             location: "us-central1",
 *         },
 *     },
 *     scheduleInfo: {
 *         schedule: "* *&#47;2 * * *",
 *     },
 * });
 * ```
 *
 * ## Import
 *
 * Pipeline can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/locations/{{region}}/pipelines/{{name}}`
 *
 * * `{{project}}/{{region}}/{{name}}`
 *
 * * `{{region}}/{{name}}`
 *
 * * `{{name}}`
 *
 * When using the `pulumi import` command, Pipeline can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:dataflow/pipeline:Pipeline default projects/{{project}}/locations/{{region}}/pipelines/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:dataflow/pipeline:Pipeline default {{project}}/{{region}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:dataflow/pipeline:Pipeline default {{region}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:dataflow/pipeline:Pipeline default {{name}}
 * ```
 */
class Pipeline extends pulumi.CustomResource {
    /**
     * Get an existing Pipeline 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 Pipeline(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of Pipeline.  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'] === Pipeline.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["createTime"] = state?.createTime;
            resourceInputs["displayName"] = state?.displayName;
            resourceInputs["jobCount"] = state?.jobCount;
            resourceInputs["lastUpdateTime"] = state?.lastUpdateTime;
            resourceInputs["name"] = state?.name;
            resourceInputs["pipelineSources"] = state?.pipelineSources;
            resourceInputs["project"] = state?.project;
            resourceInputs["region"] = state?.region;
            resourceInputs["scheduleInfo"] = state?.scheduleInfo;
            resourceInputs["schedulerServiceAccountEmail"] = state?.schedulerServiceAccountEmail;
            resourceInputs["state"] = state?.state;
            resourceInputs["type"] = state?.type;
            resourceInputs["workload"] = state?.workload;
        }
        else {
            const args = argsOrState;
            if (args?.state === undefined && !opts.urn) {
                throw new Error("Missing required property 'state'");
            }
            if (args?.type === undefined && !opts.urn) {
                throw new Error("Missing required property 'type'");
            }
            resourceInputs["displayName"] = args?.displayName;
            resourceInputs["name"] = args?.name;
            resourceInputs["pipelineSources"] = args?.pipelineSources;
            resourceInputs["project"] = args?.project;
            resourceInputs["region"] = args?.region;
            resourceInputs["scheduleInfo"] = args?.scheduleInfo;
            resourceInputs["schedulerServiceAccountEmail"] = args?.schedulerServiceAccountEmail;
            resourceInputs["state"] = args?.state;
            resourceInputs["type"] = args?.type;
            resourceInputs["workload"] = args?.workload;
            resourceInputs["createTime"] = undefined /*out*/;
            resourceInputs["jobCount"] = undefined /*out*/;
            resourceInputs["lastUpdateTime"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(Pipeline.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Pipeline = Pipeline;
/** @internal */
Pipeline.__pulumiType = 'gcp:dataflow/pipeline:Pipeline';
//# sourceMappingURL=pipeline.js.map