protected override async Task <string> ProcessResponseAsync(HttpResponseMessage response) { var items = await Deserialize <TMobileResponse[]>(response); var sb = new StringBuilder(); foreach (var item in items .Where(x => !string.IsNullOrEmpty(x.Manufacturer) && !string.IsNullOrEmpty(x.MarketingName))) { var csv = new FormattedCSV(); csv.Host = response.RequestMessage.RequestUri.Host; csv.TAC = item.IMEI.Substring(0, 8); csv.Result = $"{item.Manufacturer} {item.MarketingName}"; if (csv.Result.Contains("NotFound")) { continue; } sb.AppendLine(csv.ToString()); } return(sb.ToString()); }
protected override async Task <string> ProcessResponseAsync(HttpResponseMessage response) { var item = await Deserialize <UScellularRootItem>(response); if (item != null && item.equipment != null && item.equipment.attachment != null) { var e = item.equipment.attachment .Where(x => string.IsNullOrEmpty(x.type)).First(); var csv = new FormattedCSV(); csv.Host = response.RequestMessage.RequestUri.Host; csv.TAC = response.RequestMessage.RequestUri.Segments[5].Substring(0, 8); csv.Result = e.url; return(csv.ToString()); } return(string.Empty); }
protected override async Task <string> ProcessResponseAsync(HttpResponseMessage response) { var items = await Deserialize <XinitResponse[]>(response); var sb = new StringBuilder(); foreach (var item in items.Where(x => x.TAC.Length == 8)) { var csv = new FormattedCSV(); csv.Host = response.RequestMessage.RequestUri.Host; csv.TAC = item.TAC; csv.Result = item.Info; sb.AppendLine(csv.ToString()); } return(sb.ToString()); }
protected override async Task <string> ProcessResponseAsync(HttpResponseMessage response) { var item = await Deserialize <UltraMobileRootItem>(response); if (item != null && item.device != null && item.device.name != null && !string.IsNullOrEmpty(item.device.name)) { var json = await response.RequestMessage.Content.ReadAsStringAsync(); var tac = JsonSerializer.Deserialize <UltraMobileJson>(json); var csv = new FormattedCSV(); csv.Host = response.RequestMessage.RequestUri.Host; csv.TAC = tac.device.tac; csv.Result = item.device.name; return(csv.ToString()); } return(string.Empty); }
protected override async Task <string> ProcessResponseAsync(HttpResponseMessage response) { var item = await Deserialize <CricketWirelessRootItem>(response); if (item != null && item.Data != null) { var data = item.Data; var csv = new FormattedCSV(); csv.Host = response.RequestMessage.RequestUri.Host; csv.TAC = response.RequestMessage.RequestUri.Segments.Last().Substring(0, 8); if (data.Make == data.Model) { csv.Result = data.Make; } else { csv.Result = $"{data.Make} {data.Model}"; } return(csv.ToString()); } return(string.Empty); }