com.pulumi.awsnative.databrew.kotlin.Recipe.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.awsnative.databrew.kotlin
import com.pulumi.awsnative.databrew.kotlin.outputs.RecipeStep
import com.pulumi.awsnative.kotlin.outputs.CreateOnlyTag
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.databrew.kotlin.outputs.RecipeStep.Companion.toKotlin as recipeStepToKotlin
import com.pulumi.awsnative.kotlin.outputs.CreateOnlyTag.Companion.toKotlin as createOnlyTagToKotlin
/**
* Builder for [Recipe].
*/
@PulumiTagMarker
public class RecipeResourceBuilder internal constructor() {
public var name: String? = null
public var args: RecipeArgs = RecipeArgs()
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 RecipeArgsBuilder.() -> Unit) {
val builder = RecipeArgsBuilder()
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(): Recipe {
val builtJavaResource = com.pulumi.awsnative.databrew.Recipe(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Recipe(builtJavaResource)
}
}
/**
* Resource schema for AWS::DataBrew::Recipe.
* ## Example Usage
* ### Example
* No Java example available.
*/
public class Recipe internal constructor(
override val javaResource: com.pulumi.awsnative.databrew.Recipe,
) : KotlinCustomResource(javaResource, RecipeMapper) {
/**
* Description of the recipe
*/
public val description: Output?
get() = javaResource.description().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Recipe name
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* A list of steps that are defined by the recipe.
*/
public val steps: Output>
get() = javaResource.steps().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
recipeStepToKotlin(args0)
})
})
})
/**
* Metadata tags that have been applied to the recipe.
*/
public val tags: Output>?
get() = javaResource.tags().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> createOnlyTagToKotlin(args0) })
})
}).orElse(null)
})
}
public object RecipeMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.databrew.Recipe::class == javaResource::class
override fun map(javaResource: Resource): Recipe = Recipe(
javaResource as
com.pulumi.awsnative.databrew.Recipe,
)
}
/**
* @see [Recipe].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Recipe].
*/
public suspend fun recipe(name: String, block: suspend RecipeResourceBuilder.() -> Unit): Recipe {
val builder = RecipeResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Recipe].
* @param name The _unique_ name of the resulting resource.
*/
public fun recipe(name: String): Recipe {
val builder = RecipeResourceBuilder()
builder.name(name)
return builder.build()
}