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

Examples of com.google.api.ads.adwords.jaxws.v201406.mcm.ManagedCustomer


    // Get the CampaignService.
    ManagedCustomerServiceInterface managedCustomerService =
        adWordsServices.get(session, ManagedCustomerServiceInterface.class);

    // Create account.
    ManagedCustomer customer = new ManagedCustomer();
    customer.setName("Customer created with ManagedCustomerService on " + new DateTime());
    customer.setCurrencyCode("EUR");
    customer.setDateTimeZone("Europe/London");

    // Create operations.
    ManagedCustomerOperation operation = new ManagedCustomerOperation();
    operation.setOperand(customer);
    operation.setOperator(Operator.ADD);
View Full Code Here


    // Get the CampaignService.
    ManagedCustomerServiceInterface managedCustomerService =
        adWordsServices.get(session, ManagedCustomerServiceInterface.class);

    // Create account.
    ManagedCustomer customer = new ManagedCustomer();
    customer.setName("Customer created with ManagedCustomerService on " + new DateTime());
    customer.setCurrencyCode("EUR");
    customer.setDateTimeZone("Europe/London");

    // Create operations.
    ManagedCustomerOperation operation = new ManagedCustomerOperation();
    operation.setOperand(customer);
    operation.setOperator(Operator.ADD);
View Full Code Here

    // Get the CampaignService.
    ManagedCustomerServiceInterface managedCustomerService =
        adWordsServices.get(session, ManagedCustomerServiceInterface.class);

    // Create account.
    ManagedCustomer customer = new ManagedCustomer();
    customer.setName("Customer created with ManagedCustomerService on " + new DateTime());
    customer.setCurrencyCode("EUR");
    customer.setDateTimeZone("Europe/London");

    // Create operations.
    ManagedCustomerOperation operation = new ManagedCustomerOperation();
    operation.setOperand(customer);
    operation.setOperator(Operator.ADD);
View Full Code Here

    // Get the CampaignService.
    ManagedCustomerServiceInterface managedCustomerService =
        adWordsServices.get(session, ManagedCustomerServiceInterface.class);

    // Create account.
    ManagedCustomer customer = new ManagedCustomer();
    customer.setName("Customer created with ManagedCustomerService on " + new DateTime());
    customer.setCurrencyCode("EUR");
    customer.setDateTimeZone("Europe/London");

    // Create operations.
    ManagedCustomerOperation operation = new ManagedCustomerOperation();
    operation.setOperand(customer);
    operation.setOperator(Operator.ADD);
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.mcm.ManagedCustomer

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.