
com.pulumi.awsnative.evidently.kotlin.Feature.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-aws-native-kotlin Show documentation
Show all versions of pulumi-aws-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.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.awsnative.evidently.kotlin
import com.pulumi.awsnative.evidently.kotlin.enums.FeatureEvaluationStrategy
import com.pulumi.awsnative.evidently.kotlin.outputs.FeatureEntityOverride
import com.pulumi.awsnative.evidently.kotlin.outputs.FeatureVariationObject
import com.pulumi.awsnative.kotlin.outputs.Tag
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.evidently.kotlin.enums.FeatureEvaluationStrategy.Companion.toKotlin as featureEvaluationStrategyToKotlin
import com.pulumi.awsnative.evidently.kotlin.outputs.FeatureEntityOverride.Companion.toKotlin as featureEntityOverrideToKotlin
import com.pulumi.awsnative.evidently.kotlin.outputs.FeatureVariationObject.Companion.toKotlin as featureVariationObjectToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin
/**
* Builder for [Feature].
*/
@PulumiTagMarker
public class FeatureResourceBuilder internal constructor() {
public var name: String? = null
public var args: FeatureArgs = FeatureArgs()
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 FeatureArgsBuilder.() -> Unit) {
val builder = FeatureArgsBuilder()
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(): Feature {
val builtJavaResource = com.pulumi.awsnative.evidently.Feature(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Feature(builtJavaResource)
}
}
/**
* Resource Type definition for AWS::Evidently::Feature.
*/
public class Feature internal constructor(
override val javaResource: com.pulumi.awsnative.evidently.Feature,
) : KotlinCustomResource(javaResource, FeatureMapper) {
/**
* The ARN of the feature. For example, `arn:aws:evidently:us-west-2:0123455678912:project/myProject/feature/myFeature` .
*/
public val arn: Output
get() = javaResource.arn().applyValue({ args0 -> args0 })
/**
* The name of the variation to use as the default variation. The default variation is served to users who are not allocated to any ongoing launches or experiments of this feature.
* This variation must also be listed in the `Variations` structure.
* If you omit `DefaultVariation` , the first variation listed in the `Variations` structure is used as the default variation.
*/
public val defaultVariation: Output?
get() = javaResource.defaultVariation().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* An optional description of the feature.
*/
public val description: Output?
get() = javaResource.description().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Specify users that should always be served a specific variation of a feature. Each user is specified by a key-value pair . For each key, specify a user by entering their user ID, account ID, or some other identifier. For the value, specify the name of the variation that they are to be served.
*/
public val entityOverrides: Output>?
get() = javaResource.entityOverrides().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
featureEntityOverrideToKotlin(args0)
})
})
}).orElse(null)
})
/**
* Specify `ALL_RULES` to activate the traffic allocation specified by any ongoing launches or experiments. Specify `DEFAULT_VARIATION` to serve the default variation to all users instead.
*/
public val evaluationStrategy: Output?
get() = javaResource.evaluationStrategy().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> featureEvaluationStrategyToKotlin(args0) })
}).orElse(null)
})
/**
* The name for the feature. It can include up to 127 characters.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* The name or ARN of the project that is to contain the new feature.
*/
public val project: Output
get() = javaResource.project().applyValue({ args0 -> args0 })
/**
* An array of key-value pairs to apply to this resource.
*/
public val tags: Output>?
get() = javaResource.tags().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> tagToKotlin(args0) })
})
}).orElse(null)
})
/**
* An array of structures that contain the configuration of the feature's different variations.
* Each `VariationObject` in the `Variations` array for a feature must have the same type of value ( `BooleanValue` , `DoubleValue` , `LongValue` or `StringValue` ).
*/
public val variations: Output>
get() = javaResource.variations().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
featureVariationObjectToKotlin(args0)
})
})
})
}
public object FeatureMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.evidently.Feature::class == javaResource::class
override fun map(javaResource: Resource): Feature = Feature(
javaResource as
com.pulumi.awsnative.evidently.Feature,
)
}
/**
* @see [Feature].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Feature].
*/
public suspend fun feature(name: String, block: suspend FeatureResourceBuilder.() -> Unit): Feature {
val builder = FeatureResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Feature].
* @param name The _unique_ name of the resulting resource.
*/
public fun feature(name: String): Feature {
val builder = FeatureResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy