UNPKG

@pulumi/azuredevops

Version:

A Pulumi package for creating and managing Azure DevOps.

312 lines (311 loc) 14 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * Manages a Webhook TFS Service Hook that sends HTTP POST requests to a specified URL when Azure DevOps events occur. * * ## Example Usage * * ### Git Push Event * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azuredevops from "@pulumi/azuredevops"; * * const example = new azuredevops.Project("example", {name: "example-project"}); * const exampleServicehookWebhookTfs = new azuredevops.ServicehookWebhookTfs("example", { * projectId: example.id, * url: "https://example.com/webhook", * gitPush: { * branch: "refs/heads/main", * repositoryId: exampleAzuredevopsGitRepository.id, * }, * }); * ``` * * ### Build Completed Event with Authentication * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azuredevops from "@pulumi/azuredevops"; * * const example = new azuredevops.ServicehookWebhookTfs("example", { * projectId: exampleAzuredevopsProject.id, * url: "https://example.com/webhook", * basicAuthUsername: "webhook_user", * basicAuthPassword: webhookPassword, * acceptUntrustedCerts: false, * buildCompleted: { * definitionName: "CI Build", * buildStatus: "Succeeded", * }, * }); * ``` * * ### Pull Request Created Event with HTTP Headers * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azuredevops from "@pulumi/azuredevops"; * * const example = new azuredevops.ServicehookWebhookTfs("example", { * projectId: exampleAzuredevopsProject.id, * url: "https://example.com/webhook", * httpHeaders: { * "X-Custom-Header": "my-value", * Authorization: `Bearer ${apiToken}`, * }, * gitPullRequestCreated: { * repositoryId: exampleAzuredevopsGitRepository.id, * branch: "refs/heads/develop", * }, * }); * ``` * * ### Work Item Updated Event * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azuredevops from "@pulumi/azuredevops"; * * const example = new azuredevops.ServicehookWebhookTfs("example", { * projectId: exampleAzuredevopsProject.id, * url: "https://example.com/webhook", * resourceDetailsToSend: "all", * messagesToSend: "text", * detailedMessagesToSend: "markdown", * workItemUpdated: { * workItemType: "Bug", * areaPath: "MyProject\\Area", * changedFields: "System.State", * }, * }); * ``` * * An empty configuration block will trigger on all events of that type: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azuredevops from "@pulumi/azuredevops"; * * const example = new azuredevops.ServicehookWebhookTfs("example", { * projectId: exampleAzuredevopsProject.id, * url: "https://example.com/webhook", * gitPush: {}, * }); * ``` * * ## Import * * Webhook TFS Service Hook can be imported using the `resource id`, e.g. * * ```sh * $ pulumi import azuredevops:index/servicehookWebhookTfs:ServicehookWebhookTfs example 00000000-0000-0000-0000-000000000000 * ``` */ export declare class ServicehookWebhookTfs extends pulumi.CustomResource { /** * Get an existing ServicehookWebhookTfs 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?: ServicehookWebhookTfsState, opts?: pulumi.CustomResourceOptions): ServicehookWebhookTfs; /** * Returns true if the given object is an instance of ServicehookWebhookTfs. 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 ServicehookWebhookTfs; /** * Accept untrusted SSL certificates. Defaults to `false`. */ readonly acceptUntrustedCerts: pulumi.Output<boolean | undefined>; /** * Basic authentication password. */ readonly basicAuthPassword: pulumi.Output<string | undefined>; /** * Basic authentication username. */ readonly basicAuthUsername: pulumi.Output<string | undefined>; readonly buildCompleted: pulumi.Output<outputs.ServicehookWebhookTfsBuildCompleted | undefined>; /** * Detailed messages to send - `all`, `text`, `html`, `markdown`, or `none`. Defaults to `all`. */ readonly detailedMessagesToSend: pulumi.Output<string | undefined>; readonly gitPullRequestCommented: pulumi.Output<outputs.ServicehookWebhookTfsGitPullRequestCommented | undefined>; readonly gitPullRequestCreated: pulumi.Output<outputs.ServicehookWebhookTfsGitPullRequestCreated | undefined>; readonly gitPullRequestMergeAttempted: pulumi.Output<outputs.ServicehookWebhookTfsGitPullRequestMergeAttempted | undefined>; readonly gitPullRequestUpdated: pulumi.Output<outputs.ServicehookWebhookTfsGitPullRequestUpdated | undefined>; readonly gitPush: pulumi.Output<outputs.ServicehookWebhookTfsGitPush | undefined>; /** * HTTP headers as key-value pairs to include in the webhook request. */ readonly httpHeaders: pulumi.Output<{ [key: string]: string; } | undefined>; /** * Messages to send - `all`, `text`, `html`, `markdown`, or `none`. Defaults to `all`. */ readonly messagesToSend: pulumi.Output<string | undefined>; /** * The ID of the project. Changing this forces a new Service Hook Webhook TFS to be created. */ readonly projectId: pulumi.Output<string>; readonly repositoryCreated: pulumi.Output<outputs.ServicehookWebhookTfsRepositoryCreated | undefined>; readonly repositoryDeleted: pulumi.Output<outputs.ServicehookWebhookTfsRepositoryDeleted | undefined>; readonly repositoryForked: pulumi.Output<outputs.ServicehookWebhookTfsRepositoryForked | undefined>; readonly repositoryRenamed: pulumi.Output<outputs.ServicehookWebhookTfsRepositoryRenamed | undefined>; readonly repositoryStatusChanged: pulumi.Output<outputs.ServicehookWebhookTfsRepositoryStatusChanged | undefined>; /** * Resource details to send - `all`, `minimal`, or `none`. Defaults to `all`. */ readonly resourceDetailsToSend: pulumi.Output<string | undefined>; readonly serviceConnectionCreated: pulumi.Output<outputs.ServicehookWebhookTfsServiceConnectionCreated | undefined>; readonly serviceConnectionUpdated: pulumi.Output<outputs.ServicehookWebhookTfsServiceConnectionUpdated | undefined>; readonly tfvcCheckin: pulumi.Output<outputs.ServicehookWebhookTfsTfvcCheckin | undefined>; /** * The URL to send HTTP POST to. */ readonly url: pulumi.Output<string>; readonly workItemCommented: pulumi.Output<outputs.ServicehookWebhookTfsWorkItemCommented | undefined>; readonly workItemCreated: pulumi.Output<outputs.ServicehookWebhookTfsWorkItemCreated | undefined>; readonly workItemDeleted: pulumi.Output<outputs.ServicehookWebhookTfsWorkItemDeleted | undefined>; readonly workItemRestored: pulumi.Output<outputs.ServicehookWebhookTfsWorkItemRestored | undefined>; readonly workItemUpdated: pulumi.Output<outputs.ServicehookWebhookTfsWorkItemUpdated | undefined>; /** * Create a ServicehookWebhookTfs 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: ServicehookWebhookTfsArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering ServicehookWebhookTfs resources. */ export interface ServicehookWebhookTfsState { /** * Accept untrusted SSL certificates. Defaults to `false`. */ acceptUntrustedCerts?: pulumi.Input<boolean>; /** * Basic authentication password. */ basicAuthPassword?: pulumi.Input<string>; /** * Basic authentication username. */ basicAuthUsername?: pulumi.Input<string>; buildCompleted?: pulumi.Input<inputs.ServicehookWebhookTfsBuildCompleted>; /** * Detailed messages to send - `all`, `text`, `html`, `markdown`, or `none`. Defaults to `all`. */ detailedMessagesToSend?: pulumi.Input<string>; gitPullRequestCommented?: pulumi.Input<inputs.ServicehookWebhookTfsGitPullRequestCommented>; gitPullRequestCreated?: pulumi.Input<inputs.ServicehookWebhookTfsGitPullRequestCreated>; gitPullRequestMergeAttempted?: pulumi.Input<inputs.ServicehookWebhookTfsGitPullRequestMergeAttempted>; gitPullRequestUpdated?: pulumi.Input<inputs.ServicehookWebhookTfsGitPullRequestUpdated>; gitPush?: pulumi.Input<inputs.ServicehookWebhookTfsGitPush>; /** * HTTP headers as key-value pairs to include in the webhook request. */ httpHeaders?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * Messages to send - `all`, `text`, `html`, `markdown`, or `none`. Defaults to `all`. */ messagesToSend?: pulumi.Input<string>; /** * The ID of the project. Changing this forces a new Service Hook Webhook TFS to be created. */ projectId?: pulumi.Input<string>; repositoryCreated?: pulumi.Input<inputs.ServicehookWebhookTfsRepositoryCreated>; repositoryDeleted?: pulumi.Input<inputs.ServicehookWebhookTfsRepositoryDeleted>; repositoryForked?: pulumi.Input<inputs.ServicehookWebhookTfsRepositoryForked>; repositoryRenamed?: pulumi.Input<inputs.ServicehookWebhookTfsRepositoryRenamed>; repositoryStatusChanged?: pulumi.Input<inputs.ServicehookWebhookTfsRepositoryStatusChanged>; /** * Resource details to send - `all`, `minimal`, or `none`. Defaults to `all`. */ resourceDetailsToSend?: pulumi.Input<string>; serviceConnectionCreated?: pulumi.Input<inputs.ServicehookWebhookTfsServiceConnectionCreated>; serviceConnectionUpdated?: pulumi.Input<inputs.ServicehookWebhookTfsServiceConnectionUpdated>; tfvcCheckin?: pulumi.Input<inputs.ServicehookWebhookTfsTfvcCheckin>; /** * The URL to send HTTP POST to. */ url?: pulumi.Input<string>; workItemCommented?: pulumi.Input<inputs.ServicehookWebhookTfsWorkItemCommented>; workItemCreated?: pulumi.Input<inputs.ServicehookWebhookTfsWorkItemCreated>; workItemDeleted?: pulumi.Input<inputs.ServicehookWebhookTfsWorkItemDeleted>; workItemRestored?: pulumi.Input<inputs.ServicehookWebhookTfsWorkItemRestored>; workItemUpdated?: pulumi.Input<inputs.ServicehookWebhookTfsWorkItemUpdated>; } /** * The set of arguments for constructing a ServicehookWebhookTfs resource. */ export interface ServicehookWebhookTfsArgs { /** * Accept untrusted SSL certificates. Defaults to `false`. */ acceptUntrustedCerts?: pulumi.Input<boolean>; /** * Basic authentication password. */ basicAuthPassword?: pulumi.Input<string>; /** * Basic authentication username. */ basicAuthUsername?: pulumi.Input<string>; buildCompleted?: pulumi.Input<inputs.ServicehookWebhookTfsBuildCompleted>; /** * Detailed messages to send - `all`, `text`, `html`, `markdown`, or `none`. Defaults to `all`. */ detailedMessagesToSend?: pulumi.Input<string>; gitPullRequestCommented?: pulumi.Input<inputs.ServicehookWebhookTfsGitPullRequestCommented>; gitPullRequestCreated?: pulumi.Input<inputs.ServicehookWebhookTfsGitPullRequestCreated>; gitPullRequestMergeAttempted?: pulumi.Input<inputs.ServicehookWebhookTfsGitPullRequestMergeAttempted>; gitPullRequestUpdated?: pulumi.Input<inputs.ServicehookWebhookTfsGitPullRequestUpdated>; gitPush?: pulumi.Input<inputs.ServicehookWebhookTfsGitPush>; /** * HTTP headers as key-value pairs to include in the webhook request. */ httpHeaders?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * Messages to send - `all`, `text`, `html`, `markdown`, or `none`. Defaults to `all`. */ messagesToSend?: pulumi.Input<string>; /** * The ID of the project. Changing this forces a new Service Hook Webhook TFS to be created. */ projectId: pulumi.Input<string>; repositoryCreated?: pulumi.Input<inputs.ServicehookWebhookTfsRepositoryCreated>; repositoryDeleted?: pulumi.Input<inputs.ServicehookWebhookTfsRepositoryDeleted>; repositoryForked?: pulumi.Input<inputs.ServicehookWebhookTfsRepositoryForked>; repositoryRenamed?: pulumi.Input<inputs.ServicehookWebhookTfsRepositoryRenamed>; repositoryStatusChanged?: pulumi.Input<inputs.ServicehookWebhookTfsRepositoryStatusChanged>; /** * Resource details to send - `all`, `minimal`, or `none`. Defaults to `all`. */ resourceDetailsToSend?: pulumi.Input<string>; serviceConnectionCreated?: pulumi.Input<inputs.ServicehookWebhookTfsServiceConnectionCreated>; serviceConnectionUpdated?: pulumi.Input<inputs.ServicehookWebhookTfsServiceConnectionUpdated>; tfvcCheckin?: pulumi.Input<inputs.ServicehookWebhookTfsTfvcCheckin>; /** * The URL to send HTTP POST to. */ url: pulumi.Input<string>; workItemCommented?: pulumi.Input<inputs.ServicehookWebhookTfsWorkItemCommented>; workItemCreated?: pulumi.Input<inputs.ServicehookWebhookTfsWorkItemCreated>; workItemDeleted?: pulumi.Input<inputs.ServicehookWebhookTfsWorkItemDeleted>; workItemRestored?: pulumi.Input<inputs.ServicehookWebhookTfsWorkItemRestored>; workItemUpdated?: pulumi.Input<inputs.ServicehookWebhookTfsWorkItemUpdated>; }