all: update generator to use standard message for autogen code

Fixes #313

Change-Id: I00cf510afa9c0b0d8b7999f2016a66c772ea7826
Reviewed-on: https://code-review.googlesource.com/c/36010
Reviewed-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Eno Compton <enocom@google.com>
235 files changed
tree: 29fc6473fb67d9d010f92f3b4fb7b91889ddfb66
  1. abusiveexperiencereport/
  2. acceleratedmobilepageurl/
  3. accesscontextmanager/
  4. adexchangebuyer/
  5. adexchangebuyer2/
  6. adexchangeseller/
  7. adexperiencereport/
  8. admin/
  9. adsense/
  10. adsensehost/
  11. alertcenter/
  12. analytics/
  13. analyticsreporting/
  14. androiddeviceprovisioning/
  15. androidenterprise/
  16. androidmanagement/
  17. androidpublisher/
  18. appengine/
  19. appsactivity/
  20. appstate/
  21. bigquery/
  22. bigquerydatatransfer/
  23. binaryauthorization/
  24. blogger/
  25. books/
  26. calendar/
  27. chat/
  28. civicinfo/
  29. classroom/
  30. cloudasset/
  31. cloudbilling/
  32. cloudbuild/
  33. clouddebugger/
  34. clouderrorreporting/
  35. cloudfunctions/
  36. cloudiot/
  37. cloudkms/
  38. cloudprofiler/
  39. cloudresourcemanager/
  40. cloudscheduler/
  41. cloudsearch/
  42. cloudshell/
  43. cloudtasks/
  44. cloudtrace/
  45. composer/
  46. compute/
  47. consumersurveys/
  48. container/
  49. content/
  50. customsearch/
  51. dataflow/
  52. dataproc/
  53. datastore/
  54. deploymentmanager/
  55. dfareporting/
  56. dialogflow/
  57. digitalassetlinks/
  58. discovery/
  59. dlp/
  60. dns/
  61. doubleclickbidmanager/
  62. doubleclicksearch/
  63. drive/
  64. driveactivity/
  65. examples/
  66. file/
  67. firebasedynamiclinks/
  68. firebasehosting/
  69. firebaseremoteconfig/
  70. firebaserules/
  71. firestore/
  72. fitness/
  73. fusiontables/
  74. games/
  75. gamesconfiguration/
  76. gamesmanagement/
  77. genomics/
  78. gensupport/
  79. gmail/
  80. google-api-go-generator/
  81. googleapi/
  82. groupsmigration/
  83. groupssettings/
  84. iam/
  85. iamcredentials/
  86. iap/
  87. identitytoolkit/
  88. indexing/
  89. integration-tests/
  90. internal/
  91. iterator/
  92. jobs/
  93. kgsearch/
  94. language/
  95. lib/
  96. licensing/
  97. logging/
  98. manufacturers/
  99. mirror/
  100. ml/
  101. monitoring/
  102. oauth2/
  103. option/
  104. oslogin/
  105. pagespeedonline/
  106. partners/
  107. people/
  108. photoslibrary/
  109. playcustomapp/
  110. playmoviespartner/
  111. plus/
  112. plusdomains/
  113. poly/
  114. prediction/
  115. proximitybeacon/
  116. pubsub/
  117. qpxexpress/
  118. redis/
  119. replicapool/
  120. replicapoolupdater/
  121. reseller/
  122. runtimeconfig/
  123. safebrowsing/
  124. script/
  125. searchconsole/
  126. servicebroker/
  127. serviceconsumermanagement/
  128. servicecontrol/
  129. servicemanagement/
  130. servicenetworking/
  131. serviceusage/
  132. serviceuser/
  133. sheets/
  134. siteverification/
  135. slides/
  136. sourcerepo/
  137. spanner/
  138. spectrum/
  139. speech/
  140. sqladmin/
  141. storage/
  142. storagetransfer/
  143. streetviewpublish/
  144. support/
  145. surveys/
  146. tagmanager/
  147. tasks/
  148. testing/
  149. texttospeech/
  150. toolresults/
  151. tpu/
  152. tracing/
  153. translate/
  154. transport/
  155. urlshortener/
  156. vault/
  157. videointelligence/
  158. vision/
  159. webfonts/
  160. webmasters/
  161. websecurityscanner/
  162. youtube/
  163. youtubeanalytics/
  164. youtubereporting/
  165. .gitignore
  166. .hgtags
  167. api-list.json
  168. AUTHORS
  169. CONTRIBUTING.md
  170. CONTRIBUTORS
  171. GettingStarted.md
  172. key.json.enc
  173. LICENSE
  174. NOTES
  175. README.md
  176. TODO
README.md

Google APIs Client Library for Go

Getting Started

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

and using:

package main

import (
	"net/http"

	"google.golang.org/api/urlshortener/v1"
)

func main() {
	svc, err := urlshortener.New(http.DefaultClient)
	// ...
}

Status

GoDoc

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.

These client libraries are officially supported by Google. However, the libraries are considered complete and are in maintenance mode. This means that we will address critical bugs and security issues but will not add any new features.

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”).

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 (
        "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.