Package com.google.api.ads.adwords.jaxws.v201309.cm

Examples of com.google.api.ads.adwords.jaxws.v201309.cm.CampaignAdExtensionServiceInterface


  }

  public static void runExample(AdWordsServices adWordsServices, AdWordsSession session,
      long[] campaignIds) throws Exception {
    // Get the CampaignAdExtensionService.
    CampaignAdExtensionServiceInterface campaignExtensionService =
        adWordsServices.get(session, CampaignAdExtensionServiceInterface.class);
    // Get the FeedMappingService.
    FeedMappingServiceInterface feedMappingService =
        adWordsServices.get(session, FeedMappingServiceInterface.class);
    // Get the FeedService.
View Full Code Here


  }

  public static void runExample(
      AdWordsServices adWordsServices, AdWordsSession session, Long campaignId) throws Exception {
    // Get the CampaignAdExtensionService.
    CampaignAdExtensionServiceInterface campaignAdExtensionService =
        adWordsServices.get(session, CampaignAdExtensionServiceInterface.class);

    // Get the GeoLocationService.
    GeoLocationServiceInterface geoLocationService =
        adWordsServices.get(session, GeoLocationServiceInterface.class);

    // Create address.
    Address address = new Address();
    address.setStreetAddress("1600 Amphitheatre Parkway");
    address.setCityName("Mountain View");
    address.setProvinceCode("US-CA");
    address.setPostalCode("94043");
    address.setCountryCode("US");

    // Create geo location selector.
    GeoLocationSelector selector = new GeoLocationSelector();
    selector.setAddresses(new Address[] {address});

    // Get geo location.
    GeoLocation[] geoLocationResult = geoLocationService.get(selector);
    GeoLocation geoLocation = geoLocationResult[0];

    // Create location extension.
    LocationExtension locationExtension = new LocationExtension();
    locationExtension.setAddress(geoLocation.getAddress());
    locationExtension.setGeoPoint(geoLocation.getGeoPoint());
    locationExtension.setEncodedLocation(geoLocation.getEncodedLocation());
    locationExtension.setSource(LocationExtensionSource.ADWORDS_FRONTEND);

    // You can optionally provide these field(s).
    locationExtension.setCompanyName("Google");
    locationExtension.setPhoneNumber("650-253-0000");

    // Create campaign ad extension.
    CampaignAdExtension campaignAdExtension = new CampaignAdExtension();
    campaignAdExtension.setCampaignId(campaignId);
    campaignAdExtension.setAdExtension(locationExtension);

    // Create operations.
    CampaignAdExtensionOperation operation = new CampaignAdExtensionOperation();
    operation.setOperand(campaignAdExtension);
    operation.setOperator(Operator.ADD);

    CampaignAdExtensionOperation[] operations = new CampaignAdExtensionOperation[] {operation};

    // Add campaign ad extension.
    CampaignAdExtensionReturnValue result = campaignAdExtensionService.mutate(operations);

    // Display campaign ad extensions.
    for (CampaignAdExtension campaignAdExtensionResult : result.getValue()) {
      System.out.println("Location campaign ad extension with campaign id \""
          + campaignAdExtensionResult.getCampaignId() + "\", ad extension id \""
View Full Code Here

  }

  public static void runExample(
      AdWordsServices adWordsServices, AdWordsSession session, Long campaignId) throws Exception {
    // Get the CampaignAdExtensionService.
    CampaignAdExtensionServiceInterface campaignAdExtensionService =
        adWordsServices.get(session, CampaignAdExtensionServiceInterface.class);

    // Get the GeoLocationService.
    GeoLocationServiceInterface geoLocationService =
        adWordsServices.get(session, GeoLocationServiceInterface.class);

    // Create address.
    Address address = new Address();
    address.setStreetAddress("1600 Amphitheatre Parkway");
    address.setCityName("Mountain View");
    address.setProvinceCode("US-CA");
    address.setPostalCode("94043");
    address.setCountryCode("US");

    // Create geo location selector.
    GeoLocationSelector selector = new GeoLocationSelector();
    selector.setAddresses(new Address[] {address});

    // Get geo location.
    GeoLocation[] geoLocationResult = geoLocationService.get(selector);
    GeoLocation geoLocation = geoLocationResult[0];

    // Create location extension.
    LocationExtension locationExtension = new LocationExtension();
    locationExtension.setAddress(geoLocation.getAddress());
    locationExtension.setGeoPoint(geoLocation.getGeoPoint());
    locationExtension.setEncodedLocation(geoLocation.getEncodedLocation());
    locationExtension.setSource(LocationExtensionSource.ADWORDS_FRONTEND);

    // You can optionally provide these field(s).
    locationExtension.setCompanyName("Google");
    locationExtension.setPhoneNumber("650-253-0000");

    // Create campaign ad extension.
    CampaignAdExtension campaignAdExtension = new CampaignAdExtension();
    campaignAdExtension.setCampaignId(campaignId);
    campaignAdExtension.setAdExtension(locationExtension);

    // Create operations.
    CampaignAdExtensionOperation operation = new CampaignAdExtensionOperation();
    operation.setOperand(campaignAdExtension);
    operation.setOperator(Operator.ADD);

    CampaignAdExtensionOperation[] operations = new CampaignAdExtensionOperation[] {operation};

    // Add campaign ad extension.
    CampaignAdExtensionReturnValue result = campaignAdExtensionService.mutate(operations);

    // Display campaign ad extensions.
    for (CampaignAdExtension campaignAdExtensionResult : result.getValue()) {
      System.out.println("Location campaign ad extension with campaign id \""
          + campaignAdExtensionResult.getCampaignId() + "\", ad extension id \""
View Full Code Here

  }

  public static void runExample(
      AdWordsServices adWordsServices, AdWordsSession session, Long campaignId) throws Exception {
    // Get the CampaignAdExtensionService.
    CampaignAdExtensionServiceInterface campaignAdExtensionService =
        adWordsServices.get(session, CampaignAdExtensionServiceInterface.class);

    // Get the GeoLocationService.
    GeoLocationServiceInterface geoLocationService =
        adWordsServices.get(session, GeoLocationServiceInterface.class);

    // Create address.
    Address address = new Address();
    address.setStreetAddress("1600 Amphitheatre Parkway");
    address.setCityName("Mountain View");
    address.setProvinceCode("US-CA");
    address.setPostalCode("94043");
    address.setCountryCode("US");

    // Create geo location selector.
    GeoLocationSelector selector = new GeoLocationSelector();
    selector.setAddresses(new Address[] {address});

    // Get geo location.
    GeoLocation[] geoLocationResult = geoLocationService.get(selector);
    GeoLocation geoLocation = geoLocationResult[0];

    // Create location extension.
    LocationExtension locationExtension = new LocationExtension();
    locationExtension.setAddress(geoLocation.getAddress());
    locationExtension.setGeoPoint(geoLocation.getGeoPoint());
    locationExtension.setEncodedLocation(geoLocation.getEncodedLocation());
    locationExtension.setSource(LocationExtensionSource.ADWORDS_FRONTEND);

    // You can optionally provide these field(s).
    locationExtension.setCompanyName("Google");
    locationExtension.setPhoneNumber("650-253-0000");

    // Create campaign ad extension.
    CampaignAdExtension campaignAdExtension = new CampaignAdExtension();
    campaignAdExtension.setCampaignId(campaignId);
    campaignAdExtension.setAdExtension(locationExtension);

    // Create operations.
    CampaignAdExtensionOperation operation = new CampaignAdExtensionOperation();
    operation.setOperand(campaignAdExtension);
    operation.setOperator(Operator.ADD);

    CampaignAdExtensionOperation[] operations = new CampaignAdExtensionOperation[] {operation};

    // Add campaign ad extension.
    CampaignAdExtensionReturnValue result = campaignAdExtensionService.mutate(operations);

    // Display campaign ad extensions.
    for (CampaignAdExtension campaignAdExtensionResult : result.getValue()) {
      System.out.println("Location campaign ad extension with campaign id \""
          + campaignAdExtensionResult.getCampaignId() + "\", ad extension id \""
View Full Code Here

  }

  public static void runExample(
      AdWordsServices adWordsServices, AdWordsSession session, Long campaignId) throws Exception {
    // Get the CampaignAdExtensionService.
    CampaignAdExtensionServiceInterface campaignAdExtensionService =
        adWordsServices.get(session, CampaignAdExtensionServiceInterface.class);

    // Get the GeoLocationService.
    GeoLocationServiceInterface geoLocationService =
        adWordsServices.get(session, GeoLocationServiceInterface.class);

    // Create address.
    Address address = new Address();
    address.setStreetAddress("1600 Amphitheatre Parkway");
    address.setCityName("Mountain View");
    address.setProvinceCode("US-CA");
    address.setPostalCode("94043");
    address.setCountryCode("US");

    // Create geo location selector.
    GeoLocationSelector selector = new GeoLocationSelector();
    selector.setAddresses(new Address[] {address});

    // Get geo location.
    GeoLocation[] geoLocationResult = geoLocationService.get(selector);
    GeoLocation geoLocation = geoLocationResult[0];

    // Create location extension.
    LocationExtension locationExtension = new LocationExtension();
    locationExtension.setAddress(geoLocation.getAddress());
    locationExtension.setGeoPoint(geoLocation.getGeoPoint());
    locationExtension.setEncodedLocation(geoLocation.getEncodedLocation());
    locationExtension.setSource(LocationExtensionSource.ADWORDS_FRONTEND);

    // You can optionally provide these field(s).
    locationExtension.setCompanyName("Google");
    locationExtension.setPhoneNumber("650-253-0000");

    // Create campaign ad extension.
    CampaignAdExtension campaignAdExtension = new CampaignAdExtension();
    campaignAdExtension.setCampaignId(campaignId);
    campaignAdExtension.setAdExtension(locationExtension);

    // Create operations.
    CampaignAdExtensionOperation operation = new CampaignAdExtensionOperation();
    operation.setOperand(campaignAdExtension);
    operation.setOperator(Operator.ADD);

    CampaignAdExtensionOperation[] operations = new CampaignAdExtensionOperation[] {operation};

    // Add campaign ad extension.
    CampaignAdExtensionReturnValue result = campaignAdExtensionService.mutate(operations);

    // Display campaign ad extensions.
    for (CampaignAdExtension campaignAdExtensionResult : result.getValue()) {
      System.out.println("Location campaign ad extension with campaign id \""
          + campaignAdExtensionResult.getCampaignId() + "\", ad extension id \""
View Full Code Here

    selectorCopy.getFields().addAll(Sets.newLinkedHashSet(this.fields));
    selectorCopy.getOrdering().addAll(orderingCopy);
    selectorCopy.getPredicates().addAll(predicatesCopy);

    if (this.dateRange != null) {
      DateRange newDateRange = new DateRange();
      newDateRange.setMin(this.dateRange.getMin());
      newDateRange.setMax(this.dateRange.getMax());
      selectorCopy.setDateRange(newDateRange);
    }
    if (this.paging != null) {
      Paging newPaging = new Paging();
      newPaging.setStartIndex(this.paging.getStartIndex());
View Full Code Here

   *
   * @return the builder itself to proceed the chain.
   */
  public SelectorBuilder forDateRange(DateTime start, DateTime end) {
    if (this.dateRange == null) {
      this.dateRange = new DateRange();
    }
    DateFormat dateFormat = new SimpleDateFormat(DEFAULT_DATE_FORMAT);
    if (start != null) {
      this.dateRange.setMin(dateFormat.format(start.toDate()));
    }
View Full Code Here

    Assert.assertEquals(selector.getDateRange().getMin(), formatStart);
    Assert.assertEquals(selector.getDateRange().getMax(), formatEnd);

    String formatEndPlusOne = dateFormat.format(end.plusDays(1).toDate());

    DateRange dateRange = new DateRange();
    dateRange.setMin(formatStart);
    dateRange.setMax(formatEndPlusOne);

    selector.setDateRange(dateRange);

    Assert.assertEquals(selector.getDateRange().getMin(), formatStart);
    Assert.assertEquals(selector.getDateRange().getMax(), formatEndPlusOne);
View Full Code Here

   * @return the new set of OrderBy objects with different instance for each of the OrderBy
   */
  private Set<OrderBy> copyOrderingSet() {
    Set<OrderBy> orderingCopy = Sets.newLinkedHashSet();
    for (OrderBy order : this.ordering) {
      OrderBy copyOrder = new OrderBy();
      copyOrder.setField(order.getField());
      copyOrder.setSortOrder(order.getSortOrder());
      orderingCopy.add(copyOrder);
    }
    return orderingCopy;
  }
View Full Code Here

   * Adds the order by the given field, on ASCENDING sort.
   *
   * @return the builder itself to proceed the chain.
   */
  public SelectorBuilder orderAscBy(String field) {
    OrderBy order = new OrderBy();
    order.setField(field);
    order.setSortOrder(SortOrder.ASCENDING);

    this.ordering.add(order);

    return this;
  }
View Full Code Here

TOP

Related Classes of com.google.api.ads.adwords.jaxws.v201309.cm.CampaignAdExtensionServiceInterface

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.