Пример #1
0
    /// <summary>
    /// Deletes the shared set.
    /// </summary>
    /// <param name="user">The user.</param>
    /// <param name="sharedSetId">The shared set ID.</param>
    public void DeleteSharedSet(AdWordsUser user, long sharedSetId) {
      // Get the SharedSetService.
      SharedSetService sharedSetService = (SharedSetService)
          user.GetService(AdWordsService.v201506.SharedSetService);

      SharedSetOperation operation = new SharedSetOperation();
      operation.@operator = Operator.REMOVE;
      SharedSet sharedSet = new SharedSet();
      sharedSet.sharedSetId = sharedSetId;
      operation.operand = sharedSet;

      SharedSetReturnValue retval = sharedSetService.mutate(
          new SharedSetOperation[] { operation });
    }
    /// <summary>
    /// Create a shared keyword set.
    /// </summary>
    /// <param name="user">The AdWords user.</param>
    /// <returns>The shared set.</returns>
    public SharedSet CreateSharedKeywordSet(AdWordsUser user) {
      // Get the SharedSetService.
      SharedSetService sharedSetService = (SharedSetService)
          user.GetService(AdWordsService.v201506.SharedSetService);

      SharedSetOperation operation = new SharedSetOperation();
      operation.@operator = Operator.ADD;
      SharedSet sharedSet = new SharedSet();
      sharedSet.name = "API Negative keyword list - " + ExampleUtilities.GetRandomString();
      sharedSet.type = SharedSetType.NEGATIVE_KEYWORDS;
      operation.operand = sharedSet;

      SharedSetReturnValue retval = sharedSetService.mutate(new SharedSetOperation[] {operation});
      return retval.value[0];
    }
Пример #3
0
    /// <summary>
    /// Creates the shared keyword set.
    /// </summary>
    /// <param name="user">The AdWords user.</param>
    /// <returns>A shared keyword set.</returns>
    public long CreateSharedKeywordSet(AdWordsUser user) {
      // Get the SharedSetService.
      SharedSetService sharedSetService = (SharedSetService)
          user.GetService(AdWordsService.v201506.SharedSetService);

      SharedSetOperation operation = new SharedSetOperation();
      operation.@operator = Operator.ADD;
      SharedSet sharedSet = new SharedSet();
      sharedSet.name = "API Negative keyword list - " + GetTimeStampAlpha();
      sharedSet.type = SharedSetType.NEGATIVE_KEYWORDS;
      operation.operand = sharedSet;

      SharedSetReturnValue retval = sharedSetService.mutate(
          new SharedSetOperation[] { operation });
      return retval.value[0].sharedSetId;
    }