public static SubscribeRequest FromDict(JsonData data) { return(new SubscribeRequest { namespaceName = data.Keys.Contains("namespaceName") && data["namespaceName"] != null ? data["namespaceName"].ToString(): null, roomName = data.Keys.Contains("roomName") && data["roomName"] != null ? data["roomName"].ToString(): null, notificationTypes = data.Keys.Contains("notificationTypes") && data["notificationTypes"] != null ? data["notificationTypes"].Cast <JsonData>().Select(value => { return NotificationType.FromDict(value); } ).ToList() : null, duplicationAvoider = data.Keys.Contains("duplicationAvoider") && data["duplicationAvoider"] != null ? data["duplicationAvoider"].ToString(): null, }); }