"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.Developer = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * A `Developer` is an API consumer that can have apps registered in Apigee.
 *
 * To get more information about Developer, see:
 *
 * * [API documentation](https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.developers)
 * * How-to Guides
 *     * [Creating a developer](https://cloud.google.com/apigee/docs/api-platform/publish/adding-developers-your-api-product)
 *
 * ## Example Usage
 *
 * ### Apigee Developer Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const current = gcp.organizations.getClientConfig({});
 * const apigeeNetwork = new gcp.compute.Network("apigee_network", {name: "apigee-network"});
 * const apigeeRange = new gcp.compute.GlobalAddress("apigee_range", {
 *     name: "apigee-range",
 *     purpose: "VPC_PEERING",
 *     addressType: "INTERNAL",
 *     prefixLength: 16,
 *     network: apigeeNetwork.id,
 * });
 * const apigeeVpcConnection = new gcp.servicenetworking.Connection("apigee_vpc_connection", {
 *     network: apigeeNetwork.id,
 *     service: "servicenetworking.googleapis.com",
 *     reservedPeeringRanges: [apigeeRange.name],
 * });
 * const apigeeOrg = new gcp.apigee.Organization("apigee_org", {
 *     analyticsRegion: "us-central1",
 *     projectId: current.then(current => current.project),
 *     authorizedNetwork: apigeeNetwork.id,
 * }, {
 *     dependsOn: [apigeeVpcConnection],
 * });
 * const apigeeInstance = new gcp.apigee.Instance("apigee_instance", {
 *     name: "my-instance",
 *     location: "us-central1",
 *     orgId: apigeeOrg.id,
 *     peeringCidrRange: "SLASH_22",
 * });
 * const apigeeDeveloper = new gcp.apigee.Developer("apigee_developer", {
 *     email: "john.doe@acme.com",
 *     firstName: "John",
 *     lastName: "Doe",
 *     userName: "john.doe",
 *     orgId: apigeeOrg.id,
 * }, {
 *     dependsOn: [apigeeInstance],
 * });
 * ```
 * ### Apigee Developer With Attributes
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const current = gcp.organizations.getClientConfig({});
 * const apigeeNetwork = new gcp.compute.Network("apigee_network", {name: "apigee-network"});
 * const apigeeRange = new gcp.compute.GlobalAddress("apigee_range", {
 *     name: "apigee-range",
 *     purpose: "VPC_PEERING",
 *     addressType: "INTERNAL",
 *     prefixLength: 16,
 *     network: apigeeNetwork.id,
 * });
 * const apigeeVpcConnection = new gcp.servicenetworking.Connection("apigee_vpc_connection", {
 *     network: apigeeNetwork.id,
 *     service: "servicenetworking.googleapis.com",
 *     reservedPeeringRanges: [apigeeRange.name],
 * });
 * const apigeeOrg = new gcp.apigee.Organization("apigee_org", {
 *     analyticsRegion: "us-central1",
 *     projectId: current.then(current => current.project),
 *     authorizedNetwork: apigeeNetwork.id,
 * }, {
 *     dependsOn: [apigeeVpcConnection],
 * });
 * const apigeeInstance = new gcp.apigee.Instance("apigee_instance", {
 *     name: "my-instance",
 *     location: "us-central1",
 *     orgId: apigeeOrg.id,
 *     peeringCidrRange: "SLASH_22",
 * });
 * const apigeeDeveloper = new gcp.apigee.Developer("apigee_developer", {
 *     email: "john.doe@acme.com",
 *     firstName: "John",
 *     lastName: "Doe",
 *     userName: "john.doe",
 *     attributes: [
 *         {
 *             name: "business_unit",
 *             value: "HR",
 *         },
 *         {
 *             name: "department",
 *             value: "payroll",
 *         },
 *     ],
 *     orgId: apigeeOrg.id,
 * }, {
 *     dependsOn: [apigeeInstance],
 * });
 * ```
 *
 * ## Import
 *
 * Developer can be imported using any of these accepted formats:
 *
 * * `{{org_id}}/developers/{{email}}`
 *
 * * `{{org_id}}/{{email}}`
 *
 * When using the `pulumi import` command, Developer can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:apigee/developer:Developer default {{org_id}}/developers/{{email}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:apigee/developer:Developer default {{org_id}}/{{email}}
 * ```
 */
class Developer extends pulumi.CustomResource {
    /**
     * Get an existing Developer 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 Developer(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of Developer.  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'] === Developer.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["attributes"] = state?.attributes;
            resourceInputs["createdAt"] = state?.createdAt;
            resourceInputs["email"] = state?.email;
            resourceInputs["firstName"] = state?.firstName;
            resourceInputs["lastModifiedAt"] = state?.lastModifiedAt;
            resourceInputs["lastName"] = state?.lastName;
            resourceInputs["orgId"] = state?.orgId;
            resourceInputs["organizatioName"] = state?.organizatioName;
            resourceInputs["status"] = state?.status;
            resourceInputs["userName"] = state?.userName;
        }
        else {
            const args = argsOrState;
            if (args?.email === undefined && !opts.urn) {
                throw new Error("Missing required property 'email'");
            }
            if (args?.firstName === undefined && !opts.urn) {
                throw new Error("Missing required property 'firstName'");
            }
            if (args?.lastName === undefined && !opts.urn) {
                throw new Error("Missing required property 'lastName'");
            }
            if (args?.orgId === undefined && !opts.urn) {
                throw new Error("Missing required property 'orgId'");
            }
            if (args?.userName === undefined && !opts.urn) {
                throw new Error("Missing required property 'userName'");
            }
            resourceInputs["attributes"] = args?.attributes;
            resourceInputs["email"] = args?.email;
            resourceInputs["firstName"] = args?.firstName;
            resourceInputs["lastName"] = args?.lastName;
            resourceInputs["orgId"] = args?.orgId;
            resourceInputs["userName"] = args?.userName;
            resourceInputs["createdAt"] = undefined /*out*/;
            resourceInputs["lastModifiedAt"] = undefined /*out*/;
            resourceInputs["organizatioName"] = undefined /*out*/;
            resourceInputs["status"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(Developer.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Developer = Developer;
/** @internal */
Developer.__pulumiType = 'gcp:apigee/developer:Developer';
//# sourceMappingURL=developer.js.map