class SubscriptionRequestMapper {

  public PrivateSubscribeRequest mapPrivateSubscribeRequest(
      final JsonRpcRequestContext jsonRpcRequestContext, final String enclavePublicKey)
      throws InvalidSubscriptionRequestException {
    try {
      final WebSocketRpcRequest webSocketRpcRequestBody = validateRequest(jsonRpcRequestContext);

      final String privacyGroupId = webSocketRpcRequestBody.getRequiredParameter(0, String.class);
      final SubscriptionType subscriptionType =
          webSocketRpcRequestBody.getRequiredParameter(1, SubscriptionType.class);

      switch (subscriptionType) {
        case LOGS:
          {
            final FilterParameter filterParameter =
                jsonRpcRequestContext.getRequiredParameter(2, FilterParameter.class);
            return new PrivateSubscribeRequest(
                SubscriptionType.LOGS,
                filterParameter,
                null,
                webSocketRpcRequestBody.getConnectionId(),
                privacyGroupId,
                enclavePublicKey);
          }
        default:
          throw new InvalidSubscriptionRequestException(
              "Invalid subscribe request. Invalid private subscription type.");
      }
    } catch (final InvalidSubscriptionRequestException e) {
      throw e;
    } catch (final Exception e) {
      throw new InvalidSubscriptionRequestException("Error parsing subscribe request", e);
    }
  }

  public  SubscriptionRequestMapper();

}