Class CreateUploadRequest

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

public final class CreateUploadRequest extends Object implements com.azure.json.JsonSerializable<CreateUploadRequest>
The request body of an upload creation operation.
  • Constructor Details

    • CreateUploadRequest

      public CreateUploadRequest(String filename, CreateUploadRequestPurpose purpose, int bytes, String mimeType)
      Creates an instance of CreateUploadRequest class.
      Parameters:
      filename - the filename value to set.
      purpose - the purpose value to set.
      bytes - the bytes value to set.
      mimeType - the mimeType value to set.
  • Method Details

    • getFilename

      public String getFilename()
      Get the filename property: The name of the file to upload.
      Returns:
      the filename value.
    • getPurpose

      public CreateUploadRequestPurpose getPurpose()
      Get the purpose property: The intended purpose of the uploaded file. Use 'assistants' for Assistants and Message files, 'vision' for Assistants image file inputs, 'batch' for Batch API, and 'fine-tune' for Fine-tuning.
      Returns:
      the purpose value.
    • getBytes

      public int getBytes()
      Get the bytes property: The number of bytes in the file you are uploading.
      Returns:
      the bytes value.
    • getMimeType

      public String getMimeType()
      Get the mimeType property: The MIME type of the file. This must fall within the supported MIME types for your file purpose. See the supported MIME types for assistants and vision.
      Returns:
      the mimeType value.
    • toJson

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

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