slides: make int values of Range optional

Depending on `Type` of `Range` speicified the api either expects
or does not expect values. In the case of type `ALL`, these indexes
should not be sent. In the case of type `FIXED_RANGE`, a user might
want to set either the start index or end index to 0. By making
these two pointer types both ways can work provided the correct
input.

Fixes: #433
Change-Id: I060d648dfd72ef51bd8ba202c45dc9a486efed4a
Reviewed-on: https://code-review.googlesource.com/c/google-api-go-client/+/55090
Reviewed-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Chris Broadfoot <cbro@google.com>
1 file changed
tree: 3be90fbb8328e714cd80eaebf05595ab0d64f13a
  1. .gitignore
  2. .hgtags
  3. AUTHORS
  4. CHANGES.md
  5. CONTRIBUTING.md
  6. CONTRIBUTORS
  7. GettingStarted.md
  8. LICENSE
  9. NOTES
  10. README.md
  11. RELEASING.md
  12. TODO
  13. abusiveexperiencereport/
  14. acceleratedmobilepageurl/
  15. accessapproval/
  16. accesscontextmanager/
  17. adexchangebuyer/
  18. adexchangebuyer2/
  19. adexchangeseller/
  20. adexperiencereport/
  21. admin/
  22. admob/
  23. adsense/
  24. adsensehost/
  25. alertcenter/
  26. analytics/
  27. analyticsreporting/
  28. androiddeviceprovisioning/
  29. androidenterprise/
  30. androidmanagement/
  31. androidpublisher/
  32. api-list.json
  33. apigee/
  34. appengine/
  35. appsactivity/
  36. appstate/
  37. bigquery/
  38. bigqueryconnection/
  39. bigquerydatatransfer/
  40. bigqueryreservation/
  41. bigtableadmin/
  42. billingbudgets/
  43. binaryauthorization/
  44. blogger/
  45. books/
  46. calendar/
  47. chat/
  48. civicinfo/
  49. classroom/
  50. cloudasset/
  51. cloudbilling/
  52. cloudbuild/
  53. cloudcommerceprocurement/
  54. clouddebugger/
  55. clouderrorreporting/
  56. cloudfunctions/
  57. cloudidentity/
  58. cloudiot/
  59. cloudkms/
  60. cloudprivatecatalog/
  61. cloudprivatecatalogproducer/
  62. cloudprofiler/
  63. cloudresourcemanager/
  64. cloudscheduler/
  65. cloudsearch/
  66. cloudshell/
  67. cloudtasks/
  68. cloudtrace/
  69. commentanalyzer/
  70. composer/
  71. compute/
  72. consumersurveys/
  73. container/
  74. containeranalysis/
  75. content/
  76. customsearch/
  77. datacatalog/
  78. dataflow/
  79. datafusion/
  80. dataproc/
  81. datastore/
  82. deploymentmanager/
  83. dfareporting/
  84. dialogflow/
  85. digitalassetlinks/
  86. discovery/
  87. displayvideo/
  88. dlp/
  89. dns/
  90. doc.go
  91. docs/
  92. domainsrdap/
  93. doubleclickbidmanager/
  94. doubleclicksearch/
  95. drive/
  96. driveactivity/
  97. examples/
  98. factchecktools/
  99. fcm/
  100. file/
  101. firebase/
  102. firebasedynamiclinks/
  103. firebasehosting/
  104. firebaseremoteconfig/
  105. firebaserules/
  106. firestore/
  107. fitness/
  108. fusiontables/
  109. games/
  110. gamesconfiguration/
  111. gameservices/
  112. gamesmanagement/
  113. genomics/
  114. gmail/
  115. go.mod
  116. go.sum
  117. google-api-go-generator/
  118. googleapi/
  119. groupsmigration/
  120. groupssettings/
  121. healthcare/
  122. homegraph/
  123. iam/
  124. iamcredentials/
  125. iap/
  126. identitytoolkit/
  127. indexing/
  128. integration-tests/
  129. internal/
  130. iterator/
  131. jobs/
  132. kgsearch/
  133. language/
  134. lib/
  135. libraryagent/
  136. license_test.go
  137. licensing/
  138. lifesciences/
  139. logging/
  140. managedidentities/
  141. manufacturers/
  142. memcache/
  143. mirror/
  144. ml/
  145. monitoring/
  146. networkmanagement/
  147. oauth2/
  148. option/
  149. osconfig/
  150. oslogin/
  151. pagespeedonline/
  152. partners/
  153. people/
  154. playcustomapp/
  155. playmoviespartner/
  156. plus/
  157. plusdomains/
  158. policytroubleshooter/
  159. poly/
  160. prod_tt_sasportal/
  161. proximitybeacon/
  162. pubsub/
  163. qpxexpress/
  164. recommender/
  165. redis/
  166. remotebuildexecution/
  167. replicapool/
  168. replicapoolupdater/
  169. reseller/
  170. run/
  171. runtimeconfig/
  172. safebrowsing/
  173. sasportal/
  174. script/
  175. searchconsole/
  176. secretmanager/
  177. securitycenter/
  178. servicebroker/
  179. serviceconsumermanagement/
  180. servicecontrol/
  181. servicedirectory/
  182. servicemanagement/
  183. servicenetworking/
  184. serviceusage/
  185. serviceuser/
  186. sheets/
  187. siteverification/
  188. slides/
  189. sourcerepo/
  190. spanner/
  191. spectrum/
  192. speech/
  193. sql/
  194. sqladmin/
  195. storage/
  196. storagetransfer/
  197. streetviewpublish/
  198. support/
  199. surveys/
  200. tagmanager/
  201. tasks/
  202. testing/
  203. texttospeech/
  204. toolresults/
  205. tools.go
  206. tpu/
  207. tracing/
  208. translate/
  209. transport/
  210. urlshortener/
  211. vault/
  212. verifiedaccess/
  213. videointelligence/
  214. vision/
  215. webfonts/
  216. webmasters/
  217. websecurityscanner/
  218. youtube/
  219. youtubeanalytics/
  220. youtubereporting/
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.