all: autogenerated update (2017-10-14)

Update:
- calendar/v3
- servicecontrol/v1
- servicemanagement/v1
- serviceuser/v1
87 files changed
tree: 75b819ad8e4c300fe3f1f7fce673e352b180edbd
  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. cloudiot/
  31. cloudkms/
  32. cloudmonitoring/
  33. cloudresourcemanager/
  34. cloudtasks/
  35. cloudtrace/
  36. clouduseraccounts/
  37. compute/
  38. consumersurveys/
  39. container/
  40. content/
  41. customsearch/
  42. dataflow/
  43. dataproc/
  44. datastore/
  45. deploymentmanager/
  46. dfareporting/
  47. discovery/
  48. dlp/
  49. dns/
  50. doubleclickbidmanager/
  51. doubleclicksearch/
  52. drive/
  53. examples/
  54. firebasedynamiclinks/
  55. firebaseremoteconfig/
  56. firebaserules/
  57. firestore/
  58. fitness/
  59. fusiontables/
  60. games/
  61. gamesconfiguration/
  62. gamesmanagement/
  63. genomics/
  64. gensupport/
  65. gmail/
  66. google-api-go-generator/
  67. googleapi/
  68. groupsmigration/
  69. groupssettings/
  70. iam/
  71. identitytoolkit/
  72. integration-tests/
  73. internal/
  74. iterator/
  75. kgsearch/
  76. language/
  77. lib/
  78. licensing/
  79. logging/
  80. manufacturers/
  81. mirror/
  82. ml/
  83. monitoring/
  84. oauth2/
  85. option/
  86. oslogin/
  87. pagespeedonline/
  88. partners/
  89. people/
  90. playcustomapp/
  91. playmoviespartner/
  92. plus/
  93. plusdomains/
  94. prediction/
  95. proximitybeacon/
  96. pubsub/
  97. qpxexpress/
  98. replicapool/
  99. replicapoolupdater/
  100. reseller/
  101. resourceviews/
  102. runtimeconfig/
  103. safebrowsing/
  104. script/
  105. searchconsole/
  106. servicecontrol/
  107. servicemanagement/
  108. serviceuser/
  109. sheets/
  110. siteverification/
  111. slides/
  112. sourcerepo/
  113. spanner/
  114. spectrum/
  115. speech/
  116. sqladmin/
  117. storage/
  118. storagetransfer/
  119. streetviewpublish/
  120. support/
  121. surveys/
  122. tagmanager/
  123. taskqueue/
  124. tasks/
  125. testing/
  126. toolresults/
  127. tracing/
  128. translate/
  129. transport/
  130. urlshortener/
  131. vault/
  132. videointelligence/
  133. vision/
  134. webfonts/
  135. webmasters/
  136. youtube/
  137. youtubeanalytics/
  138. youtubereporting/
  139. .gitignore
  140. .hgtags
  141. .travis.yml
  142. api-list.json
  143. AUTHORS
  144. CONTRIBUTING.md
  145. CONTRIBUTORS
  146. GettingStarted.md
  147. key.json.enc
  148. LICENSE
  149. NOTES
  150. README.md
  151. 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

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

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.

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