anchor.diff:    /**
      * Sends a HTTPRequest using [method] (usually GET or POST) to [requestUrl] using the specified [urlParams] and [queryParams]. Optionally include a [body] in the request.
      */
  -  Future _request(String requestUrl, String method, {String body, String contentType:"application/json", Map urlParams, Map queryParams}) {
  +  Future request(String requestUrl, String method, {String body, String contentType:"application/json", Map urlParams, Map queryParams}) {
       var request = new HttpRequest();
       var completer = new Completer();
   
       if (urlParams == null) urlParams = {};
       if (queryParams == null) queryParams = {};
   
  -    _params.forEach((key, param) {
  +    params.forEach((key, param) {
         if (param != null && queryParams[key] == null) {
           queryParams[key] = param;
         }
  
positive.code: 
      (new File("$folderName/CONTRIBUTORS")).writeAsStringSync(_createContributors());
  
      // Create browser versions of the libraries
      (new File("$folderName/lib/$_libraryName.dart")).writeAsStringSync(_createLibrary());
  
      (new File("$folderName/lib/src/client.dart")).writeAsStringSync(_createClientClass());
  
      (new File("$folderName/lib/src/schemas.dart")).writeAsStringSync(_createSchemas());
  
      (new File("$folderName/lib/src/resources.dart")).writeAsStringSync(_createResources());
  
      (new File("$folderName/lib/src/$_name.dart")).writeAsStringSync(_createMainClass());
  
      // Create console versions of the libraries
      (new File("$folderName/lib/$_libraryConsoleName.dart")).writeAsStringSync(_createConsoleLibrary());
  
      (new File("$folderName/lib/src/console/client.dart")).writeAsStringSync(_createConsoleClientClass());
  
      (new File("$folderName/lib/src/console/schemas.dart")).writeAsStringSync(_createConsoleSchemas());
  
      (new File("$folderName/lib/src/console/resources.dart")).writeAsStringSync(_createConsoleResources());
  
      (new File("$folderName/lib/src/console/$_name.dart")).writeAsStringSync(_createConsoleMainClass());
    }
  
    String _createPubspec() {
      return """
  name: $_libraryName
  version: $_clientVersion
  description: Auto-generated client library for accessing the $_name $_version API
  homepage: https://github.com/dart-gde/discovery_api_dart_client_generator
  author: Gerwin Sturm (scarygami@gmail.com)
  
  dependencies:
    js:
      git: git://github.com/dart-lang/js-interop.git
    google_oauth2_client: '>=0.1.0'
  """;
    }
  
    String _createLicense() {
      return """
  Copyright (c) 2013 Gerwin Sturm, FoldedSoft e.U. / www.foldedsoft.at
  
  Licensed under the Apache License, Version 2.0 (the "License"); you may not
  use this file except in compliance with the License. You may obtain a copy of
  
negative.code: 
    String _createConsoleMainClass() {
      var tmp = new StringBuffer();
      tmp.add("part of $_libraryConsoleName;\n\n");
      tmp.add("/** Client to access the $_name $_version API */\n");
      if (_json.containsKey("description")) {
        tmp.add("/** ${_json["description"]} */\n");
      }
      tmp.add("class ${capitalize(_name)} extends ConsoleClient {\n");
      if (_json.containsKey("resources")) {
        tmp.add("\n");
        _json["resources"].forEach((key, resource) {
          var subClassName = "${capitalize(key)}Resource";
          tmp.add("  $subClassName _$key;\n");
          tmp.add("  $subClassName get $key => _$key;\n");
        });
      }
      if(_json.containsKey("auth") && _json["auth"].containsKey("oauth2") && _json["auth"]["oauth2"].containsKey("scopes")) {
        _json["auth"]["oauth2"]["scopes"].forEach((scope, description) {
          var p = scope.lastIndexOf("/");
          var scopeName = scope.toUpperCase();
          if (p >= 0) scopeName = scopeName.substring(p+1);
          scopeName = cleanName(scopeName);
          tmp.add("\n");
          if (description.containsKey("description")) {
            tmp.add("  /** OAuth Scope2: ${description["description"]} */\n");
          } else {
            tmp.add("  /** OAuth Scope2 */\n");
          }
          tmp.add("  static const String ${scopeName}_SCOPE = \"$scope\";\n");
        });
      }
      if (_json.containsKey("parameters")) {
        _json["parameters"].forEach((key, param) {
          var type = parameterType[param["type"]];
          if (type != null) {
            tmp.add("\n");
            tmp.add("  /**\n");
            if (param.containsKey("description")) {
              tmp.add("   * ${param["description"]}\n");
            }
            tmp.add("   * Added as queryParameter for each request.\n");
            tmp.add("   */\n");
            tmp.add("  $type get $key => params[\"$key\"];\n");
            tmp.add("  set $key($type value) => params[\"$key\"] = value;\n");
          }
        });
      }
      // TODO: change this to correct OAuth class for console
      tmp.add("\n  ${capitalize(_name)}([Object auth]) : super(auth) {\n");
      tmp.add("    basePath = \"${_json["basePath"]}\";\n");
      tmp.add("    rootUrl = \"${_json["rootUrl"]}\";\n");
      if (_json.containsKey("resources")) {
        _json["resources"].forEach((key, resource) {
          var subClassName = "${capitalize(key)}Resource";
          tmp.add("    _$key = new $subClassName(this);\n");
        });
      }
      tmp.add("  }\n");
  
      if (_json.containsKey("methods")) {
        _json["methods"].forEach((key, method) {
          tmp.add("\n");
          tmp.add(_createMethod(key, method));
        });
      }
  
      tmp.add("}\n");
  
      return tmp.toString();
    }
  
  