chore: generate based on discovery-artifact-manager (#2682)

Most other languages do not pull discovery documents directly from the discovery service, instead they share a cache. This change makes Go use that same cache while also maintaining the cached files in this repo.

Other changes:
- Added a dryrun flag to discogen for local testing
- downgraded discogen deps to work with Go 1.20
- return no doc error if the file in the index is not cached locally. This operates the same as when we pulled from the disco service, where if we got a non-2XX we would silently skip generating an api

Internal bug: 352084622
5 files changed
tree: b4e75d4b03c20809fbad3ecd655b08d51c98d1dc
  1. .github/
  2. abusiveexperiencereport/
  3. acceleratedmobilepageurl/
  4. accessapproval/
  5. accesscontextmanager/
  6. acmedns/
  7. addressvalidation/
  8. adexchangebuyer/
  9. adexchangebuyer2/
  10. adexchangeseller/
  11. adexperiencereport/
  12. admin/
  13. admob/
  14. adsense/
  15. adsensehost/
  16. advisorynotifications/
  17. aiplatform/
  18. airquality/
  19. alertcenter/
  20. alloydb/
  21. analytics/
  22. analyticsadmin/
  23. analyticsdata/
  24. analyticshub/
  25. analyticsreporting/
  26. androiddeviceprovisioning/
  27. androidenterprise/
  28. androidmanagement/
  29. androidpublisher/
  30. apigateway/
  31. apigee/
  32. apigeeregistry/
  33. apikeys/
  34. apim/
  35. appengine/
  36. apphub/
  37. appsactivity/
  38. appstate/
  39. area120tables/
  40. artifactregistry/
  41. assuredworkloads/
  42. authorizedbuyersmarketplace/
  43. backupdr/
  44. baremetalsolution/
  45. batch/
  46. beyondcorp/
  47. biglake/
  48. bigquery/
  49. bigqueryconnection/
  50. bigquerydatapolicy/
  51. bigquerydatatransfer/
  52. bigqueryreservation/
  53. bigtableadmin/
  54. billingbudgets/
  55. binaryauthorization/
  56. blockchainnodeengine/
  57. blogger/
  58. books/
  59. businessprofileperformance/
  60. calendar/
  61. certificatemanager/
  62. chat/
  63. checks/
  64. chromemanagement/
  65. chromepolicy/
  66. chromeuxreport/
  67. civicinfo/
  68. classroom/
  69. cloudasset/
  70. cloudbilling/
  71. cloudbuild/
  72. cloudchannel/
  73. cloudcommerceprocurement/
  74. cloudcontrolspartner/
  75. clouddebugger/
  76. clouddeploy/
  77. clouderrorreporting/
  78. cloudfunctions/
  79. cloudidentity/
  80. cloudiot/
  81. cloudkms/
  82. cloudprivatecatalog/
  83. cloudprivatecatalogproducer/
  84. cloudprofiler/
  85. cloudresourcemanager/
  86. cloudscheduler/
  87. cloudsearch/
  88. cloudshell/
  89. cloudsupport/
  90. cloudtasks/
  91. cloudtrace/
  92. commentanalyzer/
  93. composer/
  94. compute/
  95. config/
  96. connectors/
  97. consumersurveys/
  98. contactcenteraiplatform/
  99. contactcenterinsights/
  100. container/
  101. containeranalysis/
  102. content/
  103. contentwarehouse/
  104. css/
  105. customsearch/
  106. datacatalog/
  107. dataflow/
  108. dataform/
  109. datafusion/
  110. datalabeling/
  111. datalineage/
  112. datamigration/
  113. datapipelines/
  114. dataplex/
  115. dataportability/
  116. dataproc/
  117. datastore/
  118. datastream/
  119. deploymentmanager/
  120. developerconnect/
  121. dfareporting/
  122. dialogflow/
  123. digitalassetlinks/
  124. discovery/
  125. discoveryengine/
  126. displayvideo/
  127. dlp/
  128. dns/
  129. docs/
  130. documentai/
  131. domains/
  132. domainsrdap/
  133. doubleclickbidmanager/
  134. doubleclicksearch/
  135. drive/
  136. driveactivity/
  137. drivelabels/
  138. essentialcontacts/
  139. eventarc/
  140. examples/
  141. factchecktools/
  142. fcm/
  143. fcmdata/
  144. file/
  145. firebase/
  146. firebaseappcheck/
  147. firebaseappdistribution/
  148. firebasedatabase/
  149. firebasedynamiclinks/
  150. firebasehosting/
  151. firebaseml/
  152. firebaseremoteconfig/
  153. firebaserules/
  154. firebasestorage/
  155. firestore/
  156. fitness/
  157. forms/
  158. fusiontables/
  159. games/
  160. gamesconfiguration/
  161. gameservices/
  162. gamesmanagement/
  163. genomics/
  164. gkebackup/
  165. gkehub/
  166. gkeonprem/
  167. gmail/
  168. gmailpostmastertools/
  169. google-api-go-generator/
  170. googleapi/
  171. groupsmigration/
  172. groupssettings/
  173. healthcare/
  174. homegraph/
  175. iam/
  176. iamcredentials/
  177. iap/
  178. ideahub/
  179. identitytoolkit/
  180. ids/
  181. idtoken/
  182. impersonate/
  183. indexing/
  184. integration-tests/
  185. integrations/
  186. internal/
  187. iterator/
  188. jobs/
  189. keep/
  190. kgsearch/
  191. kmsinventory/
  192. language/
  193. lib/
  194. libraryagent/
  195. licensing/
  196. lifesciences/
  197. localservices/
  198. logging/
  199. looker/
  200. managedidentities/
  201. manufacturers/
  202. marketingplatformadmin/
  203. meet/
  204. memcache/
  205. merchantapi/
  206. metastore/
  207. migrationcenter/
  208. mirror/
  209. ml/
  210. monitoring/
  211. mybusinessaccountmanagement/
  212. mybusinessbusinesscalls/
  213. mybusinessbusinessinformation/
  214. mybusinesslodging/
  215. mybusinessnotifications/
  216. mybusinessplaceactions/
  217. mybusinessqanda/
  218. mybusinessverifications/
  219. networkconnectivity/
  220. networkmanagement/
  221. networksecurity/
  222. networkservices/
  223. notebooks/
  224. oauth2/
  225. ondemandscanning/
  226. option/
  227. orgpolicy/
  228. osconfig/
  229. oslogin/
  230. pagespeedonline/
  231. partners/
  232. paymentsresellersubscription/
  233. people/
  234. places/
  235. playablelocations/
  236. playcustomapp/
  237. playdeveloperreporting/
  238. playgrouping/
  239. playintegrity/
  240. playmoviespartner/
  241. plus/
  242. plusdomains/
  243. policyanalyzer/
  244. policysimulator/
  245. policytroubleshooter/
  246. pollen/
  247. poly/
  248. privateca/
  249. prod_tt_sasportal/
  250. proximitybeacon/
  251. publicca/
  252. pubsub/
  253. pubsublite/
  254. qpxexpress/
  255. rapidmigrationassessment/
  256. readerrevenuesubscriptionlinking/
  257. realtimebidding/
  258. recaptchaenterprise/
  259. recommendationengine/
  260. recommender/
  261. redis/
  262. remotebuildexecution/
  263. replicapool/
  264. replicapoolupdater/
  265. reseller/
  266. resourcesettings/
  267. retail/
  268. run/
  269. runtimeconfig/
  270. safebrowsing/
  271. sasportal/
  272. script/
  273. searchads360/
  274. searchconsole/
  275. secretmanager/
  276. securitycenter/
  277. servicebroker/
  278. serviceconsumermanagement/
  279. servicecontrol/
  280. servicedirectory/
  281. servicemanagement/
  282. servicenetworking/
  283. serviceusage/
  284. serviceuser/
  285. sheets/
  286. siteverification/
  287. slides/
  288. smartdevicemanagement/
  289. solar/
  290. sourcerepo/
  291. spanner/
  292. spectrum/
  293. speech/
  294. sql/
  295. sqladmin/
  296. storage/
  297. storagetransfer/
  298. streetviewpublish/
  299. sts/
  300. support/
  301. surveys/
  302. tagmanager/
  303. tasks/
  304. testing/
  305. texttospeech/
  306. toolresults/
  307. tpu/
  308. tracing/
  309. trafficdirector/
  310. transcoder/
  311. translate/
  312. transport/
  313. travelimpactmodel/
  314. urlshortener/
  315. vault/
  316. vectortile/
  317. verifiedaccess/
  318. versionhistory/
  319. videointelligence/
  320. vision/
  321. vmmigration/
  322. vmwareengine/
  323. vpcaccess/
  324. walletobjects/
  325. webfonts/
  326. webmasters/
  327. webrisk/
  328. websecurityscanner/
  329. workflowexecutions/
  330. workflows/
  331. workloadmanager/
  332. workspaceevents/
  333. workstations/
  334. youtube/
  335. youtubeanalytics/
  336. youtubereporting/
  337. .gitignore
  338. .hgtags
  339. api-list.json
  340. AUTHORS
  341. CHANGES.md
  342. CODE_OF_CONDUCT.md
  343. CONTRIBUTING.md
  344. CONTRIBUTORS
  345. doc.go
  346. GettingStarted.md
  347. go.mod
  348. go.sum
  349. go.work
  350. go.work.sum
  351. header_test.go
  352. LICENSE
  353. NOTES
  354. README.md
  355. RELEASING.md
  356. SECURITY.md
  357. testing.md
  358. 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 (
        "context"
        "net/http"

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

func main() {
        ctx := context.Background()
        svc, err := urlshortener.NewService(ctx)
        // ...
}

Status

Go Reference

These are auto-generated Go libraries from the Google Discovery Service's JSON description files.

Due to the auto-generated nature of this collection of libraries they may contain breaking changes from one release to the next. The generator itself and the code it produces are considered beta for this reason.

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, please use the Cloud Client Libraries for Go instead. These are the new and idiomatic Go libraries targeted specifically at Google Cloud Platform Services.

Authorization

By default, each API will use Google Application Default Credentials for authorization credentials used in calling the API endpoints. This will allow your application to run in many environments without requiring explicit configuration.

// import "google.golang.org/api/sheets/v4"
client, err := sheets.NewService(ctx)

To authorize using a JSON key file, pass option.WithCredentialsFile to the NewService function of the desired package. For example:

client, err := sheets.NewService(ctx, option.WithCredentialsFile("path/to/keyfile.json"))

You can exert more control over authorization by using the golang.org/x/oauth2 package to create an oauth2.TokenSource. Then pass option.WithTokenSource to the NewService function:

tokenSource := ...
svc, err := sheets.NewService(ctx, option.WithTokenSource(tokenSource))

More information

For some more information related to all of the generated clients please read through our package documentation.