@pulumi/github
Version:
A Pulumi package for creating and managing github cloud resources.
85 lines • 3.63 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.ActionsRepositoryAccessLevel = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* This resource allows you to set the access level of a non-public repositories actions and reusable workflows for use in other repositories.
* You must have admin access to a repository to use this resource.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as github from "@pulumi/github";
*
* const example = new github.Repository("example", {
* name: "my-repository",
* visibility: "private",
* });
* const test = new github.ActionsRepositoryAccessLevel("test", {
* accessLevel: "user",
* repository: example.name,
* });
* ```
*
* ## Import
*
* This resource can be imported using the name of the GitHub repository:
*
* ```sh
* $ pulumi import github:index/actionsRepositoryAccessLevel:ActionsRepositoryAccessLevel test my-repository
* ```
*/
class ActionsRepositoryAccessLevel extends pulumi.CustomResource {
/**
* Get an existing ActionsRepositoryAccessLevel 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 ActionsRepositoryAccessLevel(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ActionsRepositoryAccessLevel. 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'] === ActionsRepositoryAccessLevel.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["accessLevel"] = state ? state.accessLevel : undefined;
resourceInputs["repository"] = state ? state.repository : undefined;
}
else {
const args = argsOrState;
if ((!args || args.accessLevel === undefined) && !opts.urn) {
throw new Error("Missing required property 'accessLevel'");
}
if ((!args || args.repository === undefined) && !opts.urn) {
throw new Error("Missing required property 'repository'");
}
resourceInputs["accessLevel"] = args ? args.accessLevel : undefined;
resourceInputs["repository"] = args ? args.repository : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ActionsRepositoryAccessLevel.__pulumiType, name, resourceInputs, opts);
}
}
exports.ActionsRepositoryAccessLevel = ActionsRepositoryAccessLevel;
/** @internal */
ActionsRepositoryAccessLevel.__pulumiType = 'github:index/actionsRepositoryAccessLevel:ActionsRepositoryAccessLevel';
//# sourceMappingURL=actionsRepositoryAccessLevel.js.map
;