Package com.google.api.ads.adwords.awreporting.util

Examples of com.google.api.ads.adwords.awreporting.util.ManagedCustomerDelegate


    MockitoAnnotations.initMocks(this);

    when(managedCustomerServiceInterfaceMock.get(
        Mockito.<Selector>anyObject())).thenReturn(managedCustomerPage);
       
    managedCustomerDelegate = new ManagedCustomerDelegate(managedCustomerServiceInterfaceMock);
  }
View Full Code Here


    Set<Long> accountIdsSet = Sets.newHashSet();
    try {

      LOGGER.info("Account IDs being recovered from the API. This may take a while...");
      accountIdsSet = new ManagedCustomerDelegate(
          authenticator.authenticate(userId, mccAccountId, false).build()).getAccountIds();

    } catch (ApiException e) {
      if (e.getMessage().contains("AuthenticationError")) {

        // retries Auth once for expired Tokens
        LOGGER.info("AuthenticationError, Getting a new Token...");
        LOGGER.info("Account IDs being recovered from the API. This may take a while...");
        accountIdsSet = new ManagedCustomerDelegate(
            authenticator.authenticate(userId, mccAccountId, true).build()).getAccountIds();

      } else {
        LOGGER.error("API error: " + e.getMessage());
        e.printStackTrace();
View Full Code Here

   */
  public List<ManagedCustomer> getAccounts(String userId, String mccAccountId) throws Exception {

    List<ManagedCustomer> accounts = Lists.newArrayList();
    try {
      accounts = new ManagedCustomerDelegate(
          authenticator.authenticate(userId, mccAccountId, false).build()).getAccounts();
    } catch (ApiException e) {
      if (e.getMessage().contains("AuthenticationError")) {
        // retries Auth once for expired Tokens
        LOGGER.info("AuthenticationError, Getting a new Token...");
        accounts = new ManagedCustomerDelegate(
            authenticator.authenticate(userId, mccAccountId, true).build()).getAccounts();
      } else {
        LOGGER.error("API error: " + e.getMessage());
        e.printStackTrace();
        throw e;
View Full Code Here

TOP

Related Classes of com.google.api.ads.adwords.awreporting.util.ManagedCustomerDelegate

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.