use of com.linkedin.restli.client.BatchDeleteRequestBuilder in project rest.li by linkedin.
the class ExampleRequestResponseGenerator method batchDelete.
public ExampleRequestResponse batchDelete() {
checkSupports(ResourceMethod.BATCH_DELETE);
BatchDeleteRequestBuilder<Object, RecordTemplatePlaceholder> delete = new BatchDeleteRequestBuilder<Object, RecordTemplatePlaceholder>(_uriTemplate, RecordTemplatePlaceholder.class, _resourceSpec, _requestOptions);
Object id1 = generateKey(0);
Object id2 = generateKey(1);
delete.ids(id1, id2);
addParams(delete, ResourceMethod.BATCH_DELETE);
addPathKeys(delete);
BatchDeleteRequest<Object, RecordTemplatePlaceholder> request = delete.build();
final Map<Object, UpdateResponse> bdResponseData = new HashMap<Object, UpdateResponse>();
bdResponseData.put(id1, new UpdateResponse(HttpStatus.S_200_OK));
bdResponseData.put(id2, new UpdateResponse(HttpStatus.S_200_OK));
BatchUpdateResult<Object, RecordTemplatePlaceholder> result = new BatchUpdateResult<Object, RecordTemplatePlaceholder>(bdResponseData);
return buildRequestResponse(request, result, buildResourceMethodDescriptorForRestMethod(request));
}
Aggregations