Examples of Promotion


Examples of Modele.Promotion

        }//GEN-LAST:event_bt_enregistrer_promoActionPerformed

        private void bt_create_promoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt_create_promoActionPerformed

                Promotion p = new Promotion("");
                // ajoute a la liste sans sauvegarder dans le xml (sauvegarde se fait avec le bouton enregistrer)
                GestionPromotion.getInstance().getPromotions().addLast(p);
                bpromos.unbind();
                bpromos.bind();
                l_promos.setSelectedIndex(GestionPromotion.getInstance().getPromotions().size() - 1);
View Full Code Here

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

    // PromotionService requires an Express business ID
    session.setExpressBusinessId(businessId);

    // Update the budget for the promotion
    Promotion promotion = new Promotion();
    promotion.setId(promotionId);
    Money newBudget = new Money();
    newBudget.setMicroAmount(2000000L);
    promotion.setBudget(newBudget);

    Promotion[] mutatedPromotions = promotionService.mutate(
        new PromotionOperation[] {new PromotionOperation(Operator.SET, null, promotion)});

    System.out.printf("Promotion ID %d for business ID %d now has budget micro amount %,d%n",
View Full Code Here

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

    // 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()]));

    // Creatives
    List<Creative> creatives = Lists.newArrayList();
    Creative creative1 =
        new Creative("Standard Mars Trip", "Fly coach to Mars", "Free in-flight pretzels");
    creatives.add(creative1);

    Creative creative2 = new Creative("Deluxe Mars Trip", "Fly first class to Mars",
        "Unlimited powdered orange drink");
    creatives.add(creative2);

    marsTourPromotion.setCreatives(creatives.toArray(new Creative[creatives.size()]));

    Promotion[] addedPromotions = promotionService.mutate(
        new PromotionOperation[] {new PromotionOperation(Operator.ADD, null, marsTourPromotion)});

    System.out.printf("Added promotion ID %d with name '%s' to business ID %d%n",
View Full Code Here

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

    // PromotionService requires an Express business ID
    session.setExpressBusinessId(businessId);

    // Update the budget for the promotion
    Promotion promotion = new Promotion();
    promotion.setId(promotionId);
    Money newBudget = new Money();
    newBudget.setMicroAmount(2000000L);
    promotion.setBudget(newBudget);

    Promotion[] mutatedPromotions = promotionService.mutate(
        new PromotionOperation[] {new PromotionOperation(Operator.SET, null, promotion)});

    System.out.printf("Promotion ID %d for business ID %d now has budget micro amount %,d%n",
View Full Code Here

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

    // 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()]));

    // Creatives
    List<Creative> creatives = Lists.newArrayList();
    Creative creative1 =
        new Creative("Standard Mars Trip", "Fly coach to Mars", "Free in-flight pretzels");
    creatives.add(creative1);

    Creative creative2 = new Creative("Deluxe Mars Trip", "Fly first class to Mars",
        "Unlimited powdered orange drink");
    creatives.add(creative2);

    marsTourPromotion.setCreatives(creatives.toArray(new Creative[creatives.size()]));

    Promotion[] addedPromotions = promotionService.mutate(
        new PromotionOperation[] {new PromotionOperation(Operator.ADD, null, marsTourPromotion)});

    System.out.printf("Added promotion ID %d with name '%s' to business ID %d%n",
View Full Code Here

Examples of hudson.plugins.promoted_builds.Promotion

     */
    protected Cause createUpstreamCause(AbstractBuild<?, ?> build) {
        if(Jenkins.getInstance().getPlugin("promoted-builds") != null) {
            // Test only when promoted-builds is installed.
            if(build instanceof Promotion) {
                Promotion promotion = (Promotion)build;
               
                // This cannot be done for PromotionCause#PromotionCause is in a package scope.
                // return new PromotionCause(build, promotion.getTarget());
               
                return new UpstreamCause((Run<?,?>)promotion.getTarget());
            }
        }
        return new UpstreamCause((Run) build);
    }
View Full Code Here

Examples of in.juspay.model.Promotion

            orderStatusResponse.setPaymentGatewayResponse(paymentGatewayResponse);
        }

        JSONObject promotionResponse = (JSONObject) jsonResponse.get("promotion");
        if(promotionResponse != null) {
            Promotion promotion = assemblePromotionObjectFromJSON(promotionResponse);
            orderStatusResponse.setPromotion(promotion);
        }

        JSONArray refunds = (JSONArray) jsonResponse.get("refunds");
        if(refunds != null && refunds.size() > 0) {
View Full Code Here

Examples of in.juspay.model.Promotion

     *  - An instance of JSONObject that contains promotion information.
     * @return
     *  - Promotion object that corresponds to the json input.
     */
    private Promotion assemblePromotionObjectFromJSON(JSONObject jsonObject) {
        Promotion promotion = new Promotion();
        promotion.setId((String) jsonObject.get("id"));
        promotion.setOrderId((String) jsonObject.get("order_id"));
        promotion.setDiscountAmount(Double.valueOf(jsonObject.get("discount_amount").toString()));
        String status = (String) jsonObject.get("status");
        promotion.setStatus(PromotionStatus.valueOf(status));

        ArrayList<JSONObject> conditions = (ArrayList<JSONObject>) jsonObject.get("conditions");
        ArrayList<JSONObject> rules = (ArrayList<JSONObject>) jsonObject.get("rules");

        List<PromotionCondition> promotionConditions = new ArrayList<PromotionCondition>();
        for(JSONObject jsonCondition : (conditions != null ? conditions : rules)) {
            PromotionCondition promotionCondition = new PromotionCondition();
            promotionCondition.setDimension((String) jsonCondition.get("dimension"));
            promotionCondition.setValue((String) jsonCondition.get("value"));
            promotionConditions.add(promotionCondition);
        }
        promotion.setPromotionConditions(promotionConditions);
        return promotion;
    }
View Full Code Here

Examples of in.juspay.model.Promotion

        String response = makeServiceCall(url, serializedParams);
        JSONObject jsonResponse = (JSONObject) JSONValue.parse(response);

        CreatePromotionResponse promotionResponse = new CreatePromotionResponse();
        promotionResponse.setSuccess(true);
        Promotion promotion = assemblePromotionObjectFromJSON(jsonResponse);
        promotionResponse.setPromotion(promotion);
        return promotionResponse;
    }
View Full Code Here

Examples of in.juspay.model.Promotion

        String response = makeServiceCall(url, serializedParams);
        JSONObject jsonResponse = (JSONObject) JSONValue.parse(response);

        DeactivatePromotionResponse deactivatePromotionResponse = new DeactivatePromotionResponse();
        deactivatePromotionResponse.setSuccess(true);
        Promotion promotion = assemblePromotionObjectFromJSON(jsonResponse);
        deactivatePromotionResponse.setPromotion(promotion);
        return deactivatePromotionResponse;
    }
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.