@pulumi/github
Version:
A Pulumi package for creating and managing github cloud resources.
81 lines • 3.79 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.UserInvitationAccepter = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Provides a resource to manage GitHub repository collaborator invitations.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as github from "@pulumi/github";
*
* const example = new github.Repository("example", {name: "example-repo"});
* const exampleRepositoryCollaborator = new github.RepositoryCollaborator("example", {
* repository: example.name,
* username: "example-username",
* permission: "push",
* });
* const exampleUserInvitationAccepter = new github.UserInvitationAccepter("example", {invitationId: exampleRepositoryCollaborator.invitationId});
* ```
*
* ## Allowing empty invitation IDs
*
* Set `allowEmptyId` when using `forEach` over a list of `github_repository_collaborator.invitation_id`'s.
*
* This allows applying a module again when a new `github.RepositoryCollaborator` resource is added to the `forEach` loop.
* This is needed as the `github_repository_collaborator.invitation_id` will be empty after a state refresh when the invitation has been accepted.
*
* Note that when an invitation is accepted manually or by another tool between a state refresh and a `pulumi up` using that refreshed state,
* the plan will contain the invitation ID, but the apply will receive an HTTP 404 from the API since the invitation has already been accepted.
*
* This is tracked in #1157.
*/
class UserInvitationAccepter extends pulumi.CustomResource {
/**
* Get an existing UserInvitationAccepter 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 UserInvitationAccepter(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of UserInvitationAccepter. 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'] === UserInvitationAccepter.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["allowEmptyId"] = state ? state.allowEmptyId : undefined;
resourceInputs["invitationId"] = state ? state.invitationId : undefined;
}
else {
const args = argsOrState;
resourceInputs["allowEmptyId"] = args ? args.allowEmptyId : undefined;
resourceInputs["invitationId"] = args ? args.invitationId : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(UserInvitationAccepter.__pulumiType, name, resourceInputs, opts);
}
}
exports.UserInvitationAccepter = UserInvitationAccepter;
/** @internal */
UserInvitationAccepter.__pulumiType = 'github:index/userInvitationAccepter:UserInvitationAccepter';
//# sourceMappingURL=userInvitationAccepter.js.map
;