toJsonForProtocol method
Returns a JSON structure of the model, optimized for Protocol communication.
Implementation
@override
Map<String, dynamic> toJsonForProtocol() {
return {
'success': success,
if (key != null) 'key': key,
if (keyId != null) 'keyId': keyId,
if (userInfo != null) 'userInfo': userInfo?.toJsonForProtocol(),
if (failReason != null) 'failReason': failReason?.toJson(),
};
}