Search in sources :

Example 1 with UpdateRequestBuilder

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

the class ExampleRequestResponseGenerator method update.

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

Aggregations

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