Search in sources :

Example 1 with PartialUpdateRequestBuilder

use of com.linkedin.restli.client.PartialUpdateRequestBuilder in project rest.li by linkedin.

the class ExampleRequestResponseGenerator method partialUpdate.

public ExampleRequestResponse partialUpdate() {
    checkSupports(ResourceMethod.PARTIAL_UPDATE);
    PartialUpdateRequestBuilder<Object, RecordTemplatePlaceholder> update = new PartialUpdateRequestBuilder<Object, RecordTemplatePlaceholder>(_uriTemplate, RecordTemplatePlaceholder.class, _resourceSpec, _requestOptions);
    if (_resourceSpec.getKeyType() != null) {
        update.id(generateKey());
    }
    update.input(PatchGenerator.<RecordTemplatePlaceholder>diffEmpty(generateEntity()));
    addParams(update, ResourceMethod.PARTIAL_UPDATE);
    addPathKeys(update);
    PartialUpdateRequest<RecordTemplatePlaceholder> request = update.build();
    return buildRequestResponse(request, new UpdateResponse(HttpStatus.S_200_OK), buildResourceMethodDescriptorForRestMethod(request));
}
Also used : UpdateResponse(com.linkedin.restli.server.UpdateResponse) BatchPartialUpdateRequestBuilder(com.linkedin.restli.client.BatchPartialUpdateRequestBuilder) PartialUpdateRequestBuilder(com.linkedin.restli.client.PartialUpdateRequestBuilder)

Aggregations

BatchPartialUpdateRequestBuilder (com.linkedin.restli.client.BatchPartialUpdateRequestBuilder)1 PartialUpdateRequestBuilder (com.linkedin.restli.client.PartialUpdateRequestBuilder)1 UpdateResponse (com.linkedin.restli.server.UpdateResponse)1