"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.SyncAuthorization = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Authorize the Synchronizer to download environment data from the control plane.
 *
 * To get more information about SyncAuthorization, see:
 *
 * * [API documentation](https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations#getsyncauthorization)
 * * How-to Guides
 *     * [Enable Synchronizer access](https://cloud.google.com/apigee/docs/hybrid/v1.8/synchronizer-access#enable-synchronizer-access)
 *
 * ## Example Usage
 *
 * ### Apigee Sync Authorization Basic Test
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const project = new gcp.organizations.Project("project", {
 *     projectId: "my-project",
 *     name: "my-project",
 *     orgId: "123456789",
 *     billingAccount: "000000-0000000-0000000-000000",
 *     deletionPolicy: "DELETE",
 * });
 * const apigee = new gcp.projects.Service("apigee", {
 *     project: project.projectId,
 *     service: "apigee.googleapis.com",
 * });
 * const apigeeOrg = new gcp.apigee.Organization("apigee_org", {
 *     analyticsRegion: "us-central1",
 *     projectId: project.projectId,
 *     runtimeType: "HYBRID",
 * }, {
 *     dependsOn: [apigee],
 * });
 * const serviceAccount = new gcp.serviceaccount.Account("service_account", {
 *     accountId: "my-account",
 *     displayName: "Service Account",
 * });
 * const synchronizer_iam = new gcp.projects.IAMMember("synchronizer-iam", {
 *     project: project.projectId,
 *     role: "roles/apigee.synchronizerManager",
 *     member: pulumi.interpolate`serviceAccount:${serviceAccount.email}`,
 * });
 * const apigeeSyncAuthorization = new gcp.apigee.SyncAuthorization("apigee_sync_authorization", {
 *     name: apigeeOrg.name,
 *     identities: [pulumi.interpolate`serviceAccount:${serviceAccount.email}`],
 * }, {
 *     dependsOn: [synchronizer_iam],
 * });
 * ```
 *
 * ## Import
 *
 * SyncAuthorization can be imported using any of these accepted formats:
 *
 * * `organizations/{{name}}/syncAuthorization`
 *
 * * `{{name}}`
 *
 * When using the `pulumi import` command, SyncAuthorization can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:apigee/syncAuthorization:SyncAuthorization default organizations/{{name}}/syncAuthorization
 * ```
 *
 * ```sh
 * $ pulumi import gcp:apigee/syncAuthorization:SyncAuthorization default {{name}}
 * ```
 */
class SyncAuthorization extends pulumi.CustomResource {
    /**
     * Get an existing SyncAuthorization 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 SyncAuthorization(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of SyncAuthorization.  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'] === SyncAuthorization.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["etag"] = state?.etag;
            resourceInputs["identities"] = state?.identities;
            resourceInputs["name"] = state?.name;
        }
        else {
            const args = argsOrState;
            if (args?.identities === undefined && !opts.urn) {
                throw new Error("Missing required property 'identities'");
            }
            resourceInputs["identities"] = args?.identities;
            resourceInputs["name"] = args?.name;
            resourceInputs["etag"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(SyncAuthorization.__pulumiType, name, resourceInputs, opts);
    }
}
exports.SyncAuthorization = SyncAuthorization;
/** @internal */
SyncAuthorization.__pulumiType = 'gcp:apigee/syncAuthorization:SyncAuthorization';
//# sourceMappingURL=syncAuthorization.js.map