Skip to content

Commit 57de95a

Browse files
author
Ajay Kannan
committed
Add page size and page token options
1 parent 940aa92 commit 57de95a

2 files changed

Lines changed: 23 additions & 1 deletion

File tree

gcloud-java-resourcemanager/src/main/java/com/google/gcloud/resourcemanager/ResourceManager.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,26 @@ public static ProjectListOption filter(String filter) {
132132
return new ProjectListOption(ResourceManagerRpc.Option.FILTER, filter);
133133
}
134134

135+
/**
136+
* Returns an option to specify a page token.
137+
*
138+
* The page token (returned from a previous call to list) indicates from where listing should
139+
* continue. Pagination is not yet supported; the server ignores this field.
140+
*/
141+
public static ProjectListOption pageToken(String pageToken) {
142+
return new ProjectListOption(ResourceManagerRpc.Option.PAGE_TOKEN, pageToken);
143+
}
144+
145+
/**
146+
* The maximum number of projects to return in the response.
147+
*
148+
* The server can return fewer projects than requested. If unspecified, server picks an
149+
* appropriate default. Note: pagination is not yet supported; the server ignores this field.
150+
*/
151+
public static ProjectListOption pageSize(int pageSize) {
152+
return new ProjectListOption(ResourceManagerRpc.Option.PAGE_SIZE, pageSize);
153+
}
154+
135155
/**
136156
* Returns an option to specify the project's fields to be returned by the RPC call.
137157
*

gcloud-java-resourcemanager/src/main/java/com/google/gcloud/spi/ResourceManagerRpc.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ public interface ResourceManagerRpc {
2525

2626
enum Option {
2727
FILTER("filter"),
28-
FIELDS("fields");
28+
FIELDS("fields"),
29+
PAGE_SIZE("pageSize"),
30+
PAGE_TOKEN("pageToken");
2931

3032
private final String value;
3133

0 commit comments

Comments
 (0)