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

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


    // To determine what other creative templates exist,
    // run GetAllCreativeTemplates.java.
    long creativeTemplateId = 10000680L;

    // Create a template creative.
    TemplateCreative templateCreative = new TemplateCreative();
    templateCreative.setName("Template creative #" + new Random().nextInt(Integer.MAX_VALUE));
    templateCreative.setAdvertiserId(advertiserId);
    templateCreative.setCreativeTemplateId(creativeTemplateId);
    templateCreative.setSize(size);

    // Create the asset variable value.
    AssetCreativeTemplateVariableValue assetVariableValue =
        new AssetCreativeTemplateVariableValue();
    assetVariableValue.setUniqueName("Imagefile");
    assetVariableValue.setAssetByteArray(Media.getMediaDataFromUrl(
        "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"));
    // Filenames must be unique.
    assetVariableValue.setFileName(
        String.format("image%s.jpg", new Random().nextInt(Integer.MAX_VALUE)));

    // Create the image width variable value.
    LongCreativeTemplateVariableValue imageWidthVariableValue =
        new LongCreativeTemplateVariableValue();
    imageWidthVariableValue.setUniqueName("Imagewidth");
    imageWidthVariableValue.setValue(300L);

    // Create the image height variable value.
    LongCreativeTemplateVariableValue imageHeightVariableValue =
        new LongCreativeTemplateVariableValue();
    imageHeightVariableValue.setUniqueName("Imageheight");
    imageHeightVariableValue.setValue(250L);

    // Create the URL variable value.
    UrlCreativeTemplateVariableValue urlVariableValue =
        new UrlCreativeTemplateVariableValue();
    urlVariableValue.setUniqueName("ClickthroughURL");
    urlVariableValue.setValue("www.google.com");

    // Create the target window variable value.
    StringCreativeTemplateVariableValue targetWindowVariableValue =
        new StringCreativeTemplateVariableValue();
    targetWindowVariableValue.setUniqueName("Targetwindow");
    targetWindowVariableValue.setValue("__blank");

    // Set the creative template variables.
    templateCreative.setCreativeTemplateVariableValues(new BaseCreativeTemplateVariableValue[] {
        assetVariableValue, imageWidthVariableValue, imageHeightVariableValue, urlVariableValue,
        targetWindowVariableValue});

    // Create the creative on the server.
    Creative[] creatives =
View Full Code Here


    column2.setLabelName("column2");

    column3 = new ColumnType();
    column3.setLabelName("column3");

    textValue1 = new TextValue();
    textValue1.setValue("value1");

    textValue2 = new TextValue();
    textValue2.setValue("value2");

    textValue3 = new TextValue();
    textValue3.setValue("value3");

    booleanValue1 = new BooleanValue();
    booleanValue1.setValue(false);
View Full Code Here

    assertEquals("2012-12-02", Pql.toString(dateValue1));
  }
 
  @Test
  public void testToString_null() {
    assertEquals("", Pql.toString(new TextValue()));
    assertEquals("", Pql.toString(new BooleanValue()));
    assertEquals("", Pql.toString(new NumberValue()));
    assertEquals("", Pql.toString(new DateTimeValue()));
    assertEquals("", Pql.toString(new DateValue()));
  }
View Full Code Here

    assertEquals(false, Pql.getApiValue(booleanValue1));
    assertEquals(1L, Pql.getApiValue(numberValue1));
    assertEquals(1.02, Pql.getApiValue(numberValue2));
    assertEquals(dateTime1, Pql.getApiValue(dateTimeValue1));
    assertEquals(date1, Pql.getApiValue(dateValue1));
    assertNull(Pql.getApiValue(new TextValue()));
  }
View Full Code Here

      // Create action.
      com.google.api.ads.dfp.axis.v201311.ApproveOrders action =
          new com.google.api.ads.dfp.axis.v201311.ApproveOrders();

      // Perform action.
      UpdateResult result =
          orderService.performOrderAction(action, statementBuilder.toStatement());

      if (result != null && result.getNumChanges() > 0) {
        System.out.printf("Number of orders approved: %d\n", result.getNumChanges());
      } else {
        System.out.println("No orders were approved.");
      }
    }
  }
View Full Code Here

        new LongCreativeTemplateVariableValue();
    imageHeightVariableValue.setUniqueName("Imageheight");
    imageHeightVariableValue.setValue(250L);

    // Create the URL variable value.
    UrlCreativeTemplateVariableValue urlVariableValue =
        new UrlCreativeTemplateVariableValue();
    urlVariableValue.setUniqueName("ClickthroughURL");
    urlVariableValue.setValue("www.google.com");

    // Create the target window variable value.
    StringCreativeTemplateVariableValue targetWindowVariableValue =
        new StringCreativeTemplateVariableValue();
    targetWindowVariableValue.setUniqueName("Targetwindow");
View Full Code Here

    textValue2.setValue("value2");

    textValue3 = new TextValue();
    textValue3.setValue("value3");

    booleanValue1 = new BooleanValue();
    booleanValue1.setValue(false);

    booleanValue2 = new BooleanValue();
    booleanValue2.setValue(true);

    booleanValue3 = new BooleanValue();
    booleanValue3.setValue(false);

    numberValue1 = new NumberValue();
    numberValue1.setValue("1");
View Full Code Here

  }
 
  @Test
  public void testToString_null() {
    assertEquals("", Pql.toString(new TextValue()));
    assertEquals("", Pql.toString(new BooleanValue()));
    assertEquals("", Pql.toString(new NumberValue()));
    assertEquals("", Pql.toString(new DateTimeValue()));   
  }
View Full Code Here

      return (Value) value;
    } else if (value == null) {
      return new TextValue();
    } else {
      if (value instanceof Boolean) {
        BooleanValue booleanValue = new BooleanValue();
        booleanValue.setValue((Boolean) value);
        return booleanValue;
      } else if (value instanceof Double || value instanceof Long || value instanceof Integer) {
        NumberValue numberValue = new NumberValue();
        numberValue.setValue(value.toString());
        return numberValue;
View Full Code Here

      return (Value) value;
    } else if (value == null) {
      return new TextValue();
    } else {
      if (value instanceof Boolean) {
        BooleanValue booleanValue = new BooleanValue();
        booleanValue.setValue((Boolean) value);
        return booleanValue;
      } else if (value instanceof Double || value instanceof Long || value instanceof Integer) {
        NumberValue numberValue = new NumberValue();
        numberValue.setValue(value.toString());
        return numberValue;
View Full Code Here

TOP

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

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.