FileContent

data class FileContent(val name: String? = null, val mimeType: String? = null, val bytes: ByteArray? = null, val uri: String? = null)(source)

Represents the content of a file, either as base64 encoded bytes or a URI.

This is a union type that can represent either:

  • File content provided directly as base64-encoded bytes (via bytes property)

  • File content located at a specific URI (via uri property)

Either bytes or uri should be provided, but not both.

Constructors

Link copied to clipboard
constructor(name: String? = null, mimeType: String? = null, bytes: ByteArray? = null, uri: String? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The base64-encoded content of the file. Present when representing file content directly.

Link copied to clipboard
@SerialName(value = "mimeType")
val mimeType: String?

The MIME type of the file (e.g., "application/pdf").

Link copied to clipboard
@SerialName(value = "name")
val name: String?

An optional name for the file (e.g., "document.pdf").

Link copied to clipboard
@SerialName(value = "uri")
val uri: String?

A URL pointing to the file's content. Present when representing file content via URI.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String