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

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


        combinedResultSet.getRows()[2].getValues());
  }

  @Test(expected = IllegalArgumentException.class)
  public void testCombineResultSet_badColumns() {
    Row row1 = new Row();
    row1.setValues(new Value[] {textValue1, booleanValue1, numberValue1});

    Row row2 = new Row();
    row2.setValues(new Value[] {textValue2, booleanValue2, numberValue2});

    Row row3 = new Row();
    row3.setValues(new Value[] {textValue3, booleanValue3});

    ResultSet resultSet1 = new ResultSet();
    resultSet1.setColumnTypes(new ColumnType[] {column1, column2, column3});
    resultSet1.setRows(new Row[] {row1, row2});
View Full Code Here


    // Get the CreativeService.
    CreativeServiceInterface creativeService =
        dfpServices.get(session, CreativeServiceInterface.class);

    // Create creative size.
    Size size = new Size();
    size.setWidth(300);
    size.setHeight(250);
    size.setIsAspectRatio(false);

    // Create an image creative.
    ImageCreative imageCreative = new ImageCreative();
    imageCreative.setName("Image creative #" + new Random().nextInt(Integer.MAX_VALUE));
    imageCreative.setAdvertiserId(advertiserId);
View Full Code Here

    // Get the CreativeService.
    CreativeServiceInterface creativeService =
        dfpServices.get(session, CreativeServiceInterface.class);

    // Create creative size.
    Size size = new Size();
    size.setWidth(300);
    size.setHeight(250);
    size.setIsAspectRatio(false);

    // Create a custom creative.
    CustomCreative customCreative = new CustomCreative();
    customCreative.setName("Custom creative #" + new Random().nextInt(Integer.MAX_VALUE));
    customCreative.setAdvertiserId(advertiserId);
View Full Code Here

    // Get the CreativeService.
    CreativeServiceInterface creativeService =
        dfpServices.get(session, CreativeServiceInterface.class);

    // Create creative size.
    Size size = new Size();
    size.setWidth(300);
    size.setHeight(250);
    size.setIsAspectRatio(false);

    // Use the image banner with optional third party tracking template.
    // To determine what other creative templates exist,
    // run GetAllCreativeTemplates.java.
    long creativeTemplateId = 10000680L;
View Full Code Here

        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});
View Full Code Here

    // Get the TeamService.
    TeamServiceInterface teamService =
        dfpServices.get(session, TeamServiceInterface.class);

    // Create a read/write team.
    Team readWriteTeam = new Team();
    readWriteTeam.setName("Read/write team #" + new Random().nextInt(Integer.MAX_VALUE));
    readWriteTeam.setTeamAccessType(TeamAccessType.READ_WRITE);
    readWriteTeam.setHasAllCompanies(false);
    readWriteTeam.setHasAllInventory(false);

    // Create a read-only team.
    Team readOnlyTeam = new Team();
    readOnlyTeam.setName("Read-only team #" + new Random().nextInt(Integer.MAX_VALUE));
    readOnlyTeam.setTeamAccessType(TeamAccessType.READ_ONLY);
    readOnlyTeam.setHasAllCompanies(false);
    readOnlyTeam.setHasAllInventory(false);

    // Create the teams on the server.
    Team[] teams = teamService.createTeams(new Team[] {readWriteTeam, readOnlyTeam});

    for (Team createdTeam : teams) {
View Full Code Here

    // Get the TeamService.
    TeamServiceInterface teamService =
        dfpServices.get(session, TeamServiceInterface.class);

    // Get the team.
    Team team = teamService.getTeam(teamId);

    // Don't add ad unit if the team has all inventory already.
    if (!team.getHasAllInventory()) {
      List<String> adUnitIds = Lists.newArrayList();
      if (team.getAdUnitIds() != null) {
        Collections.addAll(adUnitIds, team.getAdUnitIds());
      }
      adUnitIds.add(adUnitId);
      team.setAdUnitIds(adUnitIds.toArray(new String[] {}));

      // Update the team on the server.
      Team[] teams = teamService.updateTeams(new Team[] {team});

      for (Team updatedTeam : teams) {
View Full Code Here

    // Default for total result set size.
    int totalResultSetSize = 0;

    do {
      // Get teams by statement.
      TeamPage page = teamService.getTeamsByStatement(statementBuilder.toStatement());

      if (page.getResults() != null) {
        totalResultSetSize = page.getTotalResultSetSize();
        int i = page.getStartIndex();
        for (Team team : page.getResults()) {
          System.out.printf("%d) Team with ID \"%d\" and name \"%s\" was found.\n", i++,
              team.getId(), team.getName());
        }
      }
View Full Code Here

*/
public class CreateTeams {

  public static void runExample(DfpServices dfpServices, DfpSession session) throws Exception {
    // Get the TeamService.
    TeamServiceInterface teamService =
        dfpServices.get(session, TeamServiceInterface.class);

    // Create a read/write team.
    Team readWriteTeam = new Team();
    readWriteTeam.setName("Read/write team #" + new Random().nextInt(Integer.MAX_VALUE));
    readWriteTeam.setTeamAccessType(TeamAccessType.READ_WRITE);
    readWriteTeam.setHasAllCompanies(false);
    readWriteTeam.setHasAllInventory(false);

    // Create a read-only team.
    Team readOnlyTeam = new Team();
    readOnlyTeam.setName("Read-only team #" + new Random().nextInt(Integer.MAX_VALUE));
    readOnlyTeam.setTeamAccessType(TeamAccessType.READ_ONLY);
    readOnlyTeam.setHasAllCompanies(false);
    readOnlyTeam.setHasAllInventory(false);

    // Create the teams on the server.
    Team[] teams = teamService.createTeams(new Team[] {readWriteTeam, readOnlyTeam});

    for (Team createdTeam : teams) {
      System.out.printf("A team with ID \"%d\" and name \"%s\" was created.\n",
          createdTeam.getId(), createdTeam.getName());
    }
View Full Code Here

  private static final String AD_UNIT_ID = "INSERT_AD_UNIT_ID_HERE";

  public static void runExample(
      DfpServices dfpServices, DfpSession session, long teamId, String adUnitId) throws Exception {
    // Get the TeamService.
    TeamServiceInterface teamService =
        dfpServices.get(session, TeamServiceInterface.class);

    // Get the team.
    Team team = teamService.getTeam(teamId);

    // Don't add ad unit if the team has all inventory already.
    if (!team.getHasAllInventory()) {
      List<String> adUnitIds = Lists.newArrayList();
      if (team.getAdUnitIds() != null) {
        Collections.addAll(adUnitIds, team.getAdUnitIds());
      }
      adUnitIds.add(adUnitId);
      team.setAdUnitIds(adUnitIds.toArray(new String[] {}));

      // Update the team on the server.
      Team[] teams = teamService.updateTeams(new Team[] {team});

      for (Team updatedTeam : teams) {
        System.out.printf("Team with ID \"%d\" and name \"%s\" was updated.\n", updatedTeam.getId(),
            updatedTeam.getName());
      }
View Full Code Here

TOP

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

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.