@pulumi/github
Version:
A Pulumi package for creating and managing github cloud resources.
101 lines • 4.07 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.TeamSettings = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* This resource manages the team settings (in particular the request review delegation settings) within the organization
*
* Creating this resource will alter the team Code Review settings.
*
* The team must both belong to the same organization configured in the provider on GitHub.
*
* > **Note**: This resource relies on the v4 GraphQl GitHub API. If this API is not available, or the Stone Crop schema preview is not available, then this resource will not work as intended.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as github from "@pulumi/github";
*
* // Add a repository to the team
* const someTeam = new github.Team("some_team", {
* name: "SomeTeam",
* description: "Some cool team",
* });
* const codeReviewSettings = new github.TeamSettings("code_review_settings", {
* teamId: someTeam.id,
* reviewRequestDelegation: {
* algorithm: "ROUND_ROBIN",
* memberCount: 1,
* notify: true,
* },
* });
* ```
*
* ## Import
*
* GitHub Teams can be imported using the GitHub team ID, or the team slug e.g.
*
* ```sh
* $ pulumi import github:index/teamSettings:TeamSettings code_review_settings 1234567
* ```
* or,
*
* ```sh
* $ pulumi import github:index/teamSettings:TeamSettings code_review_settings SomeTeam
* ```
*/
class TeamSettings extends pulumi.CustomResource {
/**
* Get an existing TeamSettings 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 TeamSettings(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of TeamSettings. 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'] === TeamSettings.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["reviewRequestDelegation"] = state ? state.reviewRequestDelegation : undefined;
resourceInputs["teamId"] = state ? state.teamId : undefined;
resourceInputs["teamSlug"] = state ? state.teamSlug : undefined;
resourceInputs["teamUid"] = state ? state.teamUid : undefined;
}
else {
const args = argsOrState;
if ((!args || args.teamId === undefined) && !opts.urn) {
throw new Error("Missing required property 'teamId'");
}
resourceInputs["reviewRequestDelegation"] = args ? args.reviewRequestDelegation : undefined;
resourceInputs["teamId"] = args ? args.teamId : undefined;
resourceInputs["teamSlug"] = undefined /*out*/;
resourceInputs["teamUid"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(TeamSettings.__pulumiType, name, resourceInputs, opts);
}
}
exports.TeamSettings = TeamSettings;
/** @internal */
TeamSettings.__pulumiType = 'github:index/teamSettings:TeamSettings';
//# sourceMappingURL=teamSettings.js.map
;