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

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

package com.pulumi.awsnative.iotwireless.kotlin

import com.pulumi.awsnative.iotwireless.kotlin.enums.TaskDefinitionType
import com.pulumi.awsnative.iotwireless.kotlin.outputs.TaskDefinitionLoRaWanUpdateGatewayTaskEntry
import com.pulumi.awsnative.iotwireless.kotlin.outputs.TaskDefinitionUpdateWirelessGatewayTaskCreate
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.TaskDefinitionType.Companion.toKotlin as taskDefinitionTypeToKotlin
import com.pulumi.awsnative.iotwireless.kotlin.outputs.TaskDefinitionLoRaWanUpdateGatewayTaskEntry.Companion.toKotlin as taskDefinitionLoRaWanUpdateGatewayTaskEntryToKotlin
import com.pulumi.awsnative.iotwireless.kotlin.outputs.TaskDefinitionUpdateWirelessGatewayTaskCreate.Companion.toKotlin as taskDefinitionUpdateWirelessGatewayTaskCreateToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin

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

    public var args: TaskDefinitionArgs = TaskDefinitionArgs()

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

/**
 * Creates a gateway task definition.
 */
public class TaskDefinition internal constructor(
    override val javaResource: com.pulumi.awsnative.iotwireless.TaskDefinition,
) : KotlinCustomResource(javaResource, TaskDefinitionMapper) {
    /**
     * TaskDefinition arn. Returned after successful create.
     */
    public val arn: Output
        get() = javaResource.arn().applyValue({ args0 -> args0 })

    /**
     * Whether to automatically create tasks using this task definition for all gateways with the specified current version. If false, the task must me created by calling CreateWirelessGatewayTask.
     */
    public val autoCreateTasks: Output
        get() = javaResource.autoCreateTasks().applyValue({ args0 -> args0 })

    /**
     * The ID of the new wireless gateway task definition
     */
    public val awsId: Output
        get() = javaResource.awsId().applyValue({ args0 -> args0 })

    /**
     * The list of task definitions.
     */
    public val loRaWanUpdateGatewayTaskEntry: Output?
        get() = javaResource.loRaWanUpdateGatewayTaskEntry().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    taskDefinitionLoRaWanUpdateGatewayTaskEntryToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * The name of the new resource.
     */
    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 destination.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> tagToKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * A filter to list only the wireless gateway task definitions that use this task definition type
     */
    public val taskDefinitionType: Output?
        get() = javaResource.taskDefinitionType().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> taskDefinitionTypeToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * Information about the gateways to update.
     */
    public val update: Output?
        get() = javaResource.update().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    taskDefinitionUpdateWirelessGatewayTaskCreateToKotlin(args0)
                })
            }).orElse(null)
        })
}

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

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy