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

Examples of com.google.api.ads.dfp.axis.v201311.PublisherQueryLanguageServiceInterface


  private static final String GEO_TARGET_TYPE = "City";

  public static void runExample(DfpServices dfpServices, DfpSession session, String type)
      throws Exception {
    // Get the PublisherQueryLanguageService.
    PublisherQueryLanguageServiceInterface pqlService =
        dfpServices.get(session, PublisherQueryLanguageServiceInterface.class);

    // Create statement to select all targetable cities.
    StatementBuilder statementBuilder = new StatementBuilder()
        .select("Id, Name, CanonicalParentId, ParentIds, CountryCode")
        .from("Geo_Target")
        .where("Type = :type and Targetable = true")
        .orderBy("CountryCode ASC, Name ASC")
        .offset(0)
        .limit(StatementBuilder.SUGGESTED_PAGE_LIMIT)
        .withBindVariableValue("type", type);

    // Default for result sets.
    ResultSet combinedResultSet = null;
    ResultSet resultSet;
    int i = 0;

    do {
      // Get all cities.
      resultSet = pqlService.select(statementBuilder.toStatement());

      // Combine result sets with previous ones.
      combinedResultSet = combinedResultSet == null
          ? resultSet
          : Pql.combineResultSets(combinedResultSet, resultSet);
View Full Code Here


public class GetAllBrowsers {

  public static void runExample(DfpServices dfpServices, DfpSession session)
      throws Exception {
    // Get the PublisherQueryLanguageService.
    PublisherQueryLanguageServiceInterface pqlService =
        dfpServices.get(session, PublisherQueryLanguageServiceInterface.class);

    // Create statement to select all browsers.
    StatementBuilder statementBuilder = new StatementBuilder()
        .select("Id, BrowserName, MajorVersion, MinorVersion")
        .from("Browser")
        .orderBy("BrowserName ASC")
        .offset(0)
        .limit(StatementBuilder.SUGGESTED_PAGE_LIMIT);

    // Default for result sets.
    ResultSet combinedResultSet = null;
    ResultSet resultSet;
    int i = 0;

    do {
      // Get all browsers.
      resultSet = pqlService.select(statementBuilder.toStatement());

      // Combine result sets with previous ones.
      combinedResultSet = combinedResultSet == null
          ? resultSet
          : Pql.combineResultSets(combinedResultSet, resultSet);
View Full Code Here

  private static final String GEO_TARGET_TYPE = "City";

  public static void runExample(DfpServices dfpServices, DfpSession session, String type)
      throws Exception {
    // Get the PublisherQueryLanguageService.
    PublisherQueryLanguageServiceInterface pqlService =
        dfpServices.get(session, PublisherQueryLanguageServiceInterface.class);

    // Create statement to select all targetable cities.
    StatementBuilder statementBuilder = new StatementBuilder()
        .select("Id, Name, CanonicalParentId, ParentIds, CountryCode")
        .from("Geo_Target")
        .where("Type = :type and Targetable = true")
        .orderBy("CountryCode ASC, Name ASC")
        .offset(0)
        .limit(StatementBuilder.SUGGESTED_PAGE_LIMIT)
        .withBindVariableValue("type", type);

    // Default for result sets.
    ResultSet combinedResultSet = null;
    ResultSet resultSet;
    int i = 0;

    do {
      // Get all cities.
      resultSet = pqlService.select(statementBuilder.toStatement());

      // Combine result sets with previous ones.
      combinedResultSet = combinedResultSet == null
          ? resultSet
          : Pql.combineResultSets(combinedResultSet, resultSet);
View Full Code Here

public class GetAllBrowsers {

  public static void runExample(DfpServices dfpServices, DfpSession session)
      throws Exception {
    // Get the PublisherQueryLanguageService.
    PublisherQueryLanguageServiceInterface pqlService =
        dfpServices.get(session, PublisherQueryLanguageServiceInterface.class);

    // Create statement to select all browsers.
    StatementBuilder statementBuilder = new StatementBuilder()
        .select("Id, BrowserName, MajorVersion, MinorVersion")
        .from("Browser")
        .orderBy("BrowserName ASC")
        .offset(0)
        .limit(StatementBuilder.SUGGESTED_PAGE_LIMIT);

    // Default for result sets.
    ResultSet combinedResultSet = null;
    ResultSet resultSet;
    int i = 0;

    do {
      // Get all browsers.
      resultSet = pqlService.select(statementBuilder.toStatement());

      // Combine result sets with previous ones.
      combinedResultSet = combinedResultSet == null
          ? resultSet
          : Pql.combineResultSets(combinedResultSet, resultSet);
View Full Code Here

public class GetAllLineItems {

  public static void runExample(DfpServices dfpServices, DfpSession session)
      throws Exception {
    // Get the PublisherQueryLanguageService.
    PublisherQueryLanguageServiceInterface pqlService =
        dfpServices.get(session, PublisherQueryLanguageServiceInterface.class);

    // Create statement to select all line items.
    StatementBuilder statementBuilder = new StatementBuilder()
        .select("Id, Name, Status")
        .from("Line_Item")
        .orderBy("Id ASC")
        .offset(0)
        .limit(StatementBuilder.SUGGESTED_PAGE_LIMIT);

    // Default for result sets.
    ResultSet combinedResultSet = null;
    ResultSet resultSet;
    int i = 0;

    do {
      // Get all line items.
      resultSet = pqlService.select(statementBuilder.toStatement());

      // Combine result sets with previous ones.
      combinedResultSet = combinedResultSet == null
          ? resultSet
          : Pql.combineResultSets(combinedResultSet, resultSet);
View Full Code Here

public class GetLineItemsNamedLike {

  public static void runExample(DfpServices dfpServices, DfpSession session)
      throws Exception {
    // Get the PublisherQueryLanguageService.
    PublisherQueryLanguageServiceInterface pqlService =
        dfpServices.get(session, PublisherQueryLanguageServiceInterface.class);

    // Create statement to select all line items.
    StatementBuilder statementBuilder = new StatementBuilder()
        .select("Id, Name, Status")
        .from("Line_Item")
        .where("Name LIKE 'line item%'")
        .orderBy("Id ASC")
        .offset(0)
        .limit(StatementBuilder.SUGGESTED_PAGE_LIMIT);

    // Default for result sets.
    ResultSet combinedResultSet = null;
    ResultSet resultSet;
    int i = 0;

    do {
      // Get line items like 'line item%'.
      resultSet = pqlService.select(statementBuilder.toStatement());

      // Combine result sets with previous ones.
      combinedResultSet = combinedResultSet == null
          ? resultSet
          : Pql.combineResultSets(combinedResultSet, resultSet);
View Full Code Here

  private static final String GEO_TARGET_TYPE = "City";

  public static void runExample(DfpServices dfpServices, DfpSession session, String type)
      throws Exception {
    // Get the PublisherQueryLanguageService.
    PublisherQueryLanguageServiceInterface pqlService =
        dfpServices.get(session, PublisherQueryLanguageServiceInterface.class);

    // Create statement to select all targetable cities.
    StatementBuilder statementBuilder = new StatementBuilder()
        .select("Id, Name, CanonicalParentId, ParentIds, CountryCode")
        .from("Geo_Target")
        .where("Type = :type and Targetable = true")
        .orderBy("CountryCode ASC, Name ASC")
        .offset(0)
        .limit(StatementBuilder.SUGGESTED_PAGE_LIMIT)
        .withBindVariableValue("type", type);

    // Default for result sets.
    ResultSet combinedResultSet = null;
    ResultSet resultSet;
    int i = 0;

    do {
      // Get all cities.
      resultSet = pqlService.select(statementBuilder.toStatement());

      // Combine result sets with previous ones.
      combinedResultSet = combinedResultSet == null
          ? resultSet
          : Pql.combineResultSets(combinedResultSet, resultSet);
View Full Code Here

public class GetAllBrowsers {

  public static void runExample(DfpServices dfpServices, DfpSession session)
      throws Exception {
    // Get the PublisherQueryLanguageService.
    PublisherQueryLanguageServiceInterface pqlService =
        dfpServices.get(session, PublisherQueryLanguageServiceInterface.class);

    // Create statement to select all browsers.
    StatementBuilder statementBuilder = new StatementBuilder()
        .select("Id, BrowserName, MajorVersion, MinorVersion")
        .from("Browser")
        .orderBy("BrowserName ASC")
        .offset(0)
        .limit(StatementBuilder.SUGGESTED_PAGE_LIMIT);

    // Default for result sets.
    ResultSet combinedResultSet = null;
    ResultSet resultSet;
    int i = 0;

    do {
      // Get all browsers.
      resultSet = pqlService.select(statementBuilder.toStatement());

      // Combine result sets with previous ones.
      combinedResultSet = combinedResultSet == null
          ? resultSet
          : Pql.combineResultSets(combinedResultSet, resultSet);
View Full Code Here

    // Get the ActivityGroupService.
    ActivityGroupServiceInterface activityGroupService =
        dfpServices.get(session, ActivityGroupServiceInterface.class);

    // Get the activity group.
    ActivityGroup activityGroup = activityGroupService.getActivityGroup(activityGroupId);

    // Update the companies.
    activityGroup.setCompanyIds(
        Longs.concat(activityGroup.getCompanyIds(), new long[] {advertiserCompanyId}));

    // Update the activity group on the server.
    ActivityGroup[] activityGroups =
        activityGroupService.updateActivityGroups(new ActivityGroup[] {activityGroup});
View Full Code Here

    // Get the ActivityGroupService.
    ActivityGroupServiceInterface activityGroupService =
        dfpServices.get(session, ActivityGroupServiceInterface.class);

    // Create a short-term activity group.
    ActivityGroup shortTermActivityGroup = new ActivityGroup();
    shortTermActivityGroup.setName(
        "Short-term activity group #" + new Random().nextInt(Integer.MAX_VALUE));
    shortTermActivityGroup.setCompanyIds(new long[] {advertiserCompanyId});
    shortTermActivityGroup.setClicksLookback(1);
    shortTermActivityGroup.setImpressionsLookback(1);

    // Create a long-term activity group.
    ActivityGroup longTermActivityGroup = new ActivityGroup();
    longTermActivityGroup.setName(
        "Long-term activity group #" + new Random().nextInt(Integer.MAX_VALUE));
    longTermActivityGroup.setCompanyIds(new long[] {advertiserCompanyId});
    longTermActivityGroup.setClicksLookback(30);
    longTermActivityGroup.setImpressionsLookback(30);

    // Create the activity groups on the server.
    ActivityGroup[] activityGroups = activityGroupService.createActivityGroups(
        new ActivityGroup[] {shortTermActivityGroup, longTermActivityGroup});
View Full Code Here

TOP

Related Classes of com.google.api.ads.dfp.axis.v201311.PublisherQueryLanguageServiceInterface

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.