public static void runExample(
      AdManagerServices adManagerServices, AdManagerSession session, long placementId)
      throws RemoteException {
    // Get the PlacementService.
    PlacementServiceInterface placementService =
        adManagerServices.get(session, PlacementServiceInterface.class);

    // Create a statement to only select a single placement by ID.
    StatementBuilder statementBuilder = new StatementBuilder()
        .where("id = :id")
        .orderBy("id ASC")
        .limit(1)
        .withBindVariableValue("id", placementId);

    // Get the placement.
    PlacementPage page =
        placementService.getPlacementsByStatement(statementBuilder.toStatement());

    Placement placement = Iterables.getOnlyElement(Arrays.asList(page.getResults()));

    placement.setDescription("This placement contains all leaderboards.");

    // Update the placement on the server.
    Placement[] placements = placementService.updatePlacements(new Placement[] {placement});

    for (Placement updatedPlacement : placements) {
      System.out.printf("Placement with ID %d and name '%s' was updated.%n",
          updatedPlacement.getId(), updatedPlacement.getName());
    }
  }
public static void runExample ( AdManagerServices adManagerServices , AdManagerSession session , long placementId ) throws RemoteException { PlacementServiceInterface placementService = adManagerServices . get ( session , PlacementServiceInterface . class ) ; StatementBuilder statementBuilder = new StatementBuilder ( ) . where ( "id = :id" ) . orderBy ( "id ASC" ) . limit ( 1 ) . withBindVariableValue ( "id" , placementId ) ; PlacementPage page = placementService . getPlacementsByStatement ( statementBuilder . toStatement ( ) ) ; Placement placement = Iterables . getOnlyElement ( Arrays . asList ( page . getResults ( ) ) ) ; placement . setDescription ( "This placement contains all leaderboards." ) ; Placement [ ] placements = placementService . updatePlacements ( new Placement [ ] { placement } ) ; for ( Placement updatedPlacement : placements ) { System . out . printf ( "Placement with ID %d and name '%s' was updated.%n" , updatedPlacement . getId ( ) , updatedPlacement . getName ( ) ) ; } }
Runs the example.

@param adManagerServices the services factory.
@param session the session.
@param placementId the ID of the placement to update.
@throws ApiException if the API request failed with one or more service errors.
@throws RemoteException if the API request failed due to other errors.