using System; using SUISS.Cloud.Boomlagoon.JSON; namespace SUISS.Cloud { public class ApiResponse { public ApiResponse(object data) { this.Json = data; } public JSONValue Data { get { string text = SUISS.Cloud.Json.Encode(this.Json); text = text.Trim(); if (!text.StartsWith("{") && !text.StartsWith("[")) { return null; } if (text.StartsWith("{")) { JSONObject jsonobject = JSONObject.Parse(text); if (jsonobject == null) { return null; } return new JSONValue(jsonobject); } else { JSONObject jsonobject2 = JSONObject.Parse("{\"data\":" + text + "}"); if (jsonobject2 == null) { return null; } return jsonobject2.GetValue("data"); } } } public object Json { get; private set; } } }