class JobManagementSpringResource {

    @ApiOperation("Update attributes of a task")
    @PutMapping(path = "/tasks/{taskId}/attributes")
    public ResponseEntity<Void> updateTaskAttributes(@PathVariable("taskId") String taskId,
                                                     @RequestBody TaskAttributesUpdate request,
                                                     CallMetadataAuthentication authentication) {
        TaskAttributesUpdate sanitizedRequest;
        if (request.getTaskId().isEmpty()) {
            sanitizedRequest = request.toBuilder().setTaskId(taskId).build();
        } else {
            if (!taskId.equals(request.getTaskId())) {
                return ResponseEntity.status(HttpStatus.BAD_REQUEST).build();
            }
            sanitizedRequest = request;
        }
        return Responses.fromCompletable(
                jobServiceGateway.updateTaskAttributes(sanitizedRequest, authentication.getCallMetadata()),
                HttpStatus.OK
        );
    }

    @Inject public  JobManagementSpringResource(JobServiceGateway jobServiceGateway, SystemLogService systemLog);

}