"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.DatasetAccess = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * ## Example Usage
 *
 * ### Bigquery Dataset Access Basic User
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const dataset = new gcp.bigquery.Dataset("dataset", {datasetId: "example_dataset"});
 * const bqowner = new gcp.serviceaccount.Account("bqowner", {accountId: "bqowner"});
 * const access = new gcp.bigquery.DatasetAccess("access", {
 *     datasetId: dataset.datasetId,
 *     role: "OWNER",
 *     userByEmail: bqowner.email,
 * });
 * ```
 * ### Bigquery Dataset Access View
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const _private = new gcp.bigquery.Dataset("private", {datasetId: "example_dataset"});
 * const _public = new gcp.bigquery.Dataset("public", {datasetId: "example_dataset2"});
 * const publicTable = new gcp.bigquery.Table("public", {
 *     deletionProtection: false,
 *     datasetId: _public.datasetId,
 *     tableId: "example_table",
 *     view: {
 *         query: "SELECT state FROM [lookerdata:cdc.project_tycho_reports]",
 *         useLegacySql: false,
 *     },
 * });
 * const access = new gcp.bigquery.DatasetAccess("access", {
 *     datasetId: _private.datasetId,
 *     view: {
 *         projectId: publicTable.project,
 *         datasetId: _public.datasetId,
 *         tableId: publicTable.tableId,
 *     },
 * });
 * ```
 * ### Bigquery Dataset Access Authorized Dataset
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const _private = new gcp.bigquery.Dataset("private", {datasetId: "private"});
 * const _public = new gcp.bigquery.Dataset("public", {datasetId: "public"});
 * const access = new gcp.bigquery.DatasetAccess("access", {
 *     datasetId: _private.datasetId,
 *     authorizedDataset: {
 *         dataset: {
 *             projectId: _public.project,
 *             datasetId: _public.datasetId,
 *         },
 *         targetTypes: ["VIEWS"],
 *     },
 * });
 * ```
 * ### Bigquery Dataset Access Authorized Routine
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const _public = new gcp.bigquery.Dataset("public", {
 *     datasetId: "public_dataset",
 *     description: "This dataset is public",
 * });
 * const publicRoutine = new gcp.bigquery.Routine("public", {
 *     datasetId: _public.datasetId,
 *     routineId: "public_routine",
 *     routineType: "TABLE_VALUED_FUNCTION",
 *     language: "SQL",
 *     definitionBody: "SELECT 1 + value AS value\n",
 *     arguments: [{
 *         name: "value",
 *         argumentKind: "FIXED_TYPE",
 *         dataType: JSON.stringify({
 *             typeKind: "INT64",
 *         }),
 *     }],
 *     returnTableType: JSON.stringify({
 *         columns: [{
 *             name: "value",
 *             type: {
 *                 typeKind: "INT64",
 *             },
 *         }],
 *     }),
 * });
 * const _private = new gcp.bigquery.Dataset("private", {
 *     datasetId: "private_dataset",
 *     description: "This dataset is private",
 * });
 * const authorizedRoutine = new gcp.bigquery.DatasetAccess("authorized_routine", {
 *     datasetId: _private.datasetId,
 *     routine: {
 *         projectId: publicRoutine.project,
 *         datasetId: publicRoutine.datasetId,
 *         routineId: publicRoutine.routineId,
 *     },
 * });
 * ```
 *
 * ## Import
 *
 * This resource does not support import.
 */
class DatasetAccess extends pulumi.CustomResource {
    /**
     * Get an existing DatasetAccess 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 DatasetAccess(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of DatasetAccess.  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'] === DatasetAccess.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["apiUpdatedMember"] = state?.apiUpdatedMember;
            resourceInputs["authorizedDataset"] = state?.authorizedDataset;
            resourceInputs["condition"] = state?.condition;
            resourceInputs["datasetId"] = state?.datasetId;
            resourceInputs["domain"] = state?.domain;
            resourceInputs["groupByEmail"] = state?.groupByEmail;
            resourceInputs["iamMember"] = state?.iamMember;
            resourceInputs["project"] = state?.project;
            resourceInputs["role"] = state?.role;
            resourceInputs["routine"] = state?.routine;
            resourceInputs["specialGroup"] = state?.specialGroup;
            resourceInputs["userByEmail"] = state?.userByEmail;
            resourceInputs["view"] = state?.view;
        }
        else {
            const args = argsOrState;
            if (args?.datasetId === undefined && !opts.urn) {
                throw new Error("Missing required property 'datasetId'");
            }
            resourceInputs["authorizedDataset"] = args?.authorizedDataset;
            resourceInputs["condition"] = args?.condition;
            resourceInputs["datasetId"] = args?.datasetId;
            resourceInputs["domain"] = args?.domain;
            resourceInputs["groupByEmail"] = args?.groupByEmail;
            resourceInputs["iamMember"] = args?.iamMember;
            resourceInputs["project"] = args?.project;
            resourceInputs["role"] = args?.role;
            resourceInputs["routine"] = args?.routine;
            resourceInputs["specialGroup"] = args?.specialGroup;
            resourceInputs["userByEmail"] = args?.userByEmail;
            resourceInputs["view"] = args?.view;
            resourceInputs["apiUpdatedMember"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(DatasetAccess.__pulumiType, name, resourceInputs, opts);
    }
}
exports.DatasetAccess = DatasetAccess;
/** @internal */
DatasetAccess.__pulumiType = 'gcp:bigquery/datasetAccess:DatasetAccess';
//# sourceMappingURL=datasetAccess.js.map