Package com.microsoft.graph.requests
Class GraphServiceClient.Builder<httpClientType,nativeRequestType>
java.lang.Object
com.microsoft.graph.core.BaseClient.Builder<httpClientType,nativeRequestType>
com.microsoft.graph.requests.GraphServiceClient.Builder<httpClientType,nativeRequestType>
- Type Parameters:
nativeRequestType- type of a request for the native http client
- Enclosing class:
GraphServiceClient<nativeRequestType>
public static class GraphServiceClient.Builder<httpClientType,nativeRequestType>
extends com.microsoft.graph.core.BaseClient.Builder<httpClientType,nativeRequestType>
Builder to help configure the Graph service client
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionauthenticationProvider(com.microsoft.graph.authentication.IAuthenticationProvider auth) Sets the authentication providerBuilds and returns the Graph service client.httpClient(httpClientType client) Sets the http clienthttpProvider(com.microsoft.graph.http.IHttpProvider<nativeRequestType> httpProvider) Sets the httpProviderlogger(com.microsoft.graph.logger.ILogger logger) Sets the loggerserializer(com.microsoft.graph.serializer.ISerializer serializer) Sets the serializer.Methods inherited from class com.microsoft.graph.core.BaseClient.Builder
buildClient
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
serializer
@Nonnull public GraphServiceClient.Builder<httpClientType,nativeRequestType> serializer(@Nonnull com.microsoft.graph.serializer.ISerializer serializer) Sets the serializer.- Overrides:
serializerin classcom.microsoft.graph.core.BaseClient.Builder<httpClientType,nativeRequestType> - Parameters:
serializer- the serializer- Returns:
- the instance of this builder
-
httpProvider
@Nonnull public GraphServiceClient.Builder<httpClientType,nativeRequestType> httpProvider(@Nonnull com.microsoft.graph.http.IHttpProvider<nativeRequestType> httpProvider) Sets the httpProvider- Overrides:
httpProviderin classcom.microsoft.graph.core.BaseClient.Builder<httpClientType,nativeRequestType> - Parameters:
httpProvider- the httpProvider- Returns:
- the instance of this builder
-
logger
@Nonnull public GraphServiceClient.Builder<httpClientType,nativeRequestType> logger(@Nonnull com.microsoft.graph.logger.ILogger logger) Sets the logger- Overrides:
loggerin classcom.microsoft.graph.core.BaseClient.Builder<httpClientType,nativeRequestType> - Parameters:
logger- the logger- Returns:
- the instance of this builder
-
httpClient
@Nonnull public GraphServiceClient.Builder<httpClientType,nativeRequestType> httpClient(@Nonnull httpClientType client) Sets the http client- Overrides:
httpClientin classcom.microsoft.graph.core.BaseClient.Builder<httpClientType,nativeRequestType> - Parameters:
client- the http client- Returns:
- the instance of this builder
-
authenticationProvider
@Nonnull public GraphServiceClient.Builder<httpClientType,nativeRequestType> authenticationProvider(@Nonnull com.microsoft.graph.authentication.IAuthenticationProvider auth) Sets the authentication provider- Overrides:
authenticationProviderin classcom.microsoft.graph.core.BaseClient.Builder<httpClientType,nativeRequestType> - Parameters:
auth- the authentication provider- Returns:
- the instance of this builder
-
buildClient
@Nonnull public GraphServiceClient<nativeRequestType> buildClient() throws com.microsoft.graph.core.ClientExceptionBuilds and returns the Graph service client.- Overrides:
buildClientin classcom.microsoft.graph.core.BaseClient.Builder<httpClientType,nativeRequestType> - Returns:
- the Graph service client object
- Throws:
com.microsoft.graph.core.ClientException- if there was an exception creating the client
-