public Session Parse(SkillRequest SkillRequest, JObject jObject) { if (jObject == null) { return(null); } var userParser = new UserParser(); var user = userParser.Parse(jObject); return(new Session { IsNew = jObject.Value <bool>("new"), SessionId = jObject.GetString("sessionId"), Application = jObject.GetApplication(), Attributes = GetAttributes(jObject), User = user }); }
private SystemObject GetSystemObject(JObject system) { if (system == null) { return(null); } var userParser = new UserParser(); var user = userParser.Parse(system); return(new SystemObject { Application = system.GetApplication(), User = user, Device = GetDevice(system.Value <JObject>("device")), ApiEndpoint = system.GetString("apiEndpoint"), ApiAccessToken = system.GetString("apiAccessToken") }); }