"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.DataTransferConfig = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Represents a data transfer configuration. A transfer configuration
 * contains all metadata needed to perform a data transfer.
 *
 * To get more information about Config, see:
 *
 * * [API documentation](https://cloud.google.com/bigquery/docs/reference/datatransfer/rest/v1/projects.locations.transferConfigs/create)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/bigquery/docs/reference/datatransfer/rest/)
 *
 * > **Note:**  All arguments marked as write-only values will not be stored in the state: `sensitive_params.secret_access_key_wo`.
 * Read more about Write-only Arguments.
 *
 * ## Example Usage
 *
 * ### Bigquerydatatransfer Config Scheduled Query
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const project = gcp.organizations.getProject({});
 * const permissions = new gcp.projects.IAMMember("permissions", {
 *     project: project.then(project => project.projectId),
 *     role: "roles/iam.serviceAccountTokenCreator",
 *     member: project.then(project => `serviceAccount:service-${project.number}@gcp-sa-bigquerydatatransfer.iam.gserviceaccount.com`),
 * });
 * const myDataset = new gcp.bigquery.Dataset("my_dataset", {
 *     datasetId: "my_dataset",
 *     friendlyName: "foo",
 *     description: "bar",
 *     location: "asia-northeast1",
 * }, {
 *     dependsOn: [permissions],
 * });
 * const queryConfig = new gcp.bigquery.DataTransferConfig("query_config", {
 *     displayName: "my-query",
 *     location: "asia-northeast1",
 *     dataSourceId: "scheduled_query",
 *     schedule: "first sunday of quarter 00:00",
 *     destinationDatasetId: myDataset.datasetId,
 *     params: {
 *         destination_table_name_template: "my_table",
 *         write_disposition: "WRITE_APPEND",
 *         query: "SELECT name FROM tabl WHERE x = 'y'",
 *     },
 * }, {
 *     dependsOn: [permissions],
 * });
 * ```
 * ### Bigquerydatatransfer Config Cmek
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const project = gcp.organizations.getProject({});
 * const permissions = new gcp.projects.IAMMember("permissions", {
 *     project: project.then(project => project.projectId),
 *     role: "roles/iam.serviceAccountTokenCreator",
 *     member: project.then(project => `serviceAccount:service-${project.number}@gcp-sa-bigquerydatatransfer.iam.gserviceaccount.com`),
 * });
 * const myDataset = new gcp.bigquery.Dataset("my_dataset", {
 *     datasetId: "example_dataset",
 *     friendlyName: "foo",
 *     description: "bar",
 *     location: "asia-northeast1",
 * }, {
 *     dependsOn: [permissions],
 * });
 * const keyRing = new gcp.kms.KeyRing("key_ring", {
 *     name: "example-keyring",
 *     location: "us",
 * });
 * const cryptoKey = new gcp.kms.CryptoKey("crypto_key", {
 *     name: "example-key",
 *     keyRing: keyRing.id,
 * });
 * const queryConfigCmek = new gcp.bigquery.DataTransferConfig("query_config_cmek", {
 *     displayName: "display-name",
 *     location: "asia-northeast1",
 *     dataSourceId: "scheduled_query",
 *     schedule: "first sunday of quarter 00:00",
 *     destinationDatasetId: myDataset.datasetId,
 *     params: {
 *         destination_table_name_template: "my_table",
 *         write_disposition: "WRITE_APPEND",
 *         query: "SELECT name FROM tabl WHERE x = 'y'",
 *     },
 *     encryptionConfiguration: {
 *         kmsKeyName: cryptoKey.id,
 *     },
 * }, {
 *     dependsOn: [permissions],
 * });
 * ```
 * ### Bigquerydatatransfer Config Salesforce
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const project = gcp.organizations.getProject({});
 * const myDataset = new gcp.bigquery.Dataset("my_dataset", {
 *     datasetId: "my_dataset",
 *     description: "My dataset",
 *     location: "asia-northeast1",
 * });
 * const salesforceConfig = new gcp.bigquery.DataTransferConfig("salesforce_config", {
 *     displayName: "my-salesforce-config",
 *     location: "asia-northeast1",
 *     dataSourceId: "salesforce",
 *     schedule: "first sunday of quarter 00:00",
 *     destinationDatasetId: myDataset.datasetId,
 *     params: {
 *         "connector.authentication.oauth.clientId": "client-id",
 *         "connector.authentication.oauth.clientSecret": "client-secret",
 *         "connector.authentication.oauth.myDomain": "MyDomainName",
 *         assets: "[\"asset-a\",\"asset-b\"]",
 *     },
 * });
 * ```
 *
 * ## Import
 *
 * Config can be imported using any of these accepted formats:
 *
 * * `{{project}}/{{name}}`
 *
 * * `{{project}} {{name}}`
 *
 * * `{{name}}`
 *
 * When using the `pulumi import` command, Config can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:bigquery/dataTransferConfig:DataTransferConfig default {{project}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:bigquery/dataTransferConfig:DataTransferConfig default "{{project}} {{name}}"
 * ```
 *
 * ```sh
 * $ pulumi import gcp:bigquery/dataTransferConfig:DataTransferConfig default {{name}}
 * ```
 */
class DataTransferConfig extends pulumi.CustomResource {
    /**
     * Get an existing DataTransferConfig 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 DataTransferConfig(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of DataTransferConfig.  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'] === DataTransferConfig.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["dataRefreshWindowDays"] = state?.dataRefreshWindowDays;
            resourceInputs["dataSourceId"] = state?.dataSourceId;
            resourceInputs["destinationDatasetId"] = state?.destinationDatasetId;
            resourceInputs["disabled"] = state?.disabled;
            resourceInputs["displayName"] = state?.displayName;
            resourceInputs["emailPreferences"] = state?.emailPreferences;
            resourceInputs["encryptionConfiguration"] = state?.encryptionConfiguration;
            resourceInputs["location"] = state?.location;
            resourceInputs["name"] = state?.name;
            resourceInputs["notificationPubsubTopic"] = state?.notificationPubsubTopic;
            resourceInputs["params"] = state?.params;
            resourceInputs["project"] = state?.project;
            resourceInputs["schedule"] = state?.schedule;
            resourceInputs["scheduleOptions"] = state?.scheduleOptions;
            resourceInputs["sensitiveParams"] = state?.sensitiveParams;
            resourceInputs["serviceAccountName"] = state?.serviceAccountName;
        }
        else {
            const args = argsOrState;
            if (args?.dataSourceId === undefined && !opts.urn) {
                throw new Error("Missing required property 'dataSourceId'");
            }
            if (args?.displayName === undefined && !opts.urn) {
                throw new Error("Missing required property 'displayName'");
            }
            if (args?.params === undefined && !opts.urn) {
                throw new Error("Missing required property 'params'");
            }
            resourceInputs["dataRefreshWindowDays"] = args?.dataRefreshWindowDays;
            resourceInputs["dataSourceId"] = args?.dataSourceId;
            resourceInputs["destinationDatasetId"] = args?.destinationDatasetId;
            resourceInputs["disabled"] = args?.disabled;
            resourceInputs["displayName"] = args?.displayName;
            resourceInputs["emailPreferences"] = args?.emailPreferences;
            resourceInputs["encryptionConfiguration"] = args?.encryptionConfiguration;
            resourceInputs["location"] = args?.location;
            resourceInputs["notificationPubsubTopic"] = args?.notificationPubsubTopic;
            resourceInputs["params"] = args?.params;
            resourceInputs["project"] = args?.project;
            resourceInputs["schedule"] = args?.schedule;
            resourceInputs["scheduleOptions"] = args?.scheduleOptions;
            resourceInputs["sensitiveParams"] = args?.sensitiveParams;
            resourceInputs["serviceAccountName"] = args?.serviceAccountName;
            resourceInputs["name"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(DataTransferConfig.__pulumiType, name, resourceInputs, opts);
    }
}
exports.DataTransferConfig = DataTransferConfig;
/** @internal */
DataTransferConfig.__pulumiType = 'gcp:bigquery/dataTransferConfig:DataTransferConfig';
//# sourceMappingURL=dataTransferConfig.js.map