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));
}
Aggregations