MessageInputTextBlock Class

public final class MessageInputTextBlock
extends MessageInputContentBlock

A text block in a new message, containing plain text content.

Constructor Summary

Constructor Description
MessageInputTextBlock(String text)

Creates an instance of MessageInputTextBlock class.

Method Summary

Modifier and Type Method and Description
static MessageInputTextBlock fromJson(JsonReader jsonReader)

Reads an instance of MessageInputTextBlock from the JsonReader.

String getText()

Get the text property: The plain text content for this block.

MessageBlockType getType()

Get the type property: Specifies which kind of content block this is (text, image_file, image_url, etc.).

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from MessageInputContentBlock

Methods inherited from java.lang.Object

Constructor Details

MessageInputTextBlock

public MessageInputTextBlock(String text)

Creates an instance of MessageInputTextBlock class.

Parameters:

text - the text value to set.

Method Details

fromJson

public static MessageInputTextBlock fromJson(JsonReader jsonReader)

Reads an instance of MessageInputTextBlock from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of MessageInputTextBlock if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If the deserialized JSON object was missing any required properties.

getText

public String getText()

Get the text property: The plain text content for this block.

Returns:

the text value.

getType

public MessageBlockType getType()

Get the type property: Specifies which kind of content block this is (text, image_file, image_url, etc.).

Overrides:

MessageInputTextBlock.getType()

Returns:

the type value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Overrides:

MessageInputTextBlock.toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to