UNPKG

@pulumi/github

Version:

A Pulumi package for creating and managing github cloud resources.

81 lines 3.41 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.RepositoryProject = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * This resource allows you to create and manage projects for GitHub repository. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as github from "@pulumi/github"; * * const example = new github.Repository("example", { * name: "example", * description: "My awesome codebase", * hasProjects: true, * }); * const project = new github.RepositoryProject("project", { * name: "A Repository Project", * repository: example.name, * body: "This is a repository project.", * }); * ``` */ class RepositoryProject extends pulumi.CustomResource { /** * Get an existing RepositoryProject 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 RepositoryProject(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of RepositoryProject. 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'] === RepositoryProject.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["body"] = state ? state.body : undefined; resourceInputs["etag"] = state ? state.etag : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["repository"] = state ? state.repository : undefined; resourceInputs["url"] = state ? state.url : undefined; } else { const args = argsOrState; if ((!args || args.repository === undefined) && !opts.urn) { throw new Error("Missing required property 'repository'"); } resourceInputs["body"] = args ? args.body : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["repository"] = args ? args.repository : undefined; resourceInputs["etag"] = undefined /*out*/; resourceInputs["url"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(RepositoryProject.__pulumiType, name, resourceInputs, opts); } } exports.RepositoryProject = RepositoryProject; /** @internal */ RepositoryProject.__pulumiType = 'github:index/repositoryProject:RepositoryProject'; //# sourceMappingURL=repositoryProject.js.map