commonMain.aws.sdk.kotlin.services.bedrockruntime.model.DocumentSource.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.bedrockruntime.model
/**
* Contains the content of a document.
*/
public sealed class DocumentSource {
/**
* The raw bytes for the document. If you use an Amazon Web Services SDK, you don't need to encode the bytes in base64.
*/
public data class Bytes(val value: kotlin.ByteArray) : aws.sdk.kotlin.services.bedrockruntime.model.DocumentSource() {
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.DocumentSource() {
}
/**
* Casts this [DocumentSource] as a [Bytes] and retrieves its [kotlin.ByteArray] value. Throws an exception if the [DocumentSource] is not a
* [Bytes].
*/
public fun asBytes(): kotlin.ByteArray = (this as DocumentSource.Bytes).value
/**
* Casts this [DocumentSource] as a [Bytes] and retrieves its [kotlin.ByteArray] value. Returns null if the [DocumentSource] is not a [Bytes].
*/
public fun asBytesOrNull(): kotlin.ByteArray? = (this as? DocumentSource.Bytes)?.value
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy