Package com.google.api.ads.adwords.axis.v201306.cm

Examples of com.google.api.ads.adwords.axis.v201306.cm.Predicate


    selector.setFields(new String[] {"Id", "AdGroupId", "MatchType", "KeywordText"});
    selector.setOrdering(new OrderBy[] {new OrderBy("AdGroupId", SortOrder.ASCENDING)});
    selector.setPaging(new Paging(offset, PAGE_SIZE));

    // Create predicates.
    Predicate adGroupIdPredicate =
        new Predicate("AdGroupId", PredicateOperator.IN, new String[] {adGroupId.toString()});
    Predicate criteriaTypePredicate =
        new Predicate("CriteriaType", PredicateOperator.EQUALS, new String[] {"KEYWORD"});
    selector.setPredicates(new Predicate[] {adGroupIdPredicate, criteriaTypePredicate});

    while (morePages) {
      // Get all ad group criteria.
      AdGroupCriterionPage page = adGroupCriterionService.get(selector);
View Full Code Here


   * @return the new set of Predicate objects with different instance for each of the Predicate
   */
  private Set<Predicate> copyPredicatesSet() {
    Set<Predicate> predicatesCopy = Sets.newLinkedHashSet();
    for (Predicate predicate : this.predicates) {
      Predicate copyPredicate = new Predicate();
      copyPredicate.setField(predicate.getField());
      copyPredicate.setOperator(predicate.getOperator());
      copyPredicate.setValues(Arrays.copyOf(predicate.getValues(), predicate.getValues().length));
      predicatesCopy.add(copyPredicate);
    }
    return predicatesCopy;
  }
View Full Code Here

   * @param propertyValue the value of the property
   * @return the builder itself to proceed the chain.
   */
  private SelectorBuilder singleValuePredicate(
      String field, String propertyValue, PredicateOperator operator) {
    Predicate predicate = new Predicate();
    predicate.setField(field);
    predicate.setOperator(operator);

    String[] values = new String[1];
    values[0] = propertyValue;
    predicate.setValues(values);

    this.predicates.add(predicate);

    return this;
  }
View Full Code Here

      String field, String[] propertyValues, PredicateOperator operator) {
    if (propertyValues == null) {
      return this;
    }

    Predicate predicate = new Predicate();
    predicate.setOperator(operator);
    predicate.setField(field);

    String[] values = Arrays.copyOf(propertyValues, propertyValues.length);

    predicate.setValues(values);

    this.predicates.add(predicate);

    return this;
  }
View Full Code Here

    Selector selector = builder.build();

    Assert.assertNotNull(selector.getPredicates());
    Assert.assertEquals(1, selector.getPredicates().length);

    Predicate predicate = selector.getPredicates()[0];
    Assert.assertEquals("Id", predicate.getField());
    Assert.assertEquals(PredicateOperator.EQUALS, predicate.getOperator());
    Assert.assertNotNull(predicate.getValues());
    Assert.assertEquals(1, predicate.getValues().length);
    Assert.assertEquals("10", predicate.getValues()[0]);

  }
View Full Code Here

    selector.setFields(new String[] {"Id", "AdGroupId", "PlacementUrl"});
    selector.setOrdering(new OrderBy[] {new OrderBy("AdGroupId", SortOrder.ASCENDING)});
    selector.setPaging(new Paging(offset, PAGE_SIZE));

    // Create predicates.
    Predicate adGroupIdPredicate =
        new Predicate("AdGroupId", PredicateOperator.IN, new String[] {adGroupId.toString()});
    Predicate criteriaTypePredicate =
        new Predicate("CriteriaType", PredicateOperator.EQUALS, new String[] {"PLACEMENT"});
    selector.setPredicates(new Predicate[] {adGroupIdPredicate, criteriaTypePredicate});

    while (morePages) {
      // Get all ad group criteria.
      AdGroupCriterionPage page = adGroupCriterionService.get(selector);
View Full Code Here

    selector.setFields(new String[] {"Id", "AdGroupId", "Status"});
    selector.setOrdering(new OrderBy[] {new OrderBy("Id", SortOrder.ASCENDING)});
    selector.setPaging(new Paging(offset, PAGE_SIZE));

    // Create predicates.
    Predicate adGroupIdPredicate =
        new Predicate("AdGroupId", PredicateOperator.IN, new String[] {adGroupId.toString()});
    // By default disabled ads aren't returned by the selector. To return them
    // include the DISABLED status in a predicate.
    Predicate statusPredicate =
        new Predicate("Status", PredicateOperator.IN,
            new String[] {"ENABLED", "PAUSED", "DISABLED"});
    Predicate adTypePredicate =
        new Predicate("AdType", PredicateOperator.EQUALS, new String[] {"THIRD_PARTY_REDIRECT_AD"});
    selector.setPredicates(new Predicate[] {adGroupIdPredicate, statusPredicate, adTypePredicate});

    while (morePages) {
      // Get all ads.
      AdGroupAdPage page = adGroupAdService.get(selector);
View Full Code Here

        }
      }
    }

    // Create predicate and selector.
    Predicate predicate = new Predicate();
    predicate.setField("Id");
    predicate.setOperator(PredicateOperator.IN);
    predicate.setValues(conversionIds.toArray(new String[0]));
    Selector selector = new Selector();
    selector.setFields(new String[] {"Id"});
    selector.setPredicates(new Predicate[] {predicate});

    // Get all conversion trackers.
View Full Code Here

        }
      }
    }

    // Create predicate and selector.
    Predicate predicate = new Predicate();
    predicate.setField("Id");
    predicate.setOperator(PredicateOperator.IN);
    predicate.setValues(conversionIds.toArray(new String[0]));
    Selector selector = new Selector();
    selector.setFields(new String[] {"Id"});
    selector.setPredicates(new Predicate[] {predicate});

    // Get all conversion trackers.
View Full Code Here

   * @return the new set of Predicate objects with different instance for each of the Predicate
   */
  private Set<Predicate> copyPredicatesSet() {
    Set<Predicate> predicatesCopy = Sets.newLinkedHashSet();
    for (Predicate predicate : this.predicates) {
      Predicate copyPredicate = new Predicate();
      copyPredicate.setField(predicate.getField());
      copyPredicate.setOperator(predicate.getOperator());
      copyPredicate.getValues().addAll(predicate.getValues());
      predicatesCopy.add(copyPredicate);
    }
    return predicatesCopy;
  }
View Full Code Here

TOP

Related Classes of com.google.api.ads.adwords.axis.v201306.cm.Predicate

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.