com.pulumi.gitlab.kotlin.ProjectHookArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-gitlab-kotlin Show documentation
Show all versions of pulumi-gitlab-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.gitlab.kotlin
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gitlab.ProjectHookArgs.builder
import com.pulumi.gitlab.kotlin.inputs.ProjectHookCustomHeaderArgs
import com.pulumi.gitlab.kotlin.inputs.ProjectHookCustomHeaderArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName
/**
* The `gitlab.ProjectHook` resource allows to manage the lifecycle of a project hook.
* **Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/ee/api/projects.html#hooks)
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gitlab from "@pulumi/gitlab";
* const example = new gitlab.ProjectHook("example", {
* project: "example/hooked",
* url: "https://example.com/hook/example",
* mergeRequestsEvents: true,
* });
* // Using Custom Headers
* // Values of headers can't be imported
* const customHeaders = new gitlab.ProjectHook("custom_headers", {
* project: "example/hooked",
* url: "https://example.com/hook/example",
* mergeRequestsEvents: true,
* customHeaders: [
* {
* key: "X-Custom-Header",
* value: "example",
* },
* {
* key: "X-Custom-Header-Second",
* value: "example-second",
* },
* ],
* });
* ```
* ```python
* import pulumi
* import pulumi_gitlab as gitlab
* example = gitlab.ProjectHook("example",
* project="example/hooked",
* url="https://example.com/hook/example",
* merge_requests_events=True)
* # Using Custom Headers
* # Values of headers can't be imported
* custom_headers = gitlab.ProjectHook("custom_headers",
* project="example/hooked",
* url="https://example.com/hook/example",
* merge_requests_events=True,
* custom_headers=[
* {
* "key": "X-Custom-Header",
* "value": "example",
* },
* {
* "key": "X-Custom-Header-Second",
* "value": "example-second",
* },
* ])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using GitLab = Pulumi.GitLab;
* return await Deployment.RunAsync(() =>
* {
* var example = new GitLab.ProjectHook("example", new()
* {
* Project = "example/hooked",
* Url = "https://example.com/hook/example",
* MergeRequestsEvents = true,
* });
* // Using Custom Headers
* // Values of headers can't be imported
* var customHeaders = new GitLab.ProjectHook("custom_headers", new()
* {
* Project = "example/hooked",
* Url = "https://example.com/hook/example",
* MergeRequestsEvents = true,
* CustomHeaders = new[]
* {
* new GitLab.Inputs.ProjectHookCustomHeaderArgs
* {
* Key = "X-Custom-Header",
* Value = "example",
* },
* new GitLab.Inputs.ProjectHookCustomHeaderArgs
* {
* Key = "X-Custom-Header-Second",
* Value = "example-second",
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gitlab/sdk/v8/go/gitlab"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := gitlab.NewProjectHook(ctx, "example", &gitlab.ProjectHookArgs{
* Project: pulumi.String("example/hooked"),
* Url: pulumi.String("https://example.com/hook/example"),
* MergeRequestsEvents: pulumi.Bool(true),
* })
* if err != nil {
* return err
* }
* // Using Custom Headers
* // Values of headers can't be imported
* _, err = gitlab.NewProjectHook(ctx, "custom_headers", &gitlab.ProjectHookArgs{
* Project: pulumi.String("example/hooked"),
* Url: pulumi.String("https://example.com/hook/example"),
* MergeRequestsEvents: pulumi.Bool(true),
* CustomHeaders: gitlab.ProjectHookCustomHeaderArray{
* &gitlab.ProjectHookCustomHeaderArgs{
* Key: pulumi.String("X-Custom-Header"),
* Value: pulumi.String("example"),
* },
* &gitlab.ProjectHookCustomHeaderArgs{
* Key: pulumi.String("X-Custom-Header-Second"),
* Value: pulumi.String("example-second"),
* },
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gitlab.ProjectHook;
* import com.pulumi.gitlab.ProjectHookArgs;
* import com.pulumi.gitlab.inputs.ProjectHookCustomHeaderArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var example = new ProjectHook("example", ProjectHookArgs.builder()
* .project("example/hooked")
* .url("https://example.com/hook/example")
* .mergeRequestsEvents(true)
* .build());
* // Using Custom Headers
* // Values of headers can't be imported
* var customHeaders = new ProjectHook("customHeaders", ProjectHookArgs.builder()
* .project("example/hooked")
* .url("https://example.com/hook/example")
* .mergeRequestsEvents(true)
* .customHeaders(
* ProjectHookCustomHeaderArgs.builder()
* .key("X-Custom-Header")
* .value("example")
* .build(),
* ProjectHookCustomHeaderArgs.builder()
* .key("X-Custom-Header-Second")
* .value("example-second")
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: gitlab:ProjectHook
* properties:
* project: example/hooked
* url: https://example.com/hook/example
* mergeRequestsEvents: true
* # Using Custom Headers
* # Values of headers can't be imported
* customHeaders:
* type: gitlab:ProjectHook
* name: custom_headers
* properties:
* project: example/hooked
* url: https://example.com/hook/example
* mergeRequestsEvents: true
* customHeaders:
* - key: X-Custom-Header
* value: example
* - key: X-Custom-Header-Second
* value: example-second
* ```
*
* ## Import
* Starting in Terraform v1.5.0 you can use an import block to import `gitlab_project_hook`. For example:
* terraform
* import {
* to = gitlab_project_hook.example
* id = "see CLI command below for ID"
* }
* Import using the CLI is supported using the following syntax:
* A GitLab Project Hook can be imported using a key composed of `:`, e.g.
* ```sh
* $ pulumi import gitlab:index/projectHook:ProjectHook example "12345:1"
* ```
* NOTE: the `token` resource attribute is not available for imported resources as this information cannot be read from the GitLab API.
* @property confidentialIssuesEvents Invoke the hook for confidential issues events.
* @property confidentialNoteEvents Invoke the hook for confidential note events.
* @property customHeaders Custom headers for the project webhook.
* @property customWebhookTemplate Custom webhook template.
* @property deploymentEvents Invoke the hook for deployment events.
* @property enableSslVerification Enable SSL verification when invoking the hook.
* @property issuesEvents Invoke the hook for issues events.
* @property jobEvents Invoke the hook for job events.
* @property mergeRequestsEvents Invoke the hook for merge requests events.
* @property noteEvents Invoke the hook for note events.
* @property pipelineEvents Invoke the hook for pipeline events.
* @property project The name or id of the project to add the hook to.
* @property pushEvents Invoke the hook for push events.
* @property pushEventsBranchFilter Invoke the hook for push events on matching branches only.
* @property releasesEvents Invoke the hook for release events.
* @property tagPushEvents Invoke the hook for tag push events.
* @property token A token to present when invoking the hook. The token is not available for imported resources.
* @property url The url of the hook to invoke. Forces re-creation to preserve `token`.
* @property wikiPageEvents Invoke the hook for wiki page events.
*/
public data class ProjectHookArgs(
public val confidentialIssuesEvents: Output? = null,
public val confidentialNoteEvents: Output? = null,
public val customHeaders: Output>? = null,
public val customWebhookTemplate: Output? = null,
public val deploymentEvents: Output? = null,
public val enableSslVerification: Output? = null,
public val issuesEvents: Output? = null,
public val jobEvents: Output? = null,
public val mergeRequestsEvents: Output? = null,
public val noteEvents: Output? = null,
public val pipelineEvents: Output? = null,
public val project: Output? = null,
public val pushEvents: Output? = null,
public val pushEventsBranchFilter: Output? = null,
public val releasesEvents: Output? = null,
public val tagPushEvents: Output? = null,
public val token: Output? = null,
public val url: Output? = null,
public val wikiPageEvents: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.gitlab.ProjectHookArgs =
com.pulumi.gitlab.ProjectHookArgs.builder()
.confidentialIssuesEvents(confidentialIssuesEvents?.applyValue({ args0 -> args0 }))
.confidentialNoteEvents(confidentialNoteEvents?.applyValue({ args0 -> args0 }))
.customHeaders(
customHeaders?.applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
})
}),
)
.customWebhookTemplate(customWebhookTemplate?.applyValue({ args0 -> args0 }))
.deploymentEvents(deploymentEvents?.applyValue({ args0 -> args0 }))
.enableSslVerification(enableSslVerification?.applyValue({ args0 -> args0 }))
.issuesEvents(issuesEvents?.applyValue({ args0 -> args0 }))
.jobEvents(jobEvents?.applyValue({ args0 -> args0 }))
.mergeRequestsEvents(mergeRequestsEvents?.applyValue({ args0 -> args0 }))
.noteEvents(noteEvents?.applyValue({ args0 -> args0 }))
.pipelineEvents(pipelineEvents?.applyValue({ args0 -> args0 }))
.project(project?.applyValue({ args0 -> args0 }))
.pushEvents(pushEvents?.applyValue({ args0 -> args0 }))
.pushEventsBranchFilter(pushEventsBranchFilter?.applyValue({ args0 -> args0 }))
.releasesEvents(releasesEvents?.applyValue({ args0 -> args0 }))
.tagPushEvents(tagPushEvents?.applyValue({ args0 -> args0 }))
.token(token?.applyValue({ args0 -> args0 }))
.url(url?.applyValue({ args0 -> args0 }))
.wikiPageEvents(wikiPageEvents?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [ProjectHookArgs].
*/
@PulumiTagMarker
public class ProjectHookArgsBuilder internal constructor() {
private var confidentialIssuesEvents: Output? = null
private var confidentialNoteEvents: Output? = null
private var customHeaders: Output>? = null
private var customWebhookTemplate: Output? = null
private var deploymentEvents: Output? = null
private var enableSslVerification: Output? = null
private var issuesEvents: Output? = null
private var jobEvents: Output? = null
private var mergeRequestsEvents: Output? = null
private var noteEvents: Output? = null
private var pipelineEvents: Output? = null
private var project: Output? = null
private var pushEvents: Output? = null
private var pushEventsBranchFilter: Output? = null
private var releasesEvents: Output? = null
private var tagPushEvents: Output? = null
private var token: Output? = null
private var url: Output? = null
private var wikiPageEvents: Output? = null
/**
* @param value Invoke the hook for confidential issues events.
*/
@JvmName("wwnkwjbegypprrqj")
public suspend fun confidentialIssuesEvents(`value`: Output) {
this.confidentialIssuesEvents = value
}
/**
* @param value Invoke the hook for confidential note events.
*/
@JvmName("hkkqlobyqegdnqjp")
public suspend fun confidentialNoteEvents(`value`: Output) {
this.confidentialNoteEvents = value
}
/**
* @param value Custom headers for the project webhook.
*/
@JvmName("wrbrhngcpkjrfmva")
public suspend fun customHeaders(`value`: Output>) {
this.customHeaders = value
}
@JvmName("xjqpoeumrsdsglst")
public suspend fun customHeaders(vararg values: Output) {
this.customHeaders = Output.all(values.asList())
}
/**
* @param values Custom headers for the project webhook.
*/
@JvmName("uwsmmujkjeblpfbb")
public suspend fun customHeaders(values: List
© 2015 - 2024 Weber Informatics LLC | Privacy Policy