Example #1
0
  @Override
  public PagedIterable<T> apply(ListPage<T> input) {
    if (input.nextMarker() == null) return PagedIterables.of(input);

    Optional<Object> project =
        tryFind(request.getCaller().get().getArgs(), instanceOf(String.class));

    Optional<Object> listOptions =
        tryFind(request.getInvocation().getArgs(), instanceOf(ListOptions.class));

    assert project.isPresent()
        : String.format(
            "programming error, method %s should have a string param for the " + "project",
            request.getCaller().get().getInvokable());

    return PagedIterables.advance(
        input,
        fetchNextPage(
            project.get().toString(),
            (String) input.nextMarker().orNull(),
            (ListOptions) listOptions.orNull()));
  }
 public Builder fromGeneratedHttpRequest(GeneratedHttpRequest in) {
   return super.fromHttpRequest(in).invocation(in.invocation).caller(in.getCaller().orNull());
 }