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

com.pulumi.awsnative.codeartifact.kotlin.PackageGroup.kt Maven / Gradle / Ivy

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

package com.pulumi.awsnative.codeartifact.kotlin

import com.pulumi.awsnative.codeartifact.kotlin.outputs.PackageGroupOriginConfiguration
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.codeartifact.kotlin.outputs.PackageGroupOriginConfiguration.Companion.toKotlin as packageGroupOriginConfigurationToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin

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

    public var args: PackageGroupArgs = PackageGroupArgs()

    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 PackageGroupArgsBuilder.() -> Unit) {
        val builder = PackageGroupArgsBuilder()
        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(): PackageGroup {
        val builtJavaResource = com.pulumi.awsnative.codeartifact.PackageGroup(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return PackageGroup(builtJavaResource)
    }
}

/**
 * The resource schema to create a CodeArtifact package group.
 */
public class PackageGroup internal constructor(
    override val javaResource: com.pulumi.awsnative.codeartifact.PackageGroup,
) : KotlinCustomResource(javaResource, PackageGroupMapper) {
    /**
     * The ARN of the package group.
     */
    public val arn: Output
        get() = javaResource.arn().applyValue({ args0 -> args0 })

    /**
     * The contact info of the package group.
     */
    public val contactInfo: Output?
        get() = javaResource.contactInfo().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The text description of the package group.
     */
    public val description: Output?
        get() = javaResource.description().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The name of the domain that contains the package group.
     */
    public val domainName: Output
        get() = javaResource.domainName().applyValue({ args0 -> args0 })

    /**
     * The 12-digit account ID of the AWS account that owns the domain.
     */
    public val domainOwner: Output?
        get() = javaResource.domainOwner().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The package origin configuration of the package group.
     */
    public val originConfiguration: Output?
        get() = javaResource.originConfiguration().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> packageGroupOriginConfigurationToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * The package group pattern that is used to gather packages.
     */
    public val pattern: Output
        get() = javaResource.pattern().applyValue({ args0 -> args0 })

    /**
     * An array of key-value pairs to apply to the package group.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> tagToKotlin(args0) })
                })
            }).orElse(null)
        })
}

public object PackageGroupMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.codeartifact.PackageGroup::class == javaResource::class

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy