@pulumi/github
Version:
A Pulumi package for creating and managing github cloud resources.
98 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.RepositoryCustomProperty = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* This resource allows you to create and manage a specific custom property for a GitHub repository.
*
* ## Example Usage
*
* > Note that this assumes there already is a custom property defined on the org level called `my-cool-property` of type `string`
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as github from "@pulumi/github";
*
* const example = new github.Repository("example", {
* name: "example",
* description: "My awesome codebase",
* });
* const string = new github.RepositoryCustomProperty("string", {
* repository: example.name,
* propertyName: "my-cool-property",
* propertyType: "string",
* propertyValues: ["test"],
* });
* ```
*
* ## Import
*
* GitHub Repository Custom Property can be imported using an ID made up of a comibnation of the names of the organization, repository, custom property separated by a `:` character, e.g.
*
* ```sh
* $ pulumi import github:index/repositoryCustomProperty:RepositoryCustomProperty example <organization-name>:<repo-name>:<custom-property-name>
* ```
*/
class RepositoryCustomProperty extends pulumi.CustomResource {
/**
* Get an existing RepositoryCustomProperty 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 RepositoryCustomProperty(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of RepositoryCustomProperty. 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'] === RepositoryCustomProperty.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["propertyName"] = state ? state.propertyName : undefined;
resourceInputs["propertyType"] = state ? state.propertyType : undefined;
resourceInputs["propertyValues"] = state ? state.propertyValues : undefined;
resourceInputs["repository"] = state ? state.repository : undefined;
}
else {
const args = argsOrState;
if ((!args || args.propertyName === undefined) && !opts.urn) {
throw new Error("Missing required property 'propertyName'");
}
if ((!args || args.propertyType === undefined) && !opts.urn) {
throw new Error("Missing required property 'propertyType'");
}
if ((!args || args.propertyValues === undefined) && !opts.urn) {
throw new Error("Missing required property 'propertyValues'");
}
if ((!args || args.repository === undefined) && !opts.urn) {
throw new Error("Missing required property 'repository'");
}
resourceInputs["propertyName"] = args ? args.propertyName : undefined;
resourceInputs["propertyType"] = args ? args.propertyType : undefined;
resourceInputs["propertyValues"] = args ? args.propertyValues : undefined;
resourceInputs["repository"] = args ? args.repository : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(RepositoryCustomProperty.__pulumiType, name, resourceInputs, opts);
}
}
exports.RepositoryCustomProperty = RepositoryCustomProperty;
/** @internal */
RepositoryCustomProperty.__pulumiType = 'github:index/repositoryCustomProperty:RepositoryCustomProperty';
//# sourceMappingURL=repositoryCustomProperty.js.map
;