Class Upload

java.lang.Object
com.azure.ai.openai.models.Upload
All Implemented Interfaces:
com.azure.json.JsonSerializable<Upload>

public final class Upload extends Object implements com.azure.json.JsonSerializable<Upload>
The Upload object can accept byte chunks in the form of Parts.
  • Method Summary

    Modifier and Type
    Method
    Description
    static Upload
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of Upload from the JsonReader.
    long
    Get the bytes property: The intended number of bytes to be uploaded.
    Get the createdAt property: The Unix timestamp (in seconds) for when the Upload was created.
    Get the expiresAt property: The Unix timestamp (in seconds) for when the Upload was created.
    Get the file property: The ready File object after the Upload is completed.
    Get the filename property: The name of the file to be uploaded.
    Get the id property: The Upload unique identifier, which can be referenced in API endpoints.
    Get the object property: The object type, which is always "upload".
    Get the purpose property: The intended purpose of the file.
    Get the status property: The status of the Upload.
    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
  • Method Details

    • getId

      public String getId()
      Get the id property: The Upload unique identifier, which can be referenced in API endpoints.
      Returns:
      the id value.
    • getCreatedAt

      public OffsetDateTime getCreatedAt()
      Get the createdAt property: The Unix timestamp (in seconds) for when the Upload was created.
      Returns:
      the createdAt value.
    • getFilename

      public String getFilename()
      Get the filename property: The name of the file to be uploaded.
      Returns:
      the filename value.
    • getBytes

      public long getBytes()
      Get the bytes property: The intended number of bytes to be uploaded.
      Returns:
      the bytes value.
    • getPurpose

      public UploadPurpose getPurpose()
      Get the purpose property: The intended purpose of the file.
      Returns:
      the purpose value.
    • getStatus

      public UploadStatus getStatus()
      Get the status property: The status of the Upload.
      Returns:
      the status value.
    • getExpiresAt

      public OffsetDateTime getExpiresAt()
      Get the expiresAt property: The Unix timestamp (in seconds) for when the Upload was created.
      Returns:
      the expiresAt value.
    • getObject

      public UploadObject getObject()
      Get the object property: The object type, which is always "upload".
      Returns:
      the object value.
    • getFile

      public OpenAIFile getFile()
      Get the file property: The ready File object after the Upload is completed.
      Returns:
      the file value.
    • toJson

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

      public static Upload fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of Upload from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of Upload 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 Upload.