// Copyright 2025 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 schemaregistry_test import ( "context" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" schemaregistry "cloud.google.com/go/managedkafka/schemaregistry/apiv1" schemaregistrypb "cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb" "google.golang.org/api/iterator" locationpb "google.golang.org/genproto/googleapis/cloud/location" ) func ExampleNewManagedSchemaRegistryClient() { 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 := schemaregistry.NewManagedSchemaRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c } func ExampleNewManagedSchemaRegistryRESTClient() { 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 := schemaregistry.NewManagedSchemaRegistryRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c } func ExampleManagedSchemaRegistryClient_CheckCompatibility() { 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 := schemaregistry.NewManagedSchemaRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &schemaregistrypb.CheckCompatibilityRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#CheckCompatibilityRequest. } resp, err := c.CheckCompatibility(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleManagedSchemaRegistryClient_CreateSchemaRegistry() { 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 := schemaregistry.NewManagedSchemaRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &schemaregistrypb.CreateSchemaRegistryRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#CreateSchemaRegistryRequest. } resp, err := c.CreateSchemaRegistry(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleManagedSchemaRegistryClient_CreateVersion() { 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 := schemaregistry.NewManagedSchemaRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &schemaregistrypb.CreateVersionRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#CreateVersionRequest. } resp, err := c.CreateVersion(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleManagedSchemaRegistryClient_DeleteSchemaConfig() { 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 := schemaregistry.NewManagedSchemaRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &schemaregistrypb.DeleteSchemaConfigRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#DeleteSchemaConfigRequest. } resp, err := c.DeleteSchemaConfig(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleManagedSchemaRegistryClient_DeleteSchemaMode() { 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 := schemaregistry.NewManagedSchemaRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &schemaregistrypb.DeleteSchemaModeRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#DeleteSchemaModeRequest. } resp, err := c.DeleteSchemaMode(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleManagedSchemaRegistryClient_DeleteSchemaRegistry() { 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 := schemaregistry.NewManagedSchemaRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &schemaregistrypb.DeleteSchemaRegistryRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#DeleteSchemaRegistryRequest. } err = c.DeleteSchemaRegistry(ctx, req) if err != nil { // TODO: Handle error. } } func ExampleManagedSchemaRegistryClient_DeleteSubject() { 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 := schemaregistry.NewManagedSchemaRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &schemaregistrypb.DeleteSubjectRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#DeleteSubjectRequest. } resp, err := c.DeleteSubject(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleManagedSchemaRegistryClient_DeleteVersion() { 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 := schemaregistry.NewManagedSchemaRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &schemaregistrypb.DeleteVersionRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#DeleteVersionRequest. } resp, err := c.DeleteVersion(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleManagedSchemaRegistryClient_GetContext() { 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 := schemaregistry.NewManagedSchemaRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &schemaregistrypb.GetContextRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#GetContextRequest. } resp, err := c.GetContext(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleManagedSchemaRegistryClient_GetRawSchema() { 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 := schemaregistry.NewManagedSchemaRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &schemaregistrypb.GetSchemaRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#GetSchemaRequest. } resp, err := c.GetRawSchema(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleManagedSchemaRegistryClient_GetRawSchemaVersion() { 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 := schemaregistry.NewManagedSchemaRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &schemaregistrypb.GetVersionRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#GetVersionRequest. } resp, err := c.GetRawSchemaVersion(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleManagedSchemaRegistryClient_GetSchema() { 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 := schemaregistry.NewManagedSchemaRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &schemaregistrypb.GetSchemaRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#GetSchemaRequest. } resp, err := c.GetSchema(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleManagedSchemaRegistryClient_GetSchemaConfig() { 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 := schemaregistry.NewManagedSchemaRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &schemaregistrypb.GetSchemaConfigRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#GetSchemaConfigRequest. } resp, err := c.GetSchemaConfig(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleManagedSchemaRegistryClient_GetSchemaMode() { 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 := schemaregistry.NewManagedSchemaRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &schemaregistrypb.GetSchemaModeRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#GetSchemaModeRequest. } resp, err := c.GetSchemaMode(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleManagedSchemaRegistryClient_GetSchemaRegistry() { 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 := schemaregistry.NewManagedSchemaRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &schemaregistrypb.GetSchemaRegistryRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#GetSchemaRegistryRequest. } resp, err := c.GetSchemaRegistry(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleManagedSchemaRegistryClient_GetVersion() { 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 := schemaregistry.NewManagedSchemaRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &schemaregistrypb.GetVersionRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#GetVersionRequest. } resp, err := c.GetVersion(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleManagedSchemaRegistryClient_ListContexts() { 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 := schemaregistry.NewManagedSchemaRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &schemaregistrypb.ListContextsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#ListContextsRequest. } resp, err := c.ListContexts(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleManagedSchemaRegistryClient_ListReferencedSchemas() { 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 := schemaregistry.NewManagedSchemaRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &schemaregistrypb.ListReferencedSchemasRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#ListReferencedSchemasRequest. } resp, err := c.ListReferencedSchemas(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleManagedSchemaRegistryClient_ListSchemaRegistries() { 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 := schemaregistry.NewManagedSchemaRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &schemaregistrypb.ListSchemaRegistriesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#ListSchemaRegistriesRequest. } resp, err := c.ListSchemaRegistries(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleManagedSchemaRegistryClient_ListSchemaTypes() { 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 := schemaregistry.NewManagedSchemaRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &schemaregistrypb.ListSchemaTypesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#ListSchemaTypesRequest. } resp, err := c.ListSchemaTypes(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleManagedSchemaRegistryClient_ListSchemaVersions() { 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 := schemaregistry.NewManagedSchemaRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &schemaregistrypb.ListSchemaVersionsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#ListSchemaVersionsRequest. } resp, err := c.ListSchemaVersions(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleManagedSchemaRegistryClient_ListSubjects() { 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 := schemaregistry.NewManagedSchemaRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &schemaregistrypb.ListSubjectsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#ListSubjectsRequest. } resp, err := c.ListSubjects(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleManagedSchemaRegistryClient_ListSubjectsBySchemaId() { 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 := schemaregistry.NewManagedSchemaRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &schemaregistrypb.ListSubjectsBySchemaIdRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#ListSubjectsBySchemaIdRequest. } resp, err := c.ListSubjectsBySchemaId(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleManagedSchemaRegistryClient_ListVersions() { 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 := schemaregistry.NewManagedSchemaRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &schemaregistrypb.ListVersionsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#ListVersionsRequest. } resp, err := c.ListVersions(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleManagedSchemaRegistryClient_LookupVersion() { 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 := schemaregistry.NewManagedSchemaRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &schemaregistrypb.LookupVersionRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#LookupVersionRequest. } resp, err := c.LookupVersion(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleManagedSchemaRegistryClient_UpdateSchemaConfig() { 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 := schemaregistry.NewManagedSchemaRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &schemaregistrypb.UpdateSchemaConfigRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#UpdateSchemaConfigRequest. } resp, err := c.UpdateSchemaConfig(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleManagedSchemaRegistryClient_UpdateSchemaMode() { 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 := schemaregistry.NewManagedSchemaRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &schemaregistrypb.UpdateSchemaModeRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/managedkafka/schemaregistry/apiv1/schemaregistrypb#UpdateSchemaModeRequest. } resp, err := c.UpdateSchemaMode(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleManagedSchemaRegistryClient_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 := schemaregistry.NewManagedSchemaRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &locationpb.GetLocationRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#GetLocationRequest. } resp, err := c.GetLocation(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleManagedSchemaRegistryClient_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 := schemaregistry.NewManagedSchemaRegistryClient(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. } it := c.ListLocations(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp // If you need to access the underlying RPC response, // you can do so by casting the `Response` as below. // Otherwise, remove this line. Only populated after // first call to Next(). Not safe for concurrent access. _ = it.Response.(*locationpb.ListLocationsResponse) } } func ExampleManagedSchemaRegistryClient_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 := schemaregistry.NewManagedSchemaRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &longrunningpb.CancelOperationRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest. } err = c.CancelOperation(ctx, req) if err != nil { // TODO: Handle error. } } func ExampleManagedSchemaRegistryClient_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 := schemaregistry.NewManagedSchemaRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &longrunningpb.DeleteOperationRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest. } err = c.DeleteOperation(ctx, req) if err != nil { // TODO: Handle error. } } func ExampleManagedSchemaRegistryClient_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 := schemaregistry.NewManagedSchemaRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &longrunningpb.GetOperationRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest. } resp, err := c.GetOperation(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleManagedSchemaRegistryClient_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 := schemaregistry.NewManagedSchemaRegistryClient(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. } it := c.ListOperations(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp // If you need to access the underlying RPC response, // you can do so by casting the `Response` as below. // Otherwise, remove this line. Only populated after // first call to Next(). Not safe for concurrent access. _ = it.Response.(*longrunningpb.ListOperationsResponse) } }