class EndpointsApiController implements EndpointsApi {

    @Override
    @PreAuthorize("hasAuthority('DELETE_ENDPOINT')")
    @AuditEventMethod(event = DELETE_REST_ENDPOINT)
    public ResponseEntity<Void> deleteEndpoint(String id) {
        Long endpointId = parseLongIdOrThrowNotFound(id);
        try {
            endpointService.deleteEndpoint(endpointId);
        } catch (EndpointNotFoundException e) {
            throw new ResourceNotFoundException(e);
        } catch (ClientNotFoundException e) {
            throw new ConflictException("Client not found for the given endpoint with id: " + id);
        } catch (EndpointService.IllegalGeneratedEndpointRemoveException e) {
            throw new BadRequestException("Removing is not allowed for generated endpoint " + id);
        }
        return new ResponseEntity<>(HttpStatus.NO_CONTENT);
    }

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

}