Note: {@link ManagedCustomerOperation}only supports {@code ADD} operator.
operations
130131132133134135136137138139140
FeedOperation operation = new FeedOperation(); operation.setOperand(siteLinksFeed); operation.setOperator(Operator.ADD); // Add the feed. FeedReturnValue result = feedService.mutate(new FeedOperation[] {operation}); Feed savedFeed = result.getValue()[0]; siteLinksData.siteLinksFeedId = savedFeed.getId(); FeedAttribute[] savedAttributes = savedFeed.getAttributes(); siteLinksData.linkTextFeedAttributeId = savedAttributes[0].getId();
134135136137138139140141142143144
BulkMutateJobPolicy policy = new BulkMutateJobPolicy(); policy.setPrerequisiteJobIds(new long[] {}); // Call mutate to create a new job. SimpleMutateJob response = mutateJobService.mutate(operations.toArray(new Operation[operations.size()]), policy); long jobId = response.getId(); System.out.printf("Job with ID %d was successfully created.\n", jobId); // Create selector to retrieve job status and wait for it to complete.
125126127128129130131132133134135
113114115116117118119120121122123
OfflineConversionFeedOperation offlineConversionOperation = new OfflineConversionFeedOperation(); offlineConversionOperation.setOperator(Operator.ADD); offlineConversionOperation.setOperand(feed); OfflineConversionFeedReturnValue offlineConversionReturnValue = offlineConversionFeedService .mutate(new OfflineConversionFeedOperation[] {offlineConversionOperation}); OfflineConversionFeed newFeed = offlineConversionReturnValue.getValue(0); System.out.printf(
8687888990919293949596
operation.setOperator(Operator.ADD); ManagedCustomerOperation[] operations = new ManagedCustomerOperation[] {operation}; // Add account. ManagedCustomerReturnValue result = managedCustomerService.mutate(operations); // Display accounts. for (ManagedCustomer customerResult : result.getValue()) { System.out.println("Account with customer ID \"" + customerResult.getCustomerId() + "\" was created.");
102103104105106107108109110111112
operation.setOperator(Operator.ADD); UserListOperation[] operations = new UserListOperation[] {operation}; // Add user list. UserListReturnValue result = userListService.mutate(operations); // Display results. // Capture the ID(s) of the conversion. List<String> conversionIds = new ArrayList<String>(); for (UserList userListResult : result.getValue()) {
8384858687888990919293
6061626364656667686970