com.pulumi.awsnative.personalize.kotlin.Dataset.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.awsnative.personalize.kotlin
import com.pulumi.awsnative.personalize.kotlin.enums.DatasetType
import com.pulumi.awsnative.personalize.kotlin.outputs.DatasetImportJob
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 com.pulumi.awsnative.personalize.kotlin.enums.DatasetType.Companion.toKotlin as datasetTypeToKotlin
import com.pulumi.awsnative.personalize.kotlin.outputs.DatasetImportJob.Companion.toKotlin as datasetImportJobToKotlin
/**
* Builder for [Dataset].
*/
@PulumiTagMarker
public class DatasetResourceBuilder internal constructor() {
public var name: String? = null
public var args: DatasetArgs = DatasetArgs()
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 DatasetArgsBuilder.() -> Unit) {
val builder = DatasetArgsBuilder()
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(): Dataset {
val builtJavaResource = com.pulumi.awsnative.personalize.Dataset(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Dataset(builtJavaResource)
}
}
/**
* Resource schema for AWS::Personalize::Dataset.
* ## Example Usage
* ### Example
* No Java example available.
* ### Example
* No Java example available.
*/
public class Dataset internal constructor(
override val javaResource: com.pulumi.awsnative.personalize.Dataset,
) : KotlinCustomResource(javaResource, DatasetMapper) {
/**
* The ARN of the dataset
*/
public val datasetArn: Output
get() = javaResource.datasetArn().applyValue({ args0 -> args0 })
/**
* The Amazon Resource Name (ARN) of the dataset group to add the dataset to
*/
public val datasetGroupArn: Output
get() = javaResource.datasetGroupArn().applyValue({ args0 -> args0 })
/**
* Describes a job that imports training data from a data source (Amazon S3 bucket) to an Amazon Personalize dataset. If you specify a dataset import job as part of a dataset, all dataset import job fields are required.
*/
public val datasetImportJob: Output?
get() = javaResource.datasetImportJob().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> datasetImportJobToKotlin(args0) })
}).orElse(null)
})
/**
* The type of dataset
*/
public val datasetType: Output
get() = javaResource.datasetType().applyValue({ args0 ->
args0.let({ args0 ->
datasetTypeToKotlin(args0)
})
})
/**
* The name for the dataset
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* The ARN of the schema to associate with the dataset. The schema defines the dataset fields.
*/
public val schemaArn: Output
get() = javaResource.schemaArn().applyValue({ args0 -> args0 })
}
public object DatasetMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.personalize.Dataset::class == javaResource::class
override fun map(javaResource: Resource): Dataset = Dataset(
javaResource as
com.pulumi.awsnative.personalize.Dataset,
)
}
/**
* @see [Dataset].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Dataset].
*/
public suspend fun dataset(name: String, block: suspend DatasetResourceBuilder.() -> Unit): Dataset {
val builder = DatasetResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Dataset].
* @param name The _unique_ name of the resulting resource.
*/
public fun dataset(name: String): Dataset {
val builder = DatasetResourceBuilder()
builder.name(name)
return builder.build()
}