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

commonMain.aws.sdk.kotlin.services.bedrockruntime.model.ImageSource.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.bedrockruntime.model



/**
 * The source for an image.
 */
public sealed class ImageSource {
    /**
     * The raw image bytes for the image. If you use an AWS SDK, you don't need to encode the image bytes in base64.
     */
    public data class Bytes(val value: kotlin.ByteArray) : aws.sdk.kotlin.services.bedrockruntime.model.ImageSource() {

        override fun hashCode(): kotlin.Int {
            return value.contentHashCode()
        }

        override fun equals(other: kotlin.Any?): kotlin.Boolean {
            if (this === other) return true
            if (other == null || this::class != other::class) return false

            other as Bytes

            if (!value.contentEquals(other.value)) return false

            return true
        }
    }

    public object SdkUnknown : aws.sdk.kotlin.services.bedrockruntime.model.ImageSource() {
    }

    /**
     * Casts this [ImageSource] as a [Bytes] and retrieves its [kotlin.ByteArray] value. Throws an exception if the [ImageSource] is not a
     * [Bytes].
     */
    public fun asBytes(): kotlin.ByteArray = (this as ImageSource.Bytes).value

    /**
     * Casts this [ImageSource] as a [Bytes] and retrieves its [kotlin.ByteArray] value. Returns null if the [ImageSource] is not a [Bytes].
     */
    public fun asBytesOrNull(): kotlin.ByteArray? = (this as? ImageSource.Bytes)?.value
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy