@pulumi/github
Version:
A Pulumi package for creating and managing github cloud resources.
97 lines • 4.31 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.RepositoryMilestone = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Provides a GitHub repository milestone resource.
*
* This resource allows you to create and manage milestones for a GitHub Repository within an organization or user account.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as github from "@pulumi/github";
*
* // Create a milestone for a repository
* const example = new github.RepositoryMilestone("example", {
* owner: "example-owner",
* repository: "example-repository",
* title: "v1.1.0",
* });
* ```
*
* ## Import
*
* A GitHub Repository Milestone can be imported using an ID made up of `owner/repository/number`, e.g.
*
* ```sh
* $ pulumi import github:index/repositoryMilestone:RepositoryMilestone example example-owner/example-repository/1
* ```
*/
class RepositoryMilestone extends pulumi.CustomResource {
/**
* Get an existing RepositoryMilestone 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 RepositoryMilestone(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of RepositoryMilestone. 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'] === RepositoryMilestone.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["dueDate"] = state ? state.dueDate : undefined;
resourceInputs["number"] = state ? state.number : undefined;
resourceInputs["owner"] = state ? state.owner : undefined;
resourceInputs["repository"] = state ? state.repository : undefined;
resourceInputs["state"] = state ? state.state : undefined;
resourceInputs["title"] = state ? state.title : undefined;
}
else {
const args = argsOrState;
if ((!args || args.owner === undefined) && !opts.urn) {
throw new Error("Missing required property 'owner'");
}
if ((!args || args.repository === undefined) && !opts.urn) {
throw new Error("Missing required property 'repository'");
}
if ((!args || args.title === undefined) && !opts.urn) {
throw new Error("Missing required property 'title'");
}
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["dueDate"] = args ? args.dueDate : undefined;
resourceInputs["owner"] = args ? args.owner : undefined;
resourceInputs["repository"] = args ? args.repository : undefined;
resourceInputs["state"] = args ? args.state : undefined;
resourceInputs["title"] = args ? args.title : undefined;
resourceInputs["number"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(RepositoryMilestone.__pulumiType, name, resourceInputs, opts);
}
}
exports.RepositoryMilestone = RepositoryMilestone;
/** @internal */
RepositoryMilestone.__pulumiType = 'github:index/repositoryMilestone:RepositoryMilestone';
//# sourceMappingURL=repositoryMilestone.js.map
;