"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.V2PolicyOrchestratorForOrganization = 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 For Organization Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const policyOrchestratorForOrganization = new gcp.osconfig.V2PolicyOrchestratorForOrganization("policy_orchestrator_for_organization", {
 *     policyOrchestratorId: "po-org",
 *     organizationId: "123456789",
 *     state: "ACTIVE",
 *     action: "UPSERT",
 *     orchestratedResource: {
 *         id: "test-orchestrated-resource-org",
 *         osPolicyAssignmentV1Payload: {
 *             osPolicies: [{
 *                 id: "test-os-policy-org",
 *                 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",
 *     },
 *     orchestrationScope: {
 *         selectors: [{
 *             locationSelector: {
 *                 includedLocations: [""],
 *             },
 *         }],
 *     },
 * });
 * ```
 *
 * ## Import
 *
 * PolicyOrchestratorForOrganization can be imported using any of these accepted formats:
 *
 * * `organizations/{{organization_id}}/locations/global/policyOrchestrators/{{policy_orchestrator_id}}`
 *
 * * `{{organization_id}}/{{policy_orchestrator_id}}`
 *
 * When using the `pulumi import` command, PolicyOrchestratorForOrganization can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:osconfig/v2PolicyOrchestratorForOrganization:V2PolicyOrchestratorForOrganization default organizations/{{organization_id}}/locations/global/policyOrchestrators/{{policy_orchestrator_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:osconfig/v2PolicyOrchestratorForOrganization:V2PolicyOrchestratorForOrganization default {{organization_id}}/{{policy_orchestrator_id}}
 * ```
 */
class V2PolicyOrchestratorForOrganization extends pulumi.CustomResource {
    /**
     * Get an existing V2PolicyOrchestratorForOrganization 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 V2PolicyOrchestratorForOrganization(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of V2PolicyOrchestratorForOrganization.  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'] === V2PolicyOrchestratorForOrganization.__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["etag"] = state?.etag;
            resourceInputs["labels"] = state?.labels;
            resourceInputs["name"] = state?.name;
            resourceInputs["orchestratedResource"] = state?.orchestratedResource;
            resourceInputs["orchestrationScope"] = state?.orchestrationScope;
            resourceInputs["orchestrationStates"] = state?.orchestrationStates;
            resourceInputs["organizationId"] = state?.organizationId;
            resourceInputs["policyOrchestratorId"] = state?.policyOrchestratorId;
            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?.organizationId === undefined && !opts.urn) {
                throw new Error("Missing required property 'organizationId'");
            }
            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["organizationId"] = args?.organizationId;
            resourceInputs["policyOrchestratorId"] = args?.policyOrchestratorId;
            resourceInputs["state"] = args?.state;
            resourceInputs["createTime"] = undefined /*out*/;
            resourceInputs["effectiveLabels"] = undefined /*out*/;
            resourceInputs["etag"] = 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(V2PolicyOrchestratorForOrganization.__pulumiType, name, resourceInputs, opts);
    }
}
exports.V2PolicyOrchestratorForOrganization = V2PolicyOrchestratorForOrganization;
/** @internal */
V2PolicyOrchestratorForOrganization.__pulumiType = 'gcp:osconfig/v2PolicyOrchestratorForOrganization:V2PolicyOrchestratorForOrganization';
//# sourceMappingURL=v2policyOrchestratorForOrganization.js.map