Upload Class

  • java.lang.Object
    • com.azure.ai.openai.models.Upload

Implements

public final class Upload
implements JsonSerializable<Upload>

The Upload object can accept byte chunks in the form of Parts.

Method Summary

Modifier and Type Method and Description
static Upload fromJson(JsonReader jsonReader)

Reads an instance of Upload from the JsonReader.

long getBytes()

Get the bytes property: The intended number of bytes to be uploaded.

OffsetDateTime getCreatedAt()

Get the createdAt property: The Unix timestamp (in seconds) for when the Upload was created.

OffsetDateTime getExpiresAt()

Get the expiresAt property: The Unix timestamp (in seconds) for when the Upload was created.

OpenAIFile getFile()

Get the file property: The ready File object after the Upload is completed.

String getFilename()

Get the filename property: The name of the file to be uploaded.

String getId()

Get the id property: The Upload unique identifier, which can be referenced in API endpoints.

UploadObject getObject()

Get the object property: The object type, which is always "upload".

UploadPurpose getPurpose()

Get the purpose property: The intended purpose of the file.

UploadStatus getStatus()

Get the status property: The status of the Upload.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Method Details

fromJson

public static Upload fromJson(JsonReader jsonReader)

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:

IOException

- If the deserialized JSON object was missing any required properties.

getBytes

public long getBytes()

Get the bytes property: The intended number of bytes to be uploaded.

Returns:

the bytes value.

getCreatedAt

public OffsetDateTime getCreatedAt()

Get the createdAt property: The Unix timestamp (in seconds) for when the Upload was created.

Returns:

the createdAt value.

getExpiresAt

public OffsetDateTime getExpiresAt()

Get the expiresAt property: The Unix timestamp (in seconds) for when the Upload was created.

Returns:

the expiresAt value.

getFile

public OpenAIFile getFile()

Get the file property: The ready File object after the Upload is completed.

Returns:

the file value.

getFilename

public String getFilename()

Get the filename property: The name of the file to be uploaded.

Returns:

the filename value.

getId

public String getId()

Get the id property: The Upload unique identifier, which can be referenced in API endpoints.

Returns:

the id value.

getObject

public UploadObject getObject()

Get the object property: The object type, which is always "upload".

Returns:

the object 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.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to