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

com.pulumi.awsnative.codestarconnections.kotlin.RepositoryLink.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.codestarconnections.kotlin

import com.pulumi.awsnative.codestarconnections.kotlin.enums.RepositoryLinkProviderType
import com.pulumi.awsnative.kotlin.outputs.Tag
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import com.pulumi.awsnative.codestarconnections.kotlin.enums.RepositoryLinkProviderType.Companion.toKotlin as repositoryLinkProviderTypeToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin

/**
 * Builder for [RepositoryLink].
 */
@PulumiTagMarker
public class RepositoryLinkResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: RepositoryLinkArgs = RepositoryLinkArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend RepositoryLinkArgsBuilder.() -> Unit) {
        val builder = RepositoryLinkArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): RepositoryLink {
        val builtJavaResource =
            com.pulumi.awsnative.codestarconnections.RepositoryLink(
                this.name,
                this.args.toJava(),
                this.opts.toJava(),
            )
        return RepositoryLink(builtJavaResource)
    }
}

/**
 * Schema for AWS::CodeStarConnections::RepositoryLink resource which is used to aggregate repository metadata relevant to synchronizing source provider content to AWS Resources.
 */
public class RepositoryLink internal constructor(
    override val javaResource: com.pulumi.awsnative.codestarconnections.RepositoryLink,
) : KotlinCustomResource(javaResource, RepositoryLinkMapper) {
    /**
     * The Amazon Resource Name (ARN) of the CodeStarConnection. The ARN is used as the connection reference when the connection is shared between AWS services.
     */
    public val connectionArn: Output
        get() = javaResource.connectionArn().applyValue({ args0 -> args0 })

    /**
     * The ARN of the KMS key that the customer can optionally specify to use to encrypt RepositoryLink properties. If not specified, a default key will be used.
     */
    public val encryptionKeyArn: Output?
        get() = javaResource.encryptionKeyArn().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * the ID of the entity that owns the repository.
     */
    public val ownerId: Output
        get() = javaResource.ownerId().applyValue({ args0 -> args0 })

    /**
     * The name of the external provider where your third-party code repository is configured.
     */
    public val providerType: Output
        get() = javaResource.providerType().applyValue({ args0 ->
            args0.let({ args0 ->
                repositoryLinkProviderTypeToKotlin(args0)
            })
        })

    /**
     * A unique Amazon Resource Name (ARN) to designate the repository link.
     */
    public val repositoryLinkArn: Output
        get() = javaResource.repositoryLinkArn().applyValue({ args0 -> args0 })

    /**
     * A UUID that uniquely identifies the RepositoryLink.
     */
    public val repositoryLinkId: Output
        get() = javaResource.repositoryLinkId().applyValue({ args0 -> args0 })

    /**
     * The repository for which the link is being created.
     */
    public val repositoryName: Output
        get() = javaResource.repositoryName().applyValue({ args0 -> args0 })

    /**
     * Specifies the tags applied to a RepositoryLink.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> tagToKotlin(args0) })
                })
            }).orElse(null)
        })
}

public object RepositoryLinkMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.codestarconnections.RepositoryLink::class == javaResource::class

    override fun map(javaResource: Resource): RepositoryLink = RepositoryLink(
        javaResource as
            com.pulumi.awsnative.codestarconnections.RepositoryLink,
    )
}

/**
 * @see [RepositoryLink].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [RepositoryLink].
 */
public suspend fun repositoryLink(
    name: String,
    block: suspend RepositoryLinkResourceBuilder.() -> Unit,
): RepositoryLink {
    val builder = RepositoryLinkResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [RepositoryLink].
 * @param name The _unique_ name of the resulting resource.
 */
public fun repositoryLink(name: String): RepositoryLink {
    val builder = RepositoryLinkResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy