def GetCampaignFeeds(client, feed, placeholder_type):
 campaign_feed_service = client.GetService('CampaignFeedService', 'v201609')
 campaign_feeds = []
 more_pages = True
 selector = {'fields': ['CampaignId', 'MatchingFunction', 'PlaceholderTypes'], 'predicates': [{'field': 'Status', 'operator': 'EQUALS', 'values': ['ENABLED']}, {'field': 'FeedId', 'operator': 'EQUALS', 'values': [feed['id']]}, {'field': 'PlaceholderTypes', 'operator': 'CONTAINS_ANY', 'values': [placeholder_type]}], 'paging': {'startIndex': 0, 'numberResults': PAGE_SIZE}}
 while more_pages:
  page = campaign_feed_service.get(selector)
  if ('entries' in page):
   campaign_feeds.extend(page['entries'])
  selector['paging']['startIndex'] += PAGE_SIZE
  more_pages = (selector['paging']['startIndex'] < int(page['totalNumEntries']))
 return campaign_feeds

def GetCampaignFeeds ( client , feed , placeholder_type ) : campaign_feed_service = client . GetService ( 'CampaignFeedService' , 'v201609' ) campaign_feeds = [ ] more_pages = True selector = { 'fields' : [ 'CampaignId' , 'MatchingFunction' , 'PlaceholderTypes' ] , 'predicates' : [ { 'field' : 'Status' , 'operator' : 'EQUALS' , 'values' : [ 'ENABLED' ] } , { 'field' : 'FeedId' , 'operator' : 'EQUALS' , 'values' : [ feed [ 'id' ] ] } , { 'field' : 'PlaceholderTypes' , 'operator' : 'CONTAINS_ANY' , 'values' : [ placeholder_type ] } ] , 'paging' : { 'startIndex' : 0 , 'numberResults' : PAGE_SIZE } } while more_pages : page = campaign_feed_service . get ( selector ) if ( 'entries' in page ) : campaign_feeds . extend ( page [ 'entries' ] ) selector [ 'paging' ] [ 'startIndex' ] += PAGE_SIZE more_pages = ( selector [ 'paging' ] [ 'startIndex' ] < int ( page [ 'totalNumEntries' ] ) ) return campaign_feeds
get a list of feed item ids used by a campaign via a given campaign feed .