Examples of TeamServiceInterface


Examples of com.google.api.ads.dfp.axis.v201302.TeamServiceInterface

*/
public class GetAllTeams {

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

    // Create a statement to select all teams.
    StatementBuilder statementBuilder = new StatementBuilder()
        .orderBy("id ASC")
        .limit(StatementBuilder.SUGGESTED_PAGE_LIMIT);

    // 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()) {
View Full Code Here

Examples of com.google.api.ads.dfp.axis.v201302.TeamServiceInterface

*/
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

Examples of com.google.api.ads.dfp.axis.v201302.TeamServiceInterface

  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

Examples of com.google.api.ads.dfp.axis.v201306.TeamServiceInterface

*/
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

Examples of com.google.api.ads.dfp.axis.v201306.TeamServiceInterface

  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

Examples of com.google.api.ads.dfp.axis.v201306.TeamServiceInterface

*/
public class GetAllTeams {

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

    // Create a statement to select all teams.
    StatementBuilder statementBuilder = new StatementBuilder()
        .orderBy("id ASC")
        .limit(StatementBuilder.SUGGESTED_PAGE_LIMIT);

    // 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()) {
View Full Code Here

Examples of com.google.api.ads.dfp.axis.v201308.TeamServiceInterface

*/
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

Examples of com.google.api.ads.dfp.axis.v201308.TeamServiceInterface

  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

Examples of com.google.api.ads.dfp.axis.v201308.TeamServiceInterface

*/
public class GetAllTeams {

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

    // Create a statement to select all teams.
    StatementBuilder statementBuilder = new StatementBuilder()
        .orderBy("id ASC")
        .limit(StatementBuilder.SUGGESTED_PAGE_LIMIT);

    // 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()) {
View Full Code Here

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

*/
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
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.