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

public abstract class BaseWithReferenceRequest<T> extends BaseRequest<T>
An HTTP request.
  • 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 URL
      client - the service client
      requestOptions - the options for this request
      entityClass - 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 service
      newEntity - 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 service
      newEntity - entity to return
      Returns:
      the entity once request is executed
      Throws:
      ClientException
    • getAsync

      @Nonnull public CompletableFuture<T> getAsync()
      Gets the entity an invokes the callback with it
      Returns:
      a future with the result
    • get

      @Nullable public T get() throws ClientException
      Gets the entity
      Returns:
      the obtained entity
      Throws:
      ClientException
    • deleteAsync

      @Nonnull public CompletableFuture<T> deleteAsync()
      Deletes the entity and invokes the callback
      Returns:
      a future with the result
    • delete

      public void delete() throws ClientException
      Deletes the entity
      Throws:
      ClientException
    • patchAsync

      @Nonnull public CompletableFuture<T> patchAsync(@Nonnull T sourceObject)
      Updates the entity and invokes the callback
      Parameters:
      sourceObject - object to update
      Returns:
      a future with the result
    • patch

      @Nullable public T patch(@Nonnull T sourceObject) throws ClientException
      Updates the entity
      Parameters:
      sourceObject - object to update
      Returns:
      the updated entity
      Throws:
      ClientException