FileAsset

sealed interface FileAsset

Represents a file attached to a conversation message, such as an image, PDF, or generic document.

Inheritors

Types

Link copied to clipboard
object Factory

Factory for creating the appropriate FileAsset subtype from a local file.

Link copied to clipboard
@JsonClass(generateAdapter = true)
open class GenericAsset(val id: String = UUID.randomUUID().toString(), val parentEntryId: String? = null, val url: String? = null, val name: String = UUID.randomUUID().toString(), var file: File? = null, val mimeType: String = file?.getMimeType() ?: GenericMimeType.OCTET_STREAM.value, var attachmentUploadResult: AttachmentUploadResult? = null) : FileAsset

A concrete FileAsset for any file type, used as the default when a more specific subtype does not apply.

Link copied to clipboard
@JsonClass(generateAdapter = true)
open class ImageAsset(id: String = UUID.randomUUID().toString(), parentEntryId: String? = null, url: String? = null, name: String = UUID.randomUUID().toString(), mimeType: String = ImageMimeType.JPEG.value, attachmentUploadResult: AttachmentUploadResult? = null, file: File? = null) : FileAsset.GenericAsset

A FileAsset representing an image, such as a PNG, JPEG, or GIF.

Link copied to clipboard
@JsonClass(generateAdapter = true)
class PdfAsset(id: String = UUID.randomUUID().toString(), parentEntryId: String? = null, url: String? = null, name: String = UUID.randomUUID().toString(), mimeType: String = PdfMimeType.PDF.value, attachmentUploadResult: AttachmentUploadResult? = null, file: File? = null) : FileAsset.GenericAsset

A FileAsset representing a PDF document.

Properties

Link copied to clipboard

The broad category of this attachment (image, PDF, video, etc.).

Link copied to clipboard

The upload result status for this attachment, or null if upload has not been attempted.

Link copied to clipboard
abstract var file: File?

The local file reference, if available on device.

Link copied to clipboard

The resolved MIME type, preferring the local file's type over the server-reported type.

Link copied to clipboard
abstract val id: String

The unique identifier of this file asset.

Link copied to clipboard
abstract val mimeType: String

The MIME type of the file as reported by the server.

Link copied to clipboard
abstract val name: String

The display name of the file.

Link copied to clipboard
abstract val parentEntryId: String?

The identifier of the conversation entry that contains this attachment.

Link copied to clipboard
abstract val url: String?

The remote URL where this file can be downloaded, or null if not yet uploaded.