Repository: googleapis/gapic-generator-go
Pull request #1120 (2022-08-31 21:05:58)

feat(gengapic): add in-line snippet comment to example.go
See b/240118237 for requirements.

See also:

* [Python](https://github.com/googleapis/gapic-generator-python/pull/1417)
* [Java](https://github.com/googleapis/gapic-generator-java/pull/1029)


Patch:
diff --git a/internal/gengapic/example.go b/internal/gengapic/example.go
index 1eddd7a..ed7c934 100644
--- a/internal/gengapic/example.go
+++ b/internal/gengapic/example.go
@@ -64,6 +64,11 @@ func (g *generator) exampleInitClient(pkgName, servName string) {
 	p := g.printf
 
 	p("ctx := context.Background()")
+	p("// This snippet has been automatically generated and should be regarded as a code template only.")
+	p("// It will require modifications to work:")
+	p("// - It may require correct/in-range values for request initialization.")
+	p("// - It may require specifying regional endpoints when creating the service client as shown in:")
+	p("//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options")
 	p("c, err := %s.New%sClient(ctx)", pkgName, servName)
 	p("if err != nil {")
 	p("  // TODO: Handle error.")


Test patch:
diff --git a/internal/gengapic/testdata/custom_op_example.want b/internal/gengapic/testdata/custom_op_example.want
index 0f6985e..c5dbdf9 100644
--- a/internal/gengapic/testdata/custom_op_example.want
+++ b/internal/gengapic/testdata/custom_op_example.want
@@ -1,5 +1,10 @@
 func ExampleNewFooRESTClient() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooRESTClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -12,6 +17,11 @@ func ExampleNewFooRESTClient() {
 
 func ExampleFooClient_GetEmptyThing() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooRESTClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -30,6 +40,11 @@ func ExampleFooClient_GetEmptyThing() {
 
 func ExampleFooClient_GetOneThing() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooRESTClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -50,6 +65,11 @@ func ExampleFooClient_GetOneThing() {
 
 func ExampleFooClient_GetBigThing() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooRESTClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -75,6 +95,11 @@ func ExampleFooClient_GetBigThing() {
 
 func ExampleFooClient_GetManyThings() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooRESTClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -101,6 +126,11 @@ func ExampleFooClient_GetManyThings() {
 
 func ExampleFooClient_BidiThings() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooRESTClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -136,6 +166,11 @@ func ExampleFooClient_BidiThings() {
 
 func ExampleFooClient_EmptyLRO() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooRESTClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -159,6 +194,11 @@ func ExampleFooClient_EmptyLRO() {
 
 func ExampleFooClient_RespLRO() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooRESTClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -184,6 +224,11 @@ func ExampleFooClient_RespLRO() {
 
 func ExampleFooClient_CustomOp() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooRESTClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
diff --git a/internal/gengapic/testdata/doc_file.want b/internal/gengapic/testdata/doc_file.want
index bb14f0c..3943305 100644
--- a/internal/gengapic/testdata/doc_file.want
+++ b/internal/gengapic/testdata/doc_file.want
@@ -25,6 +25,11 @@
 //
 // To get started with this package, create a client.
 //  ctx := context.Background()
+//  // This snippet has been automatically generated and should be regarded as a code template only.
+//  // It will require modifications to work:
+//  // - 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)
 //  if err != nil {
 //  	// TODO: Handle error.
@@ -40,6 +45,11 @@
 // The following is an example of making an API call with the newly created client.
 //
 //  ctx := context.Background()
+//  // This snippet has been automatically generated and should be regarded as a code template only.
+//  // It will require modifications to work:
+//  // - 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)
 //  if err != nil {
 //  	// TODO: Handle error.
diff --git a/internal/gengapic/testdata/doc_file_alpha.want b/internal/gengapic/testdata/doc_file_alpha.want
index f523c28..21cb8be 100644
--- a/internal/gengapic/testdata/doc_file_alpha.want
+++ b/internal/gengapic/testdata/doc_file_alpha.want
@@ -27,6 +27,11 @@
 //
 // To get started with this package, create a client.
 //  ctx := context.Background()
+//  // This snippet has been automatically generated and should be regarded as a code template only.
+//  // It will require modifications to work:
+//  // - 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)
 //  if err != nil {
 //  	// TODO: Handle error.
@@ -42,6 +47,11 @@
 // The following is an example of making an API call with the newly created client.
 //
 //  ctx := context.Background()
+//  // This snippet has been automatically generated and should be regarded as a code template only.
+//  // It will require modifications to work:
+//  // - 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)
 //  if err != nil {
 //  	// TODO: Handle error.
diff --git a/internal/gengapic/testdata/doc_file_alpha_emptyservice.want b/internal/gengapic/testdata/doc_file_alpha_emptyservice.want
index a769dd6..30bc436 100644
--- a/internal/gengapic/testdata/doc_file_alpha_emptyservice.want
+++ b/internal/gengapic/testdata/doc_file_alpha_emptyservice.want
@@ -27,6 +27,11 @@
 //
 // To get started with this package, create a client.
 //  ctx := context.Background()
+//  // This snippet has been automatically generated and should be regarded as a code template only.
+//  // It will require modifications to work:
+//  // - 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)
 //  if err != nil {
 //  	// TODO: Handle error.
diff --git a/internal/gengapic/testdata/doc_file_beta.want b/internal/gengapic/testdata/doc_file_beta.want
index 82d4289..f0e58ed 100644
--- a/internal/gengapic/testdata/doc_file_beta.want
+++ b/internal/gengapic/testdata/doc_file_beta.want
@@ -27,6 +27,11 @@
 //
 // To get started with this package, create a client.
 //  ctx := context.Background()
+//  // This snippet has been automatically generated and should be regarded as a code template only.
+//  // It will require modifications to work:
+//  // - 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)
 //  if err != nil {
 //  	// TODO: Handle error.
@@ -42,6 +47,11 @@
 // The following is an example of making an API call with the newly created client.
 //
 //  ctx := context.Background()
+//  // This snippet has been automatically generated and should be regarded as a code template only.
+//  // It will require modifications to work:
+//  // - 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)
 //  if err != nil {
 //  	// TODO: Handle error.
diff --git a/internal/gengapic/testdata/doc_file_beta_emptyservice.want b/internal/gengapic/testdata/doc_file_beta_emptyservice.want
index b67939e..0100fb2 100644
--- a/internal/gengapic/testdata/doc_file_beta_emptyservice.want
+++ b/internal/gengapic/testdata/doc_file_beta_emptyservice.want
@@ -27,6 +27,11 @@
 //
 // To get started with this package, create a client.
 //  ctx := context.Background()
+//  // This snippet has been automatically generated and should be regarded as a code template only.
+//  // It will require modifications to work:
+//  // - 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)
 //  if err != nil {
 //  	// TODO: Handle error.
diff --git a/internal/gengapic/testdata/doc_file_emptyservice.want b/internal/gengapic/testdata/doc_file_emptyservice.want
index 013e9c3..ca45e6a 100644
--- a/internal/gengapic/testdata/doc_file_emptyservice.want
+++ b/internal/gengapic/testdata/doc_file_emptyservice.want
@@ -25,6 +25,11 @@
 //
 // To get started with this package, create a client.
 //  ctx := context.Background()
+//  // This snippet has been automatically generated and should be regarded as a code template only.
+//  // It will require modifications to work:
+//  // - 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)
 //  if err != nil {
 //  	// TODO: Handle error.
diff --git a/internal/gengapic/testdata/empty_example.want b/internal/gengapic/testdata/empty_example.want
index 624b7e9..2c17003 100644
--- a/internal/gengapic/testdata/empty_example.want
+++ b/internal/gengapic/testdata/empty_example.want
@@ -1,5 +1,10 @@
 func ExampleNewClient() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Foo.NewClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -12,6 +17,11 @@ func ExampleNewClient() {
 
 func ExampleNewRESTClient() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Foo.NewRESTClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -24,6 +34,11 @@ func ExampleNewRESTClient() {
 
 func ExampleClient_GetEmptyThing() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Foo.NewClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -42,6 +57,11 @@ func ExampleClient_GetEmptyThing() {
 
 func ExampleClient_GetOneThing() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Foo.NewClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -62,6 +82,11 @@ func ExampleClient_GetOneThing() {
 
 func ExampleClient_GetBigThing() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Foo.NewClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -87,6 +112,11 @@ func ExampleClient_GetBigThing() {
 
 func ExampleClient_GetManyThings() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Foo.NewClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -113,6 +143,11 @@ func ExampleClient_GetManyThings() {
 
 func ExampleClient_BidiThings() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Foo.NewClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -148,6 +183,11 @@ func ExampleClient_BidiThings() {
 
 func ExampleClient_EmptyLRO() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Foo.NewClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -171,6 +211,11 @@ func ExampleClient_EmptyLRO() {
 
 func ExampleClient_RespLRO() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Foo.NewClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -196,6 +241,11 @@ func ExampleClient_RespLRO() {
 
 func ExampleClient_CustomOp() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Foo.NewClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -216,6 +266,11 @@ func ExampleClient_CustomOp() {
 
 func ExampleClient_ListLocations() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Foo.NewClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -242,6 +297,11 @@ func ExampleClient_ListLocations() {
 
 func ExampleClient_GetLocation() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Foo.NewClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -262,6 +322,11 @@ func ExampleClient_GetLocation() {
 
 func ExampleClient_SetIamPolicy() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Foo.NewClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -282,6 +347,11 @@ func ExampleClient_SetIamPolicy() {
 
 func ExampleClient_GetIamPolicy() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Foo.NewClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -302,6 +372,11 @@ func ExampleClient_GetIamPolicy() {
 
 func ExampleClient_TestIamPermissions() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Foo.NewClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -322,6 +397,11 @@ func ExampleClient_TestIamPermissions() {
 
 func ExampleClient_ListOperations() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Foo.NewClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -348,6 +428,11 @@ func ExampleClient_ListOperations() {
 
 func ExampleClient_GetOperation() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Foo.NewClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -368,6 +453,11 @@ func ExampleClient_GetOperation() {
 
 func ExampleClient_DeleteOperation() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Foo.NewClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -386,6 +476,11 @@ func ExampleClient_DeleteOperation() {
 
 func ExampleClient_CancelOperation() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Foo.NewClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -404,6 +499,11 @@ func ExampleClient_CancelOperation() {
 
 func ExampleClient_WaitOperation() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Foo.NewClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
diff --git a/internal/gengapic/testdata/empty_example_grpc.want b/internal/gengapic/testdata/empty_example_grpc.want
index 6fcd6c4..86fc5c1 100644
--- a/internal/gengapic/testdata/empty_example_grpc.want
+++ b/internal/gengapic/testdata/empty_example_grpc.want
@@ -1,5 +1,10 @@
 func ExampleNewClient() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Foo.NewClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -12,6 +17,11 @@ func ExampleNewClient() {
 
 func ExampleClient_GetEmptyThing() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Foo.NewClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -30,6 +40,11 @@ func ExampleClient_GetEmptyThing() {
 
 func ExampleClient_GetOneThing() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Foo.NewClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -50,6 +65,11 @@ func ExampleClient_GetOneThing() {
 
 func ExampleClient_GetBigThing() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Foo.NewClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -75,6 +95,11 @@ func ExampleClient_GetBigThing() {
 
 func ExampleClient_GetManyThings() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Foo.NewClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -101,6 +126,11 @@ func ExampleClient_GetManyThings() {
 
 func ExampleClient_BidiThings() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Foo.NewClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -136,6 +166,11 @@ func ExampleClient_BidiThings() {
 
 func ExampleClient_EmptyLRO() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Foo.NewClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -159,6 +194,11 @@ func ExampleClient_EmptyLRO() {
 
 func ExampleClient_RespLRO() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Foo.NewClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -184,6 +224,11 @@ func ExampleClient_RespLRO() {
 
 func ExampleClient_CustomOp() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Foo.NewClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -204,6 +249,11 @@ func ExampleClient_CustomOp() {
 
 func ExampleClient_ListLocations() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Foo.NewClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -230,6 +280,11 @@ func ExampleClient_ListLocations() {
 
 func ExampleClient_GetLocation() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Foo.NewClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -250,6 +305,11 @@ func ExampleClient_GetLocation() {
 
 func ExampleClient_SetIamPolicy() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Foo.NewClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -270,6 +330,11 @@ func ExampleClient_SetIamPolicy() {
 
 func ExampleClient_GetIamPolicy() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Foo.NewClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -290,6 +355,11 @@ func ExampleClient_GetIamPolicy() {
 
 func ExampleClient_TestIamPermissions() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Foo.NewClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -310,6 +380,11 @@ func ExampleClient_TestIamPermissions() {
 
 func ExampleClient_ListOperations() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Foo.NewClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -336,6 +411,11 @@ func ExampleClient_ListOperations() {
 
 func ExampleClient_GetOperation() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Foo.NewClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -356,6 +436,11 @@ func ExampleClient_GetOperation() {
 
 func ExampleClient_DeleteOperation() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Foo.NewClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -374,6 +459,11 @@ func ExampleClient_DeleteOperation() {
 
 func ExampleClient_CancelOperation() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Foo.NewClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -392,6 +482,11 @@ func ExampleClient_CancelOperation() {
 
 func ExampleClient_WaitOperation() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Foo.NewClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
diff --git a/internal/gengapic/testdata/foo_example.want b/internal/gengapic/testdata/foo_example.want
index 8c79e5d..9199b55 100644
--- a/internal/gengapic/testdata/foo_example.want
+++ b/internal/gengapic/testdata/foo_example.want
@@ -1,5 +1,10 @@
 func ExampleNewFooClient() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -12,6 +17,11 @@ func ExampleNewFooClient() {
 
 func ExampleNewFooRESTClient() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooRESTClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -24,6 +34,11 @@ func ExampleNewFooRESTClient() {
 
 func ExampleFooClient_GetEmptyThing() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -42,6 +57,11 @@ func ExampleFooClient_GetEmptyThing() {
 
 func ExampleFooClient_GetOneThing() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -62,6 +82,11 @@ func ExampleFooClient_GetOneThing() {
 
 func ExampleFooClient_GetBigThing() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -87,6 +112,11 @@ func ExampleFooClient_GetBigThing() {
 
 func ExampleFooClient_GetManyThings() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -113,6 +143,11 @@ func ExampleFooClient_GetManyThings() {
 
 func ExampleFooClient_BidiThings() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -148,6 +183,11 @@ func ExampleFooClient_BidiThings() {
 
 func ExampleFooClient_EmptyLRO() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -171,6 +211,11 @@ func ExampleFooClient_EmptyLRO() {
 
 func ExampleFooClient_RespLRO() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -196,6 +241,11 @@ func ExampleFooClient_RespLRO() {
 
 func ExampleFooClient_CustomOp() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -216,6 +266,11 @@ func ExampleFooClient_CustomOp() {
 
 func ExampleFooClient_ListLocations() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -242,6 +297,11 @@ func ExampleFooClient_ListLocations() {
 
 func ExampleFooClient_GetLocation() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -262,6 +322,11 @@ func ExampleFooClient_GetLocation() {
 
 func ExampleFooClient_SetIamPolicy() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -282,6 +347,11 @@ func ExampleFooClient_SetIamPolicy() {
 
 func ExampleFooClient_GetIamPolicy() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -302,6 +372,11 @@ func ExampleFooClient_GetIamPolicy() {
 
 func ExampleFooClient_TestIamPermissions() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -322,6 +397,11 @@ func ExampleFooClient_TestIamPermissions() {
 
 func ExampleFooClient_ListOperations() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -348,6 +428,11 @@ func ExampleFooClient_ListOperations() {
 
 func ExampleFooClient_GetOperation() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -368,6 +453,11 @@ func ExampleFooClient_GetOperation() {
 
 func ExampleFooClient_DeleteOperation() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -386,6 +476,11 @@ func ExampleFooClient_DeleteOperation() {
 
 func ExampleFooClient_CancelOperation() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -404,6 +499,11 @@ func ExampleFooClient_CancelOperation() {
 
 func ExampleFooClient_WaitOperation() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
diff --git a/internal/gengapic/testdata/foo_example_rest.want b/internal/gengapic/testdata/foo_example_rest.want
index 64bad87..44111bd 100644
--- a/internal/gengapic/testdata/foo_example_rest.want
+++ b/internal/gengapic/testdata/foo_example_rest.want
@@ -1,5 +1,10 @@
 func ExampleNewFooRESTClient() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooRESTClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -12,6 +17,11 @@ func ExampleNewFooRESTClient() {
 
 func ExampleFooClient_GetEmptyThing() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooRESTClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -30,6 +40,11 @@ func ExampleFooClient_GetEmptyThing() {
 
 func ExampleFooClient_GetOneThing() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooRESTClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -50,6 +65,11 @@ func ExampleFooClient_GetOneThing() {
 
 func ExampleFooClient_GetBigThing() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooRESTClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -75,6 +95,11 @@ func ExampleFooClient_GetBigThing() {
 
 func ExampleFooClient_GetManyThings() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooRESTClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -101,6 +126,11 @@ func ExampleFooClient_GetManyThings() {
 
 func ExampleFooClient_BidiThings() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooRESTClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -136,6 +166,11 @@ func ExampleFooClient_BidiThings() {
 
 func ExampleFooClient_EmptyLRO() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooRESTClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -159,6 +194,11 @@ func ExampleFooClient_EmptyLRO() {
 
 func ExampleFooClient_RespLRO() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooRESTClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -184,6 +224,11 @@ func ExampleFooClient_RespLRO() {
 
 func ExampleFooClient_CustomOp() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooRESTClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -204,6 +249,11 @@ func ExampleFooClient_CustomOp() {
 
 func ExampleFooClient_ListLocations() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooRESTClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -230,6 +280,11 @@ func ExampleFooClient_ListLocations() {
 
 func ExampleFooClient_GetLocation() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooRESTClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -250,6 +305,11 @@ func ExampleFooClient_GetLocation() {
 
 func ExampleFooClient_SetIamPolicy() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooRESTClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -270,6 +330,11 @@ func ExampleFooClient_SetIamPolicy() {
 
 func ExampleFooClient_GetIamPolicy() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooRESTClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -290,6 +355,11 @@ func ExampleFooClient_GetIamPolicy() {
 
 func ExampleFooClient_TestIamPermissions() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooRESTClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -310,6 +380,11 @@ func ExampleFooClient_TestIamPermissions() {
 
 func ExampleFooClient_ListOperations() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooRESTClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -336,6 +411,11 @@ func ExampleFooClient_ListOperations() {
 
 func ExampleFooClient_GetOperation() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooRESTClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -356,6 +436,11 @@ func ExampleFooClient_GetOperation() {
 
 func ExampleFooClient_DeleteOperation() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooRESTClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -374,6 +459,11 @@ func ExampleFooClient_DeleteOperation() {
 
 func ExampleFooClient_CancelOperation() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooRESTClient(ctx)
 	if err != nil {
 		// TODO: Handle error.
@@ -392,6 +482,11 @@ func ExampleFooClient_CancelOperation() {
 
 func ExampleFooClient_WaitOperation() {
 	ctx := context.Background()
+	// This snippet has been automatically generated and should be regarded as a code template only.
+	// It will require modifications to work:
+	// - 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 := Bar.NewFooRESTClient(ctx)
 	if err != nil {
 		// TODO: Handle error.