com.pulumi.awsnative.iotwireless.kotlin.WirelessDevice.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-aws-native-kotlin Show documentation
Show all versions of pulumi-aws-native-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.awsnative.iotwireless.kotlin
import com.pulumi.awsnative.iotwireless.kotlin.enums.WirelessDeviceType
import com.pulumi.awsnative.iotwireless.kotlin.outputs.WirelessDeviceLoRaWanDevice
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.WirelessDeviceType.Companion.toKotlin as wirelessDeviceTypeToKotlin
import com.pulumi.awsnative.iotwireless.kotlin.outputs.WirelessDeviceLoRaWanDevice.Companion.toKotlin as wirelessDeviceLoRaWanDeviceToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin
/**
* Builder for [WirelessDevice].
*/
@PulumiTagMarker
public class WirelessDeviceResourceBuilder internal constructor() {
public var name: String? = null
public var args: WirelessDeviceArgs = WirelessDeviceArgs()
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 WirelessDeviceArgsBuilder.() -> Unit) {
val builder = WirelessDeviceArgsBuilder()
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(): WirelessDevice {
val builtJavaResource = com.pulumi.awsnative.iotwireless.WirelessDevice(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return WirelessDevice(builtJavaResource)
}
}
/**
* Create and manage wireless gateways, including LoRa gateways.
*/
public class WirelessDevice internal constructor(
override val javaResource: com.pulumi.awsnative.iotwireless.WirelessDevice,
) : KotlinCustomResource(javaResource, WirelessDeviceMapper) {
/**
* Wireless device arn. Returned after successful create.
*/
public val arn: Output
get() = javaResource.arn().applyValue({ args0 -> args0 })
/**
* Wireless device Id. Returned after successful create.
*/
public val awsId: Output
get() = javaResource.awsId().applyValue({ args0 -> args0 })
/**
* Wireless device description
*/
public val description: Output?
get() = javaResource.description().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Wireless device destination name
*/
public val destinationName: Output
get() = javaResource.destinationName().applyValue({ args0 -> args0 })
/**
* The date and time when the most recent uplink was received.
*/
public val lastUplinkReceivedAt: Output?
get() = javaResource.lastUplinkReceivedAt().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The combination of Package, Station and Model which represents the version of the LoRaWAN Wireless Device.
*/
public val loRaWan: Output?
get() = javaResource.loRaWan().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
wirelessDeviceLoRaWanDeviceToKotlin(args0)
})
}).orElse(null)
})
/**
* Wireless device name
*/
public val name: Output?
get() = javaResource.name().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* A list of key-value pairs that contain metadata for the device. Currently not supported, will not create if tags are passed.
*/
public val tags: Output>?
get() = javaResource.tags().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> tagToKotlin(args0) })
})
}).orElse(null)
})
/**
* Thing arn. Passed into update to associate Thing with Wireless device.
*/
public val thingArn: Output?
get() = javaResource.thingArn().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* Thing Arn. If there is a Thing created, this can be returned with a Get call.
*/
public val thingName: Output
get() = javaResource.thingName().applyValue({ args0 -> args0 })
/**
* Wireless device type, currently only Sidewalk and LoRa
*/
public val type: Output
get() = javaResource.type().applyValue({ args0 ->
args0.let({ args0 ->
wirelessDeviceTypeToKotlin(args0)
})
})
}
public object WirelessDeviceMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.iotwireless.WirelessDevice::class == javaResource::class
override fun map(javaResource: Resource): WirelessDevice = WirelessDevice(
javaResource as
com.pulumi.awsnative.iotwireless.WirelessDevice,
)
}
/**
* @see [WirelessDevice].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [WirelessDevice].
*/
public suspend fun wirelessDevice(
name: String,
block: suspend WirelessDeviceResourceBuilder.() -> Unit,
): WirelessDevice {
val builder = WirelessDeviceResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [WirelessDevice].
* @param name The _unique_ name of the resulting resource.
*/
public fun wirelessDevice(name: String): WirelessDevice {
val builder = WirelessDeviceResourceBuilder()
builder.name(name)
return builder.build()
}