"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.ReservationAssignment = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * The BigqueryReservation Assignment resource.
 *
 * To get more information about ReservationAssignment, see:
 *
 * * [API documentation](https://cloud.google.com/bigquery/docs/reference/reservations/rest/v1/projects.locations.reservations.assignments)
 * * How-to Guides
 *     * [Work with reservation assignments](https://cloud.google.com/bigquery/docs/reservations-assignments)
 *
 * ## Example Usage
 *
 * ### Bigquery Reservation Assignment Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const basic = new gcp.bigquery.Reservation("basic", {
 *     name: "example-reservation",
 *     project: "my-project-name",
 *     location: "us-central1",
 *     slotCapacity: 0,
 *     ignoreIdleSlots: false,
 * });
 * const assignment = new gcp.bigquery.ReservationAssignment("assignment", {
 *     assignee: "projects/my-project-name",
 *     jobType: "PIPELINE",
 *     reservation: basic.id,
 * });
 * ```
 *
 * ## Import
 *
 * ReservationAssignment can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/locations/{{location}}/reservations/{{reservation}}/assignments/{{name}}`
 *
 * * `{{project}}/{{location}}/{{reservation}}/{{name}}`
 *
 * * `{{location}}/{{reservation}}/{{name}}`
 *
 * When using the `pulumi import` command, ReservationAssignment can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:bigquery/reservationAssignment:ReservationAssignment default projects/{{project}}/locations/{{location}}/reservations/{{reservation}}/assignments/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:bigquery/reservationAssignment:ReservationAssignment default {{project}}/{{location}}/{{reservation}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:bigquery/reservationAssignment:ReservationAssignment default {{location}}/{{reservation}}/{{name}}
 * ```
 */
class ReservationAssignment extends pulumi.CustomResource {
    /**
     * Get an existing ReservationAssignment 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 ReservationAssignment(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of ReservationAssignment.  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'] === ReservationAssignment.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["assignee"] = state?.assignee;
            resourceInputs["jobType"] = state?.jobType;
            resourceInputs["location"] = state?.location;
            resourceInputs["name"] = state?.name;
            resourceInputs["project"] = state?.project;
            resourceInputs["reservation"] = state?.reservation;
            resourceInputs["state"] = state?.state;
        }
        else {
            const args = argsOrState;
            if (args?.assignee === undefined && !opts.urn) {
                throw new Error("Missing required property 'assignee'");
            }
            if (args?.jobType === undefined && !opts.urn) {
                throw new Error("Missing required property 'jobType'");
            }
            if (args?.reservation === undefined && !opts.urn) {
                throw new Error("Missing required property 'reservation'");
            }
            resourceInputs["assignee"] = args?.assignee;
            resourceInputs["jobType"] = args?.jobType;
            resourceInputs["location"] = args?.location;
            resourceInputs["project"] = args?.project;
            resourceInputs["reservation"] = args?.reservation;
            resourceInputs["name"] = undefined /*out*/;
            resourceInputs["state"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(ReservationAssignment.__pulumiType, name, resourceInputs, opts);
    }
}
exports.ReservationAssignment = ReservationAssignment;
/** @internal */
ReservationAssignment.__pulumiType = 'gcp:bigquery/reservationAssignment:ReservationAssignment';
//# sourceMappingURL=reservationAssignment.js.map