@pulumi/azuredevops
Version:
A Pulumi package for creating and managing Azure DevOps.
138 lines (137 loc) • 5.56 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
/**
* Manages required reviewer policy branch policy within Azure DevOps.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azuredevops from "@pulumi/azuredevops";
*
* const example = new azuredevops.Project("example", {name: "Example Project"});
* const exampleGit = new azuredevops.Git("example", {
* projectId: example.id,
* name: "Example Repository",
* initialization: {
* initType: "Clean",
* },
* });
* const exampleUser = new azuredevops.User("example", {
* principalName: "mail@email.com",
* accountLicenseType: "basic",
* });
* const exampleBranchPolicyAutoReviewers = new azuredevops.BranchPolicyAutoReviewers("example", {
* projectId: example.id,
* enabled: true,
* blocking: true,
* settings: {
* autoReviewerIds: [exampleUser.id],
* submitterCanVote: false,
* message: "Auto reviewer",
* pathFilters: ["*/src/*.ts"],
* scopes: [{
* repositoryId: exampleGit.id,
* repositoryRef: exampleGit.defaultBranch,
* matchType: "Exact",
* }],
* },
* });
* ```
*
* ## Relevant Links
*
* - [Azure DevOps Service REST API 7.0 - Policy Configurations](https://docs.microsoft.com/en-us/rest/api/azure/devops/policy/configurations/create?view=azure-devops-rest-7.0)
*
* ## Import
*
* Azure DevOps Branch Policies can be imported using the project ID and policy configuration ID:
*
* ```sh
* $ pulumi import azuredevops:index/branchPolicyAutoReviewers:BranchPolicyAutoReviewers example 00000000-0000-0000-0000-000000000000/0
* ```
*/
export declare class BranchPolicyAutoReviewers extends pulumi.CustomResource {
/**
* Get an existing BranchPolicyAutoReviewers 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: string, id: pulumi.Input<pulumi.ID>, state?: BranchPolicyAutoReviewersState, opts?: pulumi.CustomResourceOptions): BranchPolicyAutoReviewers;
/**
* Returns true if the given object is an instance of BranchPolicyAutoReviewers. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is BranchPolicyAutoReviewers;
/**
* A flag indicating if the policy should be blocking. This relates to the Azure DevOps terms "optional" and "required" reviewers. Defaults to `true`.
*/
readonly blocking: pulumi.Output<boolean | undefined>;
/**
* A flag indicating if the policy should be enabled. Defaults to `true`.
*/
readonly enabled: pulumi.Output<boolean | undefined>;
/**
* The ID of the project in which the policy will be created.
*/
readonly projectId: pulumi.Output<string>;
/**
* A `settings` block as defined below. Configuration for the policy. This block must be defined exactly once.
*/
readonly settings: pulumi.Output<outputs.BranchPolicyAutoReviewersSettings>;
/**
* Create a BranchPolicyAutoReviewers resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: BranchPolicyAutoReviewersArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering BranchPolicyAutoReviewers resources.
*/
export interface BranchPolicyAutoReviewersState {
/**
* A flag indicating if the policy should be blocking. This relates to the Azure DevOps terms "optional" and "required" reviewers. Defaults to `true`.
*/
blocking?: pulumi.Input<boolean>;
/**
* A flag indicating if the policy should be enabled. Defaults to `true`.
*/
enabled?: pulumi.Input<boolean>;
/**
* The ID of the project in which the policy will be created.
*/
projectId?: pulumi.Input<string>;
/**
* A `settings` block as defined below. Configuration for the policy. This block must be defined exactly once.
*/
settings?: pulumi.Input<inputs.BranchPolicyAutoReviewersSettings>;
}
/**
* The set of arguments for constructing a BranchPolicyAutoReviewers resource.
*/
export interface BranchPolicyAutoReviewersArgs {
/**
* A flag indicating if the policy should be blocking. This relates to the Azure DevOps terms "optional" and "required" reviewers. Defaults to `true`.
*/
blocking?: pulumi.Input<boolean>;
/**
* A flag indicating if the policy should be enabled. Defaults to `true`.
*/
enabled?: pulumi.Input<boolean>;
/**
* The ID of the project in which the policy will be created.
*/
projectId: pulumi.Input<string>;
/**
* A `settings` block as defined below. Configuration for the policy. This block must be defined exactly once.
*/
settings: pulumi.Input<inputs.BranchPolicyAutoReviewersSettings>;
}