UNPKG

@pulumi/github

Version:

A Pulumi package for creating and managing github cloud resources.

96 lines 3.83 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.IssueLabels = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Provides GitHub issue labels resource. * * This resource allows you to create and manage issue labels within your * GitHub organization. * * > Note: github.IssueLabels cannot be used in conjunction with github.IssueLabel or they will fight over what your policy should be. * * This resource is authoritative. For adding a label to a repo in a non-authoritative manner, use github.IssueLabel instead. * * If you change the case of a label's name, its' color, or description, this resource will edit the existing label to match the new values. However, if you change the name of a label, this resource will create a new label with the new name and delete the old label. Beware that this will remove the label from any issues it was previously attached to. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as github from "@pulumi/github"; * * // Create a new, red colored label * const testRepo = new github.IssueLabels("test_repo", { * repository: "test-repo", * labels: [ * { * name: "Urgent", * color: "FF0000", * }, * { * name: "Critical", * color: "FF0000", * }, * ], * }); * ``` * * ## Import * * GitHub Issue Labels can be imported using the repository `name`, e.g. * * ```sh * $ pulumi import github:index/issueLabels:IssueLabels test_repo test_repo * ``` */ class IssueLabels extends pulumi.CustomResource { /** * Get an existing IssueLabels 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 IssueLabels(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of IssueLabels. 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'] === IssueLabels.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["labels"] = state ? state.labels : undefined; resourceInputs["repository"] = state ? state.repository : undefined; } else { const args = argsOrState; if ((!args || args.repository === undefined) && !opts.urn) { throw new Error("Missing required property 'repository'"); } resourceInputs["labels"] = args ? args.labels : undefined; resourceInputs["repository"] = args ? args.repository : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(IssueLabels.__pulumiType, name, resourceInputs, opts); } } exports.IssueLabels = IssueLabels; /** @internal */ IssueLabels.__pulumiType = 'github:index/issueLabels:IssueLabels'; //# sourceMappingURL=issueLabels.js.map