Package com.microsoft.graph.http
Class CustomRequest<T>
java.lang.Object
com.microsoft.graph.http.BaseRequest<T>
com.microsoft.graph.http.CustomRequest<T>
- Type Parameters:
T- the entity or complex type
- All Implemented Interfaces:
IHttpRequest
Respresents a custom request to be executed against the service
-
Field Summary
Fields inherited from class com.microsoft.graph.http.BaseRequest
functionOptions, queryOptions, REQUEST_STATS_HEADER_VALUE_FORMAT_STRING -
Constructor Summary
ConstructorsConstructorDescriptionCustomRequest(String requestUrl, IBaseClient<?> client, List<? extends Option> requestOptions, Class<T> responseClass) Instanciates a custom requests to be executed against the service -
Method Summary
Modifier and TypeMethodDescriptionstatic CustomRequest<com.google.gson.JsonObject>create(String requestUrl, IBaseClient<?> client, List<? extends Option> requestOptions) Creates a custom requests to be executed against the servicevoiddelete()Delete this item from the serviceDelete this item from the serviceSets the expand clause for the requestget()Gets the resource and returns the deserialized resourcegetAsync()Gets the resource and calls the callback with the deserialized resourcePatches this item with a sourcePatches this item with a sourceCreates a new objectCreates a new objectCreates a new objectCreates a new objectSets the select clause for the requestMethods 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
-
CustomRequest
public CustomRequest(@Nonnull String requestUrl, @Nonnull IBaseClient<?> client, @Nullable List<? extends Option> requestOptions, @Nonnull Class<T> responseClass) Instanciates a custom requests to be executed against the service- Parameters:
requestUrl- the URL to send the request toclient- the client to use to send the requestrequestOptions- the options to apply to the requestresponseClass- the class for response deserialization
-
-
Method Details
-
create
@Nonnull public static CustomRequest<com.google.gson.JsonObject> create(@Nonnull String requestUrl, @Nonnull IBaseClient<?> client, @Nullable List<? extends Option> requestOptions) Creates a custom requests to be executed against the service- Parameters:
requestUrl- the URL to send the request toclient- the client to use to send the requestrequestOptions- the options to apply to the request- Returns:
- the request to execute against the service
-
get
Gets the resource and returns the deserialized resource- Returns:
- the deserialized resource
- Throws:
ClientException
-
getAsync
Gets the resource and calls the callback with the deserialized resource- Returns:
- a future with the result
-
deleteAsync
Delete this item from the service- Returns:
- a future with the result
-
delete
Delete this item from the service- Throws:
ClientException- if there was an exception during the delete operation
-
patchAsync
Patches this item with a source- Returns:
- a future with the result
-
patch
Patches this item with a source- Parameters:
sourceObject- the source object with updates- Returns:
- the updated item
- Throws:
ClientException- this exception occurs if the request was unable to complete for any reason
-
postAsync
Creates a new object- Parameters:
newObject- the new object to create- Returns:
- a future with the result
-
post
Creates a new object- Parameters:
newObject- the new object to create- Returns:
- the created object
- Throws:
ClientException- this exception occurs if the request was unable to complete for any reason
-
putAsync
Creates a new object- Parameters:
putObject- the new object to create- Returns:
- a future with the result
-
put
Creates a new object- Parameters:
putObject- the new object to create- Returns:
- the created object
- Throws:
ClientException- this exception occurs if the request was unable to complete for any reason
-
select
Sets the select clause for the request- Parameters:
value- the select clause- Returns:
- the updated request
-
expand
Sets the expand clause for the request- Parameters:
value- the expand clause- Returns:
- the updated request
-