class EndpointsApiController implements EndpointsApi {

    @Override
    @PreAuthorize("hasAuthority('EDIT_OPENAPI3_ENDPOINT')")
    @AuditEventMethod(event = EDIT_REST_ENDPOINT)
    public ResponseEntity<Endpoint> updateEndpoint(String id, EndpointUpdate endpointUpdate) {
        Long endpointId = parseLongIdOrThrowNotFound(id);
        Endpoint ep;
        try {
            String method = endpointUpdate.getMethod() == null ? null : endpointUpdate.getMethod().toString();
            ep = endpointConverter.convert(endpointService.updateEndpoint(endpointId,
                    method, endpointUpdate.getPath()));
        } catch (EndpointNotFoundException e) {
            throw new ResourceNotFoundException(NOT_FOUND_ERROR_MSG + " " + id);
        } catch (EndpointService.IllegalGeneratedEndpointUpdateException e) {
            throw new BadRequestException("Updating is not allowed for generated endpoint " + id);
        } catch (EndpointAlreadyExistsException e) {
            throw new ConflictException(e);
        } catch (ClientNotFoundException e) {
            throw new ConflictException("Client not found for the given endpoint with id: " + id);
        }

        return new ResponseEntity<>(ep, HttpStatus.OK);
    }

    @Autowired public  EndpointsApiController(
            EndpointService endpointService,
            EndpointConverter endpointConverter,
            AccessRightService accessRightService,
            ServiceClientConverter serviceClientConverter,
            ServiceClientHelper serviceClientHelper,
            ServiceClientService serviceClientService);

}