"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.Job = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Manages a job resource within a Dataproc cluster within GCE. For more information see
 * [the official dataproc documentation](https://cloud.google.com/dataproc/).
 *
 * !> **Note:** This resource does not support 'update' and changing any attributes will cause the resource to be recreated.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const mycluster = new gcp.dataproc.Cluster("mycluster", {
 *     name: "dproc-cluster-unique-name",
 *     region: "us-central1",
 * });
 * // Submit an example spark job to a dataproc cluster
 * const spark = new gcp.dataproc.Job("spark", {
 *     region: mycluster.region,
 *     forceDelete: true,
 *     placement: {
 *         clusterName: mycluster.name,
 *     },
 *     sparkConfig: {
 *         mainClass: "org.apache.spark.examples.SparkPi",
 *         jarFileUris: ["file:///usr/lib/spark/examples/jars/spark-examples.jar"],
 *         args: ["1000"],
 *         properties: {
 *             "spark.logConf": "true",
 *         },
 *         loggingConfig: {
 *             driverLogLevels: {
 *                 root: "INFO",
 *             },
 *         },
 *     },
 * });
 * // Submit an example pyspark job to a dataproc cluster
 * const pyspark = new gcp.dataproc.Job("pyspark", {
 *     region: mycluster.region,
 *     forceDelete: true,
 *     placement: {
 *         clusterName: mycluster.name,
 *     },
 *     pysparkConfig: {
 *         mainPythonFileUri: "gs://dataproc-examples-2f10d78d114f6aaec76462e3c310f31f/src/pyspark/hello-world/hello-world.py",
 *         properties: {
 *             "spark.logConf": "true",
 *         },
 *     },
 * });
 * export const sparkStatus = spark.statuses.apply(statuses => statuses[0].state);
 * export const pysparkStatus = pyspark.statuses.apply(statuses => statuses[0].state);
 * ```
 *
 * ## Import
 *
 * This resource does not support import.
 */
class Job extends pulumi.CustomResource {
    /**
     * Get an existing Job 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 Job(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of Job.  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'] === Job.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["driverControlsFilesUri"] = state?.driverControlsFilesUri;
            resourceInputs["driverOutputResourceUri"] = state?.driverOutputResourceUri;
            resourceInputs["effectiveLabels"] = state?.effectiveLabels;
            resourceInputs["forceDelete"] = state?.forceDelete;
            resourceInputs["hadoopConfig"] = state?.hadoopConfig;
            resourceInputs["hiveConfig"] = state?.hiveConfig;
            resourceInputs["labels"] = state?.labels;
            resourceInputs["pigConfig"] = state?.pigConfig;
            resourceInputs["placement"] = state?.placement;
            resourceInputs["prestoConfig"] = state?.prestoConfig;
            resourceInputs["project"] = state?.project;
            resourceInputs["pulumiLabels"] = state?.pulumiLabels;
            resourceInputs["pysparkConfig"] = state?.pysparkConfig;
            resourceInputs["reference"] = state?.reference;
            resourceInputs["region"] = state?.region;
            resourceInputs["scheduling"] = state?.scheduling;
            resourceInputs["sparkConfig"] = state?.sparkConfig;
            resourceInputs["sparksqlConfig"] = state?.sparksqlConfig;
            resourceInputs["statuses"] = state?.statuses;
        }
        else {
            const args = argsOrState;
            if (args?.placement === undefined && !opts.urn) {
                throw new Error("Missing required property 'placement'");
            }
            resourceInputs["forceDelete"] = args?.forceDelete;
            resourceInputs["hadoopConfig"] = args?.hadoopConfig;
            resourceInputs["hiveConfig"] = args?.hiveConfig;
            resourceInputs["labels"] = args?.labels;
            resourceInputs["pigConfig"] = args?.pigConfig;
            resourceInputs["placement"] = args?.placement;
            resourceInputs["prestoConfig"] = args?.prestoConfig;
            resourceInputs["project"] = args?.project;
            resourceInputs["pysparkConfig"] = args?.pysparkConfig;
            resourceInputs["reference"] = args?.reference;
            resourceInputs["region"] = args?.region;
            resourceInputs["scheduling"] = args?.scheduling;
            resourceInputs["sparkConfig"] = args?.sparkConfig;
            resourceInputs["sparksqlConfig"] = args?.sparksqlConfig;
            resourceInputs["driverControlsFilesUri"] = undefined /*out*/;
            resourceInputs["driverOutputResourceUri"] = undefined /*out*/;
            resourceInputs["effectiveLabels"] = undefined /*out*/;
            resourceInputs["pulumiLabels"] = undefined /*out*/;
            resourceInputs["statuses"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(Job.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Job = Job;
/** @internal */
Job.__pulumiType = 'gcp:dataproc/job:Job';
//# sourceMappingURL=job.js.map