Examples of ExpressBusiness


Examples of com.google.api.ads.adwords.axis.v201402.express.ExpressBusiness

    Selector businessSelector = new SelectorBuilder()
        .fields("Id", "GeoPoint")
        .equals("Id", String.valueOf(businessId))
        .build();

    ExpressBusiness business = businessService.get(businessSelector).getEntries(0);

    // Get the PromotionService
    PromotionServiceInterface promotionService =
        adWordsServices.get(session, PromotionServiceInterface.class);

    // PromotionService requires the businessId on the session
    session.setExpressBusinessId(businessId);

    // Set up the new Promotion
    Promotion marsTourPromotion = new Promotion();
    Money budget = new Money();
    budget.setMicroAmount(1000000L);
    marsTourPromotion.setName("Mars Tour Promotion " + System.currentTimeMillis());
    marsTourPromotion.setStatus(PromotionStatus.PAUSED);
    marsTourPromotion.setDestinationUrl("http://www.example.com");
    marsTourPromotion.setBudget(budget);
    marsTourPromotion.setCallTrackingEnabled(true);

    // Criteria
    List<Criterion> criteria = Lists.newArrayList();

    // Criterion - Travel Agency product/service.  See GetProductServices.java for an example
    // of how to get valid product/service settings.
    ProductService productService = new ProductService();
    productService.setText("Travel Agency");
    productService.setLocale("en_US");
    criteria.add(productService);

    // Criterion - English language
    // The ID can be found in the documentation:
    // https://developers.google.com/adwords/api/docs/appendix/languagecodes
    Language language = new Language();
    language.setId(1000L);
    criteria.add(language);

    // Criterion - Within 15 miles
    Proximity proximity = new Proximity();
    proximity.setGeoPoint(business.getGeoPoint());
    proximity.setRadiusDistanceUnits(ProximityDistanceUnits.MILES);
    proximity.setRadiusInUnits(15d);
    criteria.add(proximity);

    marsTourPromotion.setCriteria(criteria.toArray(new Criterion[criteria.size()]));
View Full Code Here

Examples of com.google.api.ads.adwords.axis.v201402.express.ExpressBusiness

      AdWordsSession session) throws Exception {
    // Get the ExpressBusinessService.
    ExpressBusinessServiceInterface businessService =
        adWordsServices.get(session, ExpressBusinessServiceInterface.class);

    ExpressBusiness business1 = new ExpressBusiness();
    business1.setStatus(ExpressBusinessStatus.ACTIVE);
    business1.setName("Express Interplanetary Cruise #" + System.currentTimeMillis());
    business1.setAddress(
        new Address("1600 Amphitheatre Pkwy", null, "Mountain View", "CA", null, null, "US"));
    business1.setWebsite("http://www.example.com/cruise1");

    ExpressBusiness business2 = new ExpressBusiness();
    business2.setStatus(ExpressBusinessStatus.ACTIVE);
    business2.setName("Express Interplanetary Cruise #" + System.currentTimeMillis());
    business2.setAddress(
        new Address("1600 Amphitheatre Pkwy", null, "Mountain View", "CA", null, null, "US"));
    business2.setWebsite("http://www.example.com/cruise2");

    ExpressBusiness[] addedBusinesses = businessService.mutate(new ExpressBusinessOperation[] {
        new ExpressBusinessOperation(Operator.ADD, null, business1),
        new ExpressBusinessOperation(Operator.ADD, null, business2)});
View Full Code Here

Examples of com.google.api.ads.adwords.axis.v201402.express.ExpressBusiness

      Long businessId) throws Exception {
    ExpressBusinessServiceInterface businessService =
        adWordsServices.get(session, ExpressBusinessServiceInterface.class);

    // Update the name and website for the business
    ExpressBusiness business = new ExpressBusiness();
    business.setId(businessId);
    business.setName("Express Interplanetary Cruise #" + System.currentTimeMillis());
    business.setWebsite("http://www.example.com/?myParam=" + System.currentTimeMillis());
   
    ExpressBusinessOperation operation = new ExpressBusinessOperation(Operator.SET, "", business);

    ExpressBusiness[] mutatedBusinesses =
        businessService.mutate(new ExpressBusinessOperation[] {operation});

    ExpressBusiness mutatedBusiness = mutatedBusinesses[0];

    System.out.printf("Express business with ID %d and name '%s' was updated%n",
        mutatedBusiness.getId(), mutatedBusiness.getName());

    return mutatedBusiness;
  }
View Full Code Here

Examples of com.google.api.ads.adwords.axis.v201406.express.ExpressBusiness

    Selector businessSelector = new SelectorBuilder()
        .fields("Id", "GeoPoint")
        .equals("Id", String.valueOf(businessId))
        .build();

    ExpressBusiness business = businessService.get(businessSelector).getEntries(0);

    // Get the PromotionService
    PromotionServiceInterface promotionService =
        adWordsServices.get(session, PromotionServiceInterface.class);

    // PromotionService requires the businessId on the session
    session.setExpressBusinessId(businessId);

    // Set up the new Promotion
    Promotion marsTourPromotion = new Promotion();
    Money budget = new Money();
    budget.setMicroAmount(1000000L);
    marsTourPromotion.setName("Mars Tour Promotion " + System.currentTimeMillis());
    marsTourPromotion.setStatus(PromotionStatus.PAUSED);
    marsTourPromotion.setDestinationUrl("http://www.example.com");
    marsTourPromotion.setBudget(budget);
    marsTourPromotion.setCallTrackingEnabled(true);

    // Criteria
    List<Criterion> criteria = Lists.newArrayList();

    // Criterion - Travel Agency product/service.  See GetProductServices.java for an example
    // of how to get valid product/service settings.
    ProductService productService = new ProductService();
    productService.setText("Travel Agency");
    productService.setLocale("en_US");
    criteria.add(productService);

    // Criterion - English language
    // The ID can be found in the documentation:
    // https://developers.google.com/adwords/api/docs/appendix/languagecodes
    Language language = new Language();
    language.setId(1000L);
    criteria.add(language);

    // Criterion - Within 15 miles
    Proximity proximity = new Proximity();
    proximity.setGeoPoint(business.getGeoPoint());
    proximity.setRadiusDistanceUnits(ProximityDistanceUnits.MILES);
    proximity.setRadiusInUnits(15d);
    criteria.add(proximity);

    marsTourPromotion.setCriteria(criteria.toArray(new Criterion[criteria.size()]));
View Full Code Here

Examples of com.google.api.ads.adwords.axis.v201406.express.ExpressBusiness

      AdWordsSession session) throws Exception {
    // Get the ExpressBusinessService.
    ExpressBusinessServiceInterface businessService =
        adWordsServices.get(session, ExpressBusinessServiceInterface.class);

    ExpressBusiness business1 = new ExpressBusiness();
    business1.setStatus(ExpressBusinessStatus.ENABLED);
    business1.setName("Express Interplanetary Cruise #" + System.currentTimeMillis());
    business1.setAddress(
        new Address("1600 Amphitheatre Pkwy", null, "Mountain View", "CA", null, null, "US"));
    business1.setWebsite("http://www.example.com/cruise1");

    ExpressBusiness business2 = new ExpressBusiness();
    business2.setStatus(ExpressBusinessStatus.ENABLED);
    business2.setName("Express Interplanetary Cruise #" + System.currentTimeMillis());
    business2.setAddress(
        new Address("1600 Amphitheatre Pkwy", null, "Mountain View", "CA", null, null, "US"));
    business2.setWebsite("http://www.example.com/cruise2");

    ExpressBusiness[] addedBusinesses = businessService.mutate(new ExpressBusinessOperation[] {
        new ExpressBusinessOperation(Operator.ADD, null, business1),
        new ExpressBusinessOperation(Operator.ADD, null, business2)});
View Full Code Here

Examples of com.google.api.ads.adwords.axis.v201406.express.ExpressBusiness

      Long businessId) throws Exception {
    ExpressBusinessServiceInterface businessService =
        adWordsServices.get(session, ExpressBusinessServiceInterface.class);

    // Update the name and website for the business
    ExpressBusiness business = new ExpressBusiness();
    business.setId(businessId);
    business.setName("Express Interplanetary Cruise #" + System.currentTimeMillis());
    business.setWebsite("http://www.example.com/?myParam=" + System.currentTimeMillis());
   
    ExpressBusinessOperation operation = new ExpressBusinessOperation(Operator.SET, "", business);

    ExpressBusiness[] mutatedBusinesses =
        businessService.mutate(new ExpressBusinessOperation[] {operation});

    ExpressBusiness mutatedBusiness = mutatedBusinesses[0];

    System.out.printf("Express business with ID %d and name '%s' was updated%n",
        mutatedBusiness.getId(), mutatedBusiness.getName());

    return mutatedBusiness;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.