commonMain.aws.sdk.kotlin.services.bedrockagent.model.ContentBlock.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bedrockagent-jvm Show documentation
Show all versions of bedrockagent-jvm Show documentation
The AWS SDK for Kotlin client for Bedrock Agent
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.bedrockagent.model
/**
* Contains the content for the message you pass to, or receive from a model. For more information, see [Create a prompt using Prompt management](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-create.html).
*/
public sealed class ContentBlock {
/**
* The text in the message.
*/
public data class Text(val value: kotlin.String) : aws.sdk.kotlin.services.bedrockagent.model.ContentBlock() {
override fun toString(): kotlin.String = "ContentBlock(*** Sensitive Data Redacted ***)"
}
public object SdkUnknown : aws.sdk.kotlin.services.bedrockagent.model.ContentBlock() {
override fun toString(): kotlin.String = "ContentBlock(*** Sensitive Data Redacted ***)"
}
/**
* Casts this [ContentBlock] as a [Text] and retrieves its [kotlin.String] value. Throws an exception if the [ContentBlock] is not a
* [Text].
*/
public fun asText(): kotlin.String = (this as ContentBlock.Text).value
/**
* Casts this [ContentBlock] as a [Text] and retrieves its [kotlin.String] value. Returns null if the [ContentBlock] is not a [Text].
*/
public fun asTextOrNull(): kotlin.String? = (this as? ContentBlock.Text)?.value
}