public AppToken(XmlElement node) : base(node) { foreach (XmlElement propertyNode in node.ChildNodes) { switch (propertyNode.Name) { case "id": this._Id = propertyNode.InnerText; continue; case "token": this._Token = propertyNode.InnerText; continue; case "partnerId": this._PartnerId = ParseInt(propertyNode.InnerText); continue; case "createdAt": this._CreatedAt = ParseInt(propertyNode.InnerText); continue; case "updatedAt": this._UpdatedAt = ParseInt(propertyNode.InnerText); continue; case "status": this._Status = (AppTokenStatus)ParseEnum(typeof(AppTokenStatus), propertyNode.InnerText); continue; case "expiry": this._Expiry = ParseInt(propertyNode.InnerText); continue; case "sessionType": this._SessionType = (SessionType)ParseEnum(typeof(SessionType), propertyNode.InnerText); continue; case "sessionUserId": this._SessionUserId = propertyNode.InnerText; continue; case "sessionDuration": this._SessionDuration = ParseInt(propertyNode.InnerText); continue; case "sessionPrivileges": this._SessionPrivileges = propertyNode.InnerText; continue; case "hashType": this._HashType = (AppTokenHashType)StringEnum.Parse(typeof(AppTokenHashType), propertyNode.InnerText); continue; case "description": this._Description = propertyNode.InnerText; continue; } } }
public AppToken(JToken node) : base(node) { if (node["id"] != null) { this._Id = node["id"].Value <string>(); } if (node["token"] != null) { this._Token = node["token"].Value <string>(); } if (node["partnerId"] != null) { this._PartnerId = ParseInt(node["partnerId"].Value <string>()); } if (node["createdAt"] != null) { this._CreatedAt = ParseInt(node["createdAt"].Value <string>()); } if (node["updatedAt"] != null) { this._UpdatedAt = ParseInt(node["updatedAt"].Value <string>()); } if (node["status"] != null) { this._Status = (AppTokenStatus)ParseEnum(typeof(AppTokenStatus), node["status"].Value <string>()); } if (node["expiry"] != null) { this._Expiry = ParseInt(node["expiry"].Value <string>()); } if (node["sessionType"] != null) { this._SessionType = (SessionType)ParseEnum(typeof(SessionType), node["sessionType"].Value <string>()); } if (node["sessionUserId"] != null) { this._SessionUserId = node["sessionUserId"].Value <string>(); } if (node["sessionDuration"] != null) { this._SessionDuration = ParseInt(node["sessionDuration"].Value <string>()); } if (node["sessionPrivileges"] != null) { this._SessionPrivileges = node["sessionPrivileges"].Value <string>(); } if (node["hashType"] != null) { this._HashType = (AppTokenHashType)StringEnum.Parse(typeof(AppTokenHashType), node["hashType"].Value <string>()); } if (node["description"] != null) { this._Description = node["description"].Value <string>(); } }