Class MessageAttachment
java.lang.Object
com.azure.ai.openai.assistants.models.MessageAttachment
- All Implemented Interfaces:
com.azure.json.JsonSerializable<MessageAttachment>
public final class MessageAttachment
extends Object
implements com.azure.json.JsonSerializable<MessageAttachment>
This describes to which tools a file has been attached.
-
Constructor Summary
ConstructorsConstructorDescriptionMessageAttachment
(String fileId, List<com.azure.core.util.BinaryData> tools) Creates an instance of MessageAttachment class. -
Method Summary
Modifier and TypeMethodDescriptionstatic MessageAttachment
fromJson
(com.azure.json.JsonReader jsonReader) Reads an instance of MessageAttachment from the JsonReader.Get the fileId property: The ID of the file to attach to the message.List
<com.azure.core.util.BinaryData> getTools()
Get the tools property: The tools to add to this file.com.azure.json.JsonWriter
toJson
(com.azure.json.JsonWriter jsonWriter) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
MessageAttachment
Creates an instance of MessageAttachment class.- Parameters:
fileId
- the fileId value to set.tools
- the tools value to set.
-
-
Method Details
-
getFileId
Get the fileId property: The ID of the file to attach to the message.- Returns:
- the fileId value.
-
getTools
Get the tools property: The tools to add to this file.- Returns:
- the tools value.
-
toJson
- Specified by:
toJson
in interfacecom.azure.json.JsonSerializable<MessageAttachment>
- Throws:
IOException
-
fromJson
Reads an instance of MessageAttachment from the JsonReader.- Parameters:
jsonReader
- The JsonReader being read.- Returns:
- An instance of MessageAttachment if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
- Throws:
IllegalStateException
- If the deserialized JSON object was missing any required properties.IOException
- If an error occurs while reading the MessageAttachment.
-