Example #1
0
        private static IList <Certification> DeserializeCertifications(JsonValue json)
        {
            IList <Certification> certifications = new List <Certification>();

            if (json != null)
            {
                JsonValue valuesJson = json.GetValue("values");
                if (valuesJson != null)
                {
                    foreach (JsonValue itemJson in valuesJson.GetValues())
                    {
                        certifications.Add(new Certification()
                        {
                            ID            = itemJson.GetValueOrDefault <int>("id"),
                            Name          = itemJson.GetValueOrDefault <string>("name", String.Empty),
                            AuthorityName = itemJson.ContainsName("authority") ? itemJson.GetValue("authority").GetValueOrDefault <string>("name", String.Empty) : String.Empty,
                            Number        = itemJson.GetValueOrDefault <string>("number", String.Empty),
                            StartDate     = DeserializeLinkedInDate(itemJson.GetValue("startDate")),
                            EndDate       = DeserializeLinkedInDate(itemJson.GetValue("endDate"))
                        });
                    }
                }
            }
            return(certifications);
        }
Example #2
0
        private static IList <Education> DeserializeEducations(JsonValue json)
        {
            IList <Education> educations = new List <Education>();

            if (json != null)
            {
                JsonValue valuesJson = json.GetValue("values");
                if (valuesJson != null)
                {
                    foreach (JsonValue itemJson in valuesJson.GetValues())
                    {
                        educations.Add(new Education()
                        {
                            ID         = itemJson.GetValueOrDefault <int>("id"),
                            SchoolName = itemJson.GetValueOrDefault <string>("schoolName", String.Empty),
                            StudyField = itemJson.GetValueOrDefault <string>("fieldOfStudy", String.Empty),
                            StartDate  = DeserializeLinkedInDate(itemJson.GetValue("startDate")),
                            EndDate    = DeserializeLinkedInDate(itemJson.GetValue("endDate")),
                            Degree     = itemJson.GetValueOrDefault <string>("degree", String.Empty),
                            Activities = itemJson.GetValueOrDefault <string>("activities", String.Empty),
                            Notes      = itemJson.GetValueOrDefault <string>("notes", String.Empty)
                        });
                    }
                }
            }
            return(educations);
        }
Example #3
0
        private static IList <Publication> DeserializePublications(JsonValue json)
        {
            IList <Publication> publications = new List <Publication>();

            if (json != null)
            {
                JsonValue valuesJson = json.GetValue("values");
                if (valuesJson != null)
                {
                    foreach (JsonValue itemJson in valuesJson.GetValues())
                    {
                        publications.Add(new Publication()
                        {
                            ID            = itemJson.GetValueOrDefault <int>("id"),
                            Title         = itemJson.GetValueOrDefault <string>("title", String.Empty),
                            PublisherName = itemJson.ContainsName("publisher") ? itemJson.GetValue("publisher").GetValueOrDefault <string>("name", String.Empty) : String.Empty,
                            Summary       = itemJson.GetValueOrDefault <string>("summary", String.Empty),
                            Url           = itemJson.GetValueOrDefault <string>("url"),
                            Date          = DeserializeLinkedInDate(itemJson.GetValue("date"))
                        });
                    }
                }
            }
            return(publications);
        }
        private IList <MediaEntity> DeserializeMedia(JsonValue value)
        {
            IList <MediaEntity> media = new List <MediaEntity>();

            if (value != null)
            {
                foreach (JsonValue urlValue in value.GetValues())
                {
                    JsonValue indicesValues = urlValue.GetValue("indices");
                    if (indicesValues != null)
                    {
                        media.Add(new MediaEntity()
                        {
                            BeginOffset    = indicesValues.GetValue <int>(0),
                            EndOffset      = indicesValues.GetValue <int>(1),
                            ID             = urlValue.GetValue <long>("id"),
                            Url            = urlValue.GetValue <string>("url"),
                            DisplayUrl     = urlValue.GetValueOrDefault <string>("display_url"),
                            ExpandedUrl    = urlValue.GetValueOrDefault <string>("expanded_url"),
                            MediaUrl       = urlValue.GetValueOrDefault <string>("media_url"),
                            MediaHttpsUrl  = urlValue.GetValueOrDefault <string>("media_url_https"),
                            SourceStatusId = urlValue.GetValueOrDefault <long?>("source_status_id")
                        });
                    }
                }
            }
            return(media);
        }
        public object Deserialize(JsonValue json, JsonMapper mapper)
        {
            var job = new Job();

            var clientJson = json.GetValue("client");

            job.Id = json.GetValueOrDefault<string>("id", "");
            job.Title = json.GetValueOrDefault<string>("title", "");
            job.Snippet = json.GetValueOrDefault<string>("snippet", "");
            job.Skills = deserializeSkills(json.GetValues("skills"));
            job.Category = json.GetValueOrDefault<string>("category", "");
            job.Subcategory = json.GetValueOrDefault<string>("subcategory", "");
            job.JobType = json.GetValueOrDefault<string>("job_type", "");
            job.Duration = json.GetValueOrDefault<string>("duration", "");
            job.Budget = json.GetValueOrDefault<string>("budget", "");
            job.Workload = json.GetValueOrDefault<string>("workload", "");
            job.Status = json.GetValueOrDefault<string>("job_status", "");
            job.Url = json.GetValueOrDefault<string>("url", "");
            job.DateCreated = json.GetValueOrDefault<DateTime>("date_created", DateTime.MinValue);

            if (clientJson != null)
            {
                job.Client.Country = clientJson.GetValueOrDefault<string>("country", "");
                job.Client.FeedbackRating = clientJson.GetValueOrDefault<float>("feedback", 0);
                job.Client.ReviewCount = clientJson.GetValueOrDefault<int>("reviews_count", 0);
                job.Client.JobCount = clientJson.GetValueOrDefault<int>("jobs_posted", 0);
                job.Client.HireCount = clientJson.GetValueOrDefault<int>("past_hires", 0);
                job.Client.PaymentVerificationStatus = clientJson.GetValueOrDefault<string>("payment_verification_status", "");
            }

            return job;
        }
Example #6
0
        private static IList <Position> DeserializePositions(JsonValue json)
        {
            IList <Position> positions = new List <Position>();

            if (json != null)
            {
                JsonValue valuesJson = json.GetValue("values");
                if (valuesJson != null)
                {
                    foreach (JsonValue itemJson in valuesJson.GetValues())
                    {
                        positions.Add(new Position()
                        {
                            ID        = itemJson.GetValueOrDefault <string>("id"),
                            Company   = DeserializeCompany(itemJson.GetValue("company")),
                            Title     = itemJson.GetValueOrDefault <string>("title", String.Empty),
                            Summary   = itemJson.GetValueOrDefault <string>("summary", String.Empty),
                            IsCurrent = itemJson.GetValue <bool>("isCurrent"),
                            StartDate = DeserializeLinkedInDate(itemJson.GetValue("startDate")),
                            EndDate   = DeserializeLinkedInDate(itemJson.GetValue("endDate"))
                        });
                    }
                }
            }
            return(positions);
        }
        public object Deserialize(JsonValue value, JsonMapper mapper)
        {
            DeltaPage deltaPage = new DeltaPage();

            deltaPage.Cursor  = value.GetValue <string>("cursor");
            deltaPage.HasMore = value.GetValue <bool>("has_more");
            deltaPage.Reset   = value.GetValue <bool>("reset");
            deltaPage.Entries = new List <DeltaEntry>();
            JsonValue entriesValue = value.GetValue("entries");

            if (entriesValue != null)
            {
                foreach (JsonValue entryValue in entriesValue.GetValues())
                {
                    DeltaEntry deltaEntry = new DeltaEntry();
                    deltaEntry.Path = entryValue.GetValue <string>(0);
                    JsonValue metadataValue = entryValue.GetValue(1) as JsonObject;
                    if (metadataValue != null)
                    {
                        deltaEntry.Metadata = mapper.Deserialize <Entry>(metadataValue);
                    }
                    deltaPage.Entries.Add(deltaEntry);
                }
            }
            return(deltaPage);
        }
 public object Deserialize(JsonValue value, JsonMapper mapper)
 {
     IList<Entry> entries = new List<Entry>();
     foreach (JsonValue itemValue in value.GetValues())
     {
         entries.Add(mapper.Deserialize<Entry>(itemValue));
     }
     return entries;
 }
Example #9
0
 private IList<Tweet> ExtractTimelineTweetsFromResponse(JsonValue response)
 {
     IList<Tweet> tweets = new List<Tweet>();
     foreach (JsonValue item in response.GetValues())
     {
         tweets.Add(PopulateTweetFromTimelineItem(item));
     }
     return tweets;
 }
 public object Deserialize(JsonValue value, JsonMapper mapper)
 {
     IList<long> longs = new List<long>();
     foreach (JsonValue itemValue in value.GetValues())
     {
         longs.Add(itemValue.GetValue<long>());
     }
     return longs;
 }
 public object Deserialize(JsonValue value, JsonMapper mapper)
 {
     IList<UserList> userLists = new List<UserList>();
     foreach (JsonValue itemValue in value.GetValues())
     {
         userLists.Add(mapper.Deserialize<UserList>(itemValue));
     }
     return userLists;
 }
 public object Deserialize(JsonValue value, JsonMapper mapper)
 {
     IList<Tweet> tweets = new List<Tweet>();
     foreach (JsonValue itemValue in value.GetValues())
     {
         tweets.Add(mapper.Deserialize<Tweet>(itemValue));
     }
     return tweets;
 }
 public object Deserialize(JsonValue value, JsonMapper mapper)
 {
     IList<SavedSearch> savedSearches = new List<SavedSearch>();
     foreach (JsonValue itemValue in value.GetValues())
     {
         savedSearches.Add(mapper.Deserialize<SavedSearch>(itemValue));
     }
     return savedSearches;
 }
 public object Deserialize(JsonValue value, JsonMapper mapper)
 {
     IList<DirectMessage> directMessages = new List<DirectMessage>();
     foreach (JsonValue itemValue in value.GetValues())
     {
         directMessages.Add(mapper.Deserialize<DirectMessage>(itemValue));
     }
     return directMessages;
 }
        public object Deserialize(JsonValue value, JsonMapper mapper)
        {
            IList <UserList> userLists = new List <UserList>();

            foreach (JsonValue itemValue in value.GetValues())
            {
                userLists.Add(mapper.Deserialize <UserList>(itemValue));
            }
            return(userLists);
        }
Example #16
0
        public object Deserialize(JsonValue value, JsonMapper mapper)
        {
            IList <long> longs = new List <long>();

            foreach (JsonValue itemValue in value.GetValues())
            {
                longs.Add(itemValue.GetValue <long>());
            }
            return(longs);
        }
Example #17
0
        public object Deserialize(JsonValue value, JsonMapper mapper)
        {
            IList <Tweet> tweets = new List <Tweet>();

            foreach (JsonValue itemValue in value.GetValues())
            {
                tweets.Add(mapper.Deserialize <Tweet>(itemValue));
            }
            return(tweets);
        }
        public object Deserialize(JsonValue value, JsonMapper mapper)
        {
            IList <SavedSearch> savedSearches = new List <SavedSearch>();

            foreach (JsonValue itemValue in value.GetValues())
            {
                savedSearches.Add(mapper.Deserialize <SavedSearch>(itemValue));
            }
            return(savedSearches);
        }
        public object Deserialize(JsonValue value, JsonMapper mapper)
        {
            IList <DirectMessage> directMessages = new List <DirectMessage>();

            foreach (JsonValue itemValue in value.GetValues())
            {
                directMessages.Add(mapper.Deserialize <DirectMessage>(itemValue));
            }
            return(directMessages);
        }
Example #20
0
        private IList <Tweet> ExtractTimelineTweetsFromResponse(JsonValue response)
        {
            IList <Tweet> tweets = new List <Tweet>();

            foreach (JsonValue item in response.GetValues())
            {
                tweets.Add(PopulateTweetFromTimelineItem(item));
            }
            return(tweets);
        }
Example #21
0
        public object Deserialize(JsonValue value, JsonMapper mapper)
        {
            IList <TwitterProfile> twitterProfiles = new List <TwitterProfile>();
            JsonValue usersValue = value.IsObject ? value.GetValue("users") : value;

            foreach (JsonValue itemValue in usersValue.GetValues())
            {
                twitterProfiles.Add(mapper.Deserialize <TwitterProfile>(itemValue));
            }
            return(twitterProfiles);
        }
 public object Deserialize(JsonValue value, JsonMapper mapper)
 {
     CursoredList<TwitterProfile> twitterProfiles = new CursoredList<TwitterProfile>();
     twitterProfiles.PreviousCursor = value.GetValue<long>("previous_cursor");
     twitterProfiles.NextCursor = value.GetValue<long>("next_cursor");
     foreach (JsonValue itemValue in value.GetValues("users"))
     {
         twitterProfiles.Add(mapper.Deserialize<TwitterProfile>(itemValue));
     }
     return twitterProfiles;
 }
 public object Deserialize(JsonValue value, JsonMapper mapper)
 {
     CursoredList<long> cursoredList = new CursoredList<long>();
     cursoredList.PreviousCursor = value.GetValue<long>("previous_cursor");
     cursoredList.NextCursor = value.GetValue<long>("next_cursor");
     foreach (JsonValue itemValue in value.GetValues("ids"))
     {
         cursoredList.Add(itemValue.GetValue<long>());
     }
     return cursoredList;
 }
 public object Deserialize(JsonValue value, JsonMapper mapper)
 {
     CursoredList<UserList> userLists = new CursoredList<UserList>();
     userLists.PreviousCursor = value.GetValue<long>("previous_cursor");
     userLists.NextCursor = value.GetValue<long>("next_cursor");
     foreach (JsonValue itemValue in value.GetValues("lists"))
     {
         userLists.Add(mapper.Deserialize<UserList>(itemValue));
     }
     return userLists;
 }
        public object Deserialize(JsonValue value, JsonMapper mapper)
        {
            CursoredList <UserList> userLists = new CursoredList <UserList>();

            userLists.PreviousCursor = value.GetValue <long>("previous_cursor");
            userLists.NextCursor     = value.GetValue <long>("next_cursor");
            foreach (JsonValue itemValue in value.GetValues("lists"))
            {
                userLists.Add(mapper.Deserialize <UserList>(itemValue));
            }
            return(userLists);
        }
Example #26
0
        public object Deserialize(JsonValue value, JsonMapper mapper)
        {
            CursoredList <TwitterProfile> twitterProfiles = new CursoredList <TwitterProfile>();

            twitterProfiles.PreviousCursor = value.GetValue <long>("previous_cursor");
            twitterProfiles.NextCursor     = value.GetValue <long>("next_cursor");
            foreach (JsonValue itemValue in value.GetValues("users"))
            {
                twitterProfiles.Add(mapper.Deserialize <TwitterProfile>(itemValue));
            }
            return(twitterProfiles);
        }
        public object Deserialize(JsonValue value, JsonMapper mapper)
        {
            CursoredList <long> cursoredList = new CursoredList <long>();

            cursoredList.PreviousCursor = value.GetValue <long>("previous_cursor");
            cursoredList.NextCursor     = value.GetValue <long>("next_cursor");
            foreach (JsonValue itemValue in value.GetValues("ids"))
            {
                cursoredList.Add(itemValue.GetValue <long>());
            }
            return(cursoredList);
        }
        public virtual object Deserialize(JsonValue json, JsonMapper mapper)
        {
            var jobList = new List<Job>();

            foreach(var jobJson in json.GetValues())
            {
                var job = mapper.Deserialize<Job>(jobJson);

                jobList.Add(job);
            }

            return jobList;
        }
 public object Deserialize(JsonValue value, JsonMapper mapper)
 {
     IList<SuggestionCategory> suggestionCategories = new List<SuggestionCategory>();
     foreach (JsonValue itemValue in value.GetValues())
     {
         suggestionCategories.Add(new SuggestionCategory()
         {
             Name = itemValue.GetValue<string>("name"),
             Size = itemValue.GetValue<int>("size"),
             Slug = itemValue.GetValue<string>("slug")
         });
     }
     return suggestionCategories;
 }
		public object Deserialize(JsonValue json, JsonMapper mapper)
		{
			IList<Photo.Image> entries = null;
			if ( json != null && !json.IsNull )
			{
				// 04/15/2012 Paul.  Images is an array, not a data node. 
				entries = new List<Photo.Image>();
				foreach ( JsonValue itemValue in json.GetValues() )
				{
					entries.Add(mapper.Deserialize<Photo.Image>(itemValue));
				}
			}
			return entries;
		}
        public object Deserialize(JsonValue json, JsonMapper mapper)
        {
            IList <Photo.Image> entries = null;

            if (json != null && !json.IsNull)
            {
                // 04/15/2012 Paul.  Images is an array, not a data node.
                entries = new List <Photo.Image>();
                foreach (JsonValue itemValue in json.GetValues())
                {
                    entries.Add(mapper.Deserialize <Photo.Image>(itemValue));
                }
            }
            return(entries);
        }
        public object Deserialize(JsonValue value, JsonMapper mapper)
        {
            IList <SuggestionCategory> suggestionCategories = new List <SuggestionCategory>();

            foreach (JsonValue itemValue in value.GetValues())
            {
                suggestionCategories.Add(new SuggestionCategory()
                {
                    Name = itemValue.GetValue <string>("name"),
                    Size = itemValue.GetValue <int>("size"),
                    Slug = itemValue.GetValue <string>("slug")
                });
            }
            return(suggestionCategories);
        }
Example #33
0
        public object Deserialize(JsonValue value, JsonMapper mapper)
        {
            Trends    trends      = new Trends();
            JsonValue trendsValue = value.GetValue(0);

            trends.Time = JsonUtils.ToDateTime(trendsValue.GetValue <string>("created_at"), TRENDS_DATE_FORMAT);
            foreach (JsonValue itemValue in trendsValue.GetValues("trends"))
            {
                trends.Items.Add(new Trend()
                {
                    Name  = itemValue.GetValue <string>("name"),
                    Query = itemValue.GetValue <string>("query")
                });
            }
            return(trends);
        }
		public object Deserialize(JsonValue json, JsonMapper mapper)
		{
			Dictionary<int, List<StoryTag>> tags = null;
			if ( json != null && !json.IsNull )
			{
				tags = new Dictionary<int, List<StoryTag>>();
				int i = 0;
				foreach ( JsonValue itemValue in json.GetValues() )
				{
					List<StoryTag> tagList = mapper.Deserialize<List<StoryTag>>(itemValue);
					tags.Add(i, tagList);
					i++;
				}
			}
			return tags;
		}
        public object Deserialize(JsonValue json, JsonMapper mapper)
        {
            Dictionary <int, List <StoryTag> > tags = null;

            if (json != null && !json.IsNull)
            {
                tags = new Dictionary <int, List <StoryTag> >();
                int i = 0;
                foreach (JsonValue itemValue in json.GetValues())
                {
                    List <StoryTag> tagList = mapper.Deserialize <List <StoryTag> >(itemValue);
                    tags.Add(i, tagList);
                    i++;
                }
            }
            return(tags);
        }
Example #36
0
        public object Deserialize(JsonValue value, JsonMapper mapper)
        {
            IList <T> list = new List <T>();

            if (value != null)
            {
                JsonValue usersValue = value.IsObject ? value.GetValue("values") : value;
                if (usersValue != null)
                {
                    foreach (JsonValue itemValue in usersValue.GetValues())
                    {
                        list.Add(mapper.Deserialize <T>(itemValue));
                    }
                }
            }
            return(list);
        }
        private List <string> DeserializePermissionsNodeToList(JsonValue jsonNode)
        {
            JsonValue     dataNode    = jsonNode.GetValue("data");
            List <string> permissions = new List <string>();

            foreach (JsonValue elementIt in dataNode.GetValues())
            {
                /*
                 * JsonValue permissionsElement = elementIt.next();
                 * foreach (string fieldNamesIt in permissionsElement.GetNames() )
                 * {
                 *      permissions.add(fieldNamesIt.next());
                 * }
                 */
            }
            return(permissions);
        }
Example #38
0
        public virtual IList <GroupCount> DeserializeCountsByCategory(JsonValue json)
        {
            IList <GroupCount> groupCounts = new List <GroupCount>();
            JsonValue          valuesJson  = json.GetValue("values");

            if (valuesJson != null)
            {
                foreach (var itemJson in valuesJson.GetValues())
                {
                    groupCounts.Add(new GroupCount()
                    {
                        Category = DeserializePostCategory(itemJson.GetValue("category")),
                        Count    = itemJson.GetValue <int>("count")
                    });
                }
            }
            return(groupCounts);
        }
        public object Deserialize(JsonValue json, JsonMapper mapper)
        {
            IList <T> entries = null;

            if (json != null && !json.IsNull)
            {
                JsonValue dataNode = json.GetValue("data");
                if (dataNode != null)
                {
                    entries = new List <T>();
                    foreach (JsonValue itemValue in dataNode.GetValues())
                    {
                        entries.Add(mapper.Deserialize <T>(itemValue));
                    }
                }
            }
            return(entries);
        }
        private string GetAuthToken(JsonValue json)
        {
            JsonValue apiStandardProfileJson = json.GetValue("apiStandardProfileRequest");

            if (apiStandardProfileJson != null)
            {
                JsonValue headerValues = apiStandardProfileJson.ContainsName("headers") ? apiStandardProfileJson.GetValue("headers").GetValue("values") : null;
                if (headerValues != null)
                {
                    foreach (JsonValue headerJson in headerValues.GetValues())
                    {
                        if (headerJson.GetValue <string>("name").Equals(AuthTokenHeaderName))
                        {
                            return(headerJson.GetValue <string>("value"));
                        }
                    }
                }
            }
            return(null);
        }
Example #41
0
        private static IList <ImAccount> DeserializeImAccounts(JsonValue json)
        {
            IList <ImAccount> imAccounts = new List <ImAccount>();

            if (json != null)
            {
                JsonValue valuesJson = json.GetValue("values");
                if (valuesJson != null)
                {
                    foreach (JsonValue itemJson in valuesJson.GetValues())
                    {
                        imAccounts.Add(new ImAccount()
                        {
                            Type = itemJson.GetValue <string>("imAccountType"),
                            Name = itemJson.GetValue <string>("imAccountName")
                        });
                    }
                }
            }
            return(imAccounts);
        }
Example #42
0
        private static IList <TwitterAccount> DeserializeTwitterAccounts(JsonValue json)
        {
            IList <TwitterAccount> twitterAccounts = new List <TwitterAccount>();

            if (json != null)
            {
                JsonValue valuesJson = json.GetValue("values");
                if (valuesJson != null)
                {
                    foreach (JsonValue itemJson in valuesJson.GetValues())
                    {
                        twitterAccounts.Add(new TwitterAccount()
                        {
                            ID   = itemJson.GetValue <string>("providerAccountId"),
                            Name = itemJson.GetValue <string>("providerAccountName")
                        });
                    }
                }
            }
            return(twitterAccounts);
        }
 private static IList<GroupSettings> DeserializeMemberships(JsonValue valuesJson)
 {
     IList<GroupSettings> groupSettings = new List<GroupSettings>();
     if (valuesJson != null)
     {
         foreach (var itemJson in valuesJson.GetValues())
         {
             groupSettings.Add(new GroupSettings()
             {
                 AllowMessagesFromMembers = itemJson.GetValueOrDefault<bool>("allowMessagesFromMembers"),
                 EmailAnnouncementsFromManagers = itemJson.GetValueOrDefault<bool>("emailAnnouncementsFromManagers"),
                 EmailDigestFrequency = DeserializeEmailDigestFrequency(itemJson.GetValue("emailDigestFrequency")),
                 EmailForEveryNewPost = itemJson.GetValueOrDefault<bool>("emailForEveryNewPost"),
                 Group = DeserializeGroup(itemJson.GetValue("group")),
                 MembershipState = DeserializeMembershipState(itemJson.GetValue("membershipState")),
                 ShowGroupLogoInProfile = itemJson.GetValueOrDefault<bool>("showGroupLogoInProfile")
             });
         }
     }
     return groupSettings;
 }
Example #44
0
        private static IList <PhoneNumber> DeserializePhoneNumbers(JsonValue json)
        {
            IList <PhoneNumber> phoneNumbers = new List <PhoneNumber>();

            if (json != null)
            {
                JsonValue valuesJson = json.GetValue("values");
                if (valuesJson != null)
                {
                    foreach (JsonValue itemJson in valuesJson.GetValues())
                    {
                        phoneNumbers.Add(new PhoneNumber()
                        {
                            Type   = itemJson.GetValue <string>("phoneType"),
                            Number = itemJson.GetValue <string>("phoneNumber")
                        });
                    }
                }
            }
            return(phoneNumbers);
        }
        private static IList <GroupSettings> DeserializeMemberships(JsonValue valuesJson)
        {
            IList <GroupSettings> groupSettings = new List <GroupSettings>();

            if (valuesJson != null)
            {
                foreach (var itemJson in valuesJson.GetValues())
                {
                    groupSettings.Add(new GroupSettings()
                    {
                        AllowMessagesFromMembers       = itemJson.GetValueOrDefault <bool>("allowMessagesFromMembers"),
                        EmailAnnouncementsFromManagers = itemJson.GetValueOrDefault <bool>("emailAnnouncementsFromManagers"),
                        EmailDigestFrequency           = DeserializeEmailDigestFrequency(itemJson.GetValue("emailDigestFrequency")),
                        EmailForEveryNewPost           = itemJson.GetValueOrDefault <bool>("emailForEveryNewPost"),
                        Group                  = DeserializeGroup(itemJson.GetValue("group")),
                        MembershipState        = DeserializeMembershipState(itemJson.GetValue("membershipState")),
                        ShowGroupLogoInProfile = itemJson.GetValueOrDefault <bool>("showGroupLogoInProfile")
                    });
                }
            }
            return(groupSettings);
        }
        private IList <HashtagEntity> DeserializeHashtags(JsonValue value)
        {
            IList <HashtagEntity> hashtags = new List <HashtagEntity>();

            if (value != null)
            {
                foreach (JsonValue hashtagValue in value.GetValues())
                {
                    JsonValue indicesValues = hashtagValue.GetValue("indices");
                    if (indicesValues != null)
                    {
                        hashtags.Add(new HashtagEntity()
                        {
                            BeginOffset = indicesValues.GetValue <int>(0),
                            EndOffset   = indicesValues.GetValue <int>(1),
                            Text        = hashtagValue.GetValue <string>("text")
                        });
                    }
                }
            }
            return(hashtags);
        }
 private IList<HashtagEntity> DeserializeHashtags(JsonValue value)
 {
     IList<HashtagEntity> hashtags = new List<HashtagEntity>();
     if (value != null)
     {
         foreach(JsonValue hashtagValue in value.GetValues())
         {
             JsonValue indicesValues = hashtagValue.GetValue("indices");
             if (indicesValues != null)
             {
                 hashtags.Add(new HashtagEntity()
                 {
                     BeginOffset = indicesValues.GetValue<int>(0),
                     EndOffset = indicesValues.GetValue<int>(1),
                     Text = hashtagValue.GetValue<string>("text")
                 });
             }
         }
     }
     return hashtags;
 }
 private IList<MediaEntity> DeserializeMedia(JsonValue value)
 {
     IList<MediaEntity> media = new List<MediaEntity>();
     if (value != null)
     {
         foreach (JsonValue urlValue in value.GetValues())
         {
             JsonValue indicesValues = urlValue.GetValue("indices");
             if (indicesValues != null)
             {
                 media.Add(new MediaEntity()
                 {
                     BeginOffset = indicesValues.GetValue<int>(0),
                     EndOffset = indicesValues.GetValue<int>(1),
                     ID = urlValue.GetValue<long>("id"),
                     Url = urlValue.GetValue<string>("url"),
                     DisplayUrl = urlValue.GetValueOrDefault<string>("display_url"),
                     ExpandedUrl = urlValue.GetValueOrDefault<string>("expanded_url"),
                     MediaUrl = urlValue.GetValueOrDefault<string>("media_url"),
                     MediaHttpsUrl = urlValue.GetValueOrDefault<string>("media_url_https"),
                     SourceStatusId = urlValue.GetValueOrDefault<long?>("source_status_id")
                 });
             }
         }
     }
     return media;
 }
 private IList<UrlEntity> DeserializeUrls(JsonValue value)
 {
     IList<UrlEntity> urls = new List<UrlEntity>();
     if (value != null)
     {
         foreach (JsonValue urlValue in value.GetValues())
         {
             JsonValue indicesValues = urlValue.GetValue("indices");
             if (indicesValues != null)
             {
                 urls.Add(new UrlEntity()
                 {
                     BeginOffset = indicesValues.GetValue<int>(0),
                     EndOffset = indicesValues.GetValue<int>(1),
                     Url = urlValue.GetValue<string>("url"),
                     DisplayUrl = urlValue.GetValueOrDefault<string>("display_url"),
                     ExpandedUrl = urlValue.GetValueOrDefault<string>("expanded_url")
                 });
             }
         }
     }
     return urls;
 }
 private IList<UserMentionEntity> DeserializeUserMentions(JsonValue value)
 {
     IList<UserMentionEntity> userMentions = new List<UserMentionEntity>();
     if (value != null)
     {
         foreach (JsonValue userMentionValue in value.GetValues())
         {
             JsonValue indicesValues = userMentionValue.GetValue("indices");
             if (indicesValues != null)
             {
                 userMentions.Add(new UserMentionEntity()
                 {
                     BeginOffset = indicesValues.GetValue<int>(0),
                     EndOffset = indicesValues.GetValue<int>(1),
                     ID = userMentionValue.GetValue<long>("id"),
                     ScreenName = userMentionValue.GetValueOrDefault<string>("screen_name"),
                     Name = userMentionValue.GetValueOrDefault<string>("name")
                 });
             }
         }
     }
     return userMentions;
 }