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

commonMain.aws.sdk.kotlin.services.qapps.model.DocumentAttributeValue.kt Maven / Gradle / Ivy

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.qapps.model

import aws.smithy.kotlin.runtime.time.Instant

/**
 * The value of a document attribute. You can only provide one value for a document attribute.
 */
public sealed class DocumentAttributeValue {
    /**
     * A date expressed as an ISO 8601 string.
     *
     * It's important for the time zone to be included in the *ISO 8601 date-time* format. For example, 2012-03-25T12:30:10+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in Central European Time.
     */
    public data class DateValue(val value: aws.smithy.kotlin.runtime.time.Instant) : aws.sdk.kotlin.services.qapps.model.DocumentAttributeValue() {
    }

    /**
     * A long integer value.
     */
    public data class LongValue(val value: kotlin.Long) : aws.sdk.kotlin.services.qapps.model.DocumentAttributeValue() {
    }

    /**
     * A list of strings.
     */
    public data class StringListValue(val value: List) : aws.sdk.kotlin.services.qapps.model.DocumentAttributeValue() {
    }

    /**
     * A string.
     */
    public data class StringValue(val value: kotlin.String) : aws.sdk.kotlin.services.qapps.model.DocumentAttributeValue() {
    }

    public object SdkUnknown : aws.sdk.kotlin.services.qapps.model.DocumentAttributeValue() {
    }

    /**
     * Casts this [DocumentAttributeValue] as a [DateValue] and retrieves its [aws.smithy.kotlin.runtime.time.Instant] value. Throws an exception if the [DocumentAttributeValue] is not a
     * [DateValue].
     */
    public fun asDateValue(): aws.smithy.kotlin.runtime.time.Instant = (this as DocumentAttributeValue.DateValue).value

    /**
     * Casts this [DocumentAttributeValue] as a [DateValue] and retrieves its [aws.smithy.kotlin.runtime.time.Instant] value. Returns null if the [DocumentAttributeValue] is not a [DateValue].
     */
    public fun asDateValueOrNull(): aws.smithy.kotlin.runtime.time.Instant? = (this as? DocumentAttributeValue.DateValue)?.value

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

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

    /**
     * Casts this [DocumentAttributeValue] as a [StringListValue] and retrieves its [List] value. Throws an exception if the [DocumentAttributeValue] is not a
     * [StringListValue].
     */
    public fun asStringListValue(): List = (this as DocumentAttributeValue.StringListValue).value

    /**
     * Casts this [DocumentAttributeValue] as a [StringListValue] and retrieves its [List] value. Returns null if the [DocumentAttributeValue] is not a [StringListValue].
     */
    public fun asStringListValueOrNull(): List? = (this as? DocumentAttributeValue.StringListValue)?.value

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy