Map<String, Object?> encode() => { 'id': id.toTfJson(), if (version != null) 'version': version!.toTfJson(), };