toJson method
Implementation
Map<String, dynamic> toJson() {
final onFailure = this.onFailure;
final onSuccess = this.onSuccess;
return {
if (onFailure != null) 'OnFailure': onFailure,
if (onSuccess != null) 'OnSuccess': onSuccess,
};
}