Class MessageAttachment

java.lang.Object
com.azure.ai.agents.persistent.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 Details

    • MessageAttachment

      public MessageAttachment(List<com.azure.core.util.BinaryData> tools)
      Creates an instance of MessageAttachment class.
      Parameters:
      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.
    • setFileId

      public MessageAttachment setFileId(String fileId)
      Set the fileId property: The ID of the file to attach to the message.
      Parameters:
      fileId - the fileId value to set.
      Returns:
      the MessageAttachment object itself.
    • getDataSource

      public VectorStoreDataSource getDataSource()
      Get the dataSource property: Azure asset ID.
      Returns:
      the dataSource value.
    • setDataSource

      public MessageAttachment setDataSource(VectorStoreDataSource dataSource)
      Set the dataSource property: Azure asset ID.
      Parameters:
      dataSource - the dataSource value to set.
      Returns:
      the MessageAttachment object itself.
    • 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.