Esempio n. 1
0
        /// <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();
                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]);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Deletes the shared set.
        /// </summary>
        /// <param name="user">The AdWords 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.v201607.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 });
        }
Esempio n. 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.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);
        }