/// <summary> /// Deserialize the object /// </summary> public virtual void DeserializeJson(JToken inputObject) { if (inputObject != null && inputObject.Type != JTokenType.Null) { JToken avatarUrlValue = inputObject["AvatarUrl"]; if (avatarUrlValue != null && avatarUrlValue.Type != JTokenType.Null) { this.AvatarUrl = ((string)avatarUrlValue); } JToken likeGroupsSequence = ((JToken)inputObject["LikeGroups"]); if (likeGroupsSequence != null && likeGroupsSequence.Type != JTokenType.Null) { foreach (JToken likeGroupsValue in ((JArray)likeGroupsSequence)) { LikeGroup likeGroup = new LikeGroup(); likeGroup.DeserializeJson(likeGroupsValue); this.LikeGroups.Add(likeGroup); } } JToken likeUrlValue = inputObject["LikeUrl"]; if (likeUrlValue != null && likeUrlValue.Type != JTokenType.Null) { this.LikeUrl = ((string)likeUrlValue); } JToken messageValue = inputObject["Message"]; if (messageValue != null && messageValue.Type != JTokenType.Null) { this.Message = ((string)messageValue); } JToken timeAgoValue = inputObject["TimeAgo"]; if (timeAgoValue != null && timeAgoValue.Type != JTokenType.Null) { this.TimeAgo = ((string)timeAgoValue); } JToken userIdValue = inputObject["UserId"]; if (userIdValue != null && userIdValue.Type != JTokenType.Null) { this.UserId = ((string)userIdValue); } JToken userNameValue = inputObject["UserName"]; if (userNameValue != null && userNameValue.Type != JTokenType.Null) { this.UserName = ((string)userNameValue); } } }
/// <summary> /// Deserialize the object /// </summary> public virtual void DeserializeJson(JToken inputObject) { if (inputObject != null && inputObject.Type != JTokenType.Null) { JToken commentsSequence = ((JToken)inputObject["Comments"]); if (commentsSequence != null && commentsSequence.Type != JTokenType.Null) { foreach (JToken commentsValue in ((JArray)commentsSequence)) { CommentDetails commentDetails = new CommentDetails(); commentDetails.DeserializeJson(commentsValue); this.Comments.Add(commentDetails); } } JToken commentUrlValue = inputObject["CommentUrl"]; if (commentUrlValue != null && commentUrlValue.Type != JTokenType.Null) { this.CommentUrl = ((string)commentUrlValue); } JToken descriptionValue = inputObject["Description"]; if (descriptionValue != null && descriptionValue.Type != JTokenType.Null) { this.Description = ((string)descriptionValue); } JToken itemsSequence = ((JToken)inputObject["Items"]); if (itemsSequence != null && itemsSequence.Type != JTokenType.Null) { foreach (JToken itemsValue in ((JArray)itemsSequence)) { AlbumItem albumItem = new AlbumItem(); albumItem.DeserializeJson(itemsValue); this.Items.Add(albumItem); } } JToken likeGroupsSequence = ((JToken)inputObject["LikeGroups"]); if (likeGroupsSequence != null && likeGroupsSequence.Type != JTokenType.Null) { foreach (JToken likeGroupsValue in ((JArray)likeGroupsSequence)) { LikeGroup likeGroup = new LikeGroup(); likeGroup.DeserializeJson(likeGroupsValue); this.LikeGroups.Add(likeGroup); } } JToken likeUrlValue = inputObject["LikeUrl"]; if (likeUrlValue != null && likeUrlValue.Type != JTokenType.Null) { this.LikeUrl = ((string)likeUrlValue); } JToken titleValue = inputObject["Title"]; if (titleValue != null && titleValue.Type != JTokenType.Null) { this.Title = ((string)titleValue); } JToken userIdValue = inputObject["UserId"]; if (userIdValue != null && userIdValue.Type != JTokenType.Null) { this.UserId = ((string)userIdValue); } } }
/// <summary> /// Deserialize the object /// </summary> public virtual void DeserializeJson(JToken inputObject) { if (inputObject != null && inputObject.Type != JTokenType.Null) { JToken avatarUrlValue = inputObject["AvatarUrl"]; if (avatarUrlValue != null && avatarUrlValue.Type != JTokenType.Null) { this.AvatarUrl = ((string)avatarUrlValue); } JToken commentsSequence = ((JToken)inputObject["Comments"]); if (commentsSequence != null && commentsSequence.Type != JTokenType.Null) { foreach (JToken commentsValue in ((JArray)commentsSequence)) { CommentDetails commentDetails = new CommentDetails(); commentDetails.DeserializeJson(commentsValue); this.Comments.Add(commentDetails); } } JToken commentUrlValue = inputObject["CommentUrl"]; if (commentUrlValue != null && commentUrlValue.Type != JTokenType.Null) { this.CommentUrl = ((string)commentUrlValue); } JToken dateTimeValue = inputObject["DateTime"]; if (dateTimeValue != null && dateTimeValue.Type != JTokenType.Null) { this.DateTime = ((string)dateTimeValue); } JToken likeGroupsSequence = ((JToken)inputObject["LikeGroups"]); if (likeGroupsSequence != null && likeGroupsSequence.Type != JTokenType.Null) { foreach (JToken likeGroupsValue in ((JArray)likeGroupsSequence)) { LikeGroup likeGroup = new LikeGroup(); likeGroup.DeserializeJson(likeGroupsValue); this.LikeGroups.Add(likeGroup); } } JToken likeUrlValue = inputObject["LikeUrl"]; if (likeUrlValue != null && likeUrlValue.Type != JTokenType.Null) { this.LikeUrl = ((string)likeUrlValue); } JToken mediaUrlsSequence = ((JToken)inputObject["MediaUrls"]); if (mediaUrlsSequence != null && mediaUrlsSequence.Type != JTokenType.Null) { foreach (JToken mediaUrlsValue in ((JArray)mediaUrlsSequence)) { this.MediaUrls.Add(((string)mediaUrlsValue)); } } JToken messageValue = inputObject["Message"]; if (messageValue != null && messageValue.Type != JTokenType.Null) { this.Message = ((string)messageValue); } JToken userIdValue = inputObject["UserId"]; if (userIdValue != null && userIdValue.Type != JTokenType.Null) { this.UserId = ((string)userIdValue); } JToken userNameValue = inputObject["UserName"]; if (userNameValue != null && userNameValue.Type != JTokenType.Null) { this.UserName = ((string)userNameValue); } } }
/// <summary> /// Deserialize the object /// </summary> public virtual void DeserializeJson(JToken inputObject) { if (inputObject != null && inputObject.Type != JTokenType.Null) { JToken commentsSequence = ((JToken)inputObject["Comments"]); if (commentsSequence != null && commentsSequence.Type != JTokenType.Null) { foreach (JToken commentsValue in ((JArray)commentsSequence)) { CommentDetails commentDetails = new CommentDetails(); commentDetails.DeserializeJson(commentsValue); this.Comments.Add(commentDetails); } } JToken commentUrlValue = inputObject["CommentUrl"]; if (commentUrlValue != null && commentUrlValue.Type != JTokenType.Null) { this.CommentUrl = ((string)commentUrlValue); } JToken createdTimeValue = inputObject["CreatedTime"]; if (createdTimeValue != null && createdTimeValue.Type != JTokenType.Null) { this.CreatedTime = ((string)createdTimeValue); } JToken createdTimeAgoValue = inputObject["CreatedTimeAgo"]; if (createdTimeAgoValue != null && createdTimeAgoValue.Type != JTokenType.Null) { this.CreatedTimeAgo = ((string)createdTimeAgoValue); } JToken descriptionValue = inputObject["Description"]; if (descriptionValue != null && descriptionValue.Type != JTokenType.Null) { this.Description = ((string)descriptionValue); } JToken idValue = inputObject["Id"]; if (idValue != null && idValue.Type != JTokenType.Null) { this.Id = ((int)idValue); } JToken likeGroupsSequence = ((JToken)inputObject["LikeGroups"]); if (likeGroupsSequence != null && likeGroupsSequence.Type != JTokenType.Null) { foreach (JToken likeGroupsValue in ((JArray)likeGroupsSequence)) { LikeGroup likeGroup = new LikeGroup(); likeGroup.DeserializeJson(likeGroupsValue); this.LikeGroups.Add(likeGroup); } } JToken likeUrlValue = inputObject["LikeUrl"]; if (likeUrlValue != null && likeUrlValue.Type != JTokenType.Null) { this.LikeUrl = ((string)likeUrlValue); } JToken mediaUrlValue = inputObject["MediaUrl"]; if (mediaUrlValue != null && mediaUrlValue.Type != JTokenType.Null) { this.MediaUrl = ((string)mediaUrlValue); } JToken titleValue = inputObject["Title"]; if (titleValue != null && titleValue.Type != JTokenType.Null) { this.Title = ((string)titleValue); } JToken userIdValue = inputObject["UserId"]; if (userIdValue != null && userIdValue.Type != JTokenType.Null) { this.UserId = ((string)userIdValue); } } }
/// <summary> /// Deserialize the object /// </summary> public virtual void DeserializeJson(JToken inputObject) { if (inputObject != null && inputObject.Type != JTokenType.Null) { JToken commentsSequence = ((JToken)inputObject["Comments"]); if (commentsSequence != null && commentsSequence.Type != JTokenType.Null) { foreach (JToken commentsValue in ((JArray)commentsSequence)) { CommentDetails commentDetails = new CommentDetails(); commentDetails.DeserializeJson(commentsValue); this.Comments.Add(commentDetails); } } JToken commentUrlValue = inputObject["CommentUrl"]; if (commentUrlValue != null && commentUrlValue.Type != JTokenType.Null) { this.CommentUrl = ((string)commentUrlValue); } JToken descriptionValue = inputObject["Description"]; if (descriptionValue != null && descriptionValue.Type != JTokenType.Null) { this.Description = ((string)descriptionValue); } JToken idValue = inputObject["Id"]; if (idValue != null && idValue.Type != JTokenType.Null) { this.Id = ((int)idValue); } JToken lastModifiedTextValue = inputObject["LastModifiedText"]; if (lastModifiedTextValue != null && lastModifiedTextValue.Type != JTokenType.Null) { this.LastModifiedText = ((string)lastModifiedTextValue); } JToken likeGroupsSequence = ((JToken)inputObject["LikeGroups"]); if (likeGroupsSequence != null && likeGroupsSequence.Type != JTokenType.Null) { foreach (JToken likeGroupsValue in ((JArray)likeGroupsSequence)) { LikeGroup likeGroup = new LikeGroup(); likeGroup.DeserializeJson(likeGroupsValue); this.LikeGroups.Add(likeGroup); } } JToken likeUrlValue = inputObject["LikeUrl"]; if (likeUrlValue != null && likeUrlValue.Type != JTokenType.Null) { this.LikeUrl = ((string)likeUrlValue); } JToken sampleMediaUrlsSequence = ((JToken)inputObject["SampleMediaUrls"]); if (sampleMediaUrlsSequence != null && sampleMediaUrlsSequence.Type != JTokenType.Null) { foreach (JToken sampleMediaUrlsValue in ((JArray)sampleMediaUrlsSequence)) { this.SampleMediaUrls.Add(((string)sampleMediaUrlsValue)); } } JToken titleValue = inputObject["Title"]; if (titleValue != null && titleValue.Type != JTokenType.Null) { this.Title = ((string)titleValue); } JToken userIdValue = inputObject["UserId"]; if (userIdValue != null && userIdValue.Type != JTokenType.Null) { this.UserId = ((string)userIdValue); } } }