diff --git a/internal/gengapic/doc_file_test.go b/internal/gengapic/doc_file_test.go index f428f5c4816..18502d62c9d 100644 --- a/internal/gengapic/doc_file_test.go +++ b/internal/gengapic/doc_file_test.go @@ -19,55 +19,37 @@ import ( "testing" "github.com/googleapis/gapic-generator-go/internal/pbinfo" + "github.com/googleapis/gapic-generator-go/internal/testing/sample" "github.com/googleapis/gapic-generator-go/internal/txtdiff" - "google.golang.org/genproto/googleapis/api/serviceconfig" - "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/descriptorpb" ) func TestDocFile(t *testing.T) { - var g generator - g.apiName = "Awesome Foo API" - g.serviceConfig = &serviceconfig.Service{ - Documentation: &serviceconfig.Documentation{ - Summary: "The Awesome Foo API is really really awesome. It enables the use of [Foo](https://api.foo.com) with [Buz](https://api.buz.com) and [Baz](https://api.baz.com) to acclerate `bar`.", + g := generator{ + apiName: sample.ServiceTitle, + serviceConfig: sample.ServiceConfig(), + imports: map[pbinfo.ImportSpec]bool{}, + opts: &options{ + pkgPath: sample.GoPackagePath, + pkgName: sample.GoPackageName, + transports: []transport{grpc, rest}, }, } - g.opts = &options{pkgPath: "path/to/awesome", pkgName: "awesome", transports: []transport{grpc, rest}} - g.imports = map[pbinfo.ImportSpec]bool{} - inputType := &descriptorpb.DescriptorProto{ - Name: proto.String("InputType"), - } - outputType := &descriptorpb.DescriptorProto{ - Name: proto.String("OutputType"), - } - - file := &descriptorpb.FileDescriptorProto{ - Options: &descriptorpb.FileOptions{ - GoPackage: proto.String("mypackage"), - }, - } + inputType := sample.InputType(sample.CreateRequest) + outputType := sample.OutputType(sample.Resource) + file := sample.File() commonTypes(&g) for _, typ := range []*descriptorpb.DescriptorProto{ inputType, outputType, } { - g.descInfo.Type[".my.pkg."+typ.GetName()] = typ + typName := sample.DescriptorInfoTypeName(typ.GetName()) + g.descInfo.Type[typName] = typ g.descInfo.ParentFile[typ] = file } - serv := &descriptorpb.ServiceDescriptorProto{ - Name: proto.String("Foo"), - Method: []*descriptorpb.MethodDescriptorProto{ - { - Name: proto.String("GetOneThing"), - InputType: proto.String(".my.pkg.InputType"), - OutputType: proto.String(".my.pkg.OutputType"), - }, - }, - } - + serv := sample.Service() for _, tst := range []struct { relLvl, want string }{ @@ -85,7 +67,7 @@ func TestDocFile(t *testing.T) { } { t.Run(tst.want, func(t *testing.T) { g.opts.relLvl = tst.relLvl - g.genDocFile(42, []string{"https://foo.bar.com/auth", "https://zip.zap.com/auth"}, serv) + g.genDocFile(sample.Year, []string{sample.ServiceOAuthScope}, serv) txtdiff.Diff(t, g.pt.String(), tst.want) g.reset() }) @@ -93,41 +75,31 @@ func TestDocFile(t *testing.T) { } func TestDocFileEmptyService(t *testing.T) { - var g generator - g.apiName = "Awesome Bar API" - g.serviceConfig = &serviceconfig.Service{ - Documentation: &serviceconfig.Documentation{ - Summary: "The Awesome Bar API is really really awesome. It enables the use of [Foo](https://api.foo.com) with [Buz](https://api.buz.com) and [Baz](https://api.baz.com) to acclerate `bar`.", - }, - } - g.opts = &options{pkgPath: "path/to/awesome", pkgName: "awesome", transports: []transport{grpc}} - g.imports = map[pbinfo.ImportSpec]bool{} - - inputType := &descriptorpb.DescriptorProto{ - Name: proto.String("InputType"), - } - outputType := &descriptorpb.DescriptorProto{ - Name: proto.String("OutputType"), - } - - file := &descriptorpb.FileDescriptorProto{ - Options: &descriptorpb.FileOptions{ - GoPackage: proto.String("mypackage"), + g := generator{ + apiName: sample.ServiceTitle, + imports: map[pbinfo.ImportSpec]bool{}, + serviceConfig: sample.ServiceConfig(), + opts: &options{ + pkgPath: sample.GoPackagePath, + pkgName: sample.GoPackageName, + transports: []transport{grpc, rest}, }, } + inputType := sample.InputType(sample.CreateRequest) + outputType := sample.OutputType(sample.Resource) + file := sample.File() commonTypes(&g) for _, typ := range []*descriptorpb.DescriptorProto{ inputType, outputType, } { - g.descInfo.Type[".my.pkg."+typ.GetName()] = typ + typName := sample.DescriptorInfoTypeName(typ.GetName()) + g.descInfo.Type[typName] = typ g.descInfo.ParentFile[typ] = file } - serv := &descriptorpb.ServiceDescriptorProto{ - Name: proto.String("Foo"), - } - + serv := sample.Service() + serv.Method = nil for _, tst := range []struct { relLvl, want string }{ @@ -149,7 +121,7 @@ func TestDocFileEmptyService(t *testing.T) { } { t.Run(tst.want, func(t *testing.T) { g.opts.relLvl = tst.relLvl - g.genDocFile(43, []string{"https://foo.bar.com/auth", "https://zip.zap.com/auth"}, serv) + g.genDocFile(sample.Year, []string{sample.ServiceOAuthScope}, serv) txtdiff.Diff(t, g.pt.String(), tst.want) g.reset() }) diff --git a/internal/gengapic/example_test.go b/internal/gengapic/example_test.go index d24f3cf04f5..cda50d9c628 100644 --- a/internal/gengapic/example_test.go +++ b/internal/gengapic/example_test.go @@ -50,12 +50,8 @@ func TestExample(t *testing.T) { }, } - inputType := &descriptorpb.DescriptorProto{ - Name: proto.String("InputType"), - } - outputType := &descriptorpb.DescriptorProto{ - Name: proto.String("OutputType"), - } + inputType := sample.InputType("InputType") + outputType := sample.OutputType("OutputType") pageInputType := &descriptorpb.DescriptorProto{ Name: proto.String("PageInputType"), diff --git a/internal/gengapic/testdata/doc_file.want b/internal/gengapic/testdata/doc_file.want index cbae1e4030f..493f0e0880e 100644 --- a/internal/gengapic/testdata/doc_file.want +++ b/internal/gengapic/testdata/doc_file.want @@ -1,4 +1,4 @@ -// Copyright 42 Google LLC +// Copyright 2024 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -14,12 +14,11 @@ // Code generated by protoc-gen-go_gapic. DO NOT EDIT. -// Package awesome is an auto-generated package for the -// Awesome Foo API. +// Package migration is an auto-generated package for the +// BigQuery Migration API. // -// The Awesome Foo API is really really awesome. It enables the use of Foo -// (at https://api.foo.com) with Buz (at https://api.buz.com) and Baz (at -// https://api.baz.com) to acclerate bar. +// The migration service, exposing apis for migration jobs operations, and +// agent management. // // General documentation // @@ -42,7 +41,7 @@ // // - It may require correct/in-range values for request initialization. // // - It may require specifying regional endpoints when creating the service client as shown in: // // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options -// c, err := awesome.NewFooClient(ctx) +// c, err := migration.NewClient(ctx) // if err != nil { // // TODO: Handle error. // } @@ -62,17 +61,17 @@ // // - It may require correct/in-range values for request initialization. // // - It may require specifying regional endpoints when creating the service client as shown in: // // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options -// c, err := awesome.NewFooClient(ctx) +// c, err := migration.NewClient(ctx) // if err != nil { // // TODO: Handle error. // } // defer c.Close() // -// req := &mypackagepb.InputType{ +// req := &migrationpb.CreateMigrationWorkflowRequest{ // // TODO: Fill request struct fields. -// // See https://pkg.go.dev/mypackage#InputType. +// // See https://pkg.go.dev/cloud.google.com/go/bigquery/migration/apiv2/migrationpb#CreateMigrationWorkflowRequest. // } -// resp, err := c.GetOneThing(ctx, req) +// resp, err := c.CreateMigrationWorkflow(ctx, req) // if err != nil { // // TODO: Handle error. // } @@ -81,7 +80,7 @@ // // Use of Context // -// The ctx passed to NewFooClient is used for authentication requests and +// The ctx passed to NewClient is used for authentication requests and // for creating the underlying connection, but is not used for subsequent calls. // Individual methods on the client use the ctx given to them. // @@ -92,7 +91,7 @@ // [Testing against Client Libraries]: https://pkg.go.dev/cloud.google.com/go#hdr-Testing // [Debugging Client Libraries]: https://pkg.go.dev/cloud.google.com/go#hdr-Debugging // [Inspecting errors]: https://pkg.go.dev/cloud.google.com/go#hdr-Inspecting_errors -package awesome // import "path/to/awesome" +package migration // import "cloud.google.com/go/bigquery/migration/apiv2" import ( "context" @@ -117,7 +116,6 @@ func getVersionClient() string { // DefaultAuthScopes reports the default set of authentication scopes to use with this package. func DefaultAuthScopes() []string { return []string{ - "https://foo.bar.com/auth", - "https://zip.zap.com/auth", + "https://www.googleapis.com/auth/cloud-platform", } } diff --git a/internal/gengapic/testdata/doc_file_alpha.want b/internal/gengapic/testdata/doc_file_alpha.want index cb422e58e44..9a5d2c8ae41 100644 --- a/internal/gengapic/testdata/doc_file_alpha.want +++ b/internal/gengapic/testdata/doc_file_alpha.want @@ -1,4 +1,4 @@ -// Copyright 42 Google LLC +// Copyright 2024 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -14,12 +14,11 @@ // Code generated by protoc-gen-go_gapic. DO NOT EDIT. -// Package awesome is an auto-generated package for the -// Awesome Foo API. +// Package migration is an auto-generated package for the +// BigQuery Migration API. // -// The Awesome Foo API is really really awesome. It enables the use of Foo -// (at https://api.foo.com) with Buz (at https://api.buz.com) and Baz (at -// https://api.baz.com) to acclerate bar. +// The migration service, exposing apis for migration jobs operations, and +// agent management. // // NOTE: This package is in alpha. It is not stable, and is likely to change. // @@ -44,7 +43,7 @@ // // - It may require correct/in-range values for request initialization. // // - It may require specifying regional endpoints when creating the service client as shown in: // // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options -// c, err := awesome.NewFooClient(ctx) +// c, err := migration.NewClient(ctx) // if err != nil { // // TODO: Handle error. // } @@ -64,17 +63,17 @@ // // - It may require correct/in-range values for request initialization. // // - It may require specifying regional endpoints when creating the service client as shown in: // // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options -// c, err := awesome.NewFooClient(ctx) +// c, err := migration.NewClient(ctx) // if err != nil { // // TODO: Handle error. // } // defer c.Close() // -// req := &mypackagepb.InputType{ +// req := &migrationpb.CreateMigrationWorkflowRequest{ // // TODO: Fill request struct fields. -// // See https://pkg.go.dev/mypackage#InputType. +// // See https://pkg.go.dev/cloud.google.com/go/bigquery/migration/apiv2/migrationpb#CreateMigrationWorkflowRequest. // } -// resp, err := c.GetOneThing(ctx, req) +// resp, err := c.CreateMigrationWorkflow(ctx, req) // if err != nil { // // TODO: Handle error. // } @@ -83,7 +82,7 @@ // // Use of Context // -// The ctx passed to NewFooClient is used for authentication requests and +// The ctx passed to NewClient is used for authentication requests and // for creating the underlying connection, but is not used for subsequent calls. // Individual methods on the client use the ctx given to them. // @@ -94,7 +93,7 @@ // [Testing against Client Libraries]: https://pkg.go.dev/cloud.google.com/go#hdr-Testing // [Debugging Client Libraries]: https://pkg.go.dev/cloud.google.com/go#hdr-Debugging // [Inspecting errors]: https://pkg.go.dev/cloud.google.com/go#hdr-Inspecting_errors -package awesome // import "path/to/awesome" +package migration // import "cloud.google.com/go/bigquery/migration/apiv2" import ( "context" @@ -119,7 +118,6 @@ func getVersionClient() string { // DefaultAuthScopes reports the default set of authentication scopes to use with this package. func DefaultAuthScopes() []string { return []string{ - "https://foo.bar.com/auth", - "https://zip.zap.com/auth", + "https://www.googleapis.com/auth/cloud-platform", } } diff --git a/internal/gengapic/testdata/doc_file_alpha_emptyservice.want b/internal/gengapic/testdata/doc_file_alpha_emptyservice.want index 4ca85b0702e..f8c0e126aa1 100644 --- a/internal/gengapic/testdata/doc_file_alpha_emptyservice.want +++ b/internal/gengapic/testdata/doc_file_alpha_emptyservice.want @@ -1,4 +1,4 @@ -// Copyright 43 Google LLC +// Copyright 2024 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -14,12 +14,11 @@ // Code generated by protoc-gen-go_gapic. DO NOT EDIT. -// Package awesome is an auto-generated package for the -// Awesome Bar API. +// Package migration is an auto-generated package for the +// BigQuery Migration API. // -// The Awesome Bar API is really really awesome. It enables the use of Foo -// (at https://api.foo.com) with Buz (at https://api.buz.com) and Baz (at -// https://api.baz.com) to acclerate bar. +// The migration service, exposing apis for migration jobs operations, and +// agent management. // // NOTE: This package is in alpha. It is not stable, and is likely to change. // @@ -44,7 +43,7 @@ // // - It may require correct/in-range values for request initialization. // // - It may require specifying regional endpoints when creating the service client as shown in: // // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options -// c, err := awesome.NewFooClient(ctx) +// c, err := migration.NewClient(ctx) // if err != nil { // // TODO: Handle error. // } @@ -56,7 +55,7 @@ // // Use of Context // -// The ctx passed to NewFooClient is used for authentication requests and +// The ctx passed to NewClient is used for authentication requests and // for creating the underlying connection, but is not used for subsequent calls. // Individual methods on the client use the ctx given to them. // @@ -67,7 +66,7 @@ // [Testing against Client Libraries]: https://pkg.go.dev/cloud.google.com/go#hdr-Testing // [Debugging Client Libraries]: https://pkg.go.dev/cloud.google.com/go#hdr-Debugging // [Inspecting errors]: https://pkg.go.dev/cloud.google.com/go#hdr-Inspecting_errors -package awesome // import "path/to/awesome" +package migration // import "cloud.google.com/go/bigquery/migration/apiv2" import ( "context" @@ -92,7 +91,6 @@ func getVersionClient() string { // DefaultAuthScopes reports the default set of authentication scopes to use with this package. func DefaultAuthScopes() []string { return []string{ - "https://foo.bar.com/auth", - "https://zip.zap.com/auth", + "https://www.googleapis.com/auth/cloud-platform", } } diff --git a/internal/gengapic/testdata/doc_file_beta.want b/internal/gengapic/testdata/doc_file_beta.want index c0ed58fc8db..8d75820683d 100644 --- a/internal/gengapic/testdata/doc_file_beta.want +++ b/internal/gengapic/testdata/doc_file_beta.want @@ -1,4 +1,4 @@ -// Copyright 42 Google LLC +// Copyright 2024 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -14,12 +14,11 @@ // Code generated by protoc-gen-go_gapic. DO NOT EDIT. -// Package awesome is an auto-generated package for the -// Awesome Foo API. +// Package migration is an auto-generated package for the +// BigQuery Migration API. // -// The Awesome Foo API is really really awesome. It enables the use of Foo -// (at https://api.foo.com) with Buz (at https://api.buz.com) and Baz (at -// https://api.baz.com) to acclerate bar. +// The migration service, exposing apis for migration jobs operations, and +// agent management. // // NOTE: This package is in beta. It is not stable, and may be subject to changes. // @@ -44,7 +43,7 @@ // // - It may require correct/in-range values for request initialization. // // - It may require specifying regional endpoints when creating the service client as shown in: // // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options -// c, err := awesome.NewFooClient(ctx) +// c, err := migration.NewClient(ctx) // if err != nil { // // TODO: Handle error. // } @@ -64,17 +63,17 @@ // // - It may require correct/in-range values for request initialization. // // - It may require specifying regional endpoints when creating the service client as shown in: // // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options -// c, err := awesome.NewFooClient(ctx) +// c, err := migration.NewClient(ctx) // if err != nil { // // TODO: Handle error. // } // defer c.Close() // -// req := &mypackagepb.InputType{ +// req := &migrationpb.CreateMigrationWorkflowRequest{ // // TODO: Fill request struct fields. -// // See https://pkg.go.dev/mypackage#InputType. +// // See https://pkg.go.dev/cloud.google.com/go/bigquery/migration/apiv2/migrationpb#CreateMigrationWorkflowRequest. // } -// resp, err := c.GetOneThing(ctx, req) +// resp, err := c.CreateMigrationWorkflow(ctx, req) // if err != nil { // // TODO: Handle error. // } @@ -83,7 +82,7 @@ // // Use of Context // -// The ctx passed to NewFooClient is used for authentication requests and +// The ctx passed to NewClient is used for authentication requests and // for creating the underlying connection, but is not used for subsequent calls. // Individual methods on the client use the ctx given to them. // @@ -94,7 +93,7 @@ // [Testing against Client Libraries]: https://pkg.go.dev/cloud.google.com/go#hdr-Testing // [Debugging Client Libraries]: https://pkg.go.dev/cloud.google.com/go#hdr-Debugging // [Inspecting errors]: https://pkg.go.dev/cloud.google.com/go#hdr-Inspecting_errors -package awesome // import "path/to/awesome" +package migration // import "cloud.google.com/go/bigquery/migration/apiv2" import ( "context" @@ -119,7 +118,6 @@ func getVersionClient() string { // DefaultAuthScopes reports the default set of authentication scopes to use with this package. func DefaultAuthScopes() []string { return []string{ - "https://foo.bar.com/auth", - "https://zip.zap.com/auth", + "https://www.googleapis.com/auth/cloud-platform", } } diff --git a/internal/gengapic/testdata/doc_file_beta_emptyservice.want b/internal/gengapic/testdata/doc_file_beta_emptyservice.want index ec9b819b854..8cc61d17bbe 100644 --- a/internal/gengapic/testdata/doc_file_beta_emptyservice.want +++ b/internal/gengapic/testdata/doc_file_beta_emptyservice.want @@ -1,4 +1,4 @@ -// Copyright 43 Google LLC +// Copyright 2024 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -14,12 +14,11 @@ // Code generated by protoc-gen-go_gapic. DO NOT EDIT. -// Package awesome is an auto-generated package for the -// Awesome Bar API. +// Package migration is an auto-generated package for the +// BigQuery Migration API. // -// The Awesome Bar API is really really awesome. It enables the use of Foo -// (at https://api.foo.com) with Buz (at https://api.buz.com) and Baz (at -// https://api.baz.com) to acclerate bar. +// The migration service, exposing apis for migration jobs operations, and +// agent management. // // NOTE: This package is in beta. It is not stable, and may be subject to changes. // @@ -44,7 +43,7 @@ // // - It may require correct/in-range values for request initialization. // // - It may require specifying regional endpoints when creating the service client as shown in: // // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options -// c, err := awesome.NewFooClient(ctx) +// c, err := migration.NewClient(ctx) // if err != nil { // // TODO: Handle error. // } @@ -56,7 +55,7 @@ // // Use of Context // -// The ctx passed to NewFooClient is used for authentication requests and +// The ctx passed to NewClient is used for authentication requests and // for creating the underlying connection, but is not used for subsequent calls. // Individual methods on the client use the ctx given to them. // @@ -67,7 +66,7 @@ // [Testing against Client Libraries]: https://pkg.go.dev/cloud.google.com/go#hdr-Testing // [Debugging Client Libraries]: https://pkg.go.dev/cloud.google.com/go#hdr-Debugging // [Inspecting errors]: https://pkg.go.dev/cloud.google.com/go#hdr-Inspecting_errors -package awesome // import "path/to/awesome" +package migration // import "cloud.google.com/go/bigquery/migration/apiv2" import ( "context" @@ -92,7 +91,6 @@ func getVersionClient() string { // DefaultAuthScopes reports the default set of authentication scopes to use with this package. func DefaultAuthScopes() []string { return []string{ - "https://foo.bar.com/auth", - "https://zip.zap.com/auth", + "https://www.googleapis.com/auth/cloud-platform", } } diff --git a/internal/gengapic/testdata/doc_file_deprecated_emptyservice.want b/internal/gengapic/testdata/doc_file_deprecated_emptyservice.want index 35e2a79d6d7..4a545af7633 100644 --- a/internal/gengapic/testdata/doc_file_deprecated_emptyservice.want +++ b/internal/gengapic/testdata/doc_file_deprecated_emptyservice.want @@ -1,4 +1,4 @@ -// Copyright 43 Google LLC +// Copyright 2024 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -14,12 +14,11 @@ // Code generated by protoc-gen-go_gapic. DO NOT EDIT. -// Package awesome is an auto-generated package for the -// Awesome Bar API. +// Package migration is an auto-generated package for the +// BigQuery Migration API. // -// The Awesome Bar API is really really awesome. It enables the use of Foo -// (at https://api.foo.com) with Buz (at https://api.buz.com) and Baz (at -// https://api.baz.com) to acclerate bar. +// The migration service, exposing apis for migration jobs operations, and +// agent management. // // Deprecated: Find the newer version of this package in the module. // @@ -44,7 +43,7 @@ // // - It may require correct/in-range values for request initialization. // // - It may require specifying regional endpoints when creating the service client as shown in: // // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options -// c, err := awesome.NewFooClient(ctx) +// c, err := migration.NewClient(ctx) // if err != nil { // // TODO: Handle error. // } @@ -56,7 +55,7 @@ // // Use of Context // -// The ctx passed to NewFooClient is used for authentication requests and +// The ctx passed to NewClient is used for authentication requests and // for creating the underlying connection, but is not used for subsequent calls. // Individual methods on the client use the ctx given to them. // @@ -67,7 +66,7 @@ // [Testing against Client Libraries]: https://pkg.go.dev/cloud.google.com/go#hdr-Testing // [Debugging Client Libraries]: https://pkg.go.dev/cloud.google.com/go#hdr-Debugging // [Inspecting errors]: https://pkg.go.dev/cloud.google.com/go#hdr-Inspecting_errors -package awesome // import "path/to/awesome" +package migration // import "cloud.google.com/go/bigquery/migration/apiv2" import ( "context" @@ -92,7 +91,6 @@ func getVersionClient() string { // DefaultAuthScopes reports the default set of authentication scopes to use with this package. func DefaultAuthScopes() []string { return []string{ - "https://foo.bar.com/auth", - "https://zip.zap.com/auth", + "https://www.googleapis.com/auth/cloud-platform", } } diff --git a/internal/gengapic/testdata/doc_file_emptyservice.want b/internal/gengapic/testdata/doc_file_emptyservice.want index e2f28806850..d8aefae5c24 100644 --- a/internal/gengapic/testdata/doc_file_emptyservice.want +++ b/internal/gengapic/testdata/doc_file_emptyservice.want @@ -1,4 +1,4 @@ -// Copyright 43 Google LLC +// Copyright 2024 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -14,12 +14,11 @@ // Code generated by protoc-gen-go_gapic. DO NOT EDIT. -// Package awesome is an auto-generated package for the -// Awesome Bar API. +// Package migration is an auto-generated package for the +// BigQuery Migration API. // -// The Awesome Bar API is really really awesome. It enables the use of Foo -// (at https://api.foo.com) with Buz (at https://api.buz.com) and Baz (at -// https://api.baz.com) to acclerate bar. +// The migration service, exposing apis for migration jobs operations, and +// agent management. // // General documentation // @@ -42,7 +41,7 @@ // // - It may require correct/in-range values for request initialization. // // - It may require specifying regional endpoints when creating the service client as shown in: // // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options -// c, err := awesome.NewFooClient(ctx) +// c, err := migration.NewClient(ctx) // if err != nil { // // TODO: Handle error. // } @@ -54,7 +53,7 @@ // // Use of Context // -// The ctx passed to NewFooClient is used for authentication requests and +// The ctx passed to NewClient is used for authentication requests and // for creating the underlying connection, but is not used for subsequent calls. // Individual methods on the client use the ctx given to them. // @@ -65,7 +64,7 @@ // [Testing against Client Libraries]: https://pkg.go.dev/cloud.google.com/go#hdr-Testing // [Debugging Client Libraries]: https://pkg.go.dev/cloud.google.com/go#hdr-Debugging // [Inspecting errors]: https://pkg.go.dev/cloud.google.com/go#hdr-Inspecting_errors -package awesome // import "path/to/awesome" +package migration // import "cloud.google.com/go/bigquery/migration/apiv2" import ( "context" @@ -90,7 +89,6 @@ func getVersionClient() string { // DefaultAuthScopes reports the default set of authentication scopes to use with this package. func DefaultAuthScopes() []string { return []string{ - "https://foo.bar.com/auth", - "https://zip.zap.com/auth", + "https://www.googleapis.com/auth/cloud-platform", } } diff --git a/internal/testing/sample/sample.go b/internal/testing/sample/sample.go index 5078c82c0d1..9ff4a158484 100644 --- a/internal/testing/sample/sample.go +++ b/internal/testing/sample/sample.go @@ -38,6 +38,27 @@ const ( // https://github.com/googleapis/googleapis/blob/f7df662a24c56ecaab79cb7d808fed4d2bb4981d/google/cloud/bigquery/migration/v2/migration_service.proto#L35 ServiceName = "MigrationService" + // ServiceTitle is the name of the service provided in the service YAML + // file. + // + // Example: + // https://github.com/googleapis/googleapis/blob/f7df662a24c56ecaab79cb7d808fed4d2bb4981d/google/cloud/bigquery/migration/v2/bigquerymigration_v2.yaml#L4 + ServiceTitle = "BigQuery Migration API" + + // ServiceDocumentationSummary is the description of the service provided in the + // service YAML file. + // + // Example: + // https://github.com/googleapis/googleapis/blob/f7df662a24c56ecaab79cb7d808fed4d2bb4981d/google/cloud/bigquery/migration/v2/bigquerymigration_v2.yaml#L11 + ServiceDocumentationSummary = "The migration service, exposing apis for migration jobs operations, and agent management." + + // ServiceOAuthScope is the OAuth 2.0 scope(s) that is needed to request + // access to the service's API, as defined in the service YAML file. + // + // Example: + // https://github.com/googleapis/googleapis/blob/f7df662a24c56ecaab79cb7d808fed4d2bb4981d/google/cloud/bigquery/migration/v2/bigquerymigration_v2.yaml#L24 + ServiceOAuthScope = "https://www.googleapis.com/auth/cloud-platform" + // CreateMethod is the name of the RPC method for creating a resource. // The same name is used for the proto RPC method and the Go method. // @@ -85,7 +106,12 @@ const ( ) const ( + // Year is the year used in the copyright header for package documentation + // and samples. + Year = 2024 +) +const ( // ProtoServiceName is the fully qualified name of service. // // Example: @@ -151,6 +177,9 @@ func ServiceConfig() *serviceconfig.Service { Apis: []*apipb.Api{ {Name: ProtoServiceName}, }, + Documentation: &serviceconfig.Documentation{ + Summary: ServiceDocumentationSummary, + }, } }