"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.DeveloperApp = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Creates an app associated with a developer.
 * This API associates the developer app with the specified API product
 * and auto-generates an API key for the app to use in calls to API proxies
 * inside that API product.
 *
 * To get more information about DeveloperApp, see:
 *
 * * [API documentation](https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.developers.apps)
 * * How-to Guides
 *     * [Creating a developer](https://cloud.google.com/apigee/docs/api-platform/publish/creating-apps-surface-your-api)
 *
 * ## Example Usage
 *
 * ### Apigee Developer App Basic
 *
 * ### Apigee Developer App Basic Test
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * import * as time from "@pulumiverse/time";
 *
 * const project = new gcp.organizations.Project("project", {
 *     projectId: "prj",
 *     name: "prj",
 *     orgId: "123456789",
 *     billingAccount: "000000-0000000-0000000-000000",
 *     deletionPolicy: "DELETE",
 * });
 * const wait60Seconds = new time.Sleep("wait_60_seconds", {createDuration: "60s"}, {
 *     dependsOn: [project],
 * });
 * const apigee = new gcp.projects.Service("apigee", {
 *     project: project.projectId,
 *     service: "apigee.googleapis.com",
 * }, {
 *     dependsOn: [wait60Seconds],
 * });
 * const apigeeOrg = new gcp.apigee.Organization("apigee_org", {
 *     analyticsRegion: "us-central1",
 *     projectId: project.projectId,
 *     disableVpcPeering: true,
 * }, {
 *     dependsOn: [apigee],
 * });
 * const apigeeInstance = new gcp.apigee.Instance("apigee_instance", {
 *     name: "instance",
 *     location: "us-central1",
 *     orgId: apigeeOrg.id,
 * });
 * const apiProduct = new gcp.apigee.ApiProduct("api_product", {
 *     name: "sample-api",
 *     orgId: apigeeOrg.id,
 *     displayName: "A sample API Product",
 *     approvalType: "auto",
 *     scopes: [
 *         "read:weather",
 *         "write:reports",
 *         "write:files",
 *     ],
 * }, {
 *     dependsOn: [apigeeInstance],
 * });
 * const developer = new gcp.apigee.Developer("developer", {
 *     email: "john.doe@acme.com",
 *     firstName: "John",
 *     lastName: "Doe",
 *     userName: "john.doe",
 *     orgId: apigeeOrg.id,
 * }, {
 *     dependsOn: [apigeeInstance],
 * });
 * const apigeeDeveloperApp = new gcp.apigee.DeveloperApp("apigee_developer_app", {
 *     name: "sample-app",
 *     appFamily: "default",
 *     developerEmail: developer.email,
 *     orgId: apigeeOrg.id,
 *     callbackUrl: "https://example-call.url",
 *     keyExpiresIn: "-1",
 *     status: "approved",
 *     apiProducts: [apiProduct.name],
 *     scopes: apiProduct.scopes,
 *     attributes: [{
 *         name: "sample_name",
 *         value: "sample_value",
 *     }],
 * });
 * ```
 *
 * ## Import
 *
 * DeveloperApp can be imported using any of these accepted formats:
 *
 * * `{{org_id}}/developers/{{developer_email}}/apps/{{name}}`
 *
 * * `{{org_id}}/{{developer_email}}/{{name}}`
 *
 * When using the `pulumi import` command, DeveloperApp can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:apigee/developerApp:DeveloperApp default {{org_id}}/developers/{{developer_email}}/apps/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:apigee/developerApp:DeveloperApp default {{org_id}}/{{developer_email}}/{{name}}
 * ```
 */
class DeveloperApp extends pulumi.CustomResource {
    /**
     * Get an existing DeveloperApp 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 DeveloperApp(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of DeveloperApp.  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'] === DeveloperApp.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["apiProducts"] = state?.apiProducts;
            resourceInputs["appFamily"] = state?.appFamily;
            resourceInputs["appId"] = state?.appId;
            resourceInputs["attributes"] = state?.attributes;
            resourceInputs["callbackUrl"] = state?.callbackUrl;
            resourceInputs["createdAt"] = state?.createdAt;
            resourceInputs["credentials"] = state?.credentials;
            resourceInputs["developerEmail"] = state?.developerEmail;
            resourceInputs["developerId"] = state?.developerId;
            resourceInputs["keyExpiresIn"] = state?.keyExpiresIn;
            resourceInputs["lastModifiedAt"] = state?.lastModifiedAt;
            resourceInputs["name"] = state?.name;
            resourceInputs["orgId"] = state?.orgId;
            resourceInputs["scopes"] = state?.scopes;
            resourceInputs["status"] = state?.status;
        }
        else {
            const args = argsOrState;
            if (args?.callbackUrl === undefined && !opts.urn) {
                throw new Error("Missing required property 'callbackUrl'");
            }
            if (args?.developerEmail === undefined && !opts.urn) {
                throw new Error("Missing required property 'developerEmail'");
            }
            if (args?.orgId === undefined && !opts.urn) {
                throw new Error("Missing required property 'orgId'");
            }
            resourceInputs["apiProducts"] = args?.apiProducts;
            resourceInputs["appFamily"] = args?.appFamily;
            resourceInputs["attributes"] = args?.attributes;
            resourceInputs["callbackUrl"] = args?.callbackUrl;
            resourceInputs["developerEmail"] = args?.developerEmail;
            resourceInputs["keyExpiresIn"] = args?.keyExpiresIn;
            resourceInputs["name"] = args?.name;
            resourceInputs["orgId"] = args?.orgId;
            resourceInputs["scopes"] = args?.scopes;
            resourceInputs["status"] = args?.status;
            resourceInputs["appId"] = undefined /*out*/;
            resourceInputs["createdAt"] = undefined /*out*/;
            resourceInputs["credentials"] = undefined /*out*/;
            resourceInputs["developerId"] = undefined /*out*/;
            resourceInputs["lastModifiedAt"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(DeveloperApp.__pulumiType, name, resourceInputs, opts);
    }
}
exports.DeveloperApp = DeveloperApp;
/** @internal */
DeveloperApp.__pulumiType = 'gcp:apigee/developerApp:DeveloperApp';
//# sourceMappingURL=developerApp.js.map