"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.Listing = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * A Bigquery Analytics Hub data exchange listing
 *
 * To get more information about Listing, see:
 *
 * * [API documentation](https://cloud.google.com/bigquery/docs/reference/analytics-hub/rest/v1/projects.locations.dataExchanges.listings)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/bigquery/docs/analytics-hub-introduction)
 *
 * ## Example Usage
 *
 * ### Bigquery Analyticshub Listing Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const listing = new gcp.bigqueryanalyticshub.DataExchange("listing", {
 *     location: "US",
 *     dataExchangeId: "my_data_exchange",
 *     displayName: "my_data_exchange",
 *     description: "example data exchange",
 * });
 * const listingDataset = new gcp.bigquery.Dataset("listing", {
 *     datasetId: "my_listing",
 *     friendlyName: "my_listing",
 *     description: "example data exchange",
 *     location: "US",
 * });
 * const listingListing = new gcp.bigqueryanalyticshub.Listing("listing", {
 *     location: "US",
 *     dataExchangeId: listing.dataExchangeId,
 *     listingId: "my_listing",
 *     displayName: "my_listing",
 *     description: "example data exchange",
 *     bigqueryDataset: {
 *         dataset: listingDataset.id,
 *     },
 * });
 * ```
 * ### Bigquery Analyticshub Listing Restricted
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const listing = new gcp.bigqueryanalyticshub.DataExchange("listing", {
 *     location: "US",
 *     dataExchangeId: "my_data_exchange",
 *     displayName: "my_data_exchange",
 *     description: "example data exchange",
 * });
 * const listingDataset = new gcp.bigquery.Dataset("listing", {
 *     datasetId: "my_listing",
 *     friendlyName: "my_listing",
 *     description: "example data exchange",
 *     location: "US",
 * });
 * const listingListing = new gcp.bigqueryanalyticshub.Listing("listing", {
 *     location: "US",
 *     dataExchangeId: listing.dataExchangeId,
 *     listingId: "my_listing",
 *     displayName: "my_listing",
 *     description: "example data exchange",
 *     bigqueryDataset: {
 *         dataset: listingDataset.id,
 *     },
 *     restrictedExportConfig: {
 *         enabled: true,
 *         restrictQueryResult: true,
 *     },
 * });
 * ```
 * ### Bigquery Analyticshub Listing Dcr
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const listing = new gcp.bigqueryanalyticshub.DataExchange("listing", {
 *     location: "US",
 *     dataExchangeId: "dcr_data_exchange",
 *     displayName: "dcr_data_exchange",
 *     description: "example dcr data exchange",
 *     sharingEnvironmentConfig: {
 *         dcrExchangeConfig: {},
 *     },
 * });
 * const listingDataset = new gcp.bigquery.Dataset("listing", {
 *     datasetId: "dcr_listing",
 *     friendlyName: "dcr_listing",
 *     description: "example dcr data exchange",
 *     location: "US",
 * });
 * const listingTable = new gcp.bigquery.Table("listing", {
 *     deletionProtection: false,
 *     tableId: "dcr_listing",
 *     datasetId: listingDataset.datasetId,
 *     schema: `[
 *   {
 *     \\"name\\": \\"name\\",
 *     \\"type\\": \\"STRING\\",
 *     \\"mode\\": \\"NULLABLE\\"
 *   },
 *   {
 *     \\"name\\": \\"post_abbr\\",
 *     \\"type\\": \\"STRING\\",
 *     \\"mode\\": \\"NULLABLE\\"
 *   },
 *   {
 *     \\"name\\": \\"date\\",
 *     \\"type\\": \\"DATE\\",
 *     \\"mode\\": \\"NULLABLE\\"
 *   }
 * ]
 * `,
 * });
 * const listingListing = new gcp.bigqueryanalyticshub.Listing("listing", {
 *     location: "US",
 *     dataExchangeId: listing.dataExchangeId,
 *     listingId: "dcr_listing",
 *     displayName: "dcr_listing",
 *     description: "example dcr data exchange",
 *     bigqueryDataset: {
 *         dataset: listingDataset.id,
 *         selectedResources: [{
 *             table: listingTable.id,
 *         }],
 *     },
 *     restrictedExportConfig: {
 *         enabled: true,
 *     },
 * });
 * ```
 * ### Bigquery Analyticshub Listing Log Linked Dataset Query User
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const listingLogEmail = new gcp.bigqueryanalyticshub.DataExchange("listing_log_email", {
 *     location: "US",
 *     dataExchangeId: "tf_test_log_email_de",
 *     displayName: "tf_test_log_email_de",
 *     description: "Example for log email test",
 * });
 * const listingLogEmailDataset = new gcp.bigquery.Dataset("listing_log_email", {
 *     datasetId: "tf_test_log_email_ds",
 *     friendlyName: "tf_test_log_email_ds",
 *     description: "Example for log email test",
 *     location: "US",
 * });
 * const listing = new gcp.bigqueryanalyticshub.Listing("listing", {
 *     location: "US",
 *     dataExchangeId: listingLogEmail.dataExchangeId,
 *     listingId: "tf_test_log_email_listing",
 *     displayName: "tf_test_log_email_listing",
 *     description: "Example for log email test",
 *     logLinkedDatasetQueryUserEmail: true,
 *     bigqueryDataset: {
 *         dataset: listingLogEmailDataset.id,
 *     },
 * });
 * ```
 * ### Bigquery Analyticshub Listing Pubsub
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const listing = new gcp.bigqueryanalyticshub.DataExchange("listing", {
 *     location: "US",
 *     dataExchangeId: "tf_test_pubsub_data_exchange",
 *     displayName: "tf_test_pubsub_data_exchange",
 *     description: "Example for pubsub topic source",
 * });
 * const tfTestPubsubTopic = new gcp.pubsub.Topic("tf_test_pubsub_topic", {name: "test_pubsub"});
 * const listingListing = new gcp.bigqueryanalyticshub.Listing("listing", {
 *     location: "US",
 *     dataExchangeId: listing.dataExchangeId,
 *     listingId: "tf_test_pubsub_listing",
 *     displayName: "tf_test_pubsub_listing",
 *     description: "Example for pubsub topic source",
 *     pubsubTopic: {
 *         topic: tfTestPubsubTopic.id,
 *         dataAffinityRegions: [
 *             "us-central1",
 *             "europe-west1",
 *         ],
 *     },
 * });
 * ```
 * ### Bigquery Analyticshub Listing Dcr Routine
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const dcrDataExchangeExample = new gcp.bigqueryanalyticshub.DataExchange("dcr_data_exchange_example", {
 *     location: "us",
 *     dataExchangeId: "tf_test_data_exchange",
 *     displayName: "tf_test_data_exchange",
 *     description: "Example for listing with routine",
 *     sharingEnvironmentConfig: {
 *         dcrExchangeConfig: {},
 *     },
 * });
 * const listing = new gcp.bigquery.Dataset("listing", {
 *     datasetId: "tf_test_dataset",
 *     friendlyName: "tf_test_dataset",
 *     description: "Example for listing with routine",
 *     location: "us",
 * });
 * const listingRoutine = new gcp.bigquery.Routine("listing", {
 *     datasetId: listing.datasetId,
 *     routineId: "tf_test_routine",
 *     routineType: "TABLE_VALUED_FUNCTION",
 *     language: "SQL",
 *     description: "A DCR routine example.",
 *     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 listingListing = new gcp.bigqueryanalyticshub.Listing("listing", {
 *     location: "US",
 *     dataExchangeId: dcrDataExchangeExample.dataExchangeId,
 *     listingId: "tf_test_listing_routine",
 *     displayName: "tf_test_listing_routine",
 *     description: "Example for listing with routine",
 *     bigqueryDataset: {
 *         dataset: listing.id,
 *         selectedResources: [{
 *             routine: listingRoutine.id,
 *         }],
 *     },
 *     restrictedExportConfig: {
 *         enabled: true,
 *     },
 * });
 * ```
 * ### Bigquery Analyticshub Public Listing
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const listing = new gcp.bigqueryanalyticshub.DataExchange("listing", {
 *     location: "US",
 *     dataExchangeId: "my_data_exchange",
 *     displayName: "my_data_exchange",
 *     description: "example public listing",
 *     discoveryType: "DISCOVERY_TYPE_PUBLIC",
 * });
 * const listingDataset = new gcp.bigquery.Dataset("listing", {
 *     datasetId: "my_listing",
 *     friendlyName: "my_listing",
 *     description: "example public listing",
 *     location: "US",
 * });
 * const listingListing = new gcp.bigqueryanalyticshub.Listing("listing", {
 *     location: "US",
 *     dataExchangeId: listing.dataExchangeId,
 *     listingId: "my_listing",
 *     displayName: "my_listing",
 *     description: "example public listing",
 *     discoveryType: "DISCOVERY_TYPE_PUBLIC",
 *     allowOnlyMetadataSharing: false,
 *     bigqueryDataset: {
 *         dataset: listingDataset.id,
 *     },
 * });
 * ```
 * ### Bigquery Analyticshub Listing Marketplace
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const listing = new gcp.bigqueryanalyticshub.DataExchange("listing", {
 *     location: "US",
 *     dataExchangeId: "my_data_exchange",
 *     displayName: "my_data_exchange",
 *     description: "example data exchange",
 * });
 * const listingDataset = new gcp.bigquery.Dataset("listing", {
 *     datasetId: "my_listing",
 *     friendlyName: "my_listing",
 *     description: "example data exchange",
 *     location: "US",
 * });
 * const listingListing = new gcp.bigqueryanalyticshub.Listing("listing", {
 *     location: "US",
 *     dataExchangeId: listing.dataExchangeId,
 *     listingId: "my_listing",
 *     displayName: "my_listing",
 *     description: "example data exchange",
 *     deleteCommercial: true,
 *     bigqueryDataset: {
 *         dataset: listingDataset.id,
 *     },
 * });
 * ```
 * ### Bigquery Analyticshub Listing Multiregion
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const listing = new gcp.bigqueryanalyticshub.DataExchange("listing", {
 *     location: "us",
 *     dataExchangeId: "my_data_exchange",
 *     displayName: "my_data_exchange",
 * });
 * const listingListing = new gcp.bigqueryanalyticshub.Listing("listing", {
 *     location: "us",
 *     dataExchangeId: listing.dataExchangeId,
 *     listingId: "my_listing",
 *     displayName: "my_listing",
 *     bigqueryDataset: {
 *         dataset: "projects/project_id/datasets/my_listing_example2",
 *         replicaLocations: ["eu"],
 *     },
 * });
 * ```
 *
 * ## Import
 *
 * Listing can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/locations/{{location}}/dataExchanges/{{data_exchange_id}}/listings/{{listing_id}}`
 *
 * * `{{project}}/{{location}}/{{data_exchange_id}}/{{listing_id}}`
 *
 * * `{{location}}/{{data_exchange_id}}/{{listing_id}}`
 *
 * When using the `pulumi import` command, Listing can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:bigqueryanalyticshub/listing:Listing default projects/{{project}}/locations/{{location}}/dataExchanges/{{data_exchange_id}}/listings/{{listing_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:bigqueryanalyticshub/listing:Listing default {{project}}/{{location}}/{{data_exchange_id}}/{{listing_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:bigqueryanalyticshub/listing:Listing default {{location}}/{{data_exchange_id}}/{{listing_id}}
 * ```
 */
class Listing extends pulumi.CustomResource {
    /**
     * Get an existing Listing 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 Listing(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of Listing.  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'] === Listing.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["allowOnlyMetadataSharing"] = state?.allowOnlyMetadataSharing;
            resourceInputs["bigqueryDataset"] = state?.bigqueryDataset;
            resourceInputs["categories"] = state?.categories;
            resourceInputs["commercialInfos"] = state?.commercialInfos;
            resourceInputs["dataExchangeId"] = state?.dataExchangeId;
            resourceInputs["dataProvider"] = state?.dataProvider;
            resourceInputs["deleteCommercial"] = state?.deleteCommercial;
            resourceInputs["description"] = state?.description;
            resourceInputs["discoveryType"] = state?.discoveryType;
            resourceInputs["displayName"] = state?.displayName;
            resourceInputs["documentation"] = state?.documentation;
            resourceInputs["icon"] = state?.icon;
            resourceInputs["listingId"] = state?.listingId;
            resourceInputs["location"] = state?.location;
            resourceInputs["logLinkedDatasetQueryUserEmail"] = state?.logLinkedDatasetQueryUserEmail;
            resourceInputs["name"] = state?.name;
            resourceInputs["primaryContact"] = state?.primaryContact;
            resourceInputs["project"] = state?.project;
            resourceInputs["publisher"] = state?.publisher;
            resourceInputs["pubsubTopic"] = state?.pubsubTopic;
            resourceInputs["requestAccess"] = state?.requestAccess;
            resourceInputs["restrictedExportConfig"] = state?.restrictedExportConfig;
            resourceInputs["state"] = state?.state;
        }
        else {
            const args = argsOrState;
            if (args?.dataExchangeId === undefined && !opts.urn) {
                throw new Error("Missing required property 'dataExchangeId'");
            }
            if (args?.displayName === undefined && !opts.urn) {
                throw new Error("Missing required property 'displayName'");
            }
            if (args?.listingId === undefined && !opts.urn) {
                throw new Error("Missing required property 'listingId'");
            }
            if (args?.location === undefined && !opts.urn) {
                throw new Error("Missing required property 'location'");
            }
            resourceInputs["allowOnlyMetadataSharing"] = args?.allowOnlyMetadataSharing;
            resourceInputs["bigqueryDataset"] = args?.bigqueryDataset;
            resourceInputs["categories"] = args?.categories;
            resourceInputs["dataExchangeId"] = args?.dataExchangeId;
            resourceInputs["dataProvider"] = args?.dataProvider;
            resourceInputs["deleteCommercial"] = args?.deleteCommercial;
            resourceInputs["description"] = args?.description;
            resourceInputs["discoveryType"] = args?.discoveryType;
            resourceInputs["displayName"] = args?.displayName;
            resourceInputs["documentation"] = args?.documentation;
            resourceInputs["icon"] = args?.icon;
            resourceInputs["listingId"] = args?.listingId;
            resourceInputs["location"] = args?.location;
            resourceInputs["logLinkedDatasetQueryUserEmail"] = args?.logLinkedDatasetQueryUserEmail;
            resourceInputs["primaryContact"] = args?.primaryContact;
            resourceInputs["project"] = args?.project;
            resourceInputs["publisher"] = args?.publisher;
            resourceInputs["pubsubTopic"] = args?.pubsubTopic;
            resourceInputs["requestAccess"] = args?.requestAccess;
            resourceInputs["restrictedExportConfig"] = args?.restrictedExportConfig;
            resourceInputs["commercialInfos"] = undefined /*out*/;
            resourceInputs["name"] = undefined /*out*/;
            resourceInputs["state"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(Listing.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Listing = Listing;
/** @internal */
Listing.__pulumiType = 'gcp:bigqueryanalyticshub/listing:Listing';
//# sourceMappingURL=listing.js.map