google-api-go-client: Fix basePath bug

The Discovery JSON doc here: https://www.googleapis.com/discovery/v1/apis/
was being used as the top-level API struct for each API.

Look at pubsub:v1beta2 as an example.  It says:
{
 "kind": "discovery#directoryItem",
 "id": "pubsub:v1beta2",
 "name": "pubsub",
 "version": "v1beta2",
 "title": "Google Cloud Pub/Sub API",
 "description": "Provides reliable, many-to-many, asynchronous messaging between applications.",
 "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/pubsub/v1beta2/rest",
 "discoveryLink": "./apis/pubsub/v1beta2/rest",
 "icons": {
  "x16": "http://www.google.com/images/icons/product/search-16.gif",
  "x32": "http://www.google.com/images/icons/product/search-32.gif"
 },
 "documentationLink": "",
 "preferred": true
}

Note that "rootUrl" and "servicePath" are not specified.
When the actual API is slurped in, however, these top-level fields are
provided but not updated.
For example, pubsub:v1beta2 API looks like this when slurped in:

{
 "kind": "discovery#restDescription",
 "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/lQI8FHp12NFK29a25qmlTN4Bqeo\"",
 "discoveryVersion": "v1",
 "id": "pubsub:v1beta2",
 "name": "pubsub",
 "version": "v1beta2",
 "revision": "20150213",
 "title": "Google Cloud Pub/Sub API",
 "description": "Provides reliable, many-to-many, asynchronous messaging between applications.",
 "ownerDomain": "google.com",
 "ownerName": "Google",
 "icons": {
  "x16": "http://www.google.com/images/icons/product/search-16.gif",
  "x32": "http://www.google.com/images/icons/product/search-32.gif"
 },
 "documentationLink": "",
 "protocol": "rest",
 "baseUrl": "https://pubsub.googleapis.com/v1beta2/",
 "basePath": "/v1beta2/",
 "rootUrl": "https://pubsub.googleapis.com/",
 "servicePath": "v1beta2/",
 "batchPath": "batch",
...
}

Note that "rootUrl" and "servicePath" are now supplied in
the actual slurped API.
Previously, the basePath was being reported as
    "https://www.googleapis.com/v1beta2/"
which is not correct.  With this change, the basePath is
now correctly being reported as
    "https://pubsub.googleapis.com/v1beta2/"

Change-Id: Ie6df5463a5d8079a6245e04f187ca64b736baea2
Reviewed-on: https://code-review.googlesource.com/2010
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
15 files changed
tree: 21b6a49ba0e79e3504b2356cce085d4a8f8ab515
  1. adexchangebuyer/
  2. adexchangeseller/
  3. admin/
  4. adsense/
  5. adsensehost/
  6. analytics/
  7. androidpublisher/
  8. appsactivity/
  9. appstate/
  10. audit/
  11. autoscaler/
  12. bigquery/
  13. blogger/
  14. books/
  15. calendar/
  16. civicinfo/
  17. cloudlatencytest/
  18. cloudmonitoring/
  19. compute/
  20. container/
  21. content/
  22. coordinate/
  23. customsearch/
  24. dataflow/
  25. datastore/
  26. deploymentmanager/
  27. dfareporting/
  28. discovery/
  29. dns/
  30. doubleclickbidmanager/
  31. doubleclicksearch/
  32. drive/
  33. examples/
  34. fitness/
  35. freebase/
  36. games/
  37. gamesconfiguration/
  38. gamesmanagement/
  39. gan/
  40. genomics/
  41. gmail/
  42. google-api-go-generator/
  43. googleapi/
  44. groupsmigration/
  45. groupssettings/
  46. identitytoolkit/
  47. lib/
  48. licensing/
  49. manager/
  50. mapsengine/
  51. mirror/
  52. oauth2/
  53. pagespeedonline/
  54. plus/
  55. plusdomains/
  56. prediction/
  57. pubsub/
  58. qpxexpress/
  59. replicapool/
  60. replicapoolupdater/
  61. reseller/
  62. resourceviews/
  63. siteverification/
  64. spectrum/
  65. sqladmin/
  66. storage/
  67. tagmanager/
  68. taskqueue/
  69. tasks/
  70. translate/
  71. urlshortener/
  72. webfonts/
  73. webmasters/
  74. youtube/
  75. youtubeanalytics/
  76. .hgignore
  77. .hgtags
  78. .travis.yml
  79. AUTHORS
  80. build-examples.sh
  81. CONTRIBUTING.md
  82. CONTRIBUTORS
  83. LICENSE
  84. Makefile
  85. NOTES
  86. README.md
  87. TODO
README.md

Google APIs Client Library for Go

Status

Build Status

These are auto-generated Go libraries from the Google Discovery Service's JSON description files of the available “new style” Google APIs.

Announcement email: http://groups.google.com/group/golang-nuts/browse_thread/thread/6c7281450be9a21e

Getting started documentation:

http://code.google.com/p/google-api-go-client/wiki/GettingStarted

In summary:

$ go get google.golang.org/api/storage/v1
$ go get google.golang.org/api/tasks/v1
$ go get google.golang.org/api/moderator/v1
... etc ...

For docs, see e.g.:

https://godoc.org/google.golang.org/api/storage/v1

The package of a given import is the second-to-last component, before the version number.

For examples, see:

https://github.com/google/google-api-go-client/tree/master/examples

For support, use the golang-nuts@ mailing list:

https://groups.google.com/group/golang-nuts