"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.V2PolicyOrchestrator = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * PolicyOrchestrator helps managing project+zone level policy resources (e.g.
 * OS Policy Assignments), by providing tools to create, update and delete them
 * across projects and locations, at scale.
 *
 * ## Example Usage
 *
 * ### Osconfigv2 Policy Orchestrator Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const policyOrchestrator = new gcp.osconfig.V2PolicyOrchestrator("policy_orchestrator", {
 *     policyOrchestratorId: "po",
 *     state: "ACTIVE",
 *     action: "UPSERT",
 *     orchestratedResource: {
 *         id: "test-orchestrated-resource",
 *         osPolicyAssignmentV1Payload: {
 *             osPolicies: [{
 *                 id: "test-os-policy",
 *                 mode: "VALIDATION",
 *                 resourceGroups: [{
 *                     resources: [{
 *                         id: "resource-tf",
 *                         file: {
 *                             content: "file-content-tf",
 *                             path: "file-path-tf-1",
 *                             state: "PRESENT",
 *                         },
 *                     }],
 *                 }],
 *             }],
 *             instanceFilter: {
 *                 inventories: [{
 *                     osShortName: "windows-10",
 *                 }],
 *             },
 *             rollout: {
 *                 disruptionBudget: {
 *                     percent: 100,
 *                 },
 *                 minWaitDuration: "60s",
 *             },
 *         },
 *     },
 *     labels: {
 *         state: "active",
 *     },
 * });
 * ```
 *
 * ## Import
 *
 * PolicyOrchestrator can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/locations/global/policyOrchestrators/{{policy_orchestrator_id}}`
 *
 * * `{{project}}/{{policy_orchestrator_id}}`
 *
 * * `{{policy_orchestrator_id}}`
 *
 * When using the `pulumi import` command, PolicyOrchestrator can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:osconfig/v2PolicyOrchestrator:V2PolicyOrchestrator default projects/{{project}}/locations/global/policyOrchestrators/{{policy_orchestrator_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:osconfig/v2PolicyOrchestrator:V2PolicyOrchestrator default {{project}}/{{policy_orchestrator_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:osconfig/v2PolicyOrchestrator:V2PolicyOrchestrator default {{policy_orchestrator_id}}
 * ```
 */
class V2PolicyOrchestrator extends pulumi.CustomResource {
    /**
     * Get an existing V2PolicyOrchestrator 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 V2PolicyOrchestrator(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of V2PolicyOrchestrator.  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'] === V2PolicyOrchestrator.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["action"] = state?.action;
            resourceInputs["createTime"] = state?.createTime;
            resourceInputs["description"] = state?.description;
            resourceInputs["effectiveLabels"] = state?.effectiveLabels;
            resourceInputs["labels"] = state?.labels;
            resourceInputs["name"] = state?.name;
            resourceInputs["orchestratedResource"] = state?.orchestratedResource;
            resourceInputs["orchestrationScope"] = state?.orchestrationScope;
            resourceInputs["orchestrationStates"] = state?.orchestrationStates;
            resourceInputs["policyOrchestratorId"] = state?.policyOrchestratorId;
            resourceInputs["project"] = state?.project;
            resourceInputs["pulumiLabels"] = state?.pulumiLabels;
            resourceInputs["reconciling"] = state?.reconciling;
            resourceInputs["state"] = state?.state;
            resourceInputs["updateTime"] = state?.updateTime;
        }
        else {
            const args = argsOrState;
            if (args?.action === undefined && !opts.urn) {
                throw new Error("Missing required property 'action'");
            }
            if (args?.orchestratedResource === undefined && !opts.urn) {
                throw new Error("Missing required property 'orchestratedResource'");
            }
            if (args?.policyOrchestratorId === undefined && !opts.urn) {
                throw new Error("Missing required property 'policyOrchestratorId'");
            }
            resourceInputs["action"] = args?.action;
            resourceInputs["description"] = args?.description;
            resourceInputs["labels"] = args?.labels;
            resourceInputs["orchestratedResource"] = args?.orchestratedResource;
            resourceInputs["orchestrationScope"] = args?.orchestrationScope;
            resourceInputs["policyOrchestratorId"] = args?.policyOrchestratorId;
            resourceInputs["project"] = args?.project;
            resourceInputs["state"] = args?.state;
            resourceInputs["createTime"] = undefined /*out*/;
            resourceInputs["effectiveLabels"] = undefined /*out*/;
            resourceInputs["name"] = undefined /*out*/;
            resourceInputs["orchestrationStates"] = undefined /*out*/;
            resourceInputs["pulumiLabels"] = undefined /*out*/;
            resourceInputs["reconciling"] = undefined /*out*/;
            resourceInputs["updateTime"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(V2PolicyOrchestrator.__pulumiType, name, resourceInputs, opts);
    }
}
exports.V2PolicyOrchestrator = V2PolicyOrchestrator;
/** @internal */
V2PolicyOrchestrator.__pulumiType = 'gcp:osconfig/v2PolicyOrchestrator:V2PolicyOrchestrator';
//# sourceMappingURL=v2policyOrchestrator.js.map