class SubscriptionRequestMapper {

  public UnsubscribeRequest mapUnsubscribeRequest(final JsonRpcRequestContext jsonRpcRequestContext)
      throws InvalidSubscriptionRequestException {
    try {
      final WebSocketRpcRequest webSocketRpcRequestBody = validateRequest(jsonRpcRequestContext);

      final long subscriptionId =
          webSocketRpcRequestBody.getRequiredParameter(0, UnsignedLongParameter.class).getValue();
      return new UnsubscribeRequest(subscriptionId, webSocketRpcRequestBody.getConnectionId());
    } catch (final Exception e) {
      throw new InvalidSubscriptionRequestException("Error parsing unsubscribe request", e);
    }
  }

  public  SubscriptionRequestMapper();

}