All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.aws.sdk.kotlin.services.evidently.model.VariableValue.kt Maven / Gradle / Ivy

There is a newer version: 1.3.35
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.evidently.model



/**
 * The value assigned to a feature variation. This structure must contain exactly one field. It can be `boolValue`, `doubleValue`, `longValue`, or `stringValue`.
 */
public sealed class VariableValue {
    /**
     * If this feature uses the Boolean variation type, this field contains the Boolean value of this variation.
     */
    public data class BoolValue(val value: kotlin.Boolean) : aws.sdk.kotlin.services.evidently.model.VariableValue() {
    }

    /**
     * If this feature uses the double integer variation type, this field contains the double integer value of this variation.
     */
    public data class DoubleValue(val value: kotlin.Double) : aws.sdk.kotlin.services.evidently.model.VariableValue() {
    }

    /**
     * If this feature uses the long variation type, this field contains the long value of this variation.
     */
    public data class LongValue(val value: kotlin.Long) : aws.sdk.kotlin.services.evidently.model.VariableValue() {
    }

    /**
     * If this feature uses the string variation type, this field contains the string value of this variation.
     */
    public data class StringValue(val value: kotlin.String) : aws.sdk.kotlin.services.evidently.model.VariableValue() {
    }

    public object SdkUnknown : aws.sdk.kotlin.services.evidently.model.VariableValue() {
    }

    /**
     * Casts this [VariableValue] as a [BoolValue] and retrieves its [kotlin.Boolean] value. Throws an exception if the [VariableValue] is not a
     * [BoolValue].
     */
    public fun asBoolValue(): kotlin.Boolean = (this as VariableValue.BoolValue).value

    /**
     * Casts this [VariableValue] as a [BoolValue] and retrieves its [kotlin.Boolean] value. Returns null if the [VariableValue] is not a [BoolValue].
     */
    public fun asBoolValueOrNull(): kotlin.Boolean? = (this as? VariableValue.BoolValue)?.value

    /**
     * Casts this [VariableValue] as a [DoubleValue] and retrieves its [kotlin.Double] value. Throws an exception if the [VariableValue] is not a
     * [DoubleValue].
     */
    public fun asDoubleValue(): kotlin.Double = (this as VariableValue.DoubleValue).value

    /**
     * Casts this [VariableValue] as a [DoubleValue] and retrieves its [kotlin.Double] value. Returns null if the [VariableValue] is not a [DoubleValue].
     */
    public fun asDoubleValueOrNull(): kotlin.Double? = (this as? VariableValue.DoubleValue)?.value

    /**
     * Casts this [VariableValue] as a [LongValue] and retrieves its [kotlin.Long] value. Throws an exception if the [VariableValue] is not a
     * [LongValue].
     */
    public fun asLongValue(): kotlin.Long = (this as VariableValue.LongValue).value

    /**
     * Casts this [VariableValue] as a [LongValue] and retrieves its [kotlin.Long] value. Returns null if the [VariableValue] is not a [LongValue].
     */
    public fun asLongValueOrNull(): kotlin.Long? = (this as? VariableValue.LongValue)?.value

    /**
     * Casts this [VariableValue] as a [StringValue] and retrieves its [kotlin.String] value. Throws an exception if the [VariableValue] is not a
     * [StringValue].
     */
    public fun asStringValue(): kotlin.String = (this as VariableValue.StringValue).value

    /**
     * Casts this [VariableValue] as a [StringValue] and retrieves its [kotlin.String] value. Returns null if the [VariableValue] is not a [StringValue].
     */
    public fun asStringValueOrNull(): kotlin.String? = (this as? VariableValue.StringValue)?.value
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy