"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.RepositoryWorkflowConfig = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * A resource represents a Dataform workflow configuration
 *
 * To get more information about RepositoryWorkflowConfig, see:
 *
 * * [API documentation](https://cloud.google.com/dataform/reference/rest/v1beta1/projects.locations.repositories.workflowConfigs)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/dataform/docs/workflow-configurations)
 *
 * ## Example Usage
 *
 * ### Dataform Repository Workflow Config
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const gitRepository = new gcp.sourcerepo.Repository("git_repository", {name: "my/repository"});
 * const secret = new gcp.secretmanager.Secret("secret", {
 *     secretId: "my_secret",
 *     replication: {
 *         auto: {},
 *     },
 * });
 * const secretVersion = new gcp.secretmanager.SecretVersion("secret_version", {
 *     secret: secret.id,
 *     secretData: "secret-data",
 * });
 * const repository = new gcp.dataform.Repository("repository", {
 *     name: "dataform_repository",
 *     region: "us-central1",
 *     gitRemoteSettings: {
 *         url: gitRepository.url,
 *         defaultBranch: "main",
 *         authenticationTokenSecretVersion: secretVersion.id,
 *     },
 *     workspaceCompilationOverrides: {
 *         defaultDatabase: "database",
 *         schemaSuffix: "_suffix",
 *         tablePrefix: "prefix_",
 *     },
 * });
 * const releaseConfig = new gcp.dataform.RepositoryReleaseConfig("release_config", {
 *     project: repository.project,
 *     region: repository.region,
 *     repository: repository.name,
 *     name: "my_release",
 *     gitCommitish: "main",
 *     cronSchedule: "0 7 * * *",
 *     timeZone: "America/New_York",
 *     codeCompilationConfig: {
 *         defaultDatabase: "gcp-example-project",
 *         defaultSchema: "example-dataset",
 *         defaultLocation: "us-central1",
 *         assertionSchema: "example-assertion-dataset",
 *         databaseSuffix: "",
 *         schemaSuffix: "",
 *         tablePrefix: "",
 *         vars: {
 *             var1: "value",
 *         },
 *     },
 * });
 * const dataformSa = new gcp.serviceaccount.Account("dataform_sa", {
 *     accountId: "dataform-sa",
 *     displayName: "Dataform Service Account",
 * });
 * const workflow = new gcp.dataform.RepositoryWorkflowConfig("workflow", {
 *     project: repository.project,
 *     region: repository.region,
 *     repository: repository.name,
 *     name: "my_workflow",
 *     releaseConfig: releaseConfig.id,
 *     invocationConfig: {
 *         includedTargets: [
 *             {
 *                 database: "gcp-example-project",
 *                 schema: "example-dataset",
 *                 name: "target_1",
 *             },
 *             {
 *                 database: "gcp-example-project",
 *                 schema: "example-dataset",
 *                 name: "target_2",
 *             },
 *         ],
 *         includedTags: ["tag_1"],
 *         transitiveDependenciesIncluded: true,
 *         transitiveDependentsIncluded: true,
 *         fullyRefreshIncrementalTablesEnabled: false,
 *         serviceAccount: dataformSa.email,
 *     },
 *     cronSchedule: "0 7 * * *",
 *     timeZone: "America/New_York",
 * });
 * ```
 *
 * ## Import
 *
 * RepositoryWorkflowConfig can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/locations/{{region}}/repositories/{{repository}}/workflowConfigs/{{name}}`
 *
 * * `{{project}}/{{region}}/{{repository}}/{{name}}`
 *
 * * `{{region}}/{{repository}}/{{name}}`
 *
 * * `{{repository}}/{{name}}`
 *
 * When using the `pulumi import` command, RepositoryWorkflowConfig can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:dataform/repositoryWorkflowConfig:RepositoryWorkflowConfig default projects/{{project}}/locations/{{region}}/repositories/{{repository}}/workflowConfigs/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:dataform/repositoryWorkflowConfig:RepositoryWorkflowConfig default {{project}}/{{region}}/{{repository}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:dataform/repositoryWorkflowConfig:RepositoryWorkflowConfig default {{region}}/{{repository}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:dataform/repositoryWorkflowConfig:RepositoryWorkflowConfig default {{repository}}/{{name}}
 * ```
 */
class RepositoryWorkflowConfig extends pulumi.CustomResource {
    /**
     * Get an existing RepositoryWorkflowConfig 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 RepositoryWorkflowConfig(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of RepositoryWorkflowConfig.  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'] === RepositoryWorkflowConfig.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["cronSchedule"] = state?.cronSchedule;
            resourceInputs["invocationConfig"] = state?.invocationConfig;
            resourceInputs["name"] = state?.name;
            resourceInputs["project"] = state?.project;
            resourceInputs["recentScheduledExecutionRecords"] = state?.recentScheduledExecutionRecords;
            resourceInputs["region"] = state?.region;
            resourceInputs["releaseConfig"] = state?.releaseConfig;
            resourceInputs["repository"] = state?.repository;
            resourceInputs["timeZone"] = state?.timeZone;
        }
        else {
            const args = argsOrState;
            if (args?.releaseConfig === undefined && !opts.urn) {
                throw new Error("Missing required property 'releaseConfig'");
            }
            resourceInputs["cronSchedule"] = args?.cronSchedule;
            resourceInputs["invocationConfig"] = args?.invocationConfig;
            resourceInputs["name"] = args?.name;
            resourceInputs["project"] = args?.project;
            resourceInputs["region"] = args?.region;
            resourceInputs["releaseConfig"] = args?.releaseConfig;
            resourceInputs["repository"] = args?.repository;
            resourceInputs["timeZone"] = args?.timeZone;
            resourceInputs["recentScheduledExecutionRecords"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(RepositoryWorkflowConfig.__pulumiType, name, resourceInputs, opts);
    }
}
exports.RepositoryWorkflowConfig = RepositoryWorkflowConfig;
/** @internal */
RepositoryWorkflowConfig.__pulumiType = 'gcp:dataform/repositoryWorkflowConfig:RepositoryWorkflowConfig';
//# sourceMappingURL=repositoryWorkflowConfig.js.map