/// <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.v201607.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); }
/// <summary> /// Create a shared keyword set. /// </summary> /// <param name="user">The AdWords user.</param> /// <returns>The shared set.</returns> public SharedSet CreateSharedKeywordSet(AdWordsUser user) { using (SharedSetService sharedSetService = (SharedSetService)user.GetService(AdWordsService.v201802.SharedSetService)) { SharedSetOperation operation = new SharedSetOperation { @operator = Operator.ADD }; SharedSet sharedSet = new SharedSet { name = "API Negative keyword list - " + ExampleUtilities.GetRandomString(), type = SharedSetType.NEGATIVE_KEYWORDS }; operation.operand = sharedSet; SharedSetReturnValue retval = sharedSetService.mutate(new SharedSetOperation[] { operation }); return(retval.value[0]); } }