Skip to content

Commit 791479f

Browse files
authored
Merge pull request #2388 from raghucha/patch-1
feat: added new constructor for GraphServiceClient
1 parent a2a4281 commit 791479f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.microsoft.graph.core.CoreConstants;
44
import com.microsoft.graph.core.requests.BaseGraphRequestAdapter;
5+
import com.microsoft.graph.core.requests.BaseGraphRequestAdapter.Clouds;
56
import com.microsoft.graph.core.requests.BatchRequestBuilder;
67
import com.microsoft.graph.core.requests.options.GraphClientOption;
78
import com.microsoft.graph.core.requests.IBaseClient;
@@ -50,6 +51,17 @@ public GraphServiceClient(@Nonnull RequestAdapter requestAdapter) {
5051
public GraphServiceClient(@Nonnull AuthenticationProvider authenticationProvider) {
5152
this(new BaseGraphRequestAdapter(authenticationProvider, null, "v1.0" , getGraphClientOptions()));
5253
}
54+
/**
55+
* Instantiate the GraphServiceClient using an AuthenticationProvider, Cloud and OkHttpClient.
56+
* @param authenticationProvider The AuthenticationProvider for this GraphServiceClient.
57+
* @param client The OkHttpClient for the GraphServiceClient.
58+
* @param clouds The Clouds for the GraphServiceClient.
59+
*
60+
*/
61+
@SuppressWarnings("LambdaLast")
62+
public GraphServiceClient(@Nonnull AuthenticationProvider authenticationProvider, @Nonnull OkHttpClient client, @Nonnull Clouds clouds) {
63+
this(new BaseGraphRequestAdapter(authenticationProvider, clouds, "v1.0", client));
64+
}
5365
/**
5466
* Instantiate the GraphServiceClient using an AuthenticationProvider and OkHttpClient.
5567
* @param authenticationProvider The AuthenticationProvider for this GraphServiceClient.

0 commit comments

Comments
 (0)