UNPKG

@pulumi/github

Version:

A Pulumi package for creating and managing github cloud resources.

78 lines 3.14 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.UserGpgKey = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Provides a GitHub user's GPG key resource. * * This resource allows you to add/remove GPG keys from your user account. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as github from "@pulumi/github"; * * const example = new github.UserGpgKey("example", {armoredPublicKey: `-----BEGIN PGP PUBLIC KEY BLOCK----- * ... * -----END PGP PUBLIC KEY BLOCK-----`}); * ``` * * ## Import * * GPG keys are not importable due to the fact that [API](https://developer.github.com/v3/users/gpg_keys/#gpg-keys) * * does not return previously uploaded GPG key. */ class UserGpgKey extends pulumi.CustomResource { /** * Get an existing UserGpgKey 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 UserGpgKey(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of UserGpgKey. 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'] === UserGpgKey.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["armoredPublicKey"] = state ? state.armoredPublicKey : undefined; resourceInputs["etag"] = state ? state.etag : undefined; resourceInputs["keyId"] = state ? state.keyId : undefined; } else { const args = argsOrState; if ((!args || args.armoredPublicKey === undefined) && !opts.urn) { throw new Error("Missing required property 'armoredPublicKey'"); } resourceInputs["armoredPublicKey"] = args ? args.armoredPublicKey : undefined; resourceInputs["etag"] = undefined /*out*/; resourceInputs["keyId"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(UserGpgKey.__pulumiType, name, resourceInputs, opts); } } exports.UserGpgKey = UserGpgKey; /** @internal */ UserGpgKey.__pulumiType = 'github:index/userGpgKey:UserGpgKey'; //# sourceMappingURL=userGpgKey.js.map