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