class PrivDeletePrivacyGroup implements JsonRpcMethod {

  @Override
  public JsonRpcResponse response(final JsonRpcRequestContext requestContext) {
    LOG.trace("Executing {}", RpcMethod.PRIV_DELETE_PRIVACY_GROUP.getMethodName());

    final String privacyGroupId = requestContext.getRequiredParameter(0, String.class);

    final String response;
    try {
      response =
          privacyController.deletePrivacyGroup(
              privacyGroupId, enclavePublicKeyProvider.getEnclaveKey(requestContext.getUser()));
    } catch (final MultiTenancyValidationException e) {
      LOG.error("Unauthorized privacy multi-tenancy rpc request. {}", e.getMessage());
      return new JsonRpcErrorResponse(
          requestContext.getRequest().getId(), DELETE_PRIVACY_GROUP_ERROR);
    } catch (Exception e) {
      LOG.error("Failed to delete privacy group", e);
      return new JsonRpcErrorResponse(
          requestContext.getRequest().getId(), DELETE_PRIVACY_GROUP_ERROR);
    }
    return new JsonRpcSuccessResponse(requestContext.getRequest().getId(), response);
  }

  public  PrivDeletePrivacyGroup(
      final PrivacyController privacyController,
      final EnclavePublicKeyProvider enclavePublicKeyProvider);

}