Converts instance to a map.
Map<String, dynamic> toMap() { return { "action": action?.toNativeValue(), "resources": resources.map((e) => e.toNativeValue()).toList(), }; }