com.pulumi.gitlab.kotlin.RepositoryFileArgs.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.RepositoryFileArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName
/**
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gitlab from "@pulumi/gitlab";
* import * as std from "@pulumi/std";
* const _this = new gitlab.Group("this", {
* name: "example",
* path: "example",
* description: "An example group",
* });
* const thisProject = new gitlab.Project("this", {
* name: "example",
* namespaceId: _this.id,
* initializeWithReadme: true,
* });
* const thisRepositoryFile = new gitlab.RepositoryFile("this", {
* project: thisProject.id,
* filePath: "meow.txt",
* branch: "main",
* content: std.base64encode({
* input: "Meow goes the cat",
* }).then(invoke => invoke.result),
* authorEmail: "[email protected]",
* authorName: "Terraform",
* commitMessage: "feature: add meow file",
* });
* const readme = new gitlab.RepositoryFile("readme", {
* project: thisProject.id,
* filePath: "readme.txt",
* branch: "main",
* content: "Meow goes the cat",
* authorEmail: "[email protected]",
* authorName: "Terraform",
* commitMessage: "feature: add readme file",
* });
* const readmeForDogs = new gitlab.RepositoryFile("readme_for_dogs", {
* project: thisProject.id,
* filePath: "readme.txt",
* branch: "main",
* content: "Bark goes the dog",
* authorEmail: "[email protected]",
* authorName: "Terraform",
* commitMessage: "feature: update readme file",
* overwriteOnCreate: true,
* });
* ```
* ```python
* import pulumi
* import pulumi_gitlab as gitlab
* import pulumi_std as std
* this = gitlab.Group("this",
* name="example",
* path="example",
* description="An example group")
* this_project = gitlab.Project("this",
* name="example",
* namespace_id=this.id,
* initialize_with_readme=True)
* this_repository_file = gitlab.RepositoryFile("this",
* project=this_project.id,
* file_path="meow.txt",
* branch="main",
* content=std.base64encode(input="Meow goes the cat").result,
* author_email="[email protected]",
* author_name="Terraform",
* commit_message="feature: add meow file")
* readme = gitlab.RepositoryFile("readme",
* project=this_project.id,
* file_path="readme.txt",
* branch="main",
* content="Meow goes the cat",
* author_email="[email protected]",
* author_name="Terraform",
* commit_message="feature: add readme file")
* readme_for_dogs = gitlab.RepositoryFile("readme_for_dogs",
* project=this_project.id,
* file_path="readme.txt",
* branch="main",
* content="Bark goes the dog",
* author_email="[email protected]",
* author_name="Terraform",
* commit_message="feature: update readme file",
* overwrite_on_create=True)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using GitLab = Pulumi.GitLab;
* using Std = Pulumi.Std;
* return await Deployment.RunAsync(() =>
* {
* var @this = new GitLab.Group("this", new()
* {
* Name = "example",
* Path = "example",
* Description = "An example group",
* });
* var thisProject = new GitLab.Project("this", new()
* {
* Name = "example",
* NamespaceId = @this.Id,
* InitializeWithReadme = true,
* });
* var thisRepositoryFile = new GitLab.RepositoryFile("this", new()
* {
* Project = thisProject.Id,
* FilePath = "meow.txt",
* Branch = "main",
* Content = Std.Base64encode.Invoke(new()
* {
* Input = "Meow goes the cat",
* }).Apply(invoke => invoke.Result),
* AuthorEmail = "[email protected]",
* AuthorName = "Terraform",
* CommitMessage = "feature: add meow file",
* });
* var readme = new GitLab.RepositoryFile("readme", new()
* {
* Project = thisProject.Id,
* FilePath = "readme.txt",
* Branch = "main",
* Content = "Meow goes the cat",
* AuthorEmail = "[email protected]",
* AuthorName = "Terraform",
* CommitMessage = "feature: add readme file",
* });
* var readmeForDogs = new GitLab.RepositoryFile("readme_for_dogs", new()
* {
* Project = thisProject.Id,
* FilePath = "readme.txt",
* Branch = "main",
* Content = "Bark goes the dog",
* AuthorEmail = "[email protected]",
* AuthorName = "Terraform",
* CommitMessage = "feature: update readme file",
* OverwriteOnCreate = true,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gitlab/sdk/v8/go/gitlab"
* "github.com/pulumi/pulumi-std/sdk/go/std"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* this, err := gitlab.NewGroup(ctx, "this", &gitlab.GroupArgs{
* Name: pulumi.String("example"),
* Path: pulumi.String("example"),
* Description: pulumi.String("An example group"),
* })
* if err != nil {
* return err
* }
* thisProject, err := gitlab.NewProject(ctx, "this", &gitlab.ProjectArgs{
* Name: pulumi.String("example"),
* NamespaceId: this.ID(),
* InitializeWithReadme: pulumi.Bool(true),
* })
* if err != nil {
* return err
* }
* invokeBase64encode, err := std.Base64encode(ctx, &std.Base64encodeArgs{
* Input: "Meow goes the cat",
* }, nil)
* if err != nil {
* return err
* }
* _, err = gitlab.NewRepositoryFile(ctx, "this", &gitlab.RepositoryFileArgs{
* Project: thisProject.ID(),
* FilePath: pulumi.String("meow.txt"),
* Branch: pulumi.String("main"),
* Content: pulumi.String(invokeBase64encode.Result),
* AuthorEmail: pulumi.String("[email protected]"),
* AuthorName: pulumi.String("Terraform"),
* CommitMessage: pulumi.String("feature: add meow file"),
* })
* if err != nil {
* return err
* }
* _, err = gitlab.NewRepositoryFile(ctx, "readme", &gitlab.RepositoryFileArgs{
* Project: thisProject.ID(),
* FilePath: pulumi.String("readme.txt"),
* Branch: pulumi.String("main"),
* Content: pulumi.String("Meow goes the cat"),
* AuthorEmail: pulumi.String("[email protected]"),
* AuthorName: pulumi.String("Terraform"),
* CommitMessage: pulumi.String("feature: add readme file"),
* })
* if err != nil {
* return err
* }
* _, err = gitlab.NewRepositoryFile(ctx, "readme_for_dogs", &gitlab.RepositoryFileArgs{
* Project: thisProject.ID(),
* FilePath: pulumi.String("readme.txt"),
* Branch: pulumi.String("main"),
* Content: pulumi.String("Bark goes the dog"),
* AuthorEmail: pulumi.String("[email protected]"),
* AuthorName: pulumi.String("Terraform"),
* CommitMessage: pulumi.String("feature: update readme file"),
* OverwriteOnCreate: pulumi.Bool(true),
* })
* 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.Group;
* import com.pulumi.gitlab.GroupArgs;
* import com.pulumi.gitlab.Project;
* import com.pulumi.gitlab.ProjectArgs;
* import com.pulumi.gitlab.RepositoryFile;
* import com.pulumi.gitlab.RepositoryFileArgs;
* 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 this_ = new Group("this", GroupArgs.builder()
* .name("example")
* .path("example")
* .description("An example group")
* .build());
* var thisProject = new Project("thisProject", ProjectArgs.builder()
* .name("example")
* .namespaceId(this_.id())
* .initializeWithReadme(true)
* .build());
* var thisRepositoryFile = new RepositoryFile("thisRepositoryFile", RepositoryFileArgs.builder()
* .project(thisProject.id())
* .filePath("meow.txt")
* .branch("main")
* .content(StdFunctions.base64encode(Base64encodeArgs.builder()
* .input("Meow goes the cat")
* .build()).result())
* .authorEmail("[email protected]")
* .authorName("Terraform")
* .commitMessage("feature: add meow file")
* .build());
* var readme = new RepositoryFile("readme", RepositoryFileArgs.builder()
* .project(thisProject.id())
* .filePath("readme.txt")
* .branch("main")
* .content("Meow goes the cat")
* .authorEmail("[email protected]")
* .authorName("Terraform")
* .commitMessage("feature: add readme file")
* .build());
* var readmeForDogs = new RepositoryFile("readmeForDogs", RepositoryFileArgs.builder()
* .project(thisProject.id())
* .filePath("readme.txt")
* .branch("main")
* .content("Bark goes the dog")
* .authorEmail("[email protected]")
* .authorName("Terraform")
* .commitMessage("feature: update readme file")
* .overwriteOnCreate(true)
* .build());
* }
* }
* ```
* ```yaml
* resources:
* this:
* type: gitlab:Group
* properties:
* name: example
* path: example
* description: An example group
* thisProject:
* type: gitlab:Project
* name: this
* properties:
* name: example
* namespaceId: ${this.id}
* initializeWithReadme: true
* thisRepositoryFile:
* type: gitlab:RepositoryFile
* name: this
* properties:
* project: ${thisProject.id}
* filePath: meow.txt
* branch: main
* content:
* fn::invoke:
* Function: std:base64encode
* Arguments:
* input: Meow goes the cat
* Return: result
* authorEmail: [email protected]
* authorName: Terraform
* commitMessage: 'feature: add meow file'
* readme:
* type: gitlab:RepositoryFile
* properties:
* project: ${thisProject.id}
* filePath: readme.txt
* branch: main
* content: Meow goes the cat
* authorEmail: [email protected]
* authorName: Terraform
* commitMessage: 'feature: add readme file'
* readmeForDogs:
* type: gitlab:RepositoryFile
* name: readme_for_dogs
* properties:
* project: ${thisProject.id}
* filePath: readme.txt
* branch: main
* content: Bark goes the dog
* authorEmail: [email protected]
* authorName: Terraform
* commitMessage: 'feature: update readme file'
* overwriteOnCreate: true
* ```
*
* ## Import
* Starting in Terraform v1.5.0 you can use an import block to import `gitlab_repository_file`. For example:
* terraform
* import {
* to = gitlab_repository_file.example
* id = "see CLI command below for ID"
* }
* Import using the CLI is supported using the following syntax:
* A Repository File can be imported using an id made up of `::`, e.g.
* ```sh
* $ pulumi import gitlab:index/repositoryFile:RepositoryFile this 1:main:foo/bar.txt
* ```
* @property authorEmail Email of the commit author.
* @property authorName Name of the commit author.
* @property branch Name of the branch to which to commit to.
* @property commitMessage Commit message.
* @property content File content.
* @property createCommitMessage Create commit message.
* @property deleteCommitMessage Delete Commit message.
* @property encoding The file content encoding. Default value is `base64`. Valid values are: `base64`, `text`.
* @property executeFilemode Enables or disables the execute flag on the file. **Note**: requires GitLab 14.10 or newer.
* @property filePath The full path of the file. It must be relative to the root of the project without a leading slash `/` or `./`.
* @property overwriteOnCreate Enable overwriting existing files, defaults to `false`. This attribute is only used during `create` and must be use carefully. We suggest to use `imports` whenever possible and limit the use of this attribute for when the project was imported on the same `apply`. This attribute is not supported during a resource import.
* @property project The name or ID of the project.
* @property startBranch Name of the branch to start the new commit from.
* @property updateCommitMessage Update commit message.
*/
public data class RepositoryFileArgs(
public val authorEmail: Output? = null,
public val authorName: Output? = null,
public val branch: Output? = null,
public val commitMessage: Output? = null,
public val content: Output? = null,
public val createCommitMessage: Output? = null,
public val deleteCommitMessage: Output? = null,
public val encoding: Output? = null,
public val executeFilemode: Output? = null,
public val filePath: Output? = null,
public val overwriteOnCreate: Output? = null,
public val project: Output? = null,
public val startBranch: Output? = null,
public val updateCommitMessage: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.gitlab.RepositoryFileArgs =
com.pulumi.gitlab.RepositoryFileArgs.builder()
.authorEmail(authorEmail?.applyValue({ args0 -> args0 }))
.authorName(authorName?.applyValue({ args0 -> args0 }))
.branch(branch?.applyValue({ args0 -> args0 }))
.commitMessage(commitMessage?.applyValue({ args0 -> args0 }))
.content(content?.applyValue({ args0 -> args0 }))
.createCommitMessage(createCommitMessage?.applyValue({ args0 -> args0 }))
.deleteCommitMessage(deleteCommitMessage?.applyValue({ args0 -> args0 }))
.encoding(encoding?.applyValue({ args0 -> args0 }))
.executeFilemode(executeFilemode?.applyValue({ args0 -> args0 }))
.filePath(filePath?.applyValue({ args0 -> args0 }))
.overwriteOnCreate(overwriteOnCreate?.applyValue({ args0 -> args0 }))
.project(project?.applyValue({ args0 -> args0 }))
.startBranch(startBranch?.applyValue({ args0 -> args0 }))
.updateCommitMessage(updateCommitMessage?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [RepositoryFileArgs].
*/
@PulumiTagMarker
public class RepositoryFileArgsBuilder internal constructor() {
private var authorEmail: Output? = null
private var authorName: Output? = null
private var branch: Output? = null
private var commitMessage: Output? = null
private var content: Output? = null
private var createCommitMessage: Output? = null
private var deleteCommitMessage: Output? = null
private var encoding: Output? = null
private var executeFilemode: Output? = null
private var filePath: Output? = null
private var overwriteOnCreate: Output? = null
private var project: Output? = null
private var startBranch: Output? = null
private var updateCommitMessage: Output? = null
/**
* @param value Email of the commit author.
*/
@JvmName("bkypmcqdodbltmip")
public suspend fun authorEmail(`value`: Output) {
this.authorEmail = value
}
/**
* @param value Name of the commit author.
*/
@JvmName("yfloagdtxinavjck")
public suspend fun authorName(`value`: Output) {
this.authorName = value
}
/**
* @param value Name of the branch to which to commit to.
*/
@JvmName("eshpfwjfutxjbhdg")
public suspend fun branch(`value`: Output) {
this.branch = value
}
/**
* @param value Commit message.
*/
@JvmName("wogptyymoqtxlpyv")
public suspend fun commitMessage(`value`: Output) {
this.commitMessage = value
}
/**
* @param value File content.
*/
@JvmName("naqaqbfonqwdthdv")
public suspend fun content(`value`: Output) {
this.content = value
}
/**
* @param value Create commit message.
*/
@JvmName("vengsltpbkcckhmw")
public suspend fun createCommitMessage(`value`: Output) {
this.createCommitMessage = value
}
/**
* @param value Delete Commit message.
*/
@JvmName("leypsgolcrmfrwgy")
public suspend fun deleteCommitMessage(`value`: Output) {
this.deleteCommitMessage = value
}
/**
* @param value The file content encoding. Default value is `base64`. Valid values are: `base64`, `text`.
*/
@JvmName("kjmnvuyexsaqjlpb")
public suspend fun encoding(`value`: Output) {
this.encoding = value
}
/**
* @param value Enables or disables the execute flag on the file. **Note**: requires GitLab 14.10 or newer.
*/
@JvmName("dksqpvgmkasobccm")
public suspend fun executeFilemode(`value`: Output) {
this.executeFilemode = value
}
/**
* @param value The full path of the file. It must be relative to the root of the project without a leading slash `/` or `./`.
*/
@JvmName("hcuryepcqrntqbbr")
public suspend fun filePath(`value`: Output) {
this.filePath = value
}
/**
* @param value Enable overwriting existing files, defaults to `false`. This attribute is only used during `create` and must be use carefully. We suggest to use `imports` whenever possible and limit the use of this attribute for when the project was imported on the same `apply`. This attribute is not supported during a resource import.
*/
@JvmName("kbgbyxyfbkpucpyb")
public suspend fun overwriteOnCreate(`value`: Output) {
this.overwriteOnCreate = value
}
/**
* @param value The name or ID of the project.
*/
@JvmName("ckiieicfdkbknxjv")
public suspend fun project(`value`: Output) {
this.project = value
}
/**
* @param value Name of the branch to start the new commit from.
*/
@JvmName("tiqcshskwddryymh")
public suspend fun startBranch(`value`: Output) {
this.startBranch = value
}
/**
* @param value Update commit message.
*/
@JvmName("tqipxudjlwwlmjiu")
public suspend fun updateCommitMessage(`value`: Output) {
this.updateCommitMessage = value
}
/**
* @param value Email of the commit author.
*/
@JvmName("gybaonoymnfdvjej")
public suspend fun authorEmail(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.authorEmail = mapped
}
/**
* @param value Name of the commit author.
*/
@JvmName("hedrkkgmvqxftagi")
public suspend fun authorName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.authorName = mapped
}
/**
* @param value Name of the branch to which to commit to.
*/
@JvmName("nfngxfqqgesmkwwn")
public suspend fun branch(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.branch = mapped
}
/**
* @param value Commit message.
*/
@JvmName("ijgvcqdewxbctmcg")
public suspend fun commitMessage(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.commitMessage = mapped
}
/**
* @param value File content.
*/
@JvmName("gcgberhobjnyagkh")
public suspend fun content(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.content = mapped
}
/**
* @param value Create commit message.
*/
@JvmName("cmkrujcpkgngbhvl")
public suspend fun createCommitMessage(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.createCommitMessage = mapped
}
/**
* @param value Delete Commit message.
*/
@JvmName("btqohvdkutvjtlxo")
public suspend fun deleteCommitMessage(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.deleteCommitMessage = mapped
}
/**
* @param value The file content encoding. Default value is `base64`. Valid values are: `base64`, `text`.
*/
@JvmName("raxivmnqptxncxyr")
public suspend fun encoding(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.encoding = mapped
}
/**
* @param value Enables or disables the execute flag on the file. **Note**: requires GitLab 14.10 or newer.
*/
@JvmName("uanapggvjnybcdnm")
public suspend fun executeFilemode(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.executeFilemode = mapped
}
/**
* @param value The full path of the file. It must be relative to the root of the project without a leading slash `/` or `./`.
*/
@JvmName("bmayqtyfapetdjot")
public suspend fun filePath(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.filePath = mapped
}
/**
* @param value Enable overwriting existing files, defaults to `false`. This attribute is only used during `create` and must be use carefully. We suggest to use `imports` whenever possible and limit the use of this attribute for when the project was imported on the same `apply`. This attribute is not supported during a resource import.
*/
@JvmName("njpxxgncbqlrolmi")
public suspend fun overwriteOnCreate(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.overwriteOnCreate = mapped
}
/**
* @param value The name or ID of the project.
*/
@JvmName("hmolocpmaevwroln")
public suspend fun project(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.project = mapped
}
/**
* @param value Name of the branch to start the new commit from.
*/
@JvmName("mppufhsvrnqukmrd")
public suspend fun startBranch(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.startBranch = mapped
}
/**
* @param value Update commit message.
*/
@JvmName("cwrohohsxnmoqeof")
public suspend fun updateCommitMessage(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.updateCommitMessage = mapped
}
internal fun build(): RepositoryFileArgs = RepositoryFileArgs(
authorEmail = authorEmail,
authorName = authorName,
branch = branch,
commitMessage = commitMessage,
content = content,
createCommitMessage = createCommitMessage,
deleteCommitMessage = deleteCommitMessage,
encoding = encoding,
executeFilemode = executeFilemode,
filePath = filePath,
overwriteOnCreate = overwriteOnCreate,
project = project,
startBranch = startBranch,
updateCommitMessage = updateCommitMessage,
)
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy