toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  return <String, dynamic>{
    'status': isSuccess ? 'success' : 'failed',
    if (requestId != null) 'requestId': requestId,
    if (endpoint != null) 'endpoint': endpoint,
    if (method != null) 'method': method,
    if (statusCode != null) 'statusCode': statusCode,
    if (message != null) 'message': message,
    if (errorCode != null) 'errorCode': errorCode,
    'data': data,
    'fromCache': fromCache,
  };
}