Blob

@Serializable
data class Blob(val ref: CidLink, val mimeType: String, val size: Long, val type: String = "blob")

A reference to an uploaded blob as embedded in a record body.

AT Protocol blobs are stored out-of-band (uploaded via com.atproto.repo.uploadBlob, addressed by CID) and referenced inline from the records that use them. The inline reference shape is:

{
"$type": "blob",
"ref": { "$link": "bafkreig..." },
"mimeType": "image/jpeg",
"size": 123456
}

type is a constant "blob" discriminator required by the spec. It's marked EncodeDefault.Mode.ALWAYS so that construction doesn't require repeating the literal at every call site but the wire form still carries it.

Constructors

Link copied to clipboard
constructor(ref: CidLink, mimeType: String, size: Long, type: String = "blob")

Properties

Link copied to clipboard
@SerialName(value = "mimeType")
val mimeType: String
Link copied to clipboard
@SerialName(value = "ref")
val ref: CidLink
Link copied to clipboard
@SerialName(value = "size")
val size: Long
Link copied to clipboard
@EncodeDefault(mode = EncodeDefault.Mode.ALWAYS)
@SerialName(value = "$type")
val type: String