CoapMessage
class CoapMessage(val type: CoapMessageType, val code: CoapCode, val messageId: Int, token: ByteArray, val options: OptionSet, payload: ByteArray)(source)
A CoAP message (RFC 7252 §3): header fields, token, options and payload. Immutable; derive changed copies with toBuilder.
type and messageId belong to the UDP messaging layer. On reliable transports (RFC 8323) they do not exist on the wire: the reliable codec ignores them when encoding and sets CON and 0 when decoding.