Package com.google.api.ads.dfp.axis.v201208

Examples of com.google.api.ads.dfp.axis.v201208.CompanyPage


    // Get the CompanyService.
    CompanyServiceInterface companyService =
        user.getService(DfpService.V201306.COMPANY_SERVICE);

    // Get companies by filter.
    CompanyPage page = companyService.getCompaniesByStatement(new Statement("LIMIT 1", null));
  }
View Full Code Here


    // Fake an exception to test logger which will work now.
    DfpServiceLogger.DFP_API_LIB_LOG.error("Error in the library.", new NullPointerException());

    // Get companies by filter.
    CompanyPage page = companyService.getCompaniesByStatement(new Statement("LIMIT 1", null));

    if (page.getResults() != null) {
      int i = page.getStartIndex();
      for (Company company : page.getResults()) {
        System.out.println(i + ") Company with ID \"" + company.getId()
            + "\", name \"" + company.getName()
            + "\", and type \"" + company.getType() + "\" was found.");
        i++;
      }
View Full Code Here

      // Get the CompanyService.
      CompanyServiceInterface companyService =
          user.getService(DfpService.V201308.COMPANY_SERVICE);

      // Set defaults for page and filterStatement.
      CompanyPage page = new CompanyPage();
      Statement filterStatement = new Statement();
      int offset = 0;

      do {
        // Create a statement to get all companies.
        filterStatement.setQuery("LIMIT 500 OFFSET " + offset);

        // Get companies by statement.
        page = companyService.getCompaniesByStatement(filterStatement);

        if (page.getResults() != null) {
          int i = page.getStartIndex();
          for (Company company : page.getResults()) {
            System.out.println(i + ") Company with ID \"" + company.getId()
                + "\", name \"" + company.getName()
                + "\", and type \"" + company.getType() + "\" was found.");
            i++;
          }
        }

        offset += 500;
      } while (offset < page.getTotalResultSetSize());

      System.out.println("Number of results found: " + page.getTotalResultSetSize());
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

      Statement filterStatement =
          new StatementBuilder("WHERE type = :type ORDER BY name LIMIT 500")
              .putValue("type", CompanyType.ADVERTISER.toString()).toStatement();

      // Get companies by statement.
      CompanyPage page = companyService.getCompaniesByStatement(filterStatement);

      if (page.getResults() != null) {
        int i = page.getStartIndex();
        for (Company company : page.getResults()) {
          System.out.println(i + ") Company with ID \"" + company.getId()
              + "\", name \"" + company.getName()
              + "\", and type \"" + company.getType() + "\" was found.");
          i++;
        }
      }

      System.out.println("Number of results found: " + page.getTotalResultSetSize());
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

      Statement filterStatement =
          new StatementBuilder("WHERE type = :type LIMIT 500")
              .putValue("type", CompanyType.ADVERTISER.toString()).toStatement();

      // Get the companies by statement.
      CompanyPage page =
          companyService.getCompaniesByStatement(filterStatement);

      if (page.getResults() != null) {
        Company[] companies = page.getResults();

        // Update each local company object by appending LLC. to its name.
        for (Company company : companies) {
          company.setName(company.getName() + " LLC.");
        }
View Full Code Here

      // Get the CompanyService.
      CompanyServiceInterface companyService =
          user.getService(DfpService.V201311.COMPANY_SERVICE);

      // Set defaults for page and filterStatement.
      CompanyPage page = new CompanyPage();
      Statement filterStatement = new Statement();
      int offset = 0;

      do {
        // Create a statement to get all companies.
        filterStatement.setQuery("LIMIT 500 OFFSET " + offset);

        // Get companies by statement.
        page = companyService.getCompaniesByStatement(filterStatement);

        if (page.getResults() != null) {
          int i = page.getStartIndex();
          for (Company company : page.getResults()) {
            System.out.println(i + ") Company with ID \"" + company.getId()
                + "\", name \"" + company.getName()
                + "\", and type \"" + company.getType() + "\" was found.");
            i++;
          }
        }

        offset += 500;
      } while (offset < page.getTotalResultSetSize());

      System.out.println("Number of results found: " + page.getTotalResultSetSize());
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

      Statement filterStatement =
          new StatementBuilder("WHERE type = :type ORDER BY name LIMIT 500")
              .putValue("type", CompanyType.ADVERTISER.toString()).toStatement();

      // Get companies by statement.
      CompanyPage page = companyService.getCompaniesByStatement(filterStatement);

      if (page.getResults() != null) {
        int i = page.getStartIndex();
        for (Company company : page.getResults()) {
          System.out.println(i + ") Company with ID \"" + company.getId()
              + "\", name \"" + company.getName()
              + "\", and type \"" + company.getType() + "\" was found.");
          i++;
        }
      }

      System.out.println("Number of results found: " + page.getTotalResultSetSize());
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

      Statement filterStatement =
          new StatementBuilder("WHERE type = :type LIMIT 500")
              .putValue("type", CompanyType.ADVERTISER.toString()).toStatement();

      // Get the companies by statement.
      CompanyPage page =
          companyService.getCompaniesByStatement(filterStatement);

      if (page.getResults() != null) {
        Company[] companies = page.getResults();

        // Update each local company object by appending LLC. to its name.
        for (Company company : companies) {
          company.setName(company.getName() + " LLC.");
        }
View Full Code Here

TOP

Related Classes of com.google.api.ads.dfp.axis.v201208.CompanyPage

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.