@pulumi/github
Version:
A Pulumi package for creating and managing github cloud resources.
93 lines • 3.94 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.RepositoryDeploymentBranchPolicy = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* This resource allows you to create and manage deployment branch policies.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as github from "@pulumi/github";
*
* const env = new github.RepositoryEnvironment("env", {
* repository: "my_repo",
* environment: "my_env",
* deploymentBranchPolicy: {
* protectedBranches: false,
* customBranchPolicies: true,
* },
* });
* const foo = new github.RepositoryDeploymentBranchPolicy("foo", {
* repository: "my_repo",
* environmentName: "my_env",
* name: "foo",
* }, {
* dependsOn: [env],
* });
* ```
*
* ## Import
*
* ```sh
* $ pulumi import github:index/repositoryDeploymentBranchPolicy:RepositoryDeploymentBranchPolicy foo repo:env:id
* ```
*/
class RepositoryDeploymentBranchPolicy extends pulumi.CustomResource {
/**
* Get an existing RepositoryDeploymentBranchPolicy 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 RepositoryDeploymentBranchPolicy(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of RepositoryDeploymentBranchPolicy. 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'] === RepositoryDeploymentBranchPolicy.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["environmentName"] = state ? state.environmentName : undefined;
resourceInputs["etag"] = state ? state.etag : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["repository"] = state ? state.repository : undefined;
}
else {
const args = argsOrState;
if ((!args || args.environmentName === undefined) && !opts.urn) {
throw new Error("Missing required property 'environmentName'");
}
if ((!args || args.repository === undefined) && !opts.urn) {
throw new Error("Missing required property 'repository'");
}
resourceInputs["environmentName"] = args ? args.environmentName : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["repository"] = args ? args.repository : undefined;
resourceInputs["etag"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(RepositoryDeploymentBranchPolicy.__pulumiType, name, resourceInputs, opts);
}
}
exports.RepositoryDeploymentBranchPolicy = RepositoryDeploymentBranchPolicy;
/** @internal */
RepositoryDeploymentBranchPolicy.__pulumiType = 'github:index/repositoryDeploymentBranchPolicy:RepositoryDeploymentBranchPolicy';
//# sourceMappingURL=repositoryDeploymentBranchPolicy.js.map
;