@pulumi/github
Version:
A Pulumi package for creating and managing github cloud resources.
97 lines • 4.52 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.EnterpriseOrganization = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* This resource allows you to create and manage a GitHub enterprise organization.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as github from "@pulumi/github";
*
* const org = new github.EnterpriseOrganization("org", {
* enterpriseId: enterprise.id,
* name: "some-awesome-org",
* displayName: "Some Awesome Org",
* description: "Organization created with terraform",
* billingEmail: "jon@winteriscoming.com",
* adminLogins: ["jon-snow"],
* });
* ```
*
* ## Import
*
* GitHub Enterprise Organization can be imported using the `slug` of the enterprise, combined with the `orgname` of the organization, separated by a `/` character.
*
* ```sh
* $ pulumi import github:index/enterpriseOrganization:EnterpriseOrganization org enterp/some-awesome-org
* ```
*/
class EnterpriseOrganization extends pulumi.CustomResource {
/**
* Get an existing EnterpriseOrganization 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 EnterpriseOrganization(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of EnterpriseOrganization. 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'] === EnterpriseOrganization.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["adminLogins"] = state ? state.adminLogins : undefined;
resourceInputs["billingEmail"] = state ? state.billingEmail : undefined;
resourceInputs["databaseId"] = state ? state.databaseId : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["displayName"] = state ? state.displayName : undefined;
resourceInputs["enterpriseId"] = state ? state.enterpriseId : undefined;
resourceInputs["name"] = state ? state.name : undefined;
}
else {
const args = argsOrState;
if ((!args || args.adminLogins === undefined) && !opts.urn) {
throw new Error("Missing required property 'adminLogins'");
}
if ((!args || args.billingEmail === undefined) && !opts.urn) {
throw new Error("Missing required property 'billingEmail'");
}
if ((!args || args.enterpriseId === undefined) && !opts.urn) {
throw new Error("Missing required property 'enterpriseId'");
}
resourceInputs["adminLogins"] = args ? args.adminLogins : undefined;
resourceInputs["billingEmail"] = args ? args.billingEmail : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["displayName"] = args ? args.displayName : undefined;
resourceInputs["enterpriseId"] = args ? args.enterpriseId : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["databaseId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(EnterpriseOrganization.__pulumiType, name, resourceInputs, opts);
}
}
exports.EnterpriseOrganization = EnterpriseOrganization;
/** @internal */
EnterpriseOrganization.__pulumiType = 'github:index/enterpriseOrganization:EnterpriseOrganization';
//# sourceMappingURL=enterpriseOrganization.js.map
;