@pulumi/github
Version:
A Pulumi package for creating and managing github cloud resources.
109 lines • 5.51 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.RepositoryPullRequest = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* This resource allows you to create and manage PullRequests for repositories within your GitHub organization or personal account.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as github from "@pulumi/github";
*
* const example = new github.RepositoryPullRequest("example", {
* baseRepository: "example-repository",
* baseRef: "main",
* headRef: "feature-branch",
* title: "My newest feature",
* body: "This will change everything",
* });
* ```
*/
class RepositoryPullRequest extends pulumi.CustomResource {
/**
* Get an existing RepositoryPullRequest 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 RepositoryPullRequest(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of RepositoryPullRequest. 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'] === RepositoryPullRequest.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["baseRef"] = state ? state.baseRef : undefined;
resourceInputs["baseRepository"] = state ? state.baseRepository : undefined;
resourceInputs["baseSha"] = state ? state.baseSha : undefined;
resourceInputs["body"] = state ? state.body : undefined;
resourceInputs["draft"] = state ? state.draft : undefined;
resourceInputs["headRef"] = state ? state.headRef : undefined;
resourceInputs["headSha"] = state ? state.headSha : undefined;
resourceInputs["labels"] = state ? state.labels : undefined;
resourceInputs["maintainerCanModify"] = state ? state.maintainerCanModify : undefined;
resourceInputs["number"] = state ? state.number : undefined;
resourceInputs["openedAt"] = state ? state.openedAt : undefined;
resourceInputs["openedBy"] = state ? state.openedBy : undefined;
resourceInputs["owner"] = state ? state.owner : undefined;
resourceInputs["state"] = state ? state.state : undefined;
resourceInputs["title"] = state ? state.title : undefined;
resourceInputs["updatedAt"] = state ? state.updatedAt : undefined;
}
else {
const args = argsOrState;
if ((!args || args.baseRef === undefined) && !opts.urn) {
throw new Error("Missing required property 'baseRef'");
}
if ((!args || args.baseRepository === undefined) && !opts.urn) {
throw new Error("Missing required property 'baseRepository'");
}
if ((!args || args.headRef === undefined) && !opts.urn) {
throw new Error("Missing required property 'headRef'");
}
if ((!args || args.title === undefined) && !opts.urn) {
throw new Error("Missing required property 'title'");
}
resourceInputs["baseRef"] = args ? args.baseRef : undefined;
resourceInputs["baseRepository"] = args ? args.baseRepository : undefined;
resourceInputs["body"] = args ? args.body : undefined;
resourceInputs["headRef"] = args ? args.headRef : undefined;
resourceInputs["maintainerCanModify"] = args ? args.maintainerCanModify : undefined;
resourceInputs["owner"] = args ? args.owner : undefined;
resourceInputs["title"] = args ? args.title : undefined;
resourceInputs["baseSha"] = undefined /*out*/;
resourceInputs["draft"] = undefined /*out*/;
resourceInputs["headSha"] = undefined /*out*/;
resourceInputs["labels"] = undefined /*out*/;
resourceInputs["number"] = undefined /*out*/;
resourceInputs["openedAt"] = undefined /*out*/;
resourceInputs["openedBy"] = undefined /*out*/;
resourceInputs["state"] = undefined /*out*/;
resourceInputs["updatedAt"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(RepositoryPullRequest.__pulumiType, name, resourceInputs, opts);
}
}
exports.RepositoryPullRequest = RepositoryPullRequest;
/** @internal */
RepositoryPullRequest.__pulumiType = 'github:index/repositoryPullRequest:RepositoryPullRequest';
//# sourceMappingURL=repositoryPullRequest.js.map
;