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

    Constructors
    Constructor
    Description
    MessageAttachment(String fileId, List<com.azure.core.util.BinaryData> tools)
    Creates an instance of MessageAttachment class.
  • Method Summary

    Modifier and Type
    Method
    Description
    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>
    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

      public MessageAttachment(String fileId, List<com.azure.core.util.BinaryData> tools)
      Creates an instance of MessageAttachment class.
      Parameters:
      fileId - the fileId value to set.
      tools - the tools value to set.
  • Method Details

    • getFileId

      public String getFileId()
      Get the fileId property: The ID of the file to attach to the message.
      Returns:
      the fileId value.
    • getTools

      public List<com.azure.core.util.BinaryData> getTools()
      Get the tools property: The tools to add to this file.
      Returns:
      the tools value.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<MessageAttachment>
      Throws:
      IOException
    • fromJson

      public static MessageAttachment fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      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.