"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.OauthIdpConfig = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * OIDC IdP configuration for a Identity Toolkit project.
 *
 * You must enable the
 * [Google Identity Platform](https://console.cloud.google.com/marketplace/details/google-cloud-platform/customer-identity) in
 * the marketplace prior to using this resource.
 *
 * ## Example Usage
 *
 * ### Identity Platform Oauth Idp Config Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const oauthIdpConfig = new gcp.identityplatform.OauthIdpConfig("oauth_idp_config", {
 *     name: "oidc.oauth-idp-config",
 *     displayName: "Display Name",
 *     clientId: "client-id",
 *     issuer: "issuer",
 *     enabled: true,
 *     clientSecret: "secret",
 *     responseType: {
 *         idToken: true,
 *         code: false,
 *     },
 * });
 * ```
 *
 * ## Import
 *
 * OauthIdpConfig can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/oauthIdpConfigs/{{name}}`
 *
 * * `{{project}}/{{name}}`
 *
 * * `{{name}}`
 *
 * When using the `pulumi import` command, OauthIdpConfig can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:identityplatform/oauthIdpConfig:OauthIdpConfig default projects/{{project}}/oauthIdpConfigs/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:identityplatform/oauthIdpConfig:OauthIdpConfig default {{project}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:identityplatform/oauthIdpConfig:OauthIdpConfig default {{name}}
 * ```
 */
class OauthIdpConfig extends pulumi.CustomResource {
    /**
     * Get an existing OauthIdpConfig 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 OauthIdpConfig(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of OauthIdpConfig.  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'] === OauthIdpConfig.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["clientId"] = state?.clientId;
            resourceInputs["clientSecret"] = state?.clientSecret;
            resourceInputs["displayName"] = state?.displayName;
            resourceInputs["enabled"] = state?.enabled;
            resourceInputs["issuer"] = state?.issuer;
            resourceInputs["name"] = state?.name;
            resourceInputs["project"] = state?.project;
            resourceInputs["responseType"] = state?.responseType;
        }
        else {
            const args = argsOrState;
            if (args?.clientId === undefined && !opts.urn) {
                throw new Error("Missing required property 'clientId'");
            }
            if (args?.issuer === undefined && !opts.urn) {
                throw new Error("Missing required property 'issuer'");
            }
            resourceInputs["clientId"] = args?.clientId;
            resourceInputs["clientSecret"] = args?.clientSecret;
            resourceInputs["displayName"] = args?.displayName;
            resourceInputs["enabled"] = args?.enabled;
            resourceInputs["issuer"] = args?.issuer;
            resourceInputs["name"] = args?.name;
            resourceInputs["project"] = args?.project;
            resourceInputs["responseType"] = args?.responseType;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(OauthIdpConfig.__pulumiType, name, resourceInputs, opts);
    }
}
exports.OauthIdpConfig = OauthIdpConfig;
/** @internal */
OauthIdpConfig.__pulumiType = 'gcp:identityplatform/oauthIdpConfig:OauthIdpConfig';
//# sourceMappingURL=oauthIdpConfig.js.map