/// <summary>
 /// Gets the feed items in a feed.
 /// </summary>
 /// <param name="user">The user that owns the feed.</param>
 /// <param name="feedId">The feed ID.</param>
 /// <returns>The list of feed items in the feed.</returns>
 private FeedItem[] GetFeedItems(AdWordsUser user, long feedId) {
   FeedItemService feedItemService = (FeedItemService) user.GetService(
       AdWordsService.v201509.FeedItemService);
   FeedItemPage page = feedItemService.query(string.Format("Select FeedItemId, " +
       "AttributeValues, Scheduling  where Status = 'ENABLED' and FeedId = '{0}'", feedId));
   return page.entries;
 }
Esempio n. 2
0
        /// <summary>
        /// Gets the feed items in a feed.
        /// </summary>
        /// <param name="user">The user that owns the feed.</param>
        /// <param name="feedId">The feed ID.</param>
        /// <returns>The list of feed items in the feed.</returns>
        public FeedItem[] GetFeedItems(AdWordsUser user, long feedId, [Optional] long feedItemId)
        {
            using (FeedItemService feedItemService = (FeedItemService)user.GetService(AdWordsService.v201809.FeedItemService))
            {
                Selector selector = new Selector()
                {
                    fields = new string[] {
                        FeedItem.Fields.FeedId,
                        FeedItem.Fields.FeedItemId,
                        FeedItem.Fields.AttributeValues,
                        FeedItem.Fields.PolicySummaries,
                        FeedItem.Fields.StartTime,
                        FeedItem.Fields.EndTime,
                        FeedItem.Fields.Status,
                        FeedItem.Fields.UrlCustomParameters,
                    },
                };

                Predicate[] predicates;
                if (feedItemId != 0)
                {
                    predicates = new Predicate[] {
                        Predicate.Equals(FeedItem.FilterableFields.FeedId, feedId),
                        Predicate.Equals(FeedItem.FilterableFields.FeedItemId, feedItemId),
                    };
                }
                else
                {
                    predicates = new Predicate[] {
                        Predicate.Equals(FeedItem.FilterableFields.FeedId, feedId),
                    };
                }

                selector.predicates = predicates;
                selector.paging     = Paging.Default;

                FeedItemPage page = feedItemService.get(selector);
                if (page.totalNumEntries > 0)
                {
                    return(page.entries);
                }
                return(null);
            }
        }
Esempio n. 3
0
 public static void setTestGetFeedItems(string communityId, string subjectId, string favoriteId,
                                        string pageParam, int pageSize, FeedSortOrder sortParam, FeedItemPage result)
 {
     throw new global::System.NotImplementedException("ChatterFavorites.SetTestGetFeedItems");
 }