
com.pulumi.googlenative.cloudiot.v1.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-google-native-kotlin Show documentation
Show all versions of pulumi-google-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.
The newest version!
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.googlenative.cloudiot.v1.kotlin
import com.pulumi.core.Output
import com.pulumi.googlenative.cloudiot.v1.kotlin.outputs.DeviceConfigResponse
import com.pulumi.googlenative.cloudiot.v1.kotlin.outputs.DeviceCredentialResponse
import com.pulumi.googlenative.cloudiot.v1.kotlin.outputs.DeviceStateResponse
import com.pulumi.googlenative.cloudiot.v1.kotlin.outputs.GatewayConfigResponse
import com.pulumi.googlenative.cloudiot.v1.kotlin.outputs.StatusResponse
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 kotlin.collections.Map
import com.pulumi.googlenative.cloudiot.v1.kotlin.outputs.DeviceConfigResponse.Companion.toKotlin as deviceConfigResponseToKotlin
import com.pulumi.googlenative.cloudiot.v1.kotlin.outputs.DeviceCredentialResponse.Companion.toKotlin as deviceCredentialResponseToKotlin
import com.pulumi.googlenative.cloudiot.v1.kotlin.outputs.DeviceStateResponse.Companion.toKotlin as deviceStateResponseToKotlin
import com.pulumi.googlenative.cloudiot.v1.kotlin.outputs.GatewayConfigResponse.Companion.toKotlin as gatewayConfigResponseToKotlin
import com.pulumi.googlenative.cloudiot.v1.kotlin.outputs.StatusResponse.Companion.toKotlin as statusResponseToKotlin
/**
* 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.googlenative.cloudiot.v1.Device(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Device(builtJavaResource)
}
}
/**
* Creates a device in a device registry.
*/
public class Device internal constructor(
override val javaResource: com.pulumi.googlenative.cloudiot.v1.Device,
) : KotlinCustomResource(javaResource, DeviceMapper) {
/**
* If a device is blocked, connections or requests from this device will fail. Can be used to temporarily prevent the device from connecting if, for example, the sensor is generating bad data and needs maintenance.
*/
public val blocked: Output
get() = javaResource.blocked().applyValue({ args0 -> args0 })
/**
* The most recent device configuration, which is eventually sent from Cloud IoT Core to the device. If not present on creation, the configuration will be initialized with an empty payload and version value of `1`. To update this field after creation, use the `DeviceManager.ModifyCloudToDeviceConfig` method.
*/
public val config: Output
get() = javaResource.config().applyValue({ args0 ->
args0.let({ args0 ->
deviceConfigResponseToKotlin(args0)
})
})
/**
* The credentials used to authenticate this device. To allow credential rotation without interruption, multiple device credentials can be bound to this device. No more than 3 credentials can be bound to a single device at a time. When new credentials are added to a device, they are verified against the registry credentials. For details, see the description of the `DeviceRegistry.credentials` field.
*/
public val credentials: Output>
get() = javaResource.credentials().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
deviceCredentialResponseToKotlin(args0)
})
})
})
/**
* Gateway-related configuration and state.
*/
public val gatewayConfig: Output
get() = javaResource.gatewayConfig().applyValue({ args0 ->
args0.let({ args0 ->
gatewayConfigResponseToKotlin(args0)
})
})
/**
* [Output only] The last time a cloud-to-device config version acknowledgment was received from the device. This field is only for configurations sent through MQTT.
*/
public val lastConfigAckTime: Output
get() = javaResource.lastConfigAckTime().applyValue({ args0 -> args0 })
/**
* [Output only] The last time a cloud-to-device config version was sent to the device.
*/
public val lastConfigSendTime: Output
get() = javaResource.lastConfigSendTime().applyValue({ args0 -> args0 })
/**
* [Output only] The error message of the most recent error, such as a failure to publish to Cloud Pub/Sub. 'last_error_time' is the timestamp of this field. If no errors have occurred, this field has an empty message and the status code 0 == OK. Otherwise, this field is expected to have a status code other than OK.
*/
public val lastErrorStatus: Output
get() = javaResource.lastErrorStatus().applyValue({ args0 ->
args0.let({ args0 ->
statusResponseToKotlin(args0)
})
})
/**
* [Output only] The time the most recent error occurred, such as a failure to publish to Cloud Pub/Sub. This field is the timestamp of 'last_error_status'.
*/
public val lastErrorTime: Output
get() = javaResource.lastErrorTime().applyValue({ args0 -> args0 })
/**
* [Output only] The last time a telemetry event was received. Timestamps are periodically collected and written to storage; they may be stale by a few minutes.
*/
public val lastEventTime: Output
get() = javaResource.lastEventTime().applyValue({ args0 -> args0 })
/**
* [Output only] The last time an MQTT `PINGREQ` was received. This field applies only to devices connecting through MQTT. MQTT clients usually only send `PINGREQ` messages if the connection is idle, and no other messages have been sent. Timestamps are periodically collected and written to storage; they may be stale by a few minutes.
*/
public val lastHeartbeatTime: Output
get() = javaResource.lastHeartbeatTime().applyValue({ args0 -> args0 })
/**
* [Output only] The last time a state event was received. Timestamps are periodically collected and written to storage; they may be stale by a few minutes.
*/
public val lastStateTime: Output
get() = javaResource.lastStateTime().applyValue({ args0 -> args0 })
public val location: Output
get() = javaResource.location().applyValue({ args0 -> args0 })
/**
* **Beta Feature** The logging verbosity for device activity. If unspecified, DeviceRegistry.log_level will be used.
*/
public val logLevel: Output
get() = javaResource.logLevel().applyValue({ args0 -> args0 })
/**
* The metadata key-value pairs assigned to the device. This metadata is not interpreted or indexed by Cloud IoT Core. It can be used to add contextual information for the device. Keys must conform to the regular expression a-zA-Z+ and be less than 128 bytes in length. Values are free-form strings. Each value must be less than or equal to 32 KB in size. The total size of all keys and values must be less than 256 KB, and the maximum number of key-value pairs is 500.
*/
public val metadata: Output
© 2015 - 2025 Weber Informatics LLC | Privacy Policy