Map<String, dynamic> toJson() { return { 'url': url, 'failureMessage': failureMessage, if (requestId != null) 'requestId': requestId!.toJson(), }; }