Package com.google.api.ads.adwords.jaxws.v201406.cm

Examples of com.google.api.ads.adwords.jaxws.v201406.cm.Selector


  public static void runExample(AdWordsServices adWordsServices, AdWordsSession session,
      Long feedId, Map<Long, String[]> feedItemDescriptions) throws Exception {
    FeedServiceInterface feedService = adWordsServices.get(session, FeedServiceInterface.class);

    Selector selector = new SelectorBuilder()
        .fields("Id", "Attributes")
        .equalsId(feedId)
        .build();
    Feed feed = feedService.get(selector).getEntries()[0];
View Full Code Here


    FeedItemServiceInterface feedItemService =
        adWordsServices.get(session, FeedItemServiceInterface.class);

    List<String> feedItemIds = Lists.newArrayList(
        Iterables.transform(feedItemDescriptions.keySet(), Functions.toStringFunction()));
    Selector itemSelector = new SelectorBuilder()
        .fields("FeedId", "FeedItemId", "AttributeValues")
        // Limit FeedItems to the feed.
        .equalsId(feedId)
        // Limit FeedItems to the items in the feedItemDescriptions map.
        .in("FeedItemId", feedItemIds.toArray(new String[0])).build();
View Full Code Here

  private static void updateFeedMapping(AdWordsServices adWordsServices, AdWordsSession session,
      Long feedId, FeedAttribute line1FeedAttribute, FeedAttribute line2FeedAttribute)
      throws Exception {
    FeedMappingServiceInterface mappingService =
        adWordsServices.get(session, FeedMappingServiceInterface.class);
    Selector selector = new SelectorBuilder()
        .fields("FeedId", "FeedMappingId", "PlaceholderType", "AttributeFieldMappings")
        .equalsId(feedId)
        .build();

    FeedMapping feedMapping = mappingService.get(selector).getEntries()[0];
View Full Code Here

      throws Exception {
    // Get the constant data service.
    ConstantDataServiceInterface constantDataService =
        adWordsServices.get(session, ConstantDataServiceInterface.class);
   
    Selector selector = new SelectorBuilder()
      .equals("Country", "US")
      .build();
   
    ProductBiddingCategoryData[] results =
        constantDataService.getProductBiddingCategoryData(selector);
View Full Code Here

   */
  private void retrieveAccounts(Selector selector, List<ManagedCustomer> accountList) throws ApiException
       {

    int startIndex = 0;
    Paging paging = new Paging();
    selector.setPaging(paging);
    ManagedCustomerPage managedCustomerPage;
    do {
      paging.setStartIndex(startIndex);
      paging.setNumberResults(NUMBER_OF_RESULTS);

      LOGGER.info("Retrieving next " + NUMBER_OF_RESULTS + " accounts.");

      try {
        managedCustomerPage = managedCustomerService.get(selector);
View Full Code Here

   *
   * @return the list of accounts.
   * @throws ApiException error retrieving the accounts.
   */
  public List<ManagedCustomer> getAccounts() throws ApiException {
    Selector selector = createAccountSelectorFields();

    // Paging results to avoid RESPONSE_SIZE_LIMIT_EXCEEDED
    List<ManagedCustomer> accountList = Lists.newArrayList();
    try {
      this.retrieveAccounts(selector, accountList);
View Full Code Here

   * Creates a Generic Selector for Managed Customers queries.
   *
   * @return the default {@link Selector} to retrieve the accounts
   */
  private Selector createAccountSelectorFields() {
    Selector selector = new Selector();
    selector.getFields().add("CustomerId");
    selector.getFields().add("CanManageClients");
    selector.getFields().add("Name");
    selector.getFields().add("CompanyName");
    selector.getFields().add("CurrencyCode");
    selector.getFields().add("DateTimeZone");
    return selector;
  }
View Full Code Here

      this.retrieveAccounts(selector, accountList);
    } catch (Exception e) {
      LOGGER.error("Error on managedCustomerService.get(selector), probably an AuthenticationError: "
          + e.getMessage());
      e.printStackTrace();
      throw new ApiException(
          "Error on managedCustomerService.get(selector), probably an AuthenticationError: " + e.getMessage(),
          new com.google.api.ads.adwords.jaxws.v201406.cm.ApiException());
    }
    return accountList;
  }
View Full Code Here

    kratuProcessor.setPersister(mockedEntitiesPersister);
    kratuProcessor.setReportProcessor(mockedReportProcessor);
    storageHelper.setPersister(mockedEntitiesPersister);

    Customer customer1 = new Customer();
    customer1.setCustomerId(1L);
    Customer customer2 = new Customer();
    customer2.setCustomerId(2L);
    List<Customer> customers = ImmutableList.of(customer1, customer2);
    when(mockedReportProcessor.getAccountsInfo(
        Mockito.anyString(), Mockito.anyString(), Mockito.anySetOf(Long.class))).thenReturn(customers);
  }
View Full Code Here

          // Try to get the MCC Company Name and DescriptiveName
          String name = "";
          try {
            AdWordsSession adWordsSession = authenticate(null, mccAccountId, credential).build();
            CustomerDelegate customerDelegate = new CustomerDelegate(adWordsSession);         
            Customer customer = customerDelegate.getCustomer();
            name = customer.getCompanyName() + " (" + customer.getDescriptiveName() + ")";
          } catch (ValidationException e) {
            LOGGER.error("Error trying to get MCC Name " + e.getMessage());
          } catch (ApiException e) {
            LOGGER.error("Error trying to get MCC Name " + e.getMessage());
          }
View Full Code Here

TOP

Related Classes of com.google.api.ads.adwords.jaxws.v201406.cm.Selector

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.