
com.pulumi.googlenative.firebaseml.v1beta2.kotlin.Model.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.firebaseml.v1beta2.kotlin
import com.pulumi.core.Output
import com.pulumi.googlenative.firebaseml.v1beta2.kotlin.outputs.ModelStateResponse
import com.pulumi.googlenative.firebaseml.v1beta2.kotlin.outputs.OperationResponse
import com.pulumi.googlenative.firebaseml.v1beta2.kotlin.outputs.TfLiteModelResponse
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.googlenative.firebaseml.v1beta2.kotlin.outputs.ModelStateResponse.Companion.toKotlin as modelStateResponseToKotlin
import com.pulumi.googlenative.firebaseml.v1beta2.kotlin.outputs.OperationResponse.Companion.toKotlin as operationResponseToKotlin
import com.pulumi.googlenative.firebaseml.v1beta2.kotlin.outputs.TfLiteModelResponse.Companion.toKotlin as tfLiteModelResponseToKotlin
/**
* Builder for [Model].
*/
@PulumiTagMarker
public class ModelResourceBuilder internal constructor() {
public var name: String? = null
public var args: ModelArgs = ModelArgs()
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 ModelArgsBuilder.() -> Unit) {
val builder = ModelArgsBuilder()
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(): Model {
val builtJavaResource =
com.pulumi.googlenative.firebaseml.v1beta2.Model(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Model(builtJavaResource)
}
}
/**
* Creates a model in Firebase ML. The longrunning operation will eventually return a Model
*/
public class Model internal constructor(
override val javaResource: com.pulumi.googlenative.firebaseml.v1beta2.Model,
) : KotlinCustomResource(javaResource, ModelMapper) {
/**
* Lists operation ids associated with this model whose status is NOT done.
*/
public val activeOperations: Output>
get() = javaResource.activeOperations().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> operationResponseToKotlin(args0) })
})
})
/**
* Timestamp when this model was created in Firebase ML.
*/
public val createTime: Output
get() = javaResource.createTime().applyValue({ args0 -> args0 })
/**
* The name of the model to create. The name can be up to 32 characters long and can consist only of ASCII Latin letters A-Z and a-z, underscores(_) and ASCII digits 0-9. It must start with a letter.
*/
public val displayName: Output
get() = javaResource.displayName().applyValue({ args0 -> args0 })
/**
* See RFC7232 https://tools.ietf.org/html/rfc7232#section-2.3
*/
public val etag: Output
get() = javaResource.etag().applyValue({ args0 -> args0 })
/**
* The model_hash will change if a new file is available for download.
*/
public val modelHash: Output
get() = javaResource.modelHash().applyValue({ args0 -> args0 })
/**
* The resource name of the Model. Model names have the form `projects/{project_id}/models/{model_id}` The name is ignored when creating a model.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
public val project: Output
get() = javaResource.project().applyValue({ args0 -> args0 })
/**
* State common to all model types. Includes publishing and validation information.
*/
public val state: Output
get() = javaResource.state().applyValue({ args0 ->
args0.let({ args0 ->
modelStateResponseToKotlin(args0)
})
})
/**
* User defined tags which can be used to group/filter models during listing
*/
public val tags: Output>
get() = javaResource.tags().applyValue({ args0 -> args0.map({ args0 -> args0 }) })
/**
* A TFLite Model
*/
public val tfliteModel: Output
get() = javaResource.tfliteModel().applyValue({ args0 ->
args0.let({ args0 ->
tfLiteModelResponseToKotlin(args0)
})
})
/**
* Timestamp when this model was updated in Firebase ML.
*/
public val updateTime: Output
get() = javaResource.updateTime().applyValue({ args0 -> args0 })
}
public object ModelMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.googlenative.firebaseml.v1beta2.Model::class == javaResource::class
override fun map(javaResource: Resource): Model = Model(
javaResource as
com.pulumi.googlenative.firebaseml.v1beta2.Model,
)
}
/**
* @see [Model].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Model].
*/
public suspend fun model(name: String, block: suspend ModelResourceBuilder.() -> Unit): Model {
val builder = ModelResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Model].
* @param name The _unique_ name of the resulting resource.
*/
public fun model(name: String): Model {
val builder = ModelResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy