@pulumi/github
Version:
A Pulumi package for creating and managing github cloud resources.
125 lines • 4.73 kB
JavaScript
// *** 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.ProjectCard = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* This resource allows you to create and manage cards for GitHub projects.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as github from "@pulumi/github";
*
* const project = new github.OrganizationProject("project", {
* name: "An Organization Project",
* body: "This is an organization project.",
* });
* const column = new github.ProjectColumn("column", {
* projectId: project.id,
* name: "Backlog",
* });
* const card = new github.ProjectCard("card", {
* columnId: column.columnId,
* note: "## Unaccepted 👇",
* });
* ```
*
* ### Adding An Issue To A Project
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as github from "@pulumi/github";
*
* const test = new github.Repository("test", {
* name: "myrepo",
* hasProjects: true,
* hasIssues: true,
* });
* const testIssue = new github.Issue("test", {
* repository: test.id,
* title: "Test issue title",
* body: "Test issue body",
* });
* const testRepositoryProject = new github.RepositoryProject("test", {
* name: "test",
* repository: test.name,
* body: "this is a test project",
* });
* const testProjectColumn = new github.ProjectColumn("test", {
* projectId: testRepositoryProject.id,
* name: "Backlog",
* });
* const testProjectCard = new github.ProjectCard("test", {
* columnId: testProjectColumn.columnId,
* contentId: testIssue.issueId,
* contentType: "Issue",
* });
* ```
*
* ## Import
*
* A GitHub Project Card can be imported using its [Card ID](https://developer.github.com/v3/projects/cards/#get-a-project-card):
*
* ```sh
* $ pulumi import github:index/projectCard:ProjectCard card 01234567
* ```
*/
class ProjectCard extends pulumi.CustomResource {
/**
* Get an existing ProjectCard 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 ProjectCard(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ProjectCard. 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'] === ProjectCard.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["cardId"] = state ? state.cardId : undefined;
resourceInputs["columnId"] = state ? state.columnId : undefined;
resourceInputs["contentId"] = state ? state.contentId : undefined;
resourceInputs["contentType"] = state ? state.contentType : undefined;
resourceInputs["etag"] = state ? state.etag : undefined;
resourceInputs["note"] = state ? state.note : undefined;
}
else {
const args = argsOrState;
if ((!args || args.columnId === undefined) && !opts.urn) {
throw new Error("Missing required property 'columnId'");
}
resourceInputs["columnId"] = args ? args.columnId : undefined;
resourceInputs["contentId"] = args ? args.contentId : undefined;
resourceInputs["contentType"] = args ? args.contentType : undefined;
resourceInputs["note"] = args ? args.note : undefined;
resourceInputs["cardId"] = undefined /*out*/;
resourceInputs["etag"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ProjectCard.__pulumiType, name, resourceInputs, opts);
}
}
exports.ProjectCard = ProjectCard;
/** @internal */
ProjectCard.__pulumiType = 'github:index/projectCard:ProjectCard';
//# sourceMappingURL=projectCard.js.map
;