diff --git a/google-api-go-generator/gen.go b/google-api-go-generator/gen.go index fa00f7a20ec..cb9ff8a1888 100644 --- a/google-api-go-generator/gen.go +++ b/google-api-go-generator/gen.go @@ -587,6 +587,71 @@ func (a *API) WriteGeneratedCode() error { return nil } +func (a *API) printPkgDocs() { + pkg := a.Package() + pn := a.pn + + pn("// Package %s provides access to the %s.", pkg, a.doc.Title) + if r := replacementPackage.Get(pkg, a.Version); r != "" { + pn("//") + pn("// This package is DEPRECATED. Use package %s instead.", r) + } + docsLink = a.doc.DocumentationLink + if docsLink != "" { + pn("//") + pn("// For product documentation, see: %s", docsLink) + } + pn("//") + pn("// # Library status") + pn("//") + pn("// These client libraries are officially supported by Google. However, this") + pn("// library is considered complete and is in maintenance mode. This means") + pn("// that we will address critical bugs and security issues but will not add") + pn("// any new features.") + pn("// ") + pn("// When possible, we recommend using our newer") + pn("// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)") + pn("// that are still actively being worked and iterated on.") + pn("//") + pn("// # Creating a client") + pn("//") + pn("// Usage example:") + pn("//") + pn("// import %q", a.Target()) + pn("// ...") + pn("// ctx := context.Background()") + pn("// %sService, err := %s.NewService(ctx)", pkg, pkg) + pn("//") + pn("// In this example, Google Application Default Credentials are used for") + pn("// authentication. For information on how to create and obtain Application") + pn("// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.") + pn("//") + pn("// # Other authentication options") + pn("//") + if len(a.doc.Auth.OAuth2Scopes) > 1 { + pn(`// By default, all available scopes (see "Constants") are used to authenticate.`) + pn(`// To restrict scopes, use [google.golang.org/api/option.WithScopes]:`) + pn("//") + // NOTE: the first scope tends to be the broadest. Use the last one to demonstrate restriction. + pn("// %sService, err := %s.NewService(ctx, option.WithScopes(%s.%s))", pkg, pkg, pkg, scopeIdentifier(a.doc.Auth.OAuth2Scopes[len(a.doc.Auth.OAuth2Scopes)-1])) + pn("//") + } + pn("// To use an API key for authentication (note: some APIs do not support API") + pn("// keys), use [google.golang.org/api/option.WithAPIKey]:") + pn("//") + pn(`// %sService, err := %s.NewService(ctx, option.WithAPIKey("AIza..."))`, pkg, pkg) + pn("//") + pn("// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth") + pn("// flow, use [google.golang.org/api/option.WithTokenSource]:") + pn("//") + pn("// config := &oauth2.Config{...}") + pn("// // ...") + pn("// token, err := config.Exchange(ctx, ...)") + pn("// %sService, err := %s.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))", pkg, pkg) + pn("//") + pn("// See [google.golang.org/api/option.ClientOption] for details on options.") +} + var docsLink string func (a *API) GenerateCode() ([]byte, error) { @@ -638,51 +703,7 @@ func (a *API) GenerateCode() ([]byte, error) { // Code generated file. DO NOT EDIT. `, *copyrightYear) - pn("// Package %s provides access to the %s.", pkg, a.doc.Title) - if r := replacementPackage.Get(pkg, a.Version); r != "" { - pn("//") - pn("// This package is DEPRECATED. Use package %s instead.", r) - } - docsLink = a.doc.DocumentationLink - if docsLink != "" { - pn("//") - pn("// For product documentation, see: %s", docsLink) - } - pn("//") - pn("// Creating a client") - pn("//") - pn("// Usage example:") - pn("//") - pn("// import %q", a.Target()) - pn("// ...") - pn("// ctx := context.Background()") - pn("// %sService, err := %s.NewService(ctx)", pkg, pkg) - pn("//") - pn("// In this example, Google Application Default Credentials are used for authentication.") - pn("//") - pn("// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.") - pn("//") - pn("// Other authentication options") - pn("//") - if len(a.doc.Auth.OAuth2Scopes) > 1 { - pn(`// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:`) - pn("//") - // NOTE: the first scope tends to be the broadest. Use the last one to demonstrate restriction. - pn("// %sService, err := %s.NewService(ctx, option.WithScopes(%s.%s))", pkg, pkg, pkg, scopeIdentifier(a.doc.Auth.OAuth2Scopes[len(a.doc.Auth.OAuth2Scopes)-1])) - pn("//") - } - pn("// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:") - pn("//") - pn(`// %sService, err := %s.NewService(ctx, option.WithAPIKey("AIza..."))`, pkg, pkg) - pn("//") - pn("// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:") - pn("//") - pn("// config := &oauth2.Config{...}") - pn("// // ...") - pn("// token, err := config.Exchange(ctx, ...)") - pn("// %sService, err := %s.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))", pkg, pkg) - pn("//") - pn("// See https://godoc.org/google.golang.org/api/option/ for details on options.") + a.printPkgDocs() pn("package %s // import %q", pkg, a.Target()) p("\n") pn("import (") diff --git a/google-api-go-generator/testdata/any.want b/google-api-go-generator/testdata/any.want index cddbd6d97d2..539bfe3bd0c 100644 --- a/google-api-go-generator/testdata/any.want +++ b/google-api-go-generator/testdata/any.want @@ -8,6 +8,17 @@ // // This package is DEPRECATED. Use package cloud.google.com/go/logging instead. // +// # Library status +// +// These client libraries are officially supported by Google. However, this +// library is considered complete and is in maintenance mode. This means +// that we will address critical bugs and security issues but will not add +// any new features. +// +// When possible, we recommend using our newer +// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) +// that are still actively being worked and iterated on. +// // # Creating a client // // Usage example: @@ -17,24 +28,26 @@ // ctx := context.Background() // loggingService, err := logging.NewService(ctx) // -// In this example, Google Application Default Credentials are used for authentication. -// -// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. +// In this example, Google Application Default Credentials are used for +// authentication. For information on how to create and obtain Application +// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. // // # Other authentication options // -// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: +// To use an API key for authentication (note: some APIs do not support API +// keys), use [google.golang.org/api/option.WithAPIKey]: // // loggingService, err := logging.NewService(ctx, option.WithAPIKey("AIza...")) // -// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth +// flow, use [google.golang.org/api/option.WithTokenSource]: // // config := &oauth2.Config{...} // // ... // token, err := config.Exchange(ctx, ...) // loggingService, err := logging.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) // -// See https://godoc.org/google.golang.org/api/option/ for details on options. +// See [google.golang.org/api/option.ClientOption] for details on options. package logging // import "google.golang.org/api/logging/v1beta3" import ( diff --git a/google-api-go-generator/testdata/arrayofarray-1.want b/google-api-go-generator/testdata/arrayofarray-1.want index 150181e1348..f652d15f066 100644 --- a/google-api-go-generator/testdata/arrayofarray-1.want +++ b/google-api-go-generator/testdata/arrayofarray-1.want @@ -6,6 +6,17 @@ // Package arrayofarray provides access to the Example API. // +// # Library status +// +// These client libraries are officially supported by Google. However, this +// library is considered complete and is in maintenance mode. This means +// that we will address critical bugs and security issues but will not add +// any new features. +// +// When possible, we recommend using our newer +// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) +// that are still actively being worked and iterated on. +// // # Creating a client // // Usage example: @@ -15,24 +26,26 @@ // ctx := context.Background() // arrayofarrayService, err := arrayofarray.NewService(ctx) // -// In this example, Google Application Default Credentials are used for authentication. -// -// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. +// In this example, Google Application Default Credentials are used for +// authentication. For information on how to create and obtain Application +// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. // // # Other authentication options // -// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: +// To use an API key for authentication (note: some APIs do not support API +// keys), use [google.golang.org/api/option.WithAPIKey]: // // arrayofarrayService, err := arrayofarray.NewService(ctx, option.WithAPIKey("AIza...")) // -// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth +// flow, use [google.golang.org/api/option.WithTokenSource]: // // config := &oauth2.Config{...} // // ... // token, err := config.Exchange(ctx, ...) // arrayofarrayService, err := arrayofarray.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) // -// See https://godoc.org/google.golang.org/api/option/ for details on options. +// See [google.golang.org/api/option.ClientOption] for details on options. package arrayofarray // import "google.golang.org/api/arrayofarray/v1" import ( diff --git a/google-api-go-generator/testdata/arrayofenum.want b/google-api-go-generator/testdata/arrayofenum.want index a0d421e7139..da15dbe0dc6 100644 --- a/google-api-go-generator/testdata/arrayofenum.want +++ b/google-api-go-generator/testdata/arrayofenum.want @@ -6,6 +6,17 @@ // Package arrayofenum provides access to the Example API. // +// # Library status +// +// These client libraries are officially supported by Google. However, this +// library is considered complete and is in maintenance mode. This means +// that we will address critical bugs and security issues but will not add +// any new features. +// +// When possible, we recommend using our newer +// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) +// that are still actively being worked and iterated on. +// // # Creating a client // // Usage example: @@ -15,24 +26,26 @@ // ctx := context.Background() // arrayofenumService, err := arrayofenum.NewService(ctx) // -// In this example, Google Application Default Credentials are used for authentication. -// -// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. +// In this example, Google Application Default Credentials are used for +// authentication. For information on how to create and obtain Application +// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. // // # Other authentication options // -// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: +// To use an API key for authentication (note: some APIs do not support API +// keys), use [google.golang.org/api/option.WithAPIKey]: // // arrayofenumService, err := arrayofenum.NewService(ctx, option.WithAPIKey("AIza...")) // -// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth +// flow, use [google.golang.org/api/option.WithTokenSource]: // // config := &oauth2.Config{...} // // ... // token, err := config.Exchange(ctx, ...) // arrayofenumService, err := arrayofenum.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) // -// See https://godoc.org/google.golang.org/api/option/ for details on options. +// See [google.golang.org/api/option.ClientOption] for details on options. package arrayofenum // import "google.golang.org/api/arrayofenum/v1" import ( diff --git a/google-api-go-generator/testdata/arrayofmapofobjects.want b/google-api-go-generator/testdata/arrayofmapofobjects.want index 62cb65c9751..cb6d657a8ad 100644 --- a/google-api-go-generator/testdata/arrayofmapofobjects.want +++ b/google-api-go-generator/testdata/arrayofmapofobjects.want @@ -6,6 +6,17 @@ // Package arrayofmapofstrings provides access to the Example API. // +// # Library status +// +// These client libraries are officially supported by Google. However, this +// library is considered complete and is in maintenance mode. This means +// that we will address critical bugs and security issues but will not add +// any new features. +// +// When possible, we recommend using our newer +// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) +// that are still actively being worked and iterated on. +// // # Creating a client // // Usage example: @@ -15,24 +26,26 @@ // ctx := context.Background() // arrayofmapofstringsService, err := arrayofmapofstrings.NewService(ctx) // -// In this example, Google Application Default Credentials are used for authentication. -// -// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. +// In this example, Google Application Default Credentials are used for +// authentication. For information on how to create and obtain Application +// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. // // # Other authentication options // -// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: +// To use an API key for authentication (note: some APIs do not support API +// keys), use [google.golang.org/api/option.WithAPIKey]: // // arrayofmapofstringsService, err := arrayofmapofstrings.NewService(ctx, option.WithAPIKey("AIza...")) // -// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth +// flow, use [google.golang.org/api/option.WithTokenSource]: // // config := &oauth2.Config{...} // // ... // token, err := config.Exchange(ctx, ...) // arrayofmapofstringsService, err := arrayofmapofstrings.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) // -// See https://godoc.org/google.golang.org/api/option/ for details on options. +// See [google.golang.org/api/option.ClientOption] for details on options. package arrayofmapofstrings // import "google.golang.org/api/arrayofmapofstrings/v1" import ( diff --git a/google-api-go-generator/testdata/arrayofmapofstrings.want b/google-api-go-generator/testdata/arrayofmapofstrings.want index cfbeaa576bb..2a7ee2229fd 100644 --- a/google-api-go-generator/testdata/arrayofmapofstrings.want +++ b/google-api-go-generator/testdata/arrayofmapofstrings.want @@ -6,6 +6,17 @@ // Package arrayofmapofstrings provides access to the Example API. // +// # Library status +// +// These client libraries are officially supported by Google. However, this +// library is considered complete and is in maintenance mode. This means +// that we will address critical bugs and security issues but will not add +// any new features. +// +// When possible, we recommend using our newer +// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) +// that are still actively being worked and iterated on. +// // # Creating a client // // Usage example: @@ -15,24 +26,26 @@ // ctx := context.Background() // arrayofmapofstringsService, err := arrayofmapofstrings.NewService(ctx) // -// In this example, Google Application Default Credentials are used for authentication. -// -// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. +// In this example, Google Application Default Credentials are used for +// authentication. For information on how to create and obtain Application +// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. // // # Other authentication options // -// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: +// To use an API key for authentication (note: some APIs do not support API +// keys), use [google.golang.org/api/option.WithAPIKey]: // // arrayofmapofstringsService, err := arrayofmapofstrings.NewService(ctx, option.WithAPIKey("AIza...")) // -// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth +// flow, use [google.golang.org/api/option.WithTokenSource]: // // config := &oauth2.Config{...} // // ... // token, err := config.Exchange(ctx, ...) // arrayofmapofstringsService, err := arrayofmapofstrings.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) // -// See https://godoc.org/google.golang.org/api/option/ for details on options. +// See [google.golang.org/api/option.ClientOption] for details on options. package arrayofmapofstrings // import "google.golang.org/api/arrayofmapofstrings/v1" import ( diff --git a/google-api-go-generator/testdata/blogger-3.want b/google-api-go-generator/testdata/blogger-3.want index 7512410b303..97b4e5fbf6b 100644 --- a/google-api-go-generator/testdata/blogger-3.want +++ b/google-api-go-generator/testdata/blogger-3.want @@ -8,6 +8,17 @@ // // For product documentation, see: https://developers.google.com/blogger/docs/3.0/getting_started // +// # Library status +// +// These client libraries are officially supported by Google. However, this +// library is considered complete and is in maintenance mode. This means +// that we will address critical bugs and security issues but will not add +// any new features. +// +// When possible, we recommend using our newer +// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) +// that are still actively being worked and iterated on. +// // # Creating a client // // Usage example: @@ -17,28 +28,31 @@ // ctx := context.Background() // bloggerService, err := blogger.NewService(ctx) // -// In this example, Google Application Default Credentials are used for authentication. -// -// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. +// In this example, Google Application Default Credentials are used for +// authentication. For information on how to create and obtain Application +// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. // // # Other authentication options // -// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes: +// By default, all available scopes (see "Constants") are used to authenticate. +// To restrict scopes, use [google.golang.org/api/option.WithScopes]: // // bloggerService, err := blogger.NewService(ctx, option.WithScopes(blogger.BloggerReadonlyScope)) // -// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: +// To use an API key for authentication (note: some APIs do not support API +// keys), use [google.golang.org/api/option.WithAPIKey]: // // bloggerService, err := blogger.NewService(ctx, option.WithAPIKey("AIza...")) // -// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth +// flow, use [google.golang.org/api/option.WithTokenSource]: // // config := &oauth2.Config{...} // // ... // token, err := config.Exchange(ctx, ...) // bloggerService, err := blogger.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) // -// See https://godoc.org/google.golang.org/api/option/ for details on options. +// See [google.golang.org/api/option.ClientOption] for details on options. package blogger // import "google.golang.org/api/blogger/v3" import ( diff --git a/google-api-go-generator/testdata/floats.want b/google-api-go-generator/testdata/floats.want index d523ba3976d..1419138e2e0 100644 --- a/google-api-go-generator/testdata/floats.want +++ b/google-api-go-generator/testdata/floats.want @@ -8,6 +8,17 @@ // // For product documentation, see: https://cloud.google.com/appengine/docs/admin-api/ // +// # Library status +// +// These client libraries are officially supported by Google. However, this +// library is considered complete and is in maintenance mode. This means +// that we will address critical bugs and security issues but will not add +// any new features. +// +// When possible, we recommend using our newer +// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) +// that are still actively being worked and iterated on. +// // # Creating a client // // Usage example: @@ -17,24 +28,26 @@ // ctx := context.Background() // xService, err := x.NewService(ctx) // -// In this example, Google Application Default Credentials are used for authentication. -// -// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. +// In this example, Google Application Default Credentials are used for +// authentication. For information on how to create and obtain Application +// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. // // # Other authentication options // -// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: +// To use an API key for authentication (note: some APIs do not support API +// keys), use [google.golang.org/api/option.WithAPIKey]: // // xService, err := x.NewService(ctx, option.WithAPIKey("AIza...")) // -// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth +// flow, use [google.golang.org/api/option.WithTokenSource]: // // config := &oauth2.Config{...} // // ... // token, err := config.Exchange(ctx, ...) // xService, err := x.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) // -// See https://godoc.org/google.golang.org/api/option/ for details on options. +// See [google.golang.org/api/option.ClientOption] for details on options. package x // import "google.golang.org/api/x/v1" import ( diff --git a/google-api-go-generator/testdata/getwithoutbody.want b/google-api-go-generator/testdata/getwithoutbody.want index 87b7a4a083c..a0989068d9c 100644 --- a/google-api-go-generator/testdata/getwithoutbody.want +++ b/google-api-go-generator/testdata/getwithoutbody.want @@ -6,6 +6,17 @@ // Package getwithoutbody provides access to the Example API. // +// # Library status +// +// These client libraries are officially supported by Google. However, this +// library is considered complete and is in maintenance mode. This means +// that we will address critical bugs and security issues but will not add +// any new features. +// +// When possible, we recommend using our newer +// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) +// that are still actively being worked and iterated on. +// // # Creating a client // // Usage example: @@ -15,24 +26,26 @@ // ctx := context.Background() // getwithoutbodyService, err := getwithoutbody.NewService(ctx) // -// In this example, Google Application Default Credentials are used for authentication. -// -// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. +// In this example, Google Application Default Credentials are used for +// authentication. For information on how to create and obtain Application +// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. // // # Other authentication options // -// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: +// To use an API key for authentication (note: some APIs do not support API +// keys), use [google.golang.org/api/option.WithAPIKey]: // // getwithoutbodyService, err := getwithoutbody.NewService(ctx, option.WithAPIKey("AIza...")) // -// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth +// flow, use [google.golang.org/api/option.WithTokenSource]: // // config := &oauth2.Config{...} // // ... // token, err := config.Exchange(ctx, ...) // getwithoutbodyService, err := getwithoutbody.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) // -// See https://godoc.org/google.golang.org/api/option/ for details on options. +// See [google.golang.org/api/option.ClientOption] for details on options. package getwithoutbody // import "google.golang.org/api/getwithoutbody/v1" import ( diff --git a/google-api-go-generator/testdata/http-body.want b/google-api-go-generator/testdata/http-body.want index e08de778d1c..9cc8acdb6d9 100644 --- a/google-api-go-generator/testdata/http-body.want +++ b/google-api-go-generator/testdata/http-body.want @@ -8,6 +8,17 @@ // // For product documentation, see: https://cloud.google.com/healthcare // +// # Library status +// +// These client libraries are officially supported by Google. However, this +// library is considered complete and is in maintenance mode. This means +// that we will address critical bugs and security issues but will not add +// any new features. +// +// When possible, we recommend using our newer +// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) +// that are still actively being worked and iterated on. +// // # Creating a client // // Usage example: @@ -17,24 +28,26 @@ // ctx := context.Background() // healthcareService, err := healthcare.NewService(ctx) // -// In this example, Google Application Default Credentials are used for authentication. -// -// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. +// In this example, Google Application Default Credentials are used for +// authentication. For information on how to create and obtain Application +// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. // // # Other authentication options // -// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: +// To use an API key for authentication (note: some APIs do not support API +// keys), use [google.golang.org/api/option.WithAPIKey]: // // healthcareService, err := healthcare.NewService(ctx, option.WithAPIKey("AIza...")) // -// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth +// flow, use [google.golang.org/api/option.WithTokenSource]: // // config := &oauth2.Config{...} // // ... // token, err := config.Exchange(ctx, ...) // healthcareService, err := healthcare.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) // -// See https://godoc.org/google.golang.org/api/option/ for details on options. +// See [google.golang.org/api/option.ClientOption] for details on options. package healthcare // import "google.golang.org/api/healthcare/v1beta1" import ( diff --git a/google-api-go-generator/testdata/json-body.want b/google-api-go-generator/testdata/json-body.want index 0f03745281d..6a32a45d1bb 100644 --- a/google-api-go-generator/testdata/json-body.want +++ b/google-api-go-generator/testdata/json-body.want @@ -8,6 +8,17 @@ // // For product documentation, see: https://cloud.google.com/ml/ // +// # Library status +// +// These client libraries are officially supported by Google. However, this +// library is considered complete and is in maintenance mode. This means +// that we will address critical bugs and security issues but will not add +// any new features. +// +// When possible, we recommend using our newer +// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) +// that are still actively being worked and iterated on. +// // # Creating a client // // Usage example: @@ -17,24 +28,26 @@ // ctx := context.Background() // mlService, err := ml.NewService(ctx) // -// In this example, Google Application Default Credentials are used for authentication. -// -// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. +// In this example, Google Application Default Credentials are used for +// authentication. For information on how to create and obtain Application +// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. // // # Other authentication options // -// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: +// To use an API key for authentication (note: some APIs do not support API +// keys), use [google.golang.org/api/option.WithAPIKey]: // // mlService, err := ml.NewService(ctx, option.WithAPIKey("AIza...")) // -// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth +// flow, use [google.golang.org/api/option.WithTokenSource]: // // config := &oauth2.Config{...} // // ... // token, err := config.Exchange(ctx, ...) // mlService, err := ml.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) // -// See https://godoc.org/google.golang.org/api/option/ for details on options. +// See [google.golang.org/api/option.ClientOption] for details on options. package ml // import "google.golang.org/api/ml/v1" import ( diff --git a/google-api-go-generator/testdata/mapofany.want b/google-api-go-generator/testdata/mapofany.want index 4f1ef850e49..bbe228a9398 100644 --- a/google-api-go-generator/testdata/mapofany.want +++ b/google-api-go-generator/testdata/mapofany.want @@ -6,6 +6,17 @@ // Package mapofany provides access to the Example API. // +// # Library status +// +// These client libraries are officially supported by Google. However, this +// library is considered complete and is in maintenance mode. This means +// that we will address critical bugs and security issues but will not add +// any new features. +// +// When possible, we recommend using our newer +// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) +// that are still actively being worked and iterated on. +// // # Creating a client // // Usage example: @@ -15,24 +26,26 @@ // ctx := context.Background() // mapofanyService, err := mapofany.NewService(ctx) // -// In this example, Google Application Default Credentials are used for authentication. -// -// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. +// In this example, Google Application Default Credentials are used for +// authentication. For information on how to create and obtain Application +// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. // // # Other authentication options // -// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: +// To use an API key for authentication (note: some APIs do not support API +// keys), use [google.golang.org/api/option.WithAPIKey]: // // mapofanyService, err := mapofany.NewService(ctx, option.WithAPIKey("AIza...")) // -// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth +// flow, use [google.golang.org/api/option.WithTokenSource]: // // config := &oauth2.Config{...} // // ... // token, err := config.Exchange(ctx, ...) // mapofanyService, err := mapofany.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) // -// See https://godoc.org/google.golang.org/api/option/ for details on options. +// See [google.golang.org/api/option.ClientOption] for details on options. package mapofany // import "google.golang.org/api/mapofany/v1" import ( diff --git a/google-api-go-generator/testdata/mapofarrayofobjects.want b/google-api-go-generator/testdata/mapofarrayofobjects.want index dc02214d6d8..53a7cb541d7 100644 --- a/google-api-go-generator/testdata/mapofarrayofobjects.want +++ b/google-api-go-generator/testdata/mapofarrayofobjects.want @@ -6,6 +6,17 @@ // Package additionalprops provides access to the Example API. // +// # Library status +// +// These client libraries are officially supported by Google. However, this +// library is considered complete and is in maintenance mode. This means +// that we will address critical bugs and security issues but will not add +// any new features. +// +// When possible, we recommend using our newer +// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) +// that are still actively being worked and iterated on. +// // # Creating a client // // Usage example: @@ -15,24 +26,26 @@ // ctx := context.Background() // additionalpropsService, err := additionalprops.NewService(ctx) // -// In this example, Google Application Default Credentials are used for authentication. -// -// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. +// In this example, Google Application Default Credentials are used for +// authentication. For information on how to create and obtain Application +// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. // // # Other authentication options // -// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: +// To use an API key for authentication (note: some APIs do not support API +// keys), use [google.golang.org/api/option.WithAPIKey]: // // additionalpropsService, err := additionalprops.NewService(ctx, option.WithAPIKey("AIza...")) // -// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth +// flow, use [google.golang.org/api/option.WithTokenSource]: // // config := &oauth2.Config{...} // // ... // token, err := config.Exchange(ctx, ...) // additionalpropsService, err := additionalprops.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) // -// See https://godoc.org/google.golang.org/api/option/ for details on options. +// See [google.golang.org/api/option.ClientOption] for details on options. package additionalprops // import "google.golang.org/api/additionalprops/v1" import ( diff --git a/google-api-go-generator/testdata/mapofint64strings.want b/google-api-go-generator/testdata/mapofint64strings.want index fcfbb559dbc..3c307bee005 100644 --- a/google-api-go-generator/testdata/mapofint64strings.want +++ b/google-api-go-generator/testdata/mapofint64strings.want @@ -6,6 +6,17 @@ // Package androidbuildinternal provides access to the . // +// # Library status +// +// These client libraries are officially supported by Google. However, this +// library is considered complete and is in maintenance mode. This means +// that we will address critical bugs and security issues but will not add +// any new features. +// +// When possible, we recommend using our newer +// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) +// that are still actively being worked and iterated on. +// // # Creating a client // // Usage example: @@ -15,24 +26,26 @@ // ctx := context.Background() // androidbuildinternalService, err := androidbuildinternal.NewService(ctx) // -// In this example, Google Application Default Credentials are used for authentication. -// -// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. +// In this example, Google Application Default Credentials are used for +// authentication. For information on how to create and obtain Application +// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. // // # Other authentication options // -// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: +// To use an API key for authentication (note: some APIs do not support API +// keys), use [google.golang.org/api/option.WithAPIKey]: // // androidbuildinternalService, err := androidbuildinternal.NewService(ctx, option.WithAPIKey("AIza...")) // -// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth +// flow, use [google.golang.org/api/option.WithTokenSource]: // // config := &oauth2.Config{...} // // ... // token, err := config.Exchange(ctx, ...) // androidbuildinternalService, err := androidbuildinternal.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) // -// See https://godoc.org/google.golang.org/api/option/ for details on options. +// See [google.golang.org/api/option.ClientOption] for details on options. package androidbuildinternal // import "google.golang.org/api/androidbuildinternal/v1" import ( diff --git a/google-api-go-generator/testdata/mapofobjects.want b/google-api-go-generator/testdata/mapofobjects.want index aa500eeff61..fcbc5d721e4 100644 --- a/google-api-go-generator/testdata/mapofobjects.want +++ b/google-api-go-generator/testdata/mapofobjects.want @@ -6,6 +6,17 @@ // Package additionalpropsobjs provides access to the Example API. // +// # Library status +// +// These client libraries are officially supported by Google. However, this +// library is considered complete and is in maintenance mode. This means +// that we will address critical bugs and security issues but will not add +// any new features. +// +// When possible, we recommend using our newer +// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) +// that are still actively being worked and iterated on. +// // # Creating a client // // Usage example: @@ -15,24 +26,26 @@ // ctx := context.Background() // additionalpropsobjsService, err := additionalpropsobjs.NewService(ctx) // -// In this example, Google Application Default Credentials are used for authentication. -// -// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. +// In this example, Google Application Default Credentials are used for +// authentication. For information on how to create and obtain Application +// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. // // # Other authentication options // -// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: +// To use an API key for authentication (note: some APIs do not support API +// keys), use [google.golang.org/api/option.WithAPIKey]: // // additionalpropsobjsService, err := additionalpropsobjs.NewService(ctx, option.WithAPIKey("AIza...")) // -// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth +// flow, use [google.golang.org/api/option.WithTokenSource]: // // config := &oauth2.Config{...} // // ... // token, err := config.Exchange(ctx, ...) // additionalpropsobjsService, err := additionalpropsobjs.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) // -// See https://godoc.org/google.golang.org/api/option/ for details on options. +// See [google.golang.org/api/option.ClientOption] for details on options. package additionalpropsobjs // import "google.golang.org/api/additionalpropsobjs/v1" import ( diff --git a/google-api-go-generator/testdata/mapofstrings-1.want b/google-api-go-generator/testdata/mapofstrings-1.want index 1ffcd905927..e61e2c86e63 100644 --- a/google-api-go-generator/testdata/mapofstrings-1.want +++ b/google-api-go-generator/testdata/mapofstrings-1.want @@ -6,6 +6,17 @@ // Package additionalprops provides access to the Example API. // +// # Library status +// +// These client libraries are officially supported by Google. However, this +// library is considered complete and is in maintenance mode. This means +// that we will address critical bugs and security issues but will not add +// any new features. +// +// When possible, we recommend using our newer +// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) +// that are still actively being worked and iterated on. +// // # Creating a client // // Usage example: @@ -15,24 +26,26 @@ // ctx := context.Background() // additionalpropsService, err := additionalprops.NewService(ctx) // -// In this example, Google Application Default Credentials are used for authentication. -// -// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. +// In this example, Google Application Default Credentials are used for +// authentication. For information on how to create and obtain Application +// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. // // # Other authentication options // -// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: +// To use an API key for authentication (note: some APIs do not support API +// keys), use [google.golang.org/api/option.WithAPIKey]: // // additionalpropsService, err := additionalprops.NewService(ctx, option.WithAPIKey("AIza...")) // -// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth +// flow, use [google.golang.org/api/option.WithTokenSource]: // // config := &oauth2.Config{...} // // ... // token, err := config.Exchange(ctx, ...) // additionalpropsService, err := additionalprops.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) // -// See https://godoc.org/google.golang.org/api/option/ for details on options. +// See [google.golang.org/api/option.ClientOption] for details on options. package additionalprops // import "google.golang.org/api/additionalprops/v1" import ( diff --git a/google-api-go-generator/testdata/param-rename.want b/google-api-go-generator/testdata/param-rename.want index c536bd18301..c84dbdfd87d 100644 --- a/google-api-go-generator/testdata/param-rename.want +++ b/google-api-go-generator/testdata/param-rename.want @@ -6,6 +6,17 @@ // Package paramrename provides access to the Example API. // +// # Library status +// +// These client libraries are officially supported by Google. However, this +// library is considered complete and is in maintenance mode. This means +// that we will address critical bugs and security issues but will not add +// any new features. +// +// When possible, we recommend using our newer +// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) +// that are still actively being worked and iterated on. +// // # Creating a client // // Usage example: @@ -15,24 +26,26 @@ // ctx := context.Background() // paramrenameService, err := paramrename.NewService(ctx) // -// In this example, Google Application Default Credentials are used for authentication. -// -// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. +// In this example, Google Application Default Credentials are used for +// authentication. For information on how to create and obtain Application +// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. // // # Other authentication options // -// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: +// To use an API key for authentication (note: some APIs do not support API +// keys), use [google.golang.org/api/option.WithAPIKey]: // // paramrenameService, err := paramrename.NewService(ctx, option.WithAPIKey("AIza...")) // -// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth +// flow, use [google.golang.org/api/option.WithTokenSource]: // // config := &oauth2.Config{...} // // ... // token, err := config.Exchange(ctx, ...) // paramrenameService, err := paramrename.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) // -// See https://godoc.org/google.golang.org/api/option/ for details on options. +// See [google.golang.org/api/option.ClientOption] for details on options. package paramrename // import "google.golang.org/api/paramrename/v1" import ( diff --git a/google-api-go-generator/testdata/quotednum.want b/google-api-go-generator/testdata/quotednum.want index bd4af8ba298..b5023c22002 100644 --- a/google-api-go-generator/testdata/quotednum.want +++ b/google-api-go-generator/testdata/quotednum.want @@ -8,6 +8,17 @@ // // For product documentation, see: https://developers.google.com/ad-exchange/buyer-rest // +// # Library status +// +// These client libraries are officially supported by Google. However, this +// library is considered complete and is in maintenance mode. This means +// that we will address critical bugs and security issues but will not add +// any new features. +// +// When possible, we recommend using our newer +// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) +// that are still actively being worked and iterated on. +// // # Creating a client // // Usage example: @@ -17,24 +28,26 @@ // ctx := context.Background() // adexchangebuyerService, err := adexchangebuyer.NewService(ctx) // -// In this example, Google Application Default Credentials are used for authentication. -// -// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. +// In this example, Google Application Default Credentials are used for +// authentication. For information on how to create and obtain Application +// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. // // # Other authentication options // -// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: +// To use an API key for authentication (note: some APIs do not support API +// keys), use [google.golang.org/api/option.WithAPIKey]: // // adexchangebuyerService, err := adexchangebuyer.NewService(ctx, option.WithAPIKey("AIza...")) // -// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth +// flow, use [google.golang.org/api/option.WithTokenSource]: // // config := &oauth2.Config{...} // // ... // token, err := config.Exchange(ctx, ...) // adexchangebuyerService, err := adexchangebuyer.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) // -// See https://godoc.org/google.golang.org/api/option/ for details on options. +// See [google.golang.org/api/option.ClientOption] for details on options. package adexchangebuyer // import "google.golang.org/api/adexchangebuyer/v1.1" import ( diff --git a/google-api-go-generator/testdata/repeated.want b/google-api-go-generator/testdata/repeated.want index 34647c3c678..4a3390aea7c 100644 --- a/google-api-go-generator/testdata/repeated.want +++ b/google-api-go-generator/testdata/repeated.want @@ -6,6 +6,17 @@ // Package repeated provides access to the Example API. // +// # Library status +// +// These client libraries are officially supported by Google. However, this +// library is considered complete and is in maintenance mode. This means +// that we will address critical bugs and security issues but will not add +// any new features. +// +// When possible, we recommend using our newer +// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) +// that are still actively being worked and iterated on. +// // # Creating a client // // Usage example: @@ -15,24 +26,26 @@ // ctx := context.Background() // repeatedService, err := repeated.NewService(ctx) // -// In this example, Google Application Default Credentials are used for authentication. -// -// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. +// In this example, Google Application Default Credentials are used for +// authentication. For information on how to create and obtain Application +// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. // // # Other authentication options // -// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: +// To use an API key for authentication (note: some APIs do not support API +// keys), use [google.golang.org/api/option.WithAPIKey]: // // repeatedService, err := repeated.NewService(ctx, option.WithAPIKey("AIza...")) // -// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth +// flow, use [google.golang.org/api/option.WithTokenSource]: // // config := &oauth2.Config{...} // // ... // token, err := config.Exchange(ctx, ...) // repeatedService, err := repeated.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) // -// See https://godoc.org/google.golang.org/api/option/ for details on options. +// See [google.golang.org/api/option.ClientOption] for details on options. package repeated // import "google.golang.org/api/repeated/v1" import ( diff --git a/google-api-go-generator/testdata/required-query.want b/google-api-go-generator/testdata/required-query.want index 3482d1cb2bd..4911cc30971 100644 --- a/google-api-go-generator/testdata/required-query.want +++ b/google-api-go-generator/testdata/required-query.want @@ -6,6 +6,17 @@ // Package tshealth provides access to the . // +// # Library status +// +// These client libraries are officially supported by Google. However, this +// library is considered complete and is in maintenance mode. This means +// that we will address critical bugs and security issues but will not add +// any new features. +// +// When possible, we recommend using our newer +// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) +// that are still actively being worked and iterated on. +// // # Creating a client // // Usage example: @@ -15,24 +26,26 @@ // ctx := context.Background() // tshealthService, err := tshealth.NewService(ctx) // -// In this example, Google Application Default Credentials are used for authentication. -// -// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. +// In this example, Google Application Default Credentials are used for +// authentication. For information on how to create and obtain Application +// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. // // # Other authentication options // -// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: +// To use an API key for authentication (note: some APIs do not support API +// keys), use [google.golang.org/api/option.WithAPIKey]: // // tshealthService, err := tshealth.NewService(ctx, option.WithAPIKey("AIza...")) // -// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth +// flow, use [google.golang.org/api/option.WithTokenSource]: // // config := &oauth2.Config{...} // // ... // token, err := config.Exchange(ctx, ...) // tshealthService, err := tshealth.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) // -// See https://godoc.org/google.golang.org/api/option/ for details on options. +// See [google.golang.org/api/option.ClientOption] for details on options. package tshealth // import "google.golang.org/api/tshealth/" import ( diff --git a/google-api-go-generator/testdata/resource-named-service.want b/google-api-go-generator/testdata/resource-named-service.want index 15ebad40bb9..1ee19742ac1 100644 --- a/google-api-go-generator/testdata/resource-named-service.want +++ b/google-api-go-generator/testdata/resource-named-service.want @@ -8,6 +8,17 @@ // // For product documentation, see: https://cloud.google.com/appengine/docs/admin-api/ // +// # Library status +// +// These client libraries are officially supported by Google. However, this +// library is considered complete and is in maintenance mode. This means +// that we will address critical bugs and security issues but will not add +// any new features. +// +// When possible, we recommend using our newer +// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) +// that are still actively being worked and iterated on. +// // # Creating a client // // Usage example: @@ -17,24 +28,26 @@ // ctx := context.Background() // appengineService, err := appengine.NewService(ctx) // -// In this example, Google Application Default Credentials are used for authentication. -// -// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. +// In this example, Google Application Default Credentials are used for +// authentication. For information on how to create and obtain Application +// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. // // # Other authentication options // -// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: +// To use an API key for authentication (note: some APIs do not support API +// keys), use [google.golang.org/api/option.WithAPIKey]: // // appengineService, err := appengine.NewService(ctx, option.WithAPIKey("AIza...")) // -// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth +// flow, use [google.golang.org/api/option.WithTokenSource]: // // config := &oauth2.Config{...} // // ... // token, err := config.Exchange(ctx, ...) // appengineService, err := appengine.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) // -// See https://godoc.org/google.golang.org/api/option/ for details on options. +// See [google.golang.org/api/option.ClientOption] for details on options. package appengine // import "google.golang.org/api/appengine/v1" import ( diff --git a/google-api-go-generator/testdata/unfortunatedefaults.want b/google-api-go-generator/testdata/unfortunatedefaults.want index 9aa3cbd5822..907d5e9a754 100644 --- a/google-api-go-generator/testdata/unfortunatedefaults.want +++ b/google-api-go-generator/testdata/unfortunatedefaults.want @@ -6,6 +6,17 @@ // Package wrapnewlines provides access to the Example API. // +// # Library status +// +// These client libraries are officially supported by Google. However, this +// library is considered complete and is in maintenance mode. This means +// that we will address critical bugs and security issues but will not add +// any new features. +// +// When possible, we recommend using our newer +// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) +// that are still actively being worked and iterated on. +// // # Creating a client // // Usage example: @@ -15,24 +26,26 @@ // ctx := context.Background() // wrapnewlinesService, err := wrapnewlines.NewService(ctx) // -// In this example, Google Application Default Credentials are used for authentication. -// -// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. +// In this example, Google Application Default Credentials are used for +// authentication. For information on how to create and obtain Application +// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. // // # Other authentication options // -// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: +// To use an API key for authentication (note: some APIs do not support API +// keys), use [google.golang.org/api/option.WithAPIKey]: // // wrapnewlinesService, err := wrapnewlines.NewService(ctx, option.WithAPIKey("AIza...")) // -// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth +// flow, use [google.golang.org/api/option.WithTokenSource]: // // config := &oauth2.Config{...} // // ... // token, err := config.Exchange(ctx, ...) // wrapnewlinesService, err := wrapnewlines.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) // -// See https://godoc.org/google.golang.org/api/option/ for details on options. +// See [google.golang.org/api/option.ClientOption] for details on options. package wrapnewlines // import "google.golang.org/api/wrapnewlines/v1" import ( diff --git a/google-api-go-generator/testdata/variants.want b/google-api-go-generator/testdata/variants.want index 4d4e0a1e630..16ba4ce1af1 100644 --- a/google-api-go-generator/testdata/variants.want +++ b/google-api-go-generator/testdata/variants.want @@ -6,6 +6,17 @@ // Package additionalpropsobjs provides access to the Example API. // +// # Library status +// +// These client libraries are officially supported by Google. However, this +// library is considered complete and is in maintenance mode. This means +// that we will address critical bugs and security issues but will not add +// any new features. +// +// When possible, we recommend using our newer +// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) +// that are still actively being worked and iterated on. +// // # Creating a client // // Usage example: @@ -15,24 +26,26 @@ // ctx := context.Background() // additionalpropsobjsService, err := additionalpropsobjs.NewService(ctx) // -// In this example, Google Application Default Credentials are used for authentication. -// -// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. +// In this example, Google Application Default Credentials are used for +// authentication. For information on how to create and obtain Application +// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. // // # Other authentication options // -// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: +// To use an API key for authentication (note: some APIs do not support API +// keys), use [google.golang.org/api/option.WithAPIKey]: // // additionalpropsobjsService, err := additionalpropsobjs.NewService(ctx, option.WithAPIKey("AIza...")) // -// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth +// flow, use [google.golang.org/api/option.WithTokenSource]: // // config := &oauth2.Config{...} // // ... // token, err := config.Exchange(ctx, ...) // additionalpropsobjsService, err := additionalpropsobjs.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) // -// See https://godoc.org/google.golang.org/api/option/ for details on options. +// See [google.golang.org/api/option.ClientOption] for details on options. package additionalpropsobjs // import "google.golang.org/api/additionalpropsobjs/v1" import ( diff --git a/google-api-go-generator/testdata/wrapnewlines.want b/google-api-go-generator/testdata/wrapnewlines.want index 70285bf8657..41c50898954 100644 --- a/google-api-go-generator/testdata/wrapnewlines.want +++ b/google-api-go-generator/testdata/wrapnewlines.want @@ -6,6 +6,17 @@ // Package wrapnewlines provides access to the Example API. // +// # Library status +// +// These client libraries are officially supported by Google. However, this +// library is considered complete and is in maintenance mode. This means +// that we will address critical bugs and security issues but will not add +// any new features. +// +// When possible, we recommend using our newer +// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) +// that are still actively being worked and iterated on. +// // # Creating a client // // Usage example: @@ -15,24 +26,26 @@ // ctx := context.Background() // wrapnewlinesService, err := wrapnewlines.NewService(ctx) // -// In this example, Google Application Default Credentials are used for authentication. -// -// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. +// In this example, Google Application Default Credentials are used for +// authentication. For information on how to create and obtain Application +// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. // // # Other authentication options // -// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: +// To use an API key for authentication (note: some APIs do not support API +// keys), use [google.golang.org/api/option.WithAPIKey]: // // wrapnewlinesService, err := wrapnewlines.NewService(ctx, option.WithAPIKey("AIza...")) // -// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: +// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth +// flow, use [google.golang.org/api/option.WithTokenSource]: // // config := &oauth2.Config{...} // // ... // token, err := config.Exchange(ctx, ...) // wrapnewlinesService, err := wrapnewlines.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) // -// See https://godoc.org/google.golang.org/api/option/ for details on options. +// See [google.golang.org/api/option.ClientOption] for details on options. package wrapnewlines // import "google.golang.org/api/wrapnewlines/v1" import (