From 7fcd9038918adb69b43de3c48fe7b572713d6388 Mon Sep 17 00:00:00 2001 From: Cody Oss <6331106+codyoss@users.noreply.github.com> Date: Tue, 3 Dec 2024 16:37:13 -0600 Subject: [PATCH] chore: regen client with latest go generator (#1556) Ran go install ./util/cmd/... && go run ./util/cmd/compile_protos, as mentioned in the README. Also, updated the git submodule to latest. --- README.md | 6 +- client/auxiliary.go | 18 +- client/auxiliary_go123.go | 82 +++++++++ .../compliance_client_example_go123_test.go | 79 +++++++++ client/doc.go | 42 +---- client/echo_client_example_go123_test.go | 158 ++++++++++++++++++ client/helpers.go | 42 +++++ client/identity_client_example_go123_test.go | 106 ++++++++++++ client/messaging_client_example_go123_test.go | 132 +++++++++++++++ client/sequence_client_example_go123_test.go | 79 +++++++++ client/testing_client_example_go123_test.go | 132 +++++++++++++++ schema/googleapis | 2 +- server/genproto/compliance.pb.go | 2 +- server/genproto/echo.pb.go | 2 +- server/genproto/identity.pb.go | 2 +- server/genproto/messaging.pb.go | 2 +- server/genproto/sequence.pb.go | 2 +- server/genproto/testing.pb.go | 2 +- 18 files changed, 831 insertions(+), 59 deletions(-) create mode 100644 client/auxiliary_go123.go create mode 100644 client/compliance_client_example_go123_test.go create mode 100644 client/echo_client_example_go123_test.go create mode 100644 client/helpers.go create mode 100644 client/identity_client_example_go123_test.go create mode 100644 client/messaging_client_example_go123_test.go create mode 100644 client/sequence_client_example_go123_test.go create mode 100644 client/testing_client_example_go123_test.go diff --git a/README.md b/README.md index 6b71c342e..26aff255c 100644 --- a/README.md +++ b/README.md @@ -93,9 +93,9 @@ is the minimum supported version of `protoc`. 1. Set up Go protobuf tools: ```sh - go install github.com/golang/protobuf/protoc-gen-go - go install github.com/googleapis/gapic-generator-go/cmd/protoc-gen-go_cli - go install github.com/googleapis/gapic-generator-go/cmd/protoc-gen-go_gapic + go install github.com/golang/protobuf/protoc-gen-go@latest + go install github.com/googleapis/gapic-generator-go/cmd/protoc-gen-go_cli@latest + go install github.com/googleapis/gapic-generator-go/cmd/protoc-gen-go_gapic@latest ``` 1. Export the Go binaries to your environment path. diff --git a/client/auxiliary.go b/client/auxiliary.go index 11b578d6f..95955dacb 100644 --- a/client/auxiliary.go +++ b/client/auxiliary.go @@ -176,7 +176,7 @@ type BlurbIterator struct { InternalFetch func(pageSize int, pageToken string) (results []*genprotopb.Blurb, nextPageToken string, err error) } -// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +// PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details. func (it *BlurbIterator) PageInfo() *iterator.PageInfo { return it.pageInfo } @@ -223,7 +223,7 @@ type EchoResponseIterator struct { InternalFetch func(pageSize int, pageToken string) (results []*genprotopb.EchoResponse, nextPageToken string, err error) } -// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +// PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details. func (it *EchoResponseIterator) PageInfo() *iterator.PageInfo { return it.pageInfo } @@ -270,7 +270,7 @@ type LocationIterator struct { InternalFetch func(pageSize int, pageToken string) (results []*locationpb.Location, nextPageToken string, err error) } -// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +// PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details. func (it *LocationIterator) PageInfo() *iterator.PageInfo { return it.pageInfo } @@ -317,7 +317,7 @@ type OperationIterator struct { InternalFetch func(pageSize int, pageToken string) (results []*longrunningpb.Operation, nextPageToken string, err error) } -// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +// PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details. func (it *OperationIterator) PageInfo() *iterator.PageInfo { return it.pageInfo } @@ -370,7 +370,7 @@ type PagedExpandResponseListPairIterator struct { InternalFetch func(pageSize int, pageToken string) (results []PagedExpandResponseListPair, nextPageToken string, err error) } -// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +// PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details. func (it *PagedExpandResponseListPairIterator) PageInfo() *iterator.PageInfo { return it.pageInfo } @@ -417,7 +417,7 @@ type RoomIterator struct { InternalFetch func(pageSize int, pageToken string) (results []*genprotopb.Room, nextPageToken string, err error) } -// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +// PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details. func (it *RoomIterator) PageInfo() *iterator.PageInfo { return it.pageInfo } @@ -464,7 +464,7 @@ type SessionIterator struct { InternalFetch func(pageSize int, pageToken string) (results []*genprotopb.Session, nextPageToken string, err error) } -// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +// PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details. func (it *SessionIterator) PageInfo() *iterator.PageInfo { return it.pageInfo } @@ -511,7 +511,7 @@ type TestIterator struct { InternalFetch func(pageSize int, pageToken string) (results []*genprotopb.Test, nextPageToken string, err error) } -// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +// PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details. func (it *TestIterator) PageInfo() *iterator.PageInfo { return it.pageInfo } @@ -558,7 +558,7 @@ type UserIterator struct { InternalFetch func(pageSize int, pageToken string) (results []*genprotopb.User, nextPageToken string, err error) } -// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +// PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details. func (it *UserIterator) PageInfo() *iterator.PageInfo { return it.pageInfo } diff --git a/client/auxiliary_go123.go b/client/auxiliary_go123.go new file mode 100644 index 000000000..ee14ce649 --- /dev/null +++ b/client/auxiliary_go123.go @@ -0,0 +1,82 @@ +// 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. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go_gapic. DO NOT EDIT. + +//go:build go1.23 + +package client + +import ( + "iter" + + longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" + genprotopb "github.com/googleapis/gapic-showcase/server/genproto" + "github.com/googleapis/gax-go/v2/iterator" + locationpb "google.golang.org/genproto/googleapis/cloud/location" +) + +// All returns an iterator. If an error is returned by the iterator, the +// iterator will stop after that iteration. +func (it *BlurbIterator) All() iter.Seq2[*genprotopb.Blurb, error] { + return iterator.RangeAdapter(it.Next) +} + +// All returns an iterator. If an error is returned by the iterator, the +// iterator will stop after that iteration. +func (it *EchoResponseIterator) All() iter.Seq2[*genprotopb.EchoResponse, error] { + return iterator.RangeAdapter(it.Next) +} + +// All returns an iterator. If an error is returned by the iterator, the +// iterator will stop after that iteration. +func (it *LocationIterator) All() iter.Seq2[*locationpb.Location, error] { + return iterator.RangeAdapter(it.Next) +} + +// All returns an iterator. If an error is returned by the iterator, the +// iterator will stop after that iteration. +func (it *OperationIterator) All() iter.Seq2[*longrunningpb.Operation, error] { + return iterator.RangeAdapter(it.Next) +} + +// All returns an iterator. If an error is returned by the iterator, the +// iterator will stop after that iteration. +func (it *PagedExpandResponseListPairIterator) All() iter.Seq2[PagedExpandResponseListPair, error] { + return iterator.RangeAdapter(it.Next) +} + +// All returns an iterator. If an error is returned by the iterator, the +// iterator will stop after that iteration. +func (it *RoomIterator) All() iter.Seq2[*genprotopb.Room, error] { + return iterator.RangeAdapter(it.Next) +} + +// All returns an iterator. If an error is returned by the iterator, the +// iterator will stop after that iteration. +func (it *SessionIterator) All() iter.Seq2[*genprotopb.Session, error] { + return iterator.RangeAdapter(it.Next) +} + +// All returns an iterator. If an error is returned by the iterator, the +// iterator will stop after that iteration. +func (it *TestIterator) All() iter.Seq2[*genprotopb.Test, error] { + return iterator.RangeAdapter(it.Next) +} + +// All returns an iterator. If an error is returned by the iterator, the +// iterator will stop after that iteration. +func (it *UserIterator) All() iter.Seq2[*genprotopb.User, error] { + return iterator.RangeAdapter(it.Next) +} diff --git a/client/compliance_client_example_go123_test.go b/client/compliance_client_example_go123_test.go new file mode 100644 index 000000000..e0f9f5ba2 --- /dev/null +++ b/client/compliance_client_example_go123_test.go @@ -0,0 +1,79 @@ +// 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. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go_gapic. DO NOT EDIT. + +//go:build go1.23 + +package client_test + +import ( + "context" + + longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" + client "github.com/googleapis/gapic-showcase/client" + locationpb "google.golang.org/genproto/googleapis/cloud/location" +) + +func ExampleComplianceClient_ListLocations_all() { + 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 := client.NewComplianceClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &locationpb.ListLocationsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest. + } + for resp, err := range c.ListLocations(ctx, req).All() { + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +func ExampleComplianceClient_ListOperations_all() { + 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 := client.NewComplianceClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.ListOperationsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest. + } + for resp, err := range c.ListOperations(ctx, req).All() { + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} diff --git a/client/doc.go b/client/doc.go index c93e886ff..b77a154a3 100644 --- a/client/doc.go +++ b/client/doc.go @@ -36,6 +36,7 @@ // // To get started with this package, create a client. // +// // go get github.com/googleapis/gapic-showcase/client@latest // ctx := context.Background() // // This snippet has been automatically generated and should be regarded as a code template only. // // It will require modifications to work: @@ -54,19 +55,7 @@ // // # Using the Client // -// 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 := client.NewComplianceClient(ctx) -// if err != nil { -// // TODO: Handle error. -// } -// defer c.Close() +// The following is an example of making an API call with the newly created client, mentioned above. // // req := &genprotopb.EnumRequest{ // // TODO: Fill request struct fields. @@ -93,30 +82,3 @@ // [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 client // import "github.com/googleapis/gapic-showcase/client" - -import ( - "context" - - "google.golang.org/api/option" -) - -// For more information on implementing a client constructor hook, see -// https://github.com/googleapis/google-cloud-go/wiki/Customizing-constructors. -type clientHookParams struct{} -type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) - -var versionClient string - -func getVersionClient() string { - if versionClient == "" { - return "UNKNOWN" - } - return versionClient -} - -// DefaultAuthScopes reports the default set of authentication scopes to use with this package. -func DefaultAuthScopes() []string { - return []string{ - "", - } -} diff --git a/client/echo_client_example_go123_test.go b/client/echo_client_example_go123_test.go new file mode 100644 index 000000000..6cad00df6 --- /dev/null +++ b/client/echo_client_example_go123_test.go @@ -0,0 +1,158 @@ +// 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. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go_gapic. DO NOT EDIT. + +//go:build go1.23 + +package client_test + +import ( + "context" + + longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" + client "github.com/googleapis/gapic-showcase/client" + genprotopb "github.com/googleapis/gapic-showcase/server/genproto" + locationpb "google.golang.org/genproto/googleapis/cloud/location" +) + +func ExampleEchoClient_PagedExpand_all() { + 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 := client.NewEchoClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &genprotopb.PagedExpandRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/github.com/googleapis/gapic-showcase/server/genproto#PagedExpandRequest. + } + for resp, err := range c.PagedExpand(ctx, req).All() { + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +func ExampleEchoClient_PagedExpandLegacy_all() { + 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 := client.NewEchoClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &genprotopb.PagedExpandLegacyRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/github.com/googleapis/gapic-showcase/server/genproto#PagedExpandLegacyRequest. + } + for resp, err := range c.PagedExpandLegacy(ctx, req).All() { + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +func ExampleEchoClient_PagedExpandLegacyMapped_all() { + 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 := client.NewEchoClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &genprotopb.PagedExpandRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/github.com/googleapis/gapic-showcase/server/genproto#PagedExpandRequest. + } + for resp, err := range c.PagedExpandLegacyMapped(ctx, req).All() { + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +func ExampleEchoClient_ListLocations_all() { + 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 := client.NewEchoClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &locationpb.ListLocationsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest. + } + for resp, err := range c.ListLocations(ctx, req).All() { + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +func ExampleEchoClient_ListOperations_all() { + 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 := client.NewEchoClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.ListOperationsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest. + } + for resp, err := range c.ListOperations(ctx, req).All() { + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} diff --git a/client/helpers.go b/client/helpers.go new file mode 100644 index 000000000..40a2c0d12 --- /dev/null +++ b/client/helpers.go @@ -0,0 +1,42 @@ +// 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. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go_gapic. DO NOT EDIT. + +package client + +import ( + "context" + + "google.golang.org/api/option" +) + +// For more information on implementing a client constructor hook, see +// https://github.com/googleapis/google-cloud-go/wiki/Customizing-constructors. +type clientHookParams struct{} +type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) + +var versionClient string + +func getVersionClient() string { + if versionClient == "" { + return "UNKNOWN" + } + return versionClient +} + +// DefaultAuthScopes reports the default set of authentication scopes to use with this package. +func DefaultAuthScopes() []string { + return []string{} +} diff --git a/client/identity_client_example_go123_test.go b/client/identity_client_example_go123_test.go new file mode 100644 index 000000000..b646ff2a5 --- /dev/null +++ b/client/identity_client_example_go123_test.go @@ -0,0 +1,106 @@ +// 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. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go_gapic. DO NOT EDIT. + +//go:build go1.23 + +package client_test + +import ( + "context" + + longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" + client "github.com/googleapis/gapic-showcase/client" + genprotopb "github.com/googleapis/gapic-showcase/server/genproto" + locationpb "google.golang.org/genproto/googleapis/cloud/location" +) + +func ExampleIdentityClient_ListUsers_all() { + 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 := client.NewIdentityClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &genprotopb.ListUsersRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/github.com/googleapis/gapic-showcase/server/genproto#ListUsersRequest. + } + for resp, err := range c.ListUsers(ctx, req).All() { + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +func ExampleIdentityClient_ListLocations_all() { + 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 := client.NewIdentityClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &locationpb.ListLocationsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest. + } + for resp, err := range c.ListLocations(ctx, req).All() { + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +func ExampleIdentityClient_ListOperations_all() { + 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 := client.NewIdentityClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.ListOperationsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest. + } + for resp, err := range c.ListOperations(ctx, req).All() { + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} diff --git a/client/messaging_client_example_go123_test.go b/client/messaging_client_example_go123_test.go new file mode 100644 index 000000000..94a9779a1 --- /dev/null +++ b/client/messaging_client_example_go123_test.go @@ -0,0 +1,132 @@ +// 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. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go_gapic. DO NOT EDIT. + +//go:build go1.23 + +package client_test + +import ( + "context" + + longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" + client "github.com/googleapis/gapic-showcase/client" + genprotopb "github.com/googleapis/gapic-showcase/server/genproto" + locationpb "google.golang.org/genproto/googleapis/cloud/location" +) + +func ExampleMessagingClient_ListBlurbs_all() { + 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 := client.NewMessagingClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &genprotopb.ListBlurbsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/github.com/googleapis/gapic-showcase/server/genproto#ListBlurbsRequest. + } + for resp, err := range c.ListBlurbs(ctx, req).All() { + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +func ExampleMessagingClient_ListRooms_all() { + 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 := client.NewMessagingClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &genprotopb.ListRoomsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/github.com/googleapis/gapic-showcase/server/genproto#ListRoomsRequest. + } + for resp, err := range c.ListRooms(ctx, req).All() { + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +func ExampleMessagingClient_ListLocations_all() { + 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 := client.NewMessagingClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &locationpb.ListLocationsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest. + } + for resp, err := range c.ListLocations(ctx, req).All() { + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +func ExampleMessagingClient_ListOperations_all() { + 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 := client.NewMessagingClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.ListOperationsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest. + } + for resp, err := range c.ListOperations(ctx, req).All() { + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} diff --git a/client/sequence_client_example_go123_test.go b/client/sequence_client_example_go123_test.go new file mode 100644 index 000000000..7c3693c4c --- /dev/null +++ b/client/sequence_client_example_go123_test.go @@ -0,0 +1,79 @@ +// 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. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go_gapic. DO NOT EDIT. + +//go:build go1.23 + +package client_test + +import ( + "context" + + longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" + client "github.com/googleapis/gapic-showcase/client" + locationpb "google.golang.org/genproto/googleapis/cloud/location" +) + +func ExampleSequenceClient_ListLocations_all() { + 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 := client.NewSequenceClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &locationpb.ListLocationsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest. + } + for resp, err := range c.ListLocations(ctx, req).All() { + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +func ExampleSequenceClient_ListOperations_all() { + 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 := client.NewSequenceClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.ListOperationsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest. + } + for resp, err := range c.ListOperations(ctx, req).All() { + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} diff --git a/client/testing_client_example_go123_test.go b/client/testing_client_example_go123_test.go new file mode 100644 index 000000000..63f3b322e --- /dev/null +++ b/client/testing_client_example_go123_test.go @@ -0,0 +1,132 @@ +// 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. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go_gapic. DO NOT EDIT. + +//go:build go1.23 + +package client_test + +import ( + "context" + + longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" + client "github.com/googleapis/gapic-showcase/client" + genprotopb "github.com/googleapis/gapic-showcase/server/genproto" + locationpb "google.golang.org/genproto/googleapis/cloud/location" +) + +func ExampleTestingClient_ListSessions_all() { + 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 := client.NewTestingClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &genprotopb.ListSessionsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/github.com/googleapis/gapic-showcase/server/genproto#ListSessionsRequest. + } + for resp, err := range c.ListSessions(ctx, req).All() { + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +func ExampleTestingClient_ListTests_all() { + 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 := client.NewTestingClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &genprotopb.ListTestsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/github.com/googleapis/gapic-showcase/server/genproto#ListTestsRequest. + } + for resp, err := range c.ListTests(ctx, req).All() { + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +func ExampleTestingClient_ListLocations_all() { + 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 := client.NewTestingClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &locationpb.ListLocationsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest. + } + for resp, err := range c.ListLocations(ctx, req).All() { + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +func ExampleTestingClient_ListOperations_all() { + 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 := client.NewTestingClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.ListOperationsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest. + } + for resp, err := range c.ListOperations(ctx, req).All() { + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} diff --git a/schema/googleapis b/schema/googleapis index 5db2bbe91..59254b411 160000 --- a/schema/googleapis +++ b/schema/googleapis @@ -1 +1 @@ -Subproject commit 5db2bbe911db5a01c6a7564f78e84f8116de91d3 +Subproject commit 59254b411ac63bbb9bcd4a54cec10540ceaa5154 diff --git a/server/genproto/compliance.pb.go b/server/genproto/compliance.pb.go index fa453510b..4f5e4b3a7 100644 --- a/server/genproto/compliance.pb.go +++ b/server/genproto/compliance.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.33.0 -// protoc v3.20.3 +// protoc v5.28.3 // source: google/showcase/v1beta1/compliance.proto package genproto diff --git a/server/genproto/echo.pb.go b/server/genproto/echo.pb.go index ebf0b959e..39a77fec8 100644 --- a/server/genproto/echo.pb.go +++ b/server/genproto/echo.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.33.0 -// protoc v3.20.3 +// protoc v5.28.3 // source: google/showcase/v1beta1/echo.proto package genproto diff --git a/server/genproto/identity.pb.go b/server/genproto/identity.pb.go index a07d999cf..987e05a25 100644 --- a/server/genproto/identity.pb.go +++ b/server/genproto/identity.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.33.0 -// protoc v3.20.3 +// protoc v5.28.3 // source: google/showcase/v1beta1/identity.proto package genproto diff --git a/server/genproto/messaging.pb.go b/server/genproto/messaging.pb.go index 06362181c..2b4ea9827 100644 --- a/server/genproto/messaging.pb.go +++ b/server/genproto/messaging.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.33.0 -// protoc v3.20.3 +// protoc v5.28.3 // source: google/showcase/v1beta1/messaging.proto package genproto diff --git a/server/genproto/sequence.pb.go b/server/genproto/sequence.pb.go index 81d8a2020..20101d270 100644 --- a/server/genproto/sequence.pb.go +++ b/server/genproto/sequence.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.33.0 -// protoc v3.20.3 +// protoc v5.28.3 // source: google/showcase/v1beta1/sequence.proto package genproto diff --git a/server/genproto/testing.pb.go b/server/genproto/testing.pb.go index 2e0b33451..9c2b08342 100644 --- a/server/genproto/testing.pb.go +++ b/server/genproto/testing.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.33.0 -// protoc v3.20.3 +// protoc v5.28.3 // source: google/showcase/v1beta1/testing.proto package genproto