com.pulumi.awsnative.sagemaker.kotlin.App.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.awsnative.sagemaker.kotlin
import com.pulumi.awsnative.kotlin.outputs.CreateOnlyTag
import com.pulumi.awsnative.sagemaker.kotlin.enums.AppType
import com.pulumi.awsnative.sagemaker.kotlin.outputs.AppResourceSpec
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.CreateOnlyTag.Companion.toKotlin as createOnlyTagToKotlin
import com.pulumi.awsnative.sagemaker.kotlin.enums.AppType.Companion.toKotlin as appTypeToKotlin
import com.pulumi.awsnative.sagemaker.kotlin.outputs.AppResourceSpec.Companion.toKotlin as appResourceSpecToKotlin
/**
* Builder for [App].
*/
@PulumiTagMarker
public class AppResourceBuilder internal constructor() {
public var name: String? = null
public var args: AppArgs = AppArgs()
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 AppArgsBuilder.() -> Unit) {
val builder = AppArgsBuilder()
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(): App {
val builtJavaResource = com.pulumi.awsnative.sagemaker.App(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return App(builtJavaResource)
}
}
/**
* Resource Type definition for AWS::SageMaker::App
*/
public class App internal constructor(
override val javaResource: com.pulumi.awsnative.sagemaker.App,
) : KotlinCustomResource(javaResource, AppMapper) {
/**
* The Amazon Resource Name (ARN) of the app.
*/
public val appArn: Output
get() = javaResource.appArn().applyValue({ args0 -> args0 })
/**
* The name of the app.
*/
public val appName: Output
get() = javaResource.appName().applyValue({ args0 -> args0 })
/**
* The type of app.
*/
public val appType: Output
get() = javaResource.appType().applyValue({ args0 ->
args0.let({ args0 ->
appTypeToKotlin(args0)
})
})
/**
* The domain ID.
*/
public val domainId: Output
get() = javaResource.domainId().applyValue({ args0 -> args0 })
/**
* The instance type and the Amazon Resource Name (ARN) of the SageMaker image created on the instance.
*/
public val resourceSpec: Output?
get() = javaResource.resourceSpec().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
appResourceSpecToKotlin(args0)
})
}).orElse(null)
})
/**
* A list of tags to apply to the app.
*/
public val tags: Output>?
get() = javaResource.tags().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> createOnlyTagToKotlin(args0) })
})
}).orElse(null)
})
/**
* The user profile name.
*/
public val userProfileName: Output
get() = javaResource.userProfileName().applyValue({ args0 -> args0 })
}
public object AppMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.sagemaker.App::class == javaResource::class
override fun map(javaResource: Resource): App = App(
javaResource as
com.pulumi.awsnative.sagemaker.App,
)
}
/**
* @see [App].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [App].
*/
public suspend fun app(name: String, block: suspend AppResourceBuilder.() -> Unit): App {
val builder = AppResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [App].
* @param name The _unique_ name of the resulting resource.
*/
public fun app(name: String): App {
val builder = AppResourceBuilder()
builder.name(name)
return builder.build()
}