Skip to content

Commit 970c882

Browse files
authored
Merge pull request #280 from microsoftgraph/bugfix/java-missing-collection-skip
- adds missing skip and skipToken methods for collection requests
2 parents b9d490f + cbaa9c5 commit 970c882

18 files changed

+337
-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())#>

test/Typewriter.Test/TestDataJava/com/microsoft/graph/requests/extensions/CallCollectionRequest.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,27 @@ public ICallCollectionRequest top(final int value) {
106106
return (CallCollectionRequest)this;
107107
}
108108

109+
/**
110+
* Sets the skip value for the request
111+
*
112+
* @param value of the number of items to skip
113+
* @return the updated request
114+
*/
115+
public ICallCollectionRequest skip(final int value) {
116+
addQueryOption(new com.microsoft.graph.options.QueryOption("$skip", value + ""));
117+
return (CallCollectionRequest)this;
118+
}
119+
120+
121+
/**
122+
* Add Skip token for pagination
123+
* @param skipToken - Token for pagination
124+
* @return the updated request
125+
*/
126+
public ICallCollectionRequest skipToken(final String skipToken) {
127+
addQueryOption(new QueryOption("$skiptoken", skipToken));
128+
return (ICallCollectionRequest)this;
129+
}
109130
public ICallCollectionPage buildFromResponse(final CallCollectionResponse response) {
110131
final ICallCollectionRequestBuilder builder;
111132
if (response.nextLink != null) {

test/Typewriter.Test/TestDataJava/com/microsoft/graph/requests/extensions/EntityType2CollectionRequest.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,27 @@ public IEntityType2CollectionRequest top(final int value) {
106106
return (EntityType2CollectionRequest)this;
107107
}
108108

109+
/**
110+
* Sets the skip value for the request
111+
*
112+
* @param value of the number of items to skip
113+
* @return the updated request
114+
*/
115+
public IEntityType2CollectionRequest skip(final int value) {
116+
addQueryOption(new com.microsoft.graph.options.QueryOption("$skip", value + ""));
117+
return (EntityType2CollectionRequest)this;
118+
}
119+
120+
121+
/**
122+
* Add Skip token for pagination
123+
* @param skipToken - Token for pagination
124+
* @return the updated request
125+
*/
126+
public IEntityType2CollectionRequest skipToken(final String skipToken) {
127+
addQueryOption(new QueryOption("$skiptoken", skipToken));
128+
return (IEntityType2CollectionRequest)this;
129+
}
109130
public IEntityType2CollectionPage buildFromResponse(final EntityType2CollectionResponse response) {
110131
final IEntityType2CollectionRequestBuilder builder;
111132
if (response.nextLink != null) {

test/Typewriter.Test/TestDataJava/com/microsoft/graph/requests/extensions/EntityType3CollectionRequest.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,27 @@ public IEntityType3CollectionRequest top(final int value) {
107107
return (EntityType3CollectionRequest)this;
108108
}
109109

110+
/**
111+
* Sets the skip value for the request
112+
*
113+
* @param value of the number of items to skip
114+
* @return the updated request
115+
*/
116+
public IEntityType3CollectionRequest skip(final int value) {
117+
addQueryOption(new com.microsoft.graph.options.QueryOption("$skip", value + ""));
118+
return (EntityType3CollectionRequest)this;
119+
}
120+
121+
122+
/**
123+
* Add Skip token for pagination
124+
* @param skipToken - Token for pagination
125+
* @return the updated request
126+
*/
127+
public IEntityType3CollectionRequest skipToken(final String skipToken) {
128+
addQueryOption(new QueryOption("$skiptoken", skipToken));
129+
return (IEntityType3CollectionRequest)this;
130+
}
110131
public IEntityType3CollectionPage buildFromResponse(final EntityType3CollectionResponse response) {
111132
final IEntityType3CollectionRequestBuilder builder;
112133
if (response.nextLink != null) {

test/Typewriter.Test/TestDataJava/com/microsoft/graph/requests/extensions/ICallCollectionRequest.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,20 @@ public interface ICallCollectionRequest {
5353
*/
5454
ICallCollectionRequest top(final int value);
5555

56+
/**
57+
* Sets the skip value for the request
58+
*
59+
* @param value of the number of items to skip
60+
* @return the updated request
61+
*/
62+
ICallCollectionRequest skip(final int value);
63+
64+
/**
65+
* Sets the skip token value for the request
66+
*
67+
* @param skipToken value for pagination
68+
*
69+
* @return the updated request
70+
*/
71+
ICallCollectionRequest skipToken(String skipToken);
5672
}

test/Typewriter.Test/TestDataJava/com/microsoft/graph/requests/extensions/IEntityType2CollectionRequest.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,20 @@ public interface IEntityType2CollectionRequest {
5353
*/
5454
IEntityType2CollectionRequest top(final int value);
5555

56+
/**
57+
* Sets the skip value for the request
58+
*
59+
* @param value of the number of items to skip
60+
* @return the updated request
61+
*/
62+
IEntityType2CollectionRequest skip(final int value);
63+
64+
/**
65+
* Sets the skip token value for the request
66+
*
67+
* @param skipToken value for pagination
68+
*
69+
* @return the updated request
70+
*/
71+
IEntityType2CollectionRequest skipToken(String skipToken);
5672
}

test/Typewriter.Test/TestDataJava/com/microsoft/graph/requests/extensions/IEntityType3CollectionRequest.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,20 @@ public interface IEntityType3CollectionRequest {
5454
*/
5555
IEntityType3CollectionRequest top(final int value);
5656

57+
/**
58+
* Sets the skip value for the request
59+
*
60+
* @param value of the number of items to skip
61+
* @return the updated request
62+
*/
63+
IEntityType3CollectionRequest skip(final int value);
64+
65+
/**
66+
* Sets the skip token value for the request
67+
*
68+
* @param skipToken value for pagination
69+
*
70+
* @return the updated request
71+
*/
72+
IEntityType3CollectionRequest skipToken(String skipToken);
5773
}

test/Typewriter.Test/TestDataJava/com/microsoft/graph/requests/extensions/ITimeOffCollectionRequest.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,20 @@ public interface ITimeOffCollectionRequest {
5353
*/
5454
ITimeOffCollectionRequest top(final int value);
5555

56+
/**
57+
* Sets the skip value for the request
58+
*
59+
* @param value of the number of items to skip
60+
* @return the updated request
61+
*/
62+
ITimeOffCollectionRequest skip(final int value);
63+
64+
/**
65+
* Sets the skip token value for the request
66+
*
67+
* @param skipToken value for pagination
68+
*
69+
* @return the updated request
70+
*/
71+
ITimeOffCollectionRequest skipToken(String skipToken);
5672
}

test/Typewriter.Test/TestDataJava/com/microsoft/graph/requests/extensions/ITimeOffRequestCollectionRequest.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,20 @@ public interface ITimeOffRequestCollectionRequest {
5454
*/
5555
ITimeOffRequestCollectionRequest top(final int value);
5656

57+
/**
58+
* Sets the skip value for the request
59+
*
60+
* @param value of the number of items to skip
61+
* @return the updated request
62+
*/
63+
ITimeOffRequestCollectionRequest skip(final int value);
64+
65+
/**
66+
* Sets the skip token value for the request
67+
*
68+
* @param skipToken value for pagination
69+
*
70+
* @return the updated request
71+
*/
72+
ITimeOffRequestCollectionRequest skipToken(String skipToken);
5773
}

0 commit comments

Comments
 (0)