/// <summary>
    /// Creates a FeedItemOperation that will create a FeedItem with the
    /// specified values and ad group target when sent to
    /// FeedItemService.mutate.
    /// </summary>
    /// <param name="name">The value for the name attribute of the FeedItem.
    /// </param>
    /// <param name="price">The value for the price attribute of the FeedItem.
    /// </param>
    /// <param name="date">The value for the date attribute of the FeedItem.
    /// </param>
    /// <param name="adGroupId">The ID of the ad group to target with the
    /// FeedItem.</param>
    /// <param name="dataHolder">The data holder that contains metadata about
    /// the customizer Feed.</param>
    /// <returns>A new FeedItemOperation for adding a FeedItem.</returns>
    private static FeedItemOperation CreateFeedItemAddOperation(string name, string price,
        String date, long adGroupId, CustomizersDataHolder dataHolder) {
      FeedItem feedItem = new FeedItem();
      feedItem.feedId = dataHolder.FeedId;
      List<FeedItemAttributeValue> attributeValues = new List<FeedItemAttributeValue>();

      FeedItemAttributeValue nameAttributeValue = new FeedItemAttributeValue();
      nameAttributeValue.feedAttributeId = dataHolder.NameFeedAttributeId;
      nameAttributeValue.stringValue = name;
      attributeValues.Add(nameAttributeValue);

      FeedItemAttributeValue priceAttributeValue = new FeedItemAttributeValue();
      priceAttributeValue.feedAttributeId = dataHolder.PriceFeedAttributeId;
      priceAttributeValue.stringValue = price;
      attributeValues.Add(priceAttributeValue);

      FeedItemAttributeValue dateAttributeValue = new FeedItemAttributeValue();
      dateAttributeValue.feedAttributeId = dataHolder.DateFeedAttributeId;
      dateAttributeValue.stringValue = date;
      attributeValues.Add(dateAttributeValue);

      feedItem.attributeValues = attributeValues.ToArray();

      feedItem.adGroupTargeting = new FeedItemAdGroupTargeting();
      feedItem.adGroupTargeting.TargetingAdGroupId = adGroupId;

      FeedItemOperation feedItemOperation = new FeedItemOperation();
      feedItemOperation.operand = feedItem;
      feedItemOperation.@operator = Operator.ADD;

      return feedItemOperation;
    }
 /// <summary>
 /// Deletes the old feed items for which extension settings have been
 /// created.
 /// </summary>
 /// <param name="user">The user that owns the feed items.</param>
 /// <param name="feedItemIds">IDs of the feed items to be removed.</param>
 /// <param name="feedId">ID of the feed that holds the feed items.</param>
 private void DeleteOldFeedItems(AdWordsUser user, List<long> feedItemIds, long feedId) {
   if (feedItemIds.Count == 0) {
     return;
   }
   List<FeedItemOperation> operations = new List<FeedItemOperation>();
   foreach (long feedItemId in feedItemIds) {
     FeedItemOperation operation = new FeedItemOperation() {
       @operator = Operator.REMOVE,
       operand = new FeedItem() {
         feedItemId = feedItemId,
         feedId = feedId
       }
     };
     operations.Add(operation);
   }
   FeedItemService feedItemService = (FeedItemService) user.GetService(
       AdWordsService.v201409.FeedItemService);
   feedItemService.mutate(operations.ToArray());
   return;
 }