google-api-go-generator: move Makefile up from root

Having Makefile at root has caused some confusion, see this thread:
https://twitter.com/_zombiezen_/status/898027880101232642

Change-Id: I4f862cbc30b89840562d0145b2e6740fafd014e8
Reviewed-on: https://code-review.googlesource.com/15932
Reviewed-by: JBD <jbd@google.com>
3 files changed
tree: f53c7e805d472230c546ddafbaa49a33a7c38b4f
  1. acceleratedmobilepageurl/
  2. adexchangebuyer/
  3. adexchangebuyer2/
  4. adexchangeseller/
  5. adexperiencereport/
  6. admin/
  7. adsense/
  8. adsensehost/
  9. analytics/
  10. analyticsreporting/
  11. androiddeviceprovisioning/
  12. androidenterprise/
  13. androidmanagement/
  14. androidpublisher/
  15. appengine/
  16. appsactivity/
  17. appstate/
  18. bigquery/
  19. bigquerydatatransfer/
  20. blogger/
  21. books/
  22. calendar/
  23. civicinfo/
  24. classroom/
  25. cloudbilling/
  26. cloudbuild/
  27. clouddebugger/
  28. clouderrorreporting/
  29. cloudfunctions/
  30. cloudkms/
  31. cloudmonitoring/
  32. cloudresourcemanager/
  33. cloudtrace/
  34. clouduseraccounts/
  35. compute/
  36. consumersurveys/
  37. container/
  38. content/
  39. customsearch/
  40. dataflow/
  41. dataproc/
  42. datastore/
  43. deploymentmanager/
  44. dfareporting/
  45. discovery/
  46. dlp/
  47. dns/
  48. doubleclickbidmanager/
  49. doubleclicksearch/
  50. drive/
  51. examples/
  52. firebasedynamiclinks/
  53. firebaserules/
  54. fitness/
  55. fusiontables/
  56. games/
  57. gamesconfiguration/
  58. gamesmanagement/
  59. genomics/
  60. gensupport/
  61. gmail/
  62. google-api-go-generator/
  63. googleapi/
  64. groupsmigration/
  65. groupssettings/
  66. iam/
  67. identitytoolkit/
  68. integration-tests/
  69. internal/
  70. iterator/
  71. kgsearch/
  72. language/
  73. lib/
  74. licensing/
  75. logging/
  76. manufacturers/
  77. mirror/
  78. ml/
  79. monitoring/
  80. oauth2/
  81. option/
  82. oslogin/
  83. pagespeedonline/
  84. partners/
  85. people/
  86. playcustomapp/
  87. playmoviespartner/
  88. plus/
  89. plusdomains/
  90. prediction/
  91. proximitybeacon/
  92. pubsub/
  93. qpxexpress/
  94. replicapool/
  95. replicapoolupdater/
  96. reseller/
  97. resourceviews/
  98. runtimeconfig/
  99. safebrowsing/
  100. script/
  101. searchconsole/
  102. servicecontrol/
  103. servicemanagement/
  104. serviceuser/
  105. sheets/
  106. siteverification/
  107. slides/
  108. sourcerepo/
  109. spanner/
  110. spectrum/
  111. speech/
  112. sqladmin/
  113. storage/
  114. storagetransfer/
  115. streetviewpublish/
  116. support/
  117. surveys/
  118. tagmanager/
  119. taskqueue/
  120. tasks/
  121. toolresults/
  122. tracing/
  123. translate/
  124. transport/
  125. urlshortener/
  126. vault/
  127. videointelligence/
  128. vision/
  129. webfonts/
  130. webmasters/
  131. youtube/
  132. youtubeanalytics/
  133. youtubereporting/
  134. .gitignore
  135. .hgtags
  136. .travis.yml
  137. api-list.json
  138. AUTHORS
  139. CONTRIBUTING.md
  140. CONTRIBUTORS
  141. GettingStarted.md
  142. key.json.enc
  143. LICENSE
  144. NOTES
  145. README.md
  146. TODO
README.md

Google APIs Client Library for Go

Library maintenance

This client library is supported, but in maintenance mode only. We are fixing necessary bugs and adding essential features to ensure this library continues to meet your needs for accessing Google APIs. Non-critical issues will be closed. Any issue may be reopened if it is causing ongoing problems.

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.

Due to the auto-generated nature of this collection of libraries, complete APIs or specific versions can appear or go away without notice. As a result, you should always locally vendor any API(s) that your code relies upon.

If you're working with Google Cloud Platform APIs such as Datastore or Pub/Sub, consider using the Cloud Client Libraries for Go instead. These are the new and idiomatic Go libraries targeted specifically at Google Cloud Platform Services.

The generator itself and the code it produces are beta. Some APIs are alpha/beta, and indicated as such in the import path (e.g., “google.golang.org/api/someapi/v1alpha”).

Announcement email:

Getting started documentation:

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.:

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

For examples, see:

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

Application Default Credentials Example

Application Default Credentials provide a simplified way to obtain credentials for authenticating with Google APIs.

The Application Default Credentials authenticate as the application itself, which make them great for working with Google Cloud APIs like Storage or Datastore. They are the recommended form of authentication when building applications that run on Google Compute Engine or Google App Engine.

Default credentials are provided by the golang.org/x/oauth2/google package. To use them, add the following import:

import "golang.org/x/oauth2/google"

Some credentials types require you to specify scopes, and service entry points may not inject them. If you encounter this situation you may need to specify scopes as follows:

import (
        "golang.org/x/net/context"
        "golang.org/x/oauth2/google"
        "google.golang.org/api/compute/v1"
)

func main() {
        // Use oauth2.NoContext if there isn't a good context to pass in.
        ctx := context.Background()

        client, err := google.DefaultClient(ctx, compute.ComputeScope)
        if err != nil {
                //...
        }
        computeService, err := compute.New(client)
        if err != nil {
                //...
        }
}

If you need a oauth2.TokenSource, use the DefaultTokenSource function:

ts, err := google.DefaultTokenSource(ctx, scope1, scope2, ...)
if err != nil {
        //...
}
client := oauth2.NewClient(ctx, ts)

See also: golang.org/x/oauth2/google package documentation.