UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

195 lines • 8.13 kB
"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.Plugin = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * A plugin resource in the API hub. * * ## Example Usage * * ### Apihub Plugin Full * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const apihubPluginFull = new gcp.apihub.Plugin("apihub_plugin_full", { * location: "us-central1", * displayName: "Test Plugin", * description: "Test description", * pluginId: "plugin-full", * pluginCategory: "API_GATEWAY", * actionsConfigs: [{ * id: "sync-metadata", * displayName: "Sync Metadata", * description: "Syncs API metadata.", * triggerMode: "API_HUB_SCHEDULE_TRIGGER", * }], * documentation: { * externalUri: "https://example.com/plugin-documentation", * }, * hostingService: { * serviceUri: "https://your-plugin-service.example.com/api", * }, * configTemplate: { * authConfigTemplate: { * supportedAuthTypes: [ * "NO_AUTH", * "USER_PASSWORD", * ], * serviceAccount: { * serviceAccount: "test@developer.gserviceaccount.com", * }, * }, * additionalConfigTemplates: [ * { * id: "string-val", * description: "API key for the service.", * valueType: "STRING", * required: false, * validationRegex: "^[a-zA-Z0-9]{5,20}$", * }, * { * id: "integer-val", * description: "API key for the service.", * valueType: "INT", * required: true, * validationRegex: "", * }, * { * id: "bool-val", * description: "API key for the service.", * valueType: "BOOL", * required: false, * validationRegex: "", * }, * { * id: "enum-val", * description: "API key for the service.", * valueType: "ENUM", * enumOptions: [ * { * id: "Option1", * displayName: "Option1", * description: "Description for Option1", * }, * { * id: "Option2", * displayName: "Option2", * description: "Description for Option2", * }, * ], * required: false, * validationRegex: "", * }, * ], * }, * }); * ``` * * ## Import * * Plugin can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/plugins/{{plugin_id}}` * * * `{{project}}/{{location}}/{{plugin_id}}` * * * `{{location}}/{{plugin_id}}` * * When using the `pulumi import` command, Plugin can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:apihub/plugin:Plugin default projects/{{project}}/locations/{{location}}/plugins/{{plugin_id}} * ``` * * ```sh * $ pulumi import gcp:apihub/plugin:Plugin default {{project}}/{{location}}/{{plugin_id}} * ``` * * ```sh * $ pulumi import gcp:apihub/plugin:Plugin default {{location}}/{{plugin_id}} * ``` */ class Plugin extends pulumi.CustomResource { /** * Get an existing Plugin 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 Plugin(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Plugin. 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'] === Plugin.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["actionsConfigs"] = state ? state.actionsConfigs : undefined; resourceInputs["configTemplate"] = state ? state.configTemplate : undefined; resourceInputs["createTime"] = state ? state.createTime : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["displayName"] = state ? state.displayName : undefined; resourceInputs["documentation"] = state ? state.documentation : undefined; resourceInputs["hostingService"] = state ? state.hostingService : undefined; resourceInputs["location"] = state ? state.location : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["ownershipType"] = state ? state.ownershipType : undefined; resourceInputs["pluginCategory"] = state ? state.pluginCategory : undefined; resourceInputs["pluginId"] = state ? state.pluginId : undefined; resourceInputs["project"] = state ? state.project : undefined; resourceInputs["state"] = state ? state.state : undefined; resourceInputs["updateTime"] = state ? state.updateTime : undefined; } else { const args = argsOrState; if ((!args || args.displayName === undefined) && !opts.urn) { throw new Error("Missing required property 'displayName'"); } if ((!args || args.location === undefined) && !opts.urn) { throw new Error("Missing required property 'location'"); } if ((!args || args.pluginId === undefined) && !opts.urn) { throw new Error("Missing required property 'pluginId'"); } resourceInputs["actionsConfigs"] = args ? args.actionsConfigs : undefined; resourceInputs["configTemplate"] = args ? args.configTemplate : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["displayName"] = args ? args.displayName : undefined; resourceInputs["documentation"] = args ? args.documentation : undefined; resourceInputs["hostingService"] = args ? args.hostingService : undefined; resourceInputs["location"] = args ? args.location : undefined; resourceInputs["pluginCategory"] = args ? args.pluginCategory : undefined; resourceInputs["pluginId"] = args ? args.pluginId : undefined; resourceInputs["project"] = args ? args.project : undefined; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["name"] = undefined /*out*/; resourceInputs["ownershipType"] = undefined /*out*/; resourceInputs["state"] = undefined /*out*/; resourceInputs["updateTime"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Plugin.__pulumiType, name, resourceInputs, opts); } } exports.Plugin = Plugin; /** @internal */ Plugin.__pulumiType = 'gcp:apihub/plugin:Plugin'; //# sourceMappingURL=plugin.js.map