Skip to content

Commit 601e674

Browse files
committed
- adds missing skip and skipToken methods for collection requests
1 parent b9d490f commit 601e674

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

Templates/Java/requests_extensions/BaseEntityCollectionRequest.java.tt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,29 @@ import <#=mainNamespace#>.<#=TypeHelperJava.GetPrefixForRequests()#>.<#=c.TypeCo
103103
}
104104

105105
<# } #>
106+
<# if (c.GetFeatures().CanSkip) { #>
107+
/**
108+
* Sets the skip value for the request
109+
*
110+
* @param value of the number of items to skip
111+
* @return the updated request
112+
*/
113+
public <#=c.ITypeCollectionRequest()#> skip(final int value) {
114+
addQueryOption(new com.microsoft.graph.options.QueryOption("$skip", value + ""));
115+
return (<#=c.TypeCollectionRequest()#>)this;
116+
}
117+
118+
<# } #>
119+
120+
/**
121+
* Add Skip token for pagination
122+
* @param skipToken - Token for pagination
123+
* @return the updated request
124+
*/
125+
public <#=c.ITypeCollectionRequest()#> skipToken(final String skipToken) {
126+
addQueryOption(new QueryOption("$skiptoken", skipToken));
127+
return (<#=c.ITypeCollectionRequest()#>)this;
128+
}
106129
public <#=c.ITypeCollectionPage()#> buildFromResponse(final <#=c.BaseTypeCollectionResponse()#> response) {
107130
final <#=c.ITypeCollectionRequestBuilder()#> builder;
108131
if (response.nextLink != null) {

Templates/Java/requests_extensions/IBaseEntityCollectionRequest.java.tt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,23 @@ import <#=importNamespace#>.http.IBaseCollectionPage;
4949
<#=c.ITypeCollectionRequest()#> top(final int value);
5050

5151
<# } #>
52+
<# if (c.GetFeatures().CanSkip) { #>
53+
/**
54+
* Sets the skip value for the request
55+
*
56+
* @param value of the number of items to skip
57+
* @return the updated request
58+
*/
59+
<#=c.ITypeCollectionRequest()#> skip(final int value);
60+
61+
<# } #>
62+
/**
63+
* Sets the skip token value for the request
64+
*
65+
* @param skipToken value for pagination
66+
*
67+
* @return the updated request
68+
*/
69+
<#=c.ITypeCollectionRequest()#> skipToken(String skipToken);
5270
}
5371
<#=PostProcess(c.ITypeCollectionRequest())#>

0 commit comments

Comments
 (0)