Class Upload
-
- All Implemented Interfaces:
public final class Upload
The Upload object can accept byte chunks in the form of Parts.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
Upload.Builder
A builder for Upload.
public final class
Upload.Status
The status of the Upload.
-
Method Summary
Modifier and Type Method Description final String
id()
The Upload unique identifier, which can be referenced in API endpoints. final Long
bytes()
The intended number of bytes to be uploaded. final Long
createdAt()
The Unix timestamp (in seconds) for when the Upload was created. final Long
expiresAt()
The Unix timestamp (in seconds) for when the Upload will expire. final String
filename()
The name of the file to be uploaded. final JsonValue
_object_()
The object type, which is always "upload". final String
purpose()
The intended purpose of the file. final Upload.Status
status()
The status of the Upload. final Optional<FileObject>
file()
The File
object represents a document that has been uploaded to OpenAI.final JsonField<String>
_id()
Returns the raw JSON value of id. final JsonField<Long>
_bytes()
Returns the raw JSON value of bytes. final JsonField<Long>
_createdAt()
Returns the raw JSON value of createdAt. final JsonField<Long>
_expiresAt()
Returns the raw JSON value of expiresAt. final JsonField<String>
_filename()
Returns the raw JSON value of filename. final JsonField<String>
_purpose()
Returns the raw JSON value of purpose. final JsonField<Upload.Status>
_status()
Returns the raw JSON value of status. final JsonField<FileObject>
_file()
Returns the raw JSON value of file. final Map<String, JsonValue>
_additionalProperties()
final Upload.Builder
toBuilder()
final Upload
validate()
final Boolean
isValid()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static Upload.Builder
builder()
Returns a mutable builder for constructing an instance of Upload. -
-
Method Detail
-
_object_
final JsonValue _object_()
The object type, which is always "upload".
Expected to always return the following:
JsonValue.from("upload")
However, this method can be useful for debugging and logging (e.g. if the server responded with an unexpected value).
-
purpose
final String purpose()
The intended purpose of the file. Please refer here for acceptable values.
-
status
final Upload.Status status()
The status of the Upload.
-
file
final Optional<FileObject> file()
The
File
object represents a document that has been uploaded to OpenAI.
-
_id
final JsonField<String> _id()
Returns the raw JSON value of id.
Unlike id, this method doesn't throw if the JSON field has an unexpected type.
-
_bytes
final JsonField<Long> _bytes()
Returns the raw JSON value of bytes.
Unlike bytes, this method doesn't throw if the JSON field has an unexpected type.
-
_createdAt
final JsonField<Long> _createdAt()
Returns the raw JSON value of createdAt.
Unlike createdAt, this method doesn't throw if the JSON field has an unexpected type.
-
_expiresAt
final JsonField<Long> _expiresAt()
Returns the raw JSON value of expiresAt.
Unlike expiresAt, this method doesn't throw if the JSON field has an unexpected type.
-
_filename
final JsonField<String> _filename()
Returns the raw JSON value of filename.
Unlike filename, this method doesn't throw if the JSON field has an unexpected type.
-
_purpose
final JsonField<String> _purpose()
Returns the raw JSON value of purpose.
Unlike purpose, this method doesn't throw if the JSON field has an unexpected type.
-
_status
final JsonField<Upload.Status> _status()
Returns the raw JSON value of status.
Unlike status, this method doesn't throw if the JSON field has an unexpected type.
-
_file
final JsonField<FileObject> _file()
Returns the raw JSON value of file.
Unlike file, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final Upload.Builder toBuilder()
-
builder
final static Upload.Builder builder()
Returns a mutable builder for constructing an instance of Upload.
The following fields are required:
.id() .bytes() .createdAt() .expiresAt() .filename() .purpose() .status()
-
-
-
-