
com.pulumi.googlenative.retail.v2.kotlin.Control.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.retail.v2.kotlin
import com.pulumi.core.Output
import com.pulumi.googlenative.retail.v2.kotlin.outputs.GoogleCloudRetailV2RuleResponse
import com.pulumi.googlenative.retail.v2.kotlin.outputs.GoogleCloudRetailV2RuleResponse.Companion.toKotlin
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
/**
* Builder for [Control].
*/
@PulumiTagMarker
public class ControlResourceBuilder internal constructor() {
public var name: String? = null
public var args: ControlArgs = ControlArgs()
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 ControlArgsBuilder.() -> Unit) {
val builder = ControlArgsBuilder()
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(): Control {
val builtJavaResource = com.pulumi.googlenative.retail.v2.Control(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Control(builtJavaResource)
}
}
/**
* Creates a Control. If the Control to create already exists, an ALREADY_EXISTS error is returned.
* Auto-naming is currently not supported for this resource.
*/
public class Control internal constructor(
override val javaResource: com.pulumi.googlenative.retail.v2.Control,
) : KotlinCustomResource(javaResource, ControlMapper) {
/**
* List of serving config ids that are associated with this control in the same Catalog. Note the association is managed via the ServingConfig, this is an output only denormalized view.
*/
public val associatedServingConfigIds: Output>
get() = javaResource.associatedServingConfigIds().applyValue({ args0 ->
args0.map({ args0 ->
args0
})
})
public val catalogId: Output
get() = javaResource.catalogId().applyValue({ args0 -> args0 })
/**
* Required. The ID to use for the Control, which will become the final component of the Control's resource name. This value should be 4-63 characters, and valid characters are /a-z-_/.
*/
public val controlId: Output
get() = javaResource.controlId().applyValue({ args0 -> args0 })
/**
* The human readable control display name. Used in Retail UI. This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is thrown.
*/
public val displayName: Output
get() = javaResource.displayName().applyValue({ args0 -> args0 })
public val location: Output
get() = javaResource.location().applyValue({ args0 -> args0 })
/**
* Immutable. Fully qualified name `projects/*/locations/global/catalogs/*/controls/*`
* */*/*/
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
public val project: Output
get() = javaResource.project().applyValue({ args0 -> args0 })
/**
* A rule control - a condition-action pair. Enacts a set action when the condition is triggered. For example: Boost "gShoe" when query full matches "Running Shoes".
*/
public val rule: Output
get() = javaResource.rule().applyValue({ args0 -> args0.let({ args0 -> toKotlin(args0) }) })
/**
* Specifies the use case for the control. Affects what condition fields can be set. Only settable by search controls. Will default to SEARCH_SOLUTION_USE_CASE_SEARCH if not specified. Currently only allow one search_solution_use_case per control.
*/
public val searchSolutionUseCase: Output>
get() = javaResource.searchSolutionUseCase().applyValue({ args0 -> args0.map({ args0 -> args0 }) })
/**
* Immutable. The solution types that the control is used for. Currently we support setting only one type of solution at creation time. Only `SOLUTION_TYPE_SEARCH` value is supported at the moment. If no solution type is provided at creation time, will default to SOLUTION_TYPE_SEARCH.
*/
public val solutionTypes: Output>
get() = javaResource.solutionTypes().applyValue({ args0 -> args0.map({ args0 -> args0 }) })
}
public object ControlMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.googlenative.retail.v2.Control::class == javaResource::class
override fun map(javaResource: Resource): Control = Control(
javaResource as
com.pulumi.googlenative.retail.v2.Control,
)
}
/**
* @see [Control].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Control].
*/
public suspend fun control(name: String, block: suspend ControlResourceBuilder.() -> Unit): Control {
val builder = ControlResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Control].
* @param name The _unique_ name of the resulting resource.
*/
public fun control(name: String): Control {
val builder = ControlResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy