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

com.pulumi.awsnative.iotwireless.kotlin.Destination.kt Maven / Gradle / Ivy

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

package com.pulumi.awsnative.iotwireless.kotlin

import com.pulumi.awsnative.iotwireless.kotlin.enums.DestinationExpressionType
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.iotwireless.kotlin.enums.DestinationExpressionType.Companion.toKotlin as destinationExpressionTypeToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin

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

    public var args: DestinationArgs = DestinationArgs()

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

/**
 * Destination's resource schema demonstrating some basic constructs and validation rules.
 */
public class Destination internal constructor(
    override val javaResource: com.pulumi.awsnative.iotwireless.Destination,
) : KotlinCustomResource(javaResource, DestinationMapper) {
    /**
     * Destination arn. Returned after successful create.
     */
    public val arn: Output
        get() = javaResource.arn().applyValue({ args0 -> args0 })

    /**
     * Destination description
     */
    public val description: Output?
        get() = javaResource.description().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Destination expression
     */
    public val expression: Output
        get() = javaResource.expression().applyValue({ args0 -> args0 })

    /**
     * Must be RuleName
     */
    public val expressionType: Output
        get() = javaResource.expressionType().applyValue({ args0 ->
            args0.let({ args0 ->
                destinationExpressionTypeToKotlin(args0)
            })
        })

    /**
     * Unique name of destination
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * AWS role ARN that grants access
     */
    public val roleArn: Output?
        get() = javaResource.roleArn().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * A list of key-value pairs that contain metadata for the destination.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> tagToKotlin(args0) })
                })
            }).orElse(null)
        })
}

public object DestinationMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.iotwireless.Destination::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy