Serializes the resource into a transportable format.
Returns a String for formats 0, 1, 2 (Base64 string, Data URI, or URL), or a Map for format 3 (structured JSON object).
Object serialize();