com.pulumi.awsnative.networkmanager.kotlin.Device.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.networkmanager.kotlin
import com.pulumi.awsnative.kotlin.outputs.Tag
import com.pulumi.awsnative.networkmanager.kotlin.outputs.DeviceAwsLocation
import com.pulumi.awsnative.networkmanager.kotlin.outputs.DeviceLocation
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.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin
import com.pulumi.awsnative.networkmanager.kotlin.outputs.DeviceAwsLocation.Companion.toKotlin as deviceAwsLocationToKotlin
import com.pulumi.awsnative.networkmanager.kotlin.outputs.DeviceLocation.Companion.toKotlin as deviceLocationToKotlin
/**
* Builder for [Device].
*/
@PulumiTagMarker
public class DeviceResourceBuilder internal constructor() {
public var name: String? = null
public var args: DeviceArgs = DeviceArgs()
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 DeviceArgsBuilder.() -> Unit) {
val builder = DeviceArgsBuilder()
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(): Device {
val builtJavaResource = com.pulumi.awsnative.networkmanager.Device(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Device(builtJavaResource)
}
}
/**
* The AWS::NetworkManager::Device type describes a device.
*/
public class Device internal constructor(
override val javaResource: com.pulumi.awsnative.networkmanager.Device,
) : KotlinCustomResource(javaResource, DeviceMapper) {
/**
* The Amazon Web Services location of the device, if applicable.
*/
public val awsLocation: Output?
get() = javaResource.awsLocation().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
deviceAwsLocationToKotlin(args0)
})
}).orElse(null)
})
/**
* The date and time that the device was created.
*/
public val createdAt: Output
get() = javaResource.createdAt().applyValue({ args0 -> args0 })
/**
* The description of the device.
*/
public val description: Output?
get() = javaResource.description().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The Amazon Resource Name (ARN) of the device.
*/
public val deviceArn: Output
get() = javaResource.deviceArn().applyValue({ args0 -> args0 })
/**
* The ID of the device.
*/
public val deviceId: Output
get() = javaResource.deviceId().applyValue({ args0 -> args0 })
/**
* The ID of the global network.
*/
public val globalNetworkId: Output
get() = javaResource.globalNetworkId().applyValue({ args0 -> args0 })
/**
* The site location.
*/
public val location: Output?
get() = javaResource.location().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
deviceLocationToKotlin(args0)
})
}).orElse(null)
})
/**
* The device model
*/
public val model: Output?
get() = javaResource.model().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The device serial number.
*/
public val serialNumber: Output?
get() = javaResource.serialNumber().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The site ID.
*/
public val siteId: Output?
get() = javaResource.siteId().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The state of the device.
*/
public val state: Output
get() = javaResource.state().applyValue({ args0 -> args0 })
/**
* The tags for the device.
*/
public val tags: Output>?
get() = javaResource.tags().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> tagToKotlin(args0) })
})
}).orElse(null)
})
/**
* The device type.
*/
public val type: Output?
get() = javaResource.type().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The device vendor.
*/
public val vendor: Output?
get() = javaResource.vendor().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
}
public object DeviceMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.networkmanager.Device::class == javaResource::class
override fun map(javaResource: Resource): Device = Device(
javaResource as
com.pulumi.awsnative.networkmanager.Device,
)
}
/**
* @see [Device].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Device].
*/
public suspend fun device(name: String, block: suspend DeviceResourceBuilder.() -> Unit): Device {
val builder = DeviceResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Device].
* @param name The _unique_ name of the resulting resource.
*/
public fun device(name: String): Device {
val builder = DeviceResourceBuilder()
builder.name(name)
return builder.build()
}