All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.gitlab.kotlin.IntegrationJiraArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 8.4.2.0
Show newest version
@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.IntegrationJiraArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * The `gitlab.IntegrationJira` resource allows to manage the lifecycle of a project integration with Jira.
 * **Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/ee/api/integrations.html#jira)
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gitlab from "@pulumi/gitlab";
 * const awesomeProject = new gitlab.Project("awesome_project", {
 *     name: "awesome_project",
 *     description: "My awesome project.",
 *     visibilityLevel: "public",
 * });
 * const jira = new gitlab.IntegrationJira("jira", {
 *     project: awesomeProject.id,
 *     url: "https://jira.example.com",
 *     username: "user",
 *     password: "mypass",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gitlab as gitlab
 * awesome_project = gitlab.Project("awesome_project",
 *     name="awesome_project",
 *     description="My awesome project.",
 *     visibility_level="public")
 * jira = gitlab.IntegrationJira("jira",
 *     project=awesome_project.id,
 *     url="https://jira.example.com",
 *     username="user",
 *     password="mypass")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using GitLab = Pulumi.GitLab;
 * return await Deployment.RunAsync(() =>
 * {
 *     var awesomeProject = new GitLab.Project("awesome_project", new()
 *     {
 *         Name = "awesome_project",
 *         Description = "My awesome project.",
 *         VisibilityLevel = "public",
 *     });
 *     var jira = new GitLab.IntegrationJira("jira", new()
 *     {
 *         Project = awesomeProject.Id,
 *         Url = "https://jira.example.com",
 *         Username = "user",
 *         Password = "mypass",
 *     });
 * });
 * ```
 * ```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 {
 * 		awesomeProject, err := gitlab.NewProject(ctx, "awesome_project", &gitlab.ProjectArgs{
 * 			Name:            pulumi.String("awesome_project"),
 * 			Description:     pulumi.String("My awesome project."),
 * 			VisibilityLevel: pulumi.String("public"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = gitlab.NewIntegrationJira(ctx, "jira", &gitlab.IntegrationJiraArgs{
 * 			Project:  awesomeProject.ID(),
 * 			Url:      pulumi.String("https://jira.example.com"),
 * 			Username: pulumi.String("user"),
 * 			Password: pulumi.String("mypass"),
 * 		})
 * 		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.Project;
 * import com.pulumi.gitlab.ProjectArgs;
 * import com.pulumi.gitlab.IntegrationJira;
 * import com.pulumi.gitlab.IntegrationJiraArgs;
 * 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 awesomeProject = new Project("awesomeProject", ProjectArgs.builder()
 *             .name("awesome_project")
 *             .description("My awesome project.")
 *             .visibilityLevel("public")
 *             .build());
 *         var jira = new IntegrationJira("jira", IntegrationJiraArgs.builder()
 *             .project(awesomeProject.id())
 *             .url("https://jira.example.com")
 *             .username("user")
 *             .password("mypass")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   awesomeProject:
 *     type: gitlab:Project
 *     name: awesome_project
 *     properties:
 *       name: awesome_project
 *       description: My awesome project.
 *       visibilityLevel: public
 *   jira:
 *     type: gitlab:IntegrationJira
 *     properties:
 *       project: ${awesomeProject.id}
 *       url: https://jira.example.com
 *       username: user
 *       password: mypass
 * ```
 * 
 * ## Import
 * Starting in Terraform v1.5.0 you can use an import block to import `gitlab_integration_jira`. For example:
 * terraform
 * import {
 *   to = gitlab_integration_jira.example
 *   id = "see CLI command below for ID"
 * }
 * Import using the CLI is supported using the following syntax:
 * You can import a gitlab_integration_jira state using the project ID, e.g.
 * ```sh
 * $ pulumi import gitlab:index/integrationJira:IntegrationJira jira 1
 * ```
 * @property apiUrl The base URL to the Jira instance API. Web URL value is used if not set. For example, https://jira-api.example.com.
 * @property commentOnEventEnabled Enable comments inside Jira issues on each GitLab event (commit / merge request)
 * @property commitEvents Enable notifications for commit events
 * @property issuesEnabled Enable viewing Jira issues in GitLab.
 * @property jiraAuthType The authentication method to be used with Jira. 0 means Basic Authentication. 1 means Jira personal access token. Defaults to 0.
 * @property jiraIssuePrefix Prefix to match Jira issue keys.
 * @property jiraIssueRegex Regular expression to match Jira issue keys.
 * @property jiraIssueTransitionAutomatic Enable automatic issue transitions. Takes precedence over jira*issue*transition_id if enabled. Defaults to false.
 * @property jiraIssueTransitionId The ID of a transition that moves issues to a closed state. You can find this number under the JIRA workflow administration (Administration > Issues > Workflows) by selecting View under Operations of the desired workflow of your project. By default, this ID is set to 2. *Note**: importing this field is only supported since GitLab 15.2.
 * @property mergeRequestsEvents Enable notifications for merge request events
 * @property password The Jira API token, password, or personal access token to be used with Jira. When your authentication method is basic (jira*auth*type is 0), use an API token for Jira Cloud or a password for Jira Data Center or Jira Server. When your authentication method is a Jira personal access token (jira*auth*type is 1), use the personal access token.
 * @property project ID of the project you want to activate integration on.
 * @property projectKey The short identifier for your JIRA project, all uppercase, e.g., PROJ.
 * @property projectKeys Keys of Jira projects. When issues_enabled is true, this setting specifies which Jira projects to view issues from in GitLab.
 * @property url The URL to the JIRA project which is being linked to this GitLab project. For example, https://jira.example.com.
 * @property useInheritedSettings Indicates whether or not to inherit default settings. Defaults to false.
 * @property username The email or username to be used with Jira. For Jira Cloud use an email, for Jira Data Center and Jira Server use a username. Required when using Basic authentication (jira*auth*type is 0).
 */
public data class IntegrationJiraArgs(
    public val apiUrl: Output? = null,
    public val commentOnEventEnabled: Output? = null,
    public val commitEvents: Output? = null,
    public val issuesEnabled: Output? = null,
    public val jiraAuthType: Output? = null,
    public val jiraIssuePrefix: Output? = null,
    public val jiraIssueRegex: Output? = null,
    public val jiraIssueTransitionAutomatic: Output? = null,
    public val jiraIssueTransitionId: Output? = null,
    public val mergeRequestsEvents: Output? = null,
    public val password: Output? = null,
    public val project: Output? = null,
    public val projectKey: Output? = null,
    public val projectKeys: Output>? = null,
    public val url: Output? = null,
    public val useInheritedSettings: Output? = null,
    public val username: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gitlab.IntegrationJiraArgs =
        com.pulumi.gitlab.IntegrationJiraArgs.builder()
            .apiUrl(apiUrl?.applyValue({ args0 -> args0 }))
            .commentOnEventEnabled(commentOnEventEnabled?.applyValue({ args0 -> args0 }))
            .commitEvents(commitEvents?.applyValue({ args0 -> args0 }))
            .issuesEnabled(issuesEnabled?.applyValue({ args0 -> args0 }))
            .jiraAuthType(jiraAuthType?.applyValue({ args0 -> args0 }))
            .jiraIssuePrefix(jiraIssuePrefix?.applyValue({ args0 -> args0 }))
            .jiraIssueRegex(jiraIssueRegex?.applyValue({ args0 -> args0 }))
            .jiraIssueTransitionAutomatic(jiraIssueTransitionAutomatic?.applyValue({ args0 -> args0 }))
            .jiraIssueTransitionId(jiraIssueTransitionId?.applyValue({ args0 -> args0 }))
            .mergeRequestsEvents(mergeRequestsEvents?.applyValue({ args0 -> args0 }))
            .password(password?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 }))
            .projectKey(projectKey?.applyValue({ args0 -> args0 }))
            .projectKeys(projectKeys?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .url(url?.applyValue({ args0 -> args0 }))
            .useInheritedSettings(useInheritedSettings?.applyValue({ args0 -> args0 }))
            .username(username?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [IntegrationJiraArgs].
 */
@PulumiTagMarker
public class IntegrationJiraArgsBuilder internal constructor() {
    private var apiUrl: Output? = null

    private var commentOnEventEnabled: Output? = null

    private var commitEvents: Output? = null

    private var issuesEnabled: Output? = null

    private var jiraAuthType: Output? = null

    private var jiraIssuePrefix: Output? = null

    private var jiraIssueRegex: Output? = null

    private var jiraIssueTransitionAutomatic: Output? = null

    private var jiraIssueTransitionId: Output? = null

    private var mergeRequestsEvents: Output? = null

    private var password: Output? = null

    private var project: Output? = null

    private var projectKey: Output? = null

    private var projectKeys: Output>? = null

    private var url: Output? = null

    private var useInheritedSettings: Output? = null

    private var username: Output? = null

    /**
     * @param value The base URL to the Jira instance API. Web URL value is used if not set. For example, https://jira-api.example.com.
     */
    @JvmName("hjldvnejnlgncvkl")
    public suspend fun apiUrl(`value`: Output) {
        this.apiUrl = value
    }

    /**
     * @param value Enable comments inside Jira issues on each GitLab event (commit / merge request)
     */
    @JvmName("qlakadglrnsxjcuc")
    public suspend fun commentOnEventEnabled(`value`: Output) {
        this.commentOnEventEnabled = value
    }

    /**
     * @param value Enable notifications for commit events
     */
    @JvmName("yvhlsklddnsaijfl")
    public suspend fun commitEvents(`value`: Output) {
        this.commitEvents = value
    }

    /**
     * @param value Enable viewing Jira issues in GitLab.
     */
    @JvmName("cpaqagqoofbegxna")
    public suspend fun issuesEnabled(`value`: Output) {
        this.issuesEnabled = value
    }

    /**
     * @param value The authentication method to be used with Jira. 0 means Basic Authentication. 1 means Jira personal access token. Defaults to 0.
     */
    @JvmName("ubtudsajrlryrsgp")
    public suspend fun jiraAuthType(`value`: Output) {
        this.jiraAuthType = value
    }

    /**
     * @param value Prefix to match Jira issue keys.
     */
    @JvmName("eqgfjfmtjvvftlow")
    public suspend fun jiraIssuePrefix(`value`: Output) {
        this.jiraIssuePrefix = value
    }

    /**
     * @param value Regular expression to match Jira issue keys.
     */
    @JvmName("moyogcyrsbhoxlgm")
    public suspend fun jiraIssueRegex(`value`: Output) {
        this.jiraIssueRegex = value
    }

    /**
     * @param value Enable automatic issue transitions. Takes precedence over jira*issue*transition_id if enabled. Defaults to false.
     */
    @JvmName("lcrwbthqnxtruxlu")
    public suspend fun jiraIssueTransitionAutomatic(`value`: Output) {
        this.jiraIssueTransitionAutomatic = value
    }

    /**
     * @param value The ID of a transition that moves issues to a closed state. You can find this number under the JIRA workflow administration (Administration > Issues > Workflows) by selecting View under Operations of the desired workflow of your project. By default, this ID is set to 2. *Note**: importing this field is only supported since GitLab 15.2.
     */
    @JvmName("mkblfaobtfdjdxoi")
    public suspend fun jiraIssueTransitionId(`value`: Output) {
        this.jiraIssueTransitionId = value
    }

    /**
     * @param value Enable notifications for merge request events
     */
    @JvmName("xbveyutwkfgvlhja")
    public suspend fun mergeRequestsEvents(`value`: Output) {
        this.mergeRequestsEvents = value
    }

    /**
     * @param value The Jira API token, password, or personal access token to be used with Jira. When your authentication method is basic (jira*auth*type is 0), use an API token for Jira Cloud or a password for Jira Data Center or Jira Server. When your authentication method is a Jira personal access token (jira*auth*type is 1), use the personal access token.
     */
    @JvmName("jtxfqwswlmhsofbn")
    public suspend fun password(`value`: Output) {
        this.password = value
    }

    /**
     * @param value ID of the project you want to activate integration on.
     */
    @JvmName("mnrdkdechbbkqkfy")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value The short identifier for your JIRA project, all uppercase, e.g., PROJ.
     */
    @JvmName("wtvjsoarxhhyjpwk")
    public suspend fun projectKey(`value`: Output) {
        this.projectKey = value
    }

    /**
     * @param value Keys of Jira projects. When issues_enabled is true, this setting specifies which Jira projects to view issues from in GitLab.
     */
    @JvmName("mxgpbcemyhgmcrqi")
    public suspend fun projectKeys(`value`: Output>) {
        this.projectKeys = value
    }

    @JvmName("dvxomhbyxuckpfte")
    public suspend fun projectKeys(vararg values: Output) {
        this.projectKeys = Output.all(values.asList())
    }

    /**
     * @param values Keys of Jira projects. When issues_enabled is true, this setting specifies which Jira projects to view issues from in GitLab.
     */
    @JvmName("lrxlhgxsdedqqeer")
    public suspend fun projectKeys(values: List>) {
        this.projectKeys = Output.all(values)
    }

    /**
     * @param value The URL to the JIRA project which is being linked to this GitLab project. For example, https://jira.example.com.
     */
    @JvmName("dwsarqppicrvpoqv")
    public suspend fun url(`value`: Output) {
        this.url = value
    }

    /**
     * @param value Indicates whether or not to inherit default settings. Defaults to false.
     */
    @JvmName("wwalmncliruroucy")
    public suspend fun useInheritedSettings(`value`: Output) {
        this.useInheritedSettings = value
    }

    /**
     * @param value The email or username to be used with Jira. For Jira Cloud use an email, for Jira Data Center and Jira Server use a username. Required when using Basic authentication (jira*auth*type is 0).
     */
    @JvmName("opuligtoxyggopip")
    public suspend fun username(`value`: Output) {
        this.username = value
    }

    /**
     * @param value The base URL to the Jira instance API. Web URL value is used if not set. For example, https://jira-api.example.com.
     */
    @JvmName("wrlqoniyxrjhcanw")
    public suspend fun apiUrl(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.apiUrl = mapped
    }

    /**
     * @param value Enable comments inside Jira issues on each GitLab event (commit / merge request)
     */
    @JvmName("fpocjoiqocjvpotp")
    public suspend fun commentOnEventEnabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.commentOnEventEnabled = mapped
    }

    /**
     * @param value Enable notifications for commit events
     */
    @JvmName("cdetkvirtexiexph")
    public suspend fun commitEvents(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.commitEvents = mapped
    }

    /**
     * @param value Enable viewing Jira issues in GitLab.
     */
    @JvmName("hjmhkqljbkjnvnuu")
    public suspend fun issuesEnabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.issuesEnabled = mapped
    }

    /**
     * @param value The authentication method to be used with Jira. 0 means Basic Authentication. 1 means Jira personal access token. Defaults to 0.
     */
    @JvmName("kulubpgnydmybjku")
    public suspend fun jiraAuthType(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.jiraAuthType = mapped
    }

    /**
     * @param value Prefix to match Jira issue keys.
     */
    @JvmName("wrjbmhikdrgnihsq")
    public suspend fun jiraIssuePrefix(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.jiraIssuePrefix = mapped
    }

    /**
     * @param value Regular expression to match Jira issue keys.
     */
    @JvmName("kmeoxlhrknhnfnhp")
    public suspend fun jiraIssueRegex(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.jiraIssueRegex = mapped
    }

    /**
     * @param value Enable automatic issue transitions. Takes precedence over jira*issue*transition_id if enabled. Defaults to false.
     */
    @JvmName("rfualgyhxjpyajuk")
    public suspend fun jiraIssueTransitionAutomatic(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.jiraIssueTransitionAutomatic = mapped
    }

    /**
     * @param value The ID of a transition that moves issues to a closed state. You can find this number under the JIRA workflow administration (Administration > Issues > Workflows) by selecting View under Operations of the desired workflow of your project. By default, this ID is set to 2. *Note**: importing this field is only supported since GitLab 15.2.
     */
    @JvmName("gmvxledxasrtpwhr")
    public suspend fun jiraIssueTransitionId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.jiraIssueTransitionId = mapped
    }

    /**
     * @param value Enable notifications for merge request events
     */
    @JvmName("dauvfcjsasptlsni")
    public suspend fun mergeRequestsEvents(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.mergeRequestsEvents = mapped
    }

    /**
     * @param value The Jira API token, password, or personal access token to be used with Jira. When your authentication method is basic (jira*auth*type is 0), use an API token for Jira Cloud or a password for Jira Data Center or Jira Server. When your authentication method is a Jira personal access token (jira*auth*type is 1), use the personal access token.
     */
    @JvmName("spxvhvhxfdlktsle")
    public suspend fun password(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.password = mapped
    }

    /**
     * @param value ID of the project you want to activate integration on.
     */
    @JvmName("oybmiefxxlbllobg")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    /**
     * @param value The short identifier for your JIRA project, all uppercase, e.g., PROJ.
     */
    @JvmName("tcserynkmgoyannr")
    public suspend fun projectKey(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.projectKey = mapped
    }

    /**
     * @param value Keys of Jira projects. When issues_enabled is true, this setting specifies which Jira projects to view issues from in GitLab.
     */
    @JvmName("pcvsxhixdobharqu")
    public suspend fun projectKeys(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.projectKeys = mapped
    }

    /**
     * @param values Keys of Jira projects. When issues_enabled is true, this setting specifies which Jira projects to view issues from in GitLab.
     */
    @JvmName("vrogjhjxxhfaqlyv")
    public suspend fun projectKeys(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.projectKeys = mapped
    }

    /**
     * @param value The URL to the JIRA project which is being linked to this GitLab project. For example, https://jira.example.com.
     */
    @JvmName("cqeohqkocsxecpxq")
    public suspend fun url(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.url = mapped
    }

    /**
     * @param value Indicates whether or not to inherit default settings. Defaults to false.
     */
    @JvmName("lgfvrccnlhbfqrvl")
    public suspend fun useInheritedSettings(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.useInheritedSettings = mapped
    }

    /**
     * @param value The email or username to be used with Jira. For Jira Cloud use an email, for Jira Data Center and Jira Server use a username. Required when using Basic authentication (jira*auth*type is 0).
     */
    @JvmName("fkdltclgnaxlwphg")
    public suspend fun username(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.username = mapped
    }

    internal fun build(): IntegrationJiraArgs = IntegrationJiraArgs(
        apiUrl = apiUrl,
        commentOnEventEnabled = commentOnEventEnabled,
        commitEvents = commitEvents,
        issuesEnabled = issuesEnabled,
        jiraAuthType = jiraAuthType,
        jiraIssuePrefix = jiraIssuePrefix,
        jiraIssueRegex = jiraIssueRegex,
        jiraIssueTransitionAutomatic = jiraIssueTransitionAutomatic,
        jiraIssueTransitionId = jiraIssueTransitionId,
        mergeRequestsEvents = mergeRequestsEvents,
        password = password,
        project = project,
        projectKey = projectKey,
        projectKeys = projectKeys,
        url = url,
        useInheritedSettings = useInheritedSettings,
        username = username,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy