Package com.microsoft.graph.http
Class BaseWithReferenceRequest<T>
java.lang.Object
com.microsoft.graph.http.BaseRequest<T>
com.microsoft.graph.http.BaseWithReferenceRequest<T>
- Type Parameters:
T- the response class
- All Implemented Interfaces:
IHttpRequest
An HTTP request.
-
Field Summary
Fields inherited from class com.microsoft.graph.http.BaseRequest
functionOptions, queryOptions, REQUEST_STATS_HEADER_VALUE_FORMAT_STRING -
Constructor Summary
ConstructorsConstructorDescriptionBaseWithReferenceRequest(String requestUrl, IBaseClient<?> client, List<? extends Option> requestOptions, Class<T> entityClass) The request for the entity -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete()Deletes the entityDeletes the entity and invokes the callbackget()Gets the entitygetAsync()Gets the entity an invokes the callback with itUpdates the entitypatchAsync(T sourceObject) Updates the entity and invokes the callbackpost(T newEntity, IJsonBackedObject payload) Creates a new entity and invokes the callback with the resultpostAsync(T newEntity, IJsonBackedObject payload) Creates a new entity and invokes the callback with the resultMethods inherited from class com.microsoft.graph.http.BaseRequest
addCountOption, addExpandOption, addFilterOption, addFunctionOption, addHeader, addOrderByOption, addQueryOption, addSelectOption, addSkipOption, addSkipTokenOption, addTopOption, getClient, getDelay, getFunctionOptions, getHeaders, getHttpMethod, getHttpRequest, getMaxRedirects, getMaxRetries, getOptions, getQueryOptions, getRequestUrl, getResponseType, getShouldRedirect, getShouldRetry, getUseCaches, send, sendAsync, setDelay, setHttpMethod, setMaxRedirects, setMaxRetries, setShouldRedirect, setShouldRetry, setUseCaches, withHttpMethodMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.microsoft.graph.http.IHttpRequest
getHttpRequest
-
Constructor Details
-
BaseWithReferenceRequest
public BaseWithReferenceRequest(@Nonnull String requestUrl, @Nonnull IBaseClient<?> client, @Nullable List<? extends Option> requestOptions, @Nonnull Class<T> entityClass) The request for the entity- Parameters:
requestUrl- the request URLclient- the service clientrequestOptions- the options for this requestentityClass- the class for the entity
-
-
Method Details
-
postAsync
@Nonnull public CompletableFuture<T> postAsync(@Nullable T newEntity, @Nonnull IJsonBackedObject payload) Creates a new entity and invokes the callback with the result- Parameters:
payload- paylod to send to the servicenewEntity- entity to return- Returns:
- a future with the result
-
post
@Nullable public T post(@Nullable T newEntity, @Nonnull IJsonBackedObject payload) throws ClientException Creates a new entity and invokes the callback with the result- Parameters:
payload- paylod to send to the servicenewEntity- entity to return- Returns:
- the entity once request is executed
- Throws:
ClientException
-
getAsync
Gets the entity an invokes the callback with it- Returns:
- a future with the result
-
get
Gets the entity- Returns:
- the obtained entity
- Throws:
ClientException
-
deleteAsync
Deletes the entity and invokes the callback- Returns:
- a future with the result
-
delete
Deletes the entity- Throws:
ClientException
-
patchAsync
Updates the entity and invokes the callback- Parameters:
sourceObject- object to update- Returns:
- a future with the result
-
patch
Updates the entity- Parameters:
sourceObject- object to update- Returns:
- the udpated entity
- Throws:
ClientException
-