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

com.pulumi.googlenative.artifactregistry.v1beta2.kotlin.Repository.kt Maven / Gradle / Ivy

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

package com.pulumi.googlenative.artifactregistry.v1beta2.kotlin

import com.pulumi.core.Output
import com.pulumi.googlenative.artifactregistry.v1beta2.kotlin.outputs.MavenRepositoryConfigResponse
import com.pulumi.googlenative.artifactregistry.v1beta2.kotlin.outputs.MavenRepositoryConfigResponse.Companion.toKotlin
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.Map

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

    public var args: RepositoryArgs = RepositoryArgs()

    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 RepositoryArgsBuilder.() -> Unit) {
        val builder = RepositoryArgsBuilder()
        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(): Repository {
        val builtJavaResource =
            com.pulumi.googlenative.artifactregistry.v1beta2.Repository(
                this.name,
                this.args.toJava(),
                this.opts.toJava(),
            )
        return Repository(builtJavaResource)
    }
}

/**
 * Creates a repository. The returned Operation will finish once the repository has been created. Its response will be the created Repository.
 */
public class Repository internal constructor(
    override val javaResource: com.pulumi.googlenative.artifactregistry.v1beta2.Repository,
) : KotlinCustomResource(javaResource, RepositoryMapper) {
    /**
     * The time when the repository was created.
     */
    public val createTime: Output
        get() = javaResource.createTime().applyValue({ args0 -> args0 })

    /**
     * The user-provided description of the repository.
     */
    public val description: Output
        get() = javaResource.description().applyValue({ args0 -> args0 })

    /**
     * The format of packages that are stored in the repository.
     */
    public val format: Output
        get() = javaResource.format().applyValue({ args0 -> args0 })

    /**
     * The Cloud KMS resource name of the customer managed encryption key that's used to encrypt the contents of the Repository. Has the form: `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`. This value may not be changed after the Repository has been created.
     */
    public val kmsKeyName: Output
        get() = javaResource.kmsKeyName().applyValue({ args0 -> args0 })

    /**
     * Labels with user-defined metadata. This field may contain up to 64 entries. Label keys and values may be no longer than 63 characters. Label keys must begin with a lowercase letter and may only contain lowercase letters, numeric characters, underscores, and dashes.
     */
    public val labels: Output>
        get() = javaResource.labels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

    /**
     * Maven repository config contains repository level configuration for the repositories of maven type.
     */
    public val mavenConfig: Output
        get() = javaResource.mavenConfig().applyValue({ args0 -> args0.let({ args0 -> toKotlin(args0) }) })

    /**
     * The name of the repository, for example: "projects/p1/locations/us-central1/repositories/repo1".
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    public val project: Output
        get() = javaResource.project().applyValue({ args0 -> args0 })

    /**
     * The repository id to use for this repository.
     */
    public val repositoryId: Output?
        get() = javaResource.repositoryId().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * If set, the repository satisfies physical zone separation.
     */
    public val satisfiesPzs: Output
        get() = javaResource.satisfiesPzs().applyValue({ args0 -> args0 })

    /**
     * The size, in bytes, of all artifact storage in this repository. Repositories that are generally available or in public preview use this to calculate storage costs.
     */
    public val sizeBytes: Output
        get() = javaResource.sizeBytes().applyValue({ args0 -> args0 })

    /**
     * The time when the repository was last updated.
     */
    public val updateTime: Output
        get() = javaResource.updateTime().applyValue({ args0 -> args0 })
}

public object RepositoryMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.googlenative.artifactregistry.v1beta2.Repository::class == javaResource::class

    override fun map(javaResource: Resource): Repository = Repository(
        javaResource as
            com.pulumi.googlenative.artifactregistry.v1beta2.Repository,
    )
}

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy