class RequestUrlBuilder {

    URL getDatasetsUrl(String projectId, String datasetName, boolean fetchResults, Map<String, ?> queryParams) throws KeenQueryClientException {
        try {
            StringBuilder url = createBaseDatasetsUrl(projectId);

            if (datasetName != null) {
                appendDatasetName(url, datasetName);
                if (fetchResults) {
                    appendFetchResults(url);
                }
            }

            if (queryParams != null && !queryParams.isEmpty()) {
                appendQueryParams(url, queryParams);
            }
            return new URL(url.toString());
        } catch (IOException ex) {
            Logger.getLogger(RequestUrlBuilder.class.getName())
                    .log(Level.SEVERE, "Failed to format dataset URL.", ex);

            throw new KeenQueryClientException("Failed to format dataset URL.", ex);
        }
    }

      RequestUrlBuilder(String apiVersion, String baseUrl);

}