Skip to content

Commit 36b2da5

Browse files
committed
- reflecting the generic http request changes
1 parent 494ecfe commit 36b2da5

File tree

3 files changed

+25
-10
lines changed

3 files changed

+25
-10
lines changed

src/main/java/com/microsoft/graph/requests/GraphServiceClient.java

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,15 @@
101101
import com.microsoft.graph.logger.ILogger;
102102
import com.microsoft.graph.serializer.ISerializer;
103103
import okhttp3.OkHttpClient;
104+
import okhttp3.Request;
104105

105106
// **NOTE** This file was generated by a tool and any changes will be overwritten.
106107

107108
/**
108109
* The class for the Graph Service Client.
110+
* @param <NativeRequestType> type of a request for the native http client
109111
*/
110-
public class GraphServiceClient extends BaseClient implements IBaseClient {
112+
public class GraphServiceClient<NativeRequestType> extends BaseClient<NativeRequestType> implements IBaseClient<NativeRequestType> {
111113
/**
112114
* Restricted constructor
113115
*/
@@ -129,13 +131,26 @@ public String getServiceSDKVersion() {
129131
* @return builder to start configuring the client
130132
*/
131133
@Nonnull
132-
public static Builder<OkHttpClient> builder() {
134+
public static Builder<OkHttpClient, Request> builder() {
135+
return builder(OkHttpClient.class, Request.class);
136+
}
137+
138+
/**
139+
* Gets the builder to start configuring the client
140+
*
141+
* @param <nativeClient> the type of the native http client
142+
* @param <nativeRequest> the type of the native http request
143+
* @return builder to start configuring the client
144+
*/
145+
@Nonnull
146+
public static <nativeClient, nativeRequest> Builder<nativeClient, nativeRequest> builder(Class<nativeClient> nativeClientClass, Class<nativeRequest> nativeRequestClass) {
133147
return new Builder<>();
134148
}
135149
/**
136150
* Builder to help configure the Graph service client
151+
* @param <NativeRequestType> type of a request for the native http client
137152
*/
138-
public static class Builder<httpClientType> extends BaseClient.Builder<httpClientType> {
153+
public static class Builder<httpClientType, NativeRequestType> extends BaseClient.Builder<httpClientType, NativeRequestType> {
139154
/**
140155
* Sets the serializer.
141156
*
@@ -145,7 +160,7 @@ public static class Builder<httpClientType> extends BaseClient.Builder<httpClien
145160
*/
146161
@Nonnull
147162
@Override
148-
public Builder<httpClientType> serializer(@Nonnull final ISerializer serializer) {
163+
public Builder<httpClientType, NativeRequestType> serializer(@Nonnull final ISerializer serializer) {
149164
super.serializer(serializer);
150165
return this;
151166
}
@@ -159,7 +174,7 @@ public Builder<httpClientType> serializer(@Nonnull final ISerializer serializer)
159174
*/
160175
@Nonnull
161176
@Override
162-
public Builder<httpClientType> httpProvider(@Nonnull final IHttpProvider httpProvider) {
177+
public Builder<httpClientType, NativeRequestType> httpProvider(@Nonnull final IHttpProvider httpProvider) {
163178
super.httpProvider(httpProvider);
164179
return this;
165180
}
@@ -173,7 +188,7 @@ public Builder<httpClientType> httpProvider(@Nonnull final IHttpProvider httpPro
173188
*/
174189
@Nonnull
175190
@Override
176-
public Builder<httpClientType> logger(@Nonnull final ILogger logger) {
191+
public Builder<httpClientType, NativeRequestType> logger(@Nonnull final ILogger logger) {
177192
super.logger(logger);
178193
return this;
179194
}
@@ -187,7 +202,7 @@ public Builder<httpClientType> logger(@Nonnull final ILogger logger) {
187202
*/
188203
@Nonnull
189204
@Override
190-
public Builder<httpClientType> httpClient(@Nonnull final httpClientType client) {
205+
public Builder<httpClientType, NativeRequestType> httpClient(@Nonnull final httpClientType client) {
191206
super.httpClient(client);
192207
return this;
193208
}
@@ -200,7 +215,7 @@ public Builder<httpClientType> httpClient(@Nonnull final httpClientType client)
200215
*/
201216
@Nonnull
202217
@Override
203-
public Builder<httpClientType> authenticationProvider(@Nonnull final IAuthenticationProvider auth) {
218+
public Builder<httpClientType, NativeRequestType> authenticationProvider(@Nonnull final IAuthenticationProvider auth) {
204219
super.authenticationProvider(auth);
205220
return this;
206221
}

src/test/java/com/microsoft/graph/functional/BatchTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class BatchTests {
2222
@Test
2323
public void GetsABatchFromRequests() throws IOException{
2424
final TestBase testBase = new TestBase();
25-
final GraphServiceClient graphServiceClient = testBase.graphClient;
25+
final GraphServiceClient<?> graphServiceClient = testBase.graphClient;
2626
final BatchRequestContent batchContent = new BatchRequestContent();
2727
final String meGetId = batchContent.addBatchRequestStep(graphServiceClient.me()
2828
.buildRequest());

src/test/java/com/microsoft/graph/functional/TestBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class TestBase {
3030
private String tokenEndpoint = "https://login.microsoftonline.com/"+ Constants.TENANTID +"/oauth2/v2.0/token";
3131
private String resourceId = "https%3A%2F%2Fgraph.microsoft.com%2F.default";
3232

33-
public GraphServiceClient graphClient = null;
33+
public GraphServiceClient<Request> graphClient = null;
3434

3535
public TestBase(){
3636
this(true);

0 commit comments

Comments
 (0)