com.pulumi.gitlab.kotlin.ServiceGithubArgs.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.ServiceGithubArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName
/**
* The `gitlab.ServiceGithub` resource allows to manage the lifecycle of a project integration with GitHub.
* > This resource requires a GitLab Enterprise instance.
* > This resource is deprecated. use `gitlab.IntegrationGithub`instead!
* **Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/ee/api/integrations.html#github)
* ## 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 github = new gitlab.ServiceGithub("github", {
* project: awesomeProject.id,
* token: "REDACTED",
* repositoryUrl: "https://github.com/gitlabhq/terraform-provider-gitlab",
* });
* ```
* ```python
* import pulumi
* import pulumi_gitlab as gitlab
* awesome_project = gitlab.Project("awesome_project",
* name="awesome_project",
* description="My awesome project.",
* visibility_level="public")
* github = gitlab.ServiceGithub("github",
* project=awesome_project.id,
* token="REDACTED",
* repository_url="https://github.com/gitlabhq/terraform-provider-gitlab")
* ```
* ```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 github = new GitLab.ServiceGithub("github", new()
* {
* Project = awesomeProject.Id,
* Token = "REDACTED",
* RepositoryUrl = "https://github.com/gitlabhq/terraform-provider-gitlab",
* });
* });
* ```
* ```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.NewServiceGithub(ctx, "github", &gitlab.ServiceGithubArgs{
* Project: awesomeProject.ID(),
* Token: pulumi.String("REDACTED"),
* RepositoryUrl: pulumi.String("https://github.com/gitlabhq/terraform-provider-gitlab"),
* })
* 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.ServiceGithub;
* import com.pulumi.gitlab.ServiceGithubArgs;
* 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 github = new ServiceGithub("github", ServiceGithubArgs.builder()
* .project(awesomeProject.id())
* .token("REDACTED")
* .repositoryUrl("https://github.com/gitlabhq/terraform-provider-gitlab")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* awesomeProject:
* type: gitlab:Project
* name: awesome_project
* properties:
* name: awesome_project
* description: My awesome project.
* visibilityLevel: public
* github:
* type: gitlab:ServiceGithub
* properties:
* project: ${awesomeProject.id}
* token: REDACTED
* repositoryUrl: https://github.com/gitlabhq/terraform-provider-gitlab
* ```
*
* ## Import
* ```sh
* $ pulumi import gitlab:index/serviceGithub:ServiceGithub You can import a gitlab_service_github state using ` `:
* ```
* ```sh
* $ pulumi import gitlab:index/serviceGithub:ServiceGithub github 1
* ```
* @property project ID of the project you want to activate integration on.
* @property repositoryUrl
* @property staticContext Append instance name instead of branch to the status. Must enable to set a GitLab status check as *required* in GitHub. See [Static / dynamic status check names] to learn more.
* @property token A GitHub personal access token with at least `repo:status` scope.
*/
public data class ServiceGithubArgs(
public val project: Output? = null,
public val repositoryUrl: Output? = null,
public val staticContext: Output? = null,
public val token: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.gitlab.ServiceGithubArgs =
com.pulumi.gitlab.ServiceGithubArgs.builder()
.project(project?.applyValue({ args0 -> args0 }))
.repositoryUrl(repositoryUrl?.applyValue({ args0 -> args0 }))
.staticContext(staticContext?.applyValue({ args0 -> args0 }))
.token(token?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [ServiceGithubArgs].
*/
@PulumiTagMarker
public class ServiceGithubArgsBuilder internal constructor() {
private var project: Output? = null
private var repositoryUrl: Output? = null
private var staticContext: Output? = null
private var token: Output? = null
/**
* @param value ID of the project you want to activate integration on.
*/
@JvmName("sayrxpclxxlcnmlk")
public suspend fun project(`value`: Output) {
this.project = value
}
/**
* @param value
*/
@JvmName("cgstpeqodgxowaqf")
public suspend fun repositoryUrl(`value`: Output) {
this.repositoryUrl = value
}
/**
* @param value Append instance name instead of branch to the status. Must enable to set a GitLab status check as *required* in GitHub. See [Static / dynamic status check names] to learn more.
*/
@JvmName("shqhdseclkvejpyq")
public suspend fun staticContext(`value`: Output) {
this.staticContext = value
}
/**
* @param value A GitHub personal access token with at least `repo:status` scope.
*/
@JvmName("ugsllivjgbwensfy")
public suspend fun token(`value`: Output) {
this.token = value
}
/**
* @param value ID of the project you want to activate integration on.
*/
@JvmName("oevjfkddacwohvte")
public suspend fun project(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.project = mapped
}
/**
* @param value
*/
@JvmName("eahbpbqphfugjkua")
public suspend fun repositoryUrl(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.repositoryUrl = mapped
}
/**
* @param value Append instance name instead of branch to the status. Must enable to set a GitLab status check as *required* in GitHub. See [Static / dynamic status check names] to learn more.
*/
@JvmName("wjcyulfmtibjqqrf")
public suspend fun staticContext(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.staticContext = mapped
}
/**
* @param value A GitHub personal access token with at least `repo:status` scope.
*/
@JvmName("dcwgirvomnaporlf")
public suspend fun token(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.token = mapped
}
internal fun build(): ServiceGithubArgs = ServiceGithubArgs(
project = project,
repositoryUrl = repositoryUrl,
staticContext = staticContext,
token = token,
)
}