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

com.pulumi.awsnative.iotsitewise.kotlin.Gateway.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: 1.11.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.iotsitewise.kotlin

import com.pulumi.awsnative.iotsitewise.kotlin.outputs.GatewayCapabilitySummary
import com.pulumi.awsnative.iotsitewise.kotlin.outputs.GatewayPlatform
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.iotsitewise.kotlin.outputs.GatewayCapabilitySummary.Companion.toKotlin as gatewayCapabilitySummaryToKotlin
import com.pulumi.awsnative.iotsitewise.kotlin.outputs.GatewayPlatform.Companion.toKotlin as gatewayPlatformToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin

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

    public var args: GatewayArgs = GatewayArgs()

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

/**
 * Resource schema for AWS::IoTSiteWise::Gateway
 */
public class Gateway internal constructor(
    override val javaResource: com.pulumi.awsnative.iotsitewise.Gateway,
) : KotlinCustomResource(javaResource, GatewayMapper) {
    /**
     * A list of gateway capability summaries that each contain a namespace and status.
     */
    public val gatewayCapabilitySummaries: Output>?
        get() = javaResource.gatewayCapabilitySummaries().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 ->
                        gatewayCapabilitySummaryToKotlin(args0)
                    })
                })
            }).orElse(null)
        })

    /**
     * The ID of the gateway device.
     */
    public val gatewayId: Output
        get() = javaResource.gatewayId().applyValue({ args0 -> args0 })

    /**
     * A unique, friendly name for the gateway.
     */
    public val gatewayName: Output
        get() = javaResource.gatewayName().applyValue({ args0 -> args0 })

    /**
     * The gateway's platform. You can only specify one platform in a gateway.
     */
    public val gatewayPlatform: Output
        get() = javaResource.gatewayPlatform().applyValue({ args0 ->
            args0.let({ args0 ->
                gatewayPlatformToKotlin(args0)
            })
        })

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

public object GatewayMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.iotsitewise.Gateway::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy