CustomRequest<T> Class

Type Parameters

T

the entity or complex type

public class CustomRequest<T>
extends BaseRequest<T>

Respresents a custom request to be executed against the service

Constructor Summary

Constructor Description
CustomRequest(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 Type Method and Description
static CustomRequest<com.google.gson.JsonObject> create(String requestUrl, IBaseClient<?> client, List<? extends Option> requestOptions)

Creates a custom requests to be executed against the service

void delete()

Delete this item from the service

java.util.concurrent.CompletableFuture<T> deleteAsync()

Delete this item from the service

CustomRequest<T> expand(String value)

Sets the expand clause for the request

T get()

Gets the resource and returns the deserialized resource

java.util.concurrent.CompletableFuture<T> getAsync()

Gets the resource and calls the callback with the deserialized resource

T patch(T sourceObject)

Patches this item with a source

java.util.concurrent.CompletableFuture<T> patchAsync()

Patches this item with a source

T post(T newObject)

Creates a new object

java.util.concurrent.CompletableFuture<T> postAsync(T newObject)

Creates a new object

T put(T putObject)

Creates a new object

java.util.concurrent.CompletableFuture<T> putAsync(T putObject)

Creates a new object

CustomRequest<T> select(String value)

Sets the select clause for the request

Methods inherited from BaseRequest

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

CustomRequest

public CustomRequest(String requestUrl, IBaseClient client, List requestOptions, Class responseClass)

Instanciates a custom requests to be executed against the service

Parameters:

requestUrl - the URL to send the request to
client - the client to use to send the request
requestOptions - the options to apply to the request
responseClass - the class for response deserialization

Method Details

create

public static CustomRequest create(String requestUrl, IBaseClient client, List requestOptions)

Creates a custom requests to be executed against the service

Parameters:

requestUrl - the URL to send the request to
client - the client to use to send the request
requestOptions - the options to apply to the request

Returns:

the request to execute against the service

delete

public void delete()

Delete this item from the service

Throws:

ClientException - if there was an exception during the delete operation

deleteAsync

public CompletableFuture deleteAsync()

Delete this item from the service

Returns:

a future with the result

expand

public CustomRequest expand(String value)

Sets the expand clause for the request

Parameters:

value - the expand clause

Returns:

the updated request

get

public T get()

Gets the resource and returns the deserialized resource

Returns:

the deserialized resource

Throws:

getAsync

public CompletableFuture getAsync()

Gets the resource and calls the callback with the deserialized resource

Returns:

a future with the result

patch

public T patch(T sourceObject)

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

patchAsync

public CompletableFuture patchAsync()

Patches this item with a source

Returns:

a future with the result

post

public T post(T newObject)

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

postAsync

public CompletableFuture postAsync(T newObject)

Creates a new object

Parameters:

newObject - the new object to create

Returns:

a future with the result

put

public T put(T putObject)

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

putAsync

public CompletableFuture putAsync(T putObject)

Creates a new object

Parameters:

putObject - the new object to create

Returns:

a future with the result

select

public CustomRequest select(String value)

Sets the select clause for the request

Parameters:

value - the select clause

Returns:

the updated request

Applies to