Package com.microsoft.graph.core
Class BaseClient<nativeRequestType>
java.lang.Object
com.microsoft.graph.core.BaseClient<nativeRequestType>
- Type Parameters:
nativeRequestType- type of a request for the native http client
- All Implemented Interfaces:
IBaseClient<nativeRequestType>
A client that communications with an OData service
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder to help configure the Graph service client -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe default endpoint for the Microsoft Graph Service -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbatch()Get the batch request builder.static BaseClient.Builder<okhttp3.OkHttpClient,okhttp3.Request> builder()Gets the builder to start configuring the clientstatic <nativeClient,nativeRequest>
BaseClient.Builder<nativeClient,nativeRequest> Gets the builder to start configuring the clientCustomRequestBuilder<com.google.gson.JsonElement>customRequest(String url) Send a custom request to Graph<T> CustomRequestBuilder<T>customRequest(String url, Class<T> responseType) Send a custom request to GraphGets the HTTP providerGets the loggerGets the serializerGets the service rootGets the service SDK version if the service SDK is in use, null otherwiseprotected voidsetHttpProvider(IHttpProvider<nativeRequestType> httpProvider) Sets the HTTP providerprotected voidSets the loggervoidsetSerializer(ISerializer serializer) Sets the serializervoidsetServiceRoot(String value) Sets the service root
-
Field Details
-
DEFAULT_GRAPH_ENDPOINT
The default endpoint for the Microsoft Graph Service- See Also:
-
-
Constructor Details
-
BaseClient
protected BaseClient()Restricted constructor
-
-
Method Details
-
getServiceRoot
Description copied from interface:IBaseClientGets the service root- Specified by:
getServiceRootin interfaceIBaseClient<nativeRequestType>- Returns:
- the service root
-
setServiceRoot
Description copied from interface:IBaseClientSets the service root- Specified by:
setServiceRootin interfaceIBaseClient<nativeRequestType>- Parameters:
value- the service root
-
customRequest
@Nonnull public <T> CustomRequestBuilder<T> customRequest(@Nonnull String url, @Nonnull Class<T> responseType) Send a custom request to Graph- Specified by:
customRequestin interfaceIBaseClient<nativeRequestType>- Type Parameters:
T- the type to deserialize the response to- Parameters:
url- the full URL to make a request withresponseType- the response class to deserialize the response into- Returns:
- the instance of this builder
-
customRequest
@Nonnull public CustomRequestBuilder<com.google.gson.JsonElement> customRequest(@Nonnull String url) Send a custom request to Graph- Specified by:
customRequestin interfaceIBaseClient<nativeRequestType>- Parameters:
url- the full URL to make a request with- Returns:
- the instance of this builder
-
batch
Get the batch request builder.- Specified by:
batchin interfaceIBaseClient<nativeRequestType>- Returns:
- a request builder to execute a batch.
-
builder
Gets the builder to start configuring the client- Returns:
- builder to start configuring the client
-
builder
@Nonnull public static <nativeClient,nativeRequest> BaseClient.Builder<nativeClient,nativeRequest> builder(@Nonnull Class<nativeClient> nativeClientClass, @Nonnull Class<nativeRequest> nativeRequestClass) Gets the builder to start configuring the client- Type Parameters:
nativeClient- the type of the native http clientnativeRequest- the type of the native http request- Parameters:
nativeClientClass- the class of the native http clientnativeRequestClass- the class of the native http request- Returns:
- builder to start configuring the client
-
getHttpProvider
Gets the HTTP provider- Specified by:
getHttpProviderin interfaceIBaseClient<nativeRequestType>- Returns:
- The HTTP provider
-
getLogger
Gets the logger- Specified by:
getLoggerin interfaceIBaseClient<nativeRequestType>- Returns:
- The logger
-
getSerializer
Gets the serializer- Specified by:
getSerializerin interfaceIBaseClient<nativeRequestType>- Returns:
- The serializer
-
setLogger
Sets the logger- Parameters:
logger- The logger
-
setHttpProvider
Sets the HTTP provider- Parameters:
httpProvider- The HTTP provider
-
setSerializer
Sets the serializer- Parameters:
serializer- The serializer
-
getServiceSDKVersion
Gets the service SDK version if the service SDK is in use, null otherwise- Specified by:
getServiceSDKVersionin interfaceIBaseClient<nativeRequestType>- Returns:
- the service SDK version if the service SDK is in use, null otherwise
-