@Generated(value="com.amazonaws:aws-java-sdk-code-generator") public class Message extends Object implements Serializable, Cloneable, StructuredPojo
A message input, or returned from, a call to Converse or ConverseStream.
Constructor and Description |
---|
Message() |
Modifier and Type | Method and Description |
---|---|
Message |
clone() |
boolean |
equals(Object obj) |
List<ContentBlock> |
getContent()
The message content.
|
String |
getRole()
The role that the message plays in the message.
|
int |
hashCode() |
void |
marshall(ProtocolMarshaller protocolMarshaller)
Marshalls this structured data using the given
ProtocolMarshaller . |
void |
setContent(Collection<ContentBlock> content)
The message content.
|
void |
setRole(String role)
The role that the message plays in the message.
|
String |
toString()
Returns a string representation of this object.
|
Message |
withContent(Collection<ContentBlock> content)
The message content.
|
Message |
withContent(ContentBlock... content)
The message content.
|
Message |
withRole(ConversationRole role)
The role that the message plays in the message.
|
Message |
withRole(String role)
The role that the message plays in the message.
|
public void setRole(String role)
The role that the message plays in the message.
role
- The role that the message plays in the message.ConversationRole
public String getRole()
The role that the message plays in the message.
ConversationRole
public Message withRole(String role)
The role that the message plays in the message.
role
- The role that the message plays in the message.ConversationRole
public Message withRole(ConversationRole role)
The role that the message plays in the message.
role
- The role that the message plays in the message.ConversationRole
public List<ContentBlock> getContent()
The message content. Note the following restrictions:
You can include up to 20 images. Each image's size, height, and width must be no more than 3.75 MB, 8000 px, and 8000 px, respectively.
You can include up to five documents. Each document's size must be no more than 4.5 MB.
If you include a ContentBlock
with a document
field in the array, you must also include
a ContentBlock
with a text
field.
You can only include images and documents if the role
is user
.
You can include up to 20 images. Each image's size, height, and width must be no more than 3.75 MB, 8000 px, and 8000 px, respectively.
You can include up to five documents. Each document's size must be no more than 4.5 MB.
If you include a ContentBlock
with a document
field in the array, you must also
include a ContentBlock
with a text
field.
You can only include images and documents if the role
is user
.
public void setContent(Collection<ContentBlock> content)
The message content. Note the following restrictions:
You can include up to 20 images. Each image's size, height, and width must be no more than 3.75 MB, 8000 px, and 8000 px, respectively.
You can include up to five documents. Each document's size must be no more than 4.5 MB.
If you include a ContentBlock
with a document
field in the array, you must also include
a ContentBlock
with a text
field.
You can only include images and documents if the role
is user
.
content
- The message content. Note the following restrictions:
You can include up to 20 images. Each image's size, height, and width must be no more than 3.75 MB, 8000 px, and 8000 px, respectively.
You can include up to five documents. Each document's size must be no more than 4.5 MB.
If you include a ContentBlock
with a document
field in the array, you must also
include a ContentBlock
with a text
field.
You can only include images and documents if the role
is user
.
public Message withContent(ContentBlock... content)
The message content. Note the following restrictions:
You can include up to 20 images. Each image's size, height, and width must be no more than 3.75 MB, 8000 px, and 8000 px, respectively.
You can include up to five documents. Each document's size must be no more than 4.5 MB.
If you include a ContentBlock
with a document
field in the array, you must also include
a ContentBlock
with a text
field.
You can only include images and documents if the role
is user
.
NOTE: This method appends the values to the existing list (if any). Use
setContent(java.util.Collection)
or withContent(java.util.Collection)
if you want to override
the existing values.
content
- The message content. Note the following restrictions:
You can include up to 20 images. Each image's size, height, and width must be no more than 3.75 MB, 8000 px, and 8000 px, respectively.
You can include up to five documents. Each document's size must be no more than 4.5 MB.
If you include a ContentBlock
with a document
field in the array, you must also
include a ContentBlock
with a text
field.
You can only include images and documents if the role
is user
.
public Message withContent(Collection<ContentBlock> content)
The message content. Note the following restrictions:
You can include up to 20 images. Each image's size, height, and width must be no more than 3.75 MB, 8000 px, and 8000 px, respectively.
You can include up to five documents. Each document's size must be no more than 4.5 MB.
If you include a ContentBlock
with a document
field in the array, you must also include
a ContentBlock
with a text
field.
You can only include images and documents if the role
is user
.
content
- The message content. Note the following restrictions:
You can include up to 20 images. Each image's size, height, and width must be no more than 3.75 MB, 8000 px, and 8000 px, respectively.
You can include up to five documents. Each document's size must be no more than 4.5 MB.
If you include a ContentBlock
with a document
field in the array, you must also
include a ContentBlock
with a text
field.
You can only include images and documents if the role
is user
.
public String toString()
toString
in class Object
Object.toString()
public void marshall(ProtocolMarshaller protocolMarshaller)
StructuredPojo
ProtocolMarshaller
.marshall
in interface StructuredPojo
protocolMarshaller
- Implementation of ProtocolMarshaller
used to marshall this object's data.