Skip to content

Commit

Permalink
- adds missing skip and skipToken methods for collection requests
Browse files Browse the repository at this point in the history
  • Loading branch information
baywet committed Sep 2, 2020
1 parent b9d490f commit 601e674
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,29 @@ import <#=mainNamespace#>.<#=TypeHelperJava.GetPrefixForRequests()#>.<#=c.TypeCo
}

<# } #>
<# if (c.GetFeatures().CanSkip) { #>
/**
* Sets the skip value for the request
*
* @param value of the number of items to skip
* @return the updated request
*/
public <#=c.ITypeCollectionRequest()#> skip(final int value) {
addQueryOption(new com.microsoft.graph.options.QueryOption("$skip", value + ""));
return (<#=c.TypeCollectionRequest()#>)this;
}

<# } #>

/**
* Add Skip token for pagination
* @param skipToken - Token for pagination
* @return the updated request
*/
public <#=c.ITypeCollectionRequest()#> skipToken(final String skipToken) {
addQueryOption(new QueryOption("$skiptoken", skipToken));
return (<#=c.ITypeCollectionRequest()#>)this;
}
public <#=c.ITypeCollectionPage()#> buildFromResponse(final <#=c.BaseTypeCollectionResponse()#> response) {
final <#=c.ITypeCollectionRequestBuilder()#> builder;
if (response.nextLink != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,23 @@ import <#=importNamespace#>.http.IBaseCollectionPage;
<#=c.ITypeCollectionRequest()#> top(final int value);

<# } #>
<# if (c.GetFeatures().CanSkip) { #>
/**
* Sets the skip value for the request
*
* @param value of the number of items to skip
* @return the updated request
*/
<#=c.ITypeCollectionRequest()#> skip(final int value);

<# } #>
/**
* Sets the skip token value for the request
*
* @param skipToken value for pagination
*
* @return the updated request
*/
<#=c.ITypeCollectionRequest()#> skipToken(String skipToken);
}
<#=PostProcess(c.ITypeCollectionRequest())#>

0 comments on commit 601e674

Please sign in to comment.