//*** QueryEnumerator ***// //*** GetAllDocuments ***// internal static JObject QueryEnumeratorToJson(QueryEnumerator queryEnumerator) { var json = new JObject(); var rowsArray = new JArray(); var queryRows = queryEnumerator.GetEnumerator(); while (queryRows.MoveNext()) { var queryRow = queryRows.Current; var queryRowJson = C8oFullSyncTranslator.DictionaryToJson(queryRow.AsJSONDictionary()); rowsArray.Add(queryRowJson); } json[C8oFullSyncTranslator.FULL_SYNC_RESPONSE_KEY_COUNT] = queryEnumerator.Count; json[C8oFullSyncTranslator.FULL_SYNC_RESPONSE_KEY_ROWS] = rowsArray; return(json); }
//*** DefaultResponse ***// //*** Sync, ReplicatePull, ReplicatePush, Reset ***// internal static JObject FullSyncDefaultResponseToJson(FullSyncDefaultResponse fullSyncDefaultResponse) { var json = C8oFullSyncTranslator.DictionaryToJson(fullSyncDefaultResponse.GetProperties()); return(json); }
//*** Document ***// internal static JObject DocumentToJson(Document document) { var json = C8oFullSyncTranslator.DictionaryToJson(document.Properties); return(json); }