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

com.pulumi.gitlab.kotlin.DeployTokenArgs.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.DeployTokenArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * The `gitlab.DeployToken` resource allows to manage the lifecycle of group and project deploy tokens.
 * **Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/ee/api/deploy_tokens.html)
 * ## Import
 * GitLab deploy tokens can be imported using an id made up of `{type}:{type_id}:{deploy_token_id}`, where type is one of: project, group.
 * ```sh
 * $ pulumi import gitlab:index/deployToken:DeployToken group_token group:1:3
 * ```
 * ```sh
 * $ pulumi import gitlab:index/deployToken:DeployToken project_token project:1:4
 * ```
 * Note: the `token` resource attribute is not available for imported resources as this information cannot be read from the GitLab API.
 * @property expiresAt Time the token will expire it, RFC3339 format. Will not expire per default.
 * @property group The name or id of the group to add the deploy token to.
 * @property name A name to describe the deploy token with.
 * @property project The name or id of the project to add the deploy token to.
 * @property scopes Valid values: `read_repository`, `read_registry`, `read_package_registry`, `write_registry`, `write_package_registry`.
 * @property username A username for the deploy token. Default is `gitlab+deploy-token-{n}`.
 */
public data class DeployTokenArgs(
    public val expiresAt: Output? = null,
    public val group: Output? = null,
    public val name: Output? = null,
    public val project: Output? = null,
    public val scopes: Output>? = null,
    public val username: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gitlab.DeployTokenArgs =
        com.pulumi.gitlab.DeployTokenArgs.builder()
            .expiresAt(expiresAt?.applyValue({ args0 -> args0 }))
            .group(group?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 }))
            .scopes(scopes?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .username(username?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [DeployTokenArgs].
 */
@PulumiTagMarker
public class DeployTokenArgsBuilder internal constructor() {
    private var expiresAt: Output? = null

    private var group: Output? = null

    private var name: Output? = null

    private var project: Output? = null

    private var scopes: Output>? = null

    private var username: Output? = null

    /**
     * @param value Time the token will expire it, RFC3339 format. Will not expire per default.
     */
    @JvmName("rouxmimqptnvglld")
    public suspend fun expiresAt(`value`: Output) {
        this.expiresAt = value
    }

    /**
     * @param value The name or id of the group to add the deploy token to.
     */
    @JvmName("wkavtqeuxxtnibkw")
    public suspend fun group(`value`: Output) {
        this.group = value
    }

    /**
     * @param value A name to describe the deploy token with.
     */
    @JvmName("gpxguturhhvlwujb")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The name or id of the project to add the deploy token to.
     */
    @JvmName("clwvpwmcaddjjgbn")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value Valid values: `read_repository`, `read_registry`, `read_package_registry`, `write_registry`, `write_package_registry`.
     */
    @JvmName("dbecctkhlvptwkfg")
    public suspend fun scopes(`value`: Output>) {
        this.scopes = value
    }

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

    /**
     * @param values Valid values: `read_repository`, `read_registry`, `read_package_registry`, `write_registry`, `write_package_registry`.
     */
    @JvmName("lvalidgfjkiovxbn")
    public suspend fun scopes(values: List>) {
        this.scopes = Output.all(values)
    }

    /**
     * @param value A username for the deploy token. Default is `gitlab+deploy-token-{n}`.
     */
    @JvmName("kwrjcknbkfdbbhlw")
    public suspend fun username(`value`: Output) {
        this.username = value
    }

    /**
     * @param value Time the token will expire it, RFC3339 format. Will not expire per default.
     */
    @JvmName("wdrknrurfpdjqnvl")
    public suspend fun expiresAt(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.expiresAt = mapped
    }

    /**
     * @param value The name or id of the group to add the deploy token to.
     */
    @JvmName("yocqnjxksxnmdein")
    public suspend fun group(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.group = mapped
    }

    /**
     * @param value A name to describe the deploy token with.
     */
    @JvmName("mclpadhulabygiqa")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The name or id of the project to add the deploy token to.
     */
    @JvmName("xygqbuqeotqiatah")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    /**
     * @param value Valid values: `read_repository`, `read_registry`, `read_package_registry`, `write_registry`, `write_package_registry`.
     */
    @JvmName("apchxwxusggqjtfx")
    public suspend fun scopes(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.scopes = mapped
    }

    /**
     * @param values Valid values: `read_repository`, `read_registry`, `read_package_registry`, `write_registry`, `write_package_registry`.
     */
    @JvmName("tbmynorrufdkwkda")
    public suspend fun scopes(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.scopes = mapped
    }

    /**
     * @param value A username for the deploy token. Default is `gitlab+deploy-token-{n}`.
     */
    @JvmName("jifqjlvqegwkmnqp")
    public suspend fun username(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.username = mapped
    }

    internal fun build(): DeployTokenArgs = DeployTokenArgs(
        expiresAt = expiresAt,
        group = group,
        name = name,
        project = project,
        scopes = scopes,
        username = username,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy