"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.ApiProduct = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * An `ApiProduct` in Apigee.
 *
 * To get more information about ApiProduct, see:
 *
 * * [API documentation](https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.apiproducts#ApiProduct)
 * * How-to Guides
 *     * [Creating an API product](https://cloud.google.com/apigee/docs/api-platform/publish/what-api-product)
 *
 * ## Example Usage
 *
 * ### Apigee Api Product 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 basicApiProduct = new gcp.apigee.ApiProduct("basic_api_product", {
 *     orgId: apigeeOrg.id,
 *     name: "my-product",
 *     displayName: "My Basic API Product",
 *     approvalType: "auto",
 * }, {
 *     dependsOn: [apigeeInstance],
 * });
 * ```
 * ### Apigee Api Product With Legacy Operation
 *
 * ```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 fullApiProduct = new gcp.apigee.ApiProduct("full_api_product", {
 *     orgId: apigeeOrg.id,
 *     name: "my-product",
 *     displayName: "My full API Product",
 *     approvalType: "auto",
 *     description: "This is a sample API Product created with Terraform.",
 *     attributes: [{
 *         name: "access",
 *         value: "private",
 *     }],
 *     environments: [
 *         "dev",
 *         "hom",
 *     ],
 *     proxies: ["hello-world"],
 *     apiResources: [
 *         "/",
 *         "/weather/**",
 *     ],
 *     scopes: [
 *         "read:weather",
 *         "write:reports",
 *     ],
 *     quota: "10000",
 *     quotaInterval: "1",
 *     quotaTimeUnit: "day",
 *     quotaCounterScope: "PROXY",
 * }, {
 *     dependsOn: [apigeeInstance],
 * });
 * ```
 * ## Import
 *
 * ApiProduct can be imported using any of these accepted formats:
 *
 * * `{{org_id}}/apiproducts/{{name}}`
 *
 * * `{{org_id}}/{{name}}`
 *
 * When using the `pulumi import` command, ApiProduct can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:apigee/apiProduct:ApiProduct default {{org_id}}/apiproducts/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:apigee/apiProduct:ApiProduct default {{org_id}}/{{name}}
 * ```
 */
class ApiProduct extends pulumi.CustomResource {
    /**
     * Get an existing ApiProduct 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 ApiProduct(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of ApiProduct.  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'] === ApiProduct.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["apiResources"] = state?.apiResources;
            resourceInputs["approvalType"] = state?.approvalType;
            resourceInputs["attributes"] = state?.attributes;
            resourceInputs["createdAt"] = state?.createdAt;
            resourceInputs["description"] = state?.description;
            resourceInputs["displayName"] = state?.displayName;
            resourceInputs["environments"] = state?.environments;
            resourceInputs["graphqlOperationGroup"] = state?.graphqlOperationGroup;
            resourceInputs["grpcOperationGroup"] = state?.grpcOperationGroup;
            resourceInputs["lastModifiedAt"] = state?.lastModifiedAt;
            resourceInputs["name"] = state?.name;
            resourceInputs["operationGroup"] = state?.operationGroup;
            resourceInputs["orgId"] = state?.orgId;
            resourceInputs["proxies"] = state?.proxies;
            resourceInputs["quota"] = state?.quota;
            resourceInputs["quotaCounterScope"] = state?.quotaCounterScope;
            resourceInputs["quotaInterval"] = state?.quotaInterval;
            resourceInputs["quotaTimeUnit"] = state?.quotaTimeUnit;
            resourceInputs["scopes"] = state?.scopes;
            resourceInputs["space"] = state?.space;
        }
        else {
            const args = argsOrState;
            if (args?.displayName === undefined && !opts.urn) {
                throw new Error("Missing required property 'displayName'");
            }
            if (args?.orgId === undefined && !opts.urn) {
                throw new Error("Missing required property 'orgId'");
            }
            resourceInputs["apiResources"] = args?.apiResources;
            resourceInputs["approvalType"] = args?.approvalType;
            resourceInputs["attributes"] = args?.attributes;
            resourceInputs["description"] = args?.description;
            resourceInputs["displayName"] = args?.displayName;
            resourceInputs["environments"] = args?.environments;
            resourceInputs["graphqlOperationGroup"] = args?.graphqlOperationGroup;
            resourceInputs["grpcOperationGroup"] = args?.grpcOperationGroup;
            resourceInputs["name"] = args?.name;
            resourceInputs["operationGroup"] = args?.operationGroup;
            resourceInputs["orgId"] = args?.orgId;
            resourceInputs["proxies"] = args?.proxies;
            resourceInputs["quota"] = args?.quota;
            resourceInputs["quotaCounterScope"] = args?.quotaCounterScope;
            resourceInputs["quotaInterval"] = args?.quotaInterval;
            resourceInputs["quotaTimeUnit"] = args?.quotaTimeUnit;
            resourceInputs["scopes"] = args?.scopes;
            resourceInputs["space"] = args?.space;
            resourceInputs["createdAt"] = undefined /*out*/;
            resourceInputs["lastModifiedAt"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(ApiProduct.__pulumiType, name, resourceInputs, opts);
    }
}
exports.ApiProduct = ApiProduct;
/** @internal */
ApiProduct.__pulumiType = 'gcp:apigee/apiProduct:ApiProduct';
//# sourceMappingURL=apiProduct.js.map