Package com.azure.ai.openai.models
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 Summary
ConstructorsConstructorDescriptionCreateUploadRequest(String filename, CreateUploadRequestPurpose purpose, int bytes, String mimeType) Creates an instance of CreateUploadRequest class. -
Method Summary
Modifier and TypeMethodDescriptionstatic CreateUploadRequestfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of CreateUploadRequest from the JsonReader.intgetBytes()Get the bytes property: The number of bytes in the file you are uploading.Get the filename property: The name of the file to upload.Get the mimeType property: The MIME type of the file.Get the purpose property: The intended purpose of the uploaded file.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
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
Get the filename property: The name of the file to upload.- Returns:
- the filename value.
-
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
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
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<CreateUploadRequest>- Throws:
IOException
-
fromJson
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.
-