// 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 networkservices_test import ( "context" iampb "cloud.google.com/go/iam/apiv1/iampb" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" networkservices "cloud.google.com/go/networkservices/apiv1" networkservicespb "cloud.google.com/go/networkservices/apiv1/networkservicespb" "google.golang.org/api/iterator" locationpb "google.golang.org/genproto/googleapis/cloud/location" ) 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c } 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 := networkservices.NewRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c } func ExampleClient_CreateEndpointPolicy() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.CreateEndpointPolicyRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#CreateEndpointPolicyRequest. } op, err := c.CreateEndpointPolicy(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleClient_CreateGateway() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.CreateGatewayRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#CreateGatewayRequest. } op, err := c.CreateGateway(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleClient_CreateGrpcRoute() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.CreateGrpcRouteRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#CreateGrpcRouteRequest. } op, err := c.CreateGrpcRoute(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleClient_CreateHttpRoute() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.CreateHttpRouteRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#CreateHttpRouteRequest. } op, err := c.CreateHttpRoute(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleClient_CreateMesh() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.CreateMeshRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#CreateMeshRequest. } op, err := c.CreateMesh(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleClient_CreateServiceBinding() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.CreateServiceBindingRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#CreateServiceBindingRequest. } op, err := c.CreateServiceBinding(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleClient_CreateServiceLbPolicy() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.CreateServiceLbPolicyRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#CreateServiceLbPolicyRequest. } op, err := c.CreateServiceLbPolicy(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleClient_CreateTcpRoute() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.CreateTcpRouteRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#CreateTcpRouteRequest. } op, err := c.CreateTcpRoute(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleClient_CreateTlsRoute() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.CreateTlsRouteRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#CreateTlsRouteRequest. } op, err := c.CreateTlsRoute(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleClient_CreateWasmPlugin() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.CreateWasmPluginRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#CreateWasmPluginRequest. } op, err := c.CreateWasmPlugin(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleClient_CreateWasmPluginVersion() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.CreateWasmPluginVersionRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#CreateWasmPluginVersionRequest. } op, err := c.CreateWasmPluginVersion(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleClient_DeleteEndpointPolicy() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.DeleteEndpointPolicyRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#DeleteEndpointPolicyRequest. } op, err := c.DeleteEndpointPolicy(ctx, req) if err != nil { // TODO: Handle error. } err = op.Wait(ctx) if err != nil { // TODO: Handle error. } } func ExampleClient_DeleteGateway() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.DeleteGatewayRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#DeleteGatewayRequest. } op, err := c.DeleteGateway(ctx, req) if err != nil { // TODO: Handle error. } err = op.Wait(ctx) if err != nil { // TODO: Handle error. } } func ExampleClient_DeleteGrpcRoute() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.DeleteGrpcRouteRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#DeleteGrpcRouteRequest. } op, err := c.DeleteGrpcRoute(ctx, req) if err != nil { // TODO: Handle error. } err = op.Wait(ctx) if err != nil { // TODO: Handle error. } } func ExampleClient_DeleteHttpRoute() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.DeleteHttpRouteRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#DeleteHttpRouteRequest. } op, err := c.DeleteHttpRoute(ctx, req) if err != nil { // TODO: Handle error. } err = op.Wait(ctx) if err != nil { // TODO: Handle error. } } func ExampleClient_DeleteMesh() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.DeleteMeshRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#DeleteMeshRequest. } op, err := c.DeleteMesh(ctx, req) if err != nil { // TODO: Handle error. } err = op.Wait(ctx) if err != nil { // TODO: Handle error. } } func ExampleClient_DeleteServiceBinding() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.DeleteServiceBindingRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#DeleteServiceBindingRequest. } op, err := c.DeleteServiceBinding(ctx, req) if err != nil { // TODO: Handle error. } err = op.Wait(ctx) if err != nil { // TODO: Handle error. } } func ExampleClient_DeleteServiceLbPolicy() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.DeleteServiceLbPolicyRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#DeleteServiceLbPolicyRequest. } op, err := c.DeleteServiceLbPolicy(ctx, req) if err != nil { // TODO: Handle error. } err = op.Wait(ctx) if err != nil { // TODO: Handle error. } } func ExampleClient_DeleteTcpRoute() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.DeleteTcpRouteRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#DeleteTcpRouteRequest. } op, err := c.DeleteTcpRoute(ctx, req) if err != nil { // TODO: Handle error. } err = op.Wait(ctx) if err != nil { // TODO: Handle error. } } func ExampleClient_DeleteTlsRoute() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.DeleteTlsRouteRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#DeleteTlsRouteRequest. } op, err := c.DeleteTlsRoute(ctx, req) if err != nil { // TODO: Handle error. } err = op.Wait(ctx) if err != nil { // TODO: Handle error. } } func ExampleClient_DeleteWasmPlugin() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.DeleteWasmPluginRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#DeleteWasmPluginRequest. } op, err := c.DeleteWasmPlugin(ctx, req) if err != nil { // TODO: Handle error. } err = op.Wait(ctx) if err != nil { // TODO: Handle error. } } func ExampleClient_DeleteWasmPluginVersion() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.DeleteWasmPluginVersionRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#DeleteWasmPluginVersionRequest. } op, err := c.DeleteWasmPluginVersion(ctx, req) if err != nil { // TODO: Handle error. } err = op.Wait(ctx) if err != nil { // TODO: Handle error. } } func ExampleClient_GetEndpointPolicy() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.GetEndpointPolicyRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#GetEndpointPolicyRequest. } resp, err := c.GetEndpointPolicy(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleClient_GetGateway() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.GetGatewayRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#GetGatewayRequest. } resp, err := c.GetGateway(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleClient_GetGatewayRouteView() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.GetGatewayRouteViewRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#GetGatewayRouteViewRequest. } resp, err := c.GetGatewayRouteView(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleClient_GetGrpcRoute() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.GetGrpcRouteRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#GetGrpcRouteRequest. } resp, err := c.GetGrpcRoute(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleClient_GetHttpRoute() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.GetHttpRouteRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#GetHttpRouteRequest. } resp, err := c.GetHttpRoute(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleClient_GetMesh() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.GetMeshRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#GetMeshRequest. } resp, err := c.GetMesh(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleClient_GetMeshRouteView() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.GetMeshRouteViewRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#GetMeshRouteViewRequest. } resp, err := c.GetMeshRouteView(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleClient_GetServiceBinding() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.GetServiceBindingRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#GetServiceBindingRequest. } resp, err := c.GetServiceBinding(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleClient_GetServiceLbPolicy() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.GetServiceLbPolicyRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#GetServiceLbPolicyRequest. } resp, err := c.GetServiceLbPolicy(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleClient_GetTcpRoute() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.GetTcpRouteRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#GetTcpRouteRequest. } resp, err := c.GetTcpRoute(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleClient_GetTlsRoute() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.GetTlsRouteRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#GetTlsRouteRequest. } resp, err := c.GetTlsRoute(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleClient_GetWasmPlugin() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.GetWasmPluginRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#GetWasmPluginRequest. } resp, err := c.GetWasmPlugin(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleClient_GetWasmPluginVersion() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.GetWasmPluginVersionRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#GetWasmPluginVersionRequest. } resp, err := c.GetWasmPluginVersion(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleClient_ListEndpointPolicies() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.ListEndpointPoliciesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#ListEndpointPoliciesRequest. } it := c.ListEndpointPolicies(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.(*networkservicespb.ListEndpointPoliciesResponse) } } func ExampleClient_ListGatewayRouteViews() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.ListGatewayRouteViewsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#ListGatewayRouteViewsRequest. } it := c.ListGatewayRouteViews(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.(*networkservicespb.ListGatewayRouteViewsResponse) } } func ExampleClient_ListGateways() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.ListGatewaysRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#ListGatewaysRequest. } it := c.ListGateways(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.(*networkservicespb.ListGatewaysResponse) } } func ExampleClient_ListGrpcRoutes() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.ListGrpcRoutesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#ListGrpcRoutesRequest. } it := c.ListGrpcRoutes(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.(*networkservicespb.ListGrpcRoutesResponse) } } func ExampleClient_ListHttpRoutes() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.ListHttpRoutesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#ListHttpRoutesRequest. } it := c.ListHttpRoutes(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.(*networkservicespb.ListHttpRoutesResponse) } } func ExampleClient_ListMeshRouteViews() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.ListMeshRouteViewsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#ListMeshRouteViewsRequest. } it := c.ListMeshRouteViews(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.(*networkservicespb.ListMeshRouteViewsResponse) } } func ExampleClient_ListMeshes() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.ListMeshesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#ListMeshesRequest. } it := c.ListMeshes(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.(*networkservicespb.ListMeshesResponse) } } func ExampleClient_ListServiceBindings() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.ListServiceBindingsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#ListServiceBindingsRequest. } it := c.ListServiceBindings(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.(*networkservicespb.ListServiceBindingsResponse) } } func ExampleClient_ListServiceLbPolicies() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.ListServiceLbPoliciesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#ListServiceLbPoliciesRequest. } it := c.ListServiceLbPolicies(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.(*networkservicespb.ListServiceLbPoliciesResponse) } } func ExampleClient_ListTcpRoutes() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.ListTcpRoutesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#ListTcpRoutesRequest. } it := c.ListTcpRoutes(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.(*networkservicespb.ListTcpRoutesResponse) } } func ExampleClient_ListTlsRoutes() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.ListTlsRoutesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#ListTlsRoutesRequest. } it := c.ListTlsRoutes(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.(*networkservicespb.ListTlsRoutesResponse) } } func ExampleClient_ListWasmPluginVersions() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.ListWasmPluginVersionsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#ListWasmPluginVersionsRequest. } it := c.ListWasmPluginVersions(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.(*networkservicespb.ListWasmPluginVersionsResponse) } } func ExampleClient_ListWasmPlugins() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.ListWasmPluginsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#ListWasmPluginsRequest. } it := c.ListWasmPlugins(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.(*networkservicespb.ListWasmPluginsResponse) } } func ExampleClient_UpdateEndpointPolicy() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.UpdateEndpointPolicyRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#UpdateEndpointPolicyRequest. } op, err := c.UpdateEndpointPolicy(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleClient_UpdateGateway() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.UpdateGatewayRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#UpdateGatewayRequest. } op, err := c.UpdateGateway(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleClient_UpdateGrpcRoute() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.UpdateGrpcRouteRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#UpdateGrpcRouteRequest. } op, err := c.UpdateGrpcRoute(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleClient_UpdateHttpRoute() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.UpdateHttpRouteRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#UpdateHttpRouteRequest. } op, err := c.UpdateHttpRoute(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleClient_UpdateMesh() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.UpdateMeshRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#UpdateMeshRequest. } op, err := c.UpdateMesh(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleClient_UpdateServiceBinding() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.UpdateServiceBindingRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#UpdateServiceBindingRequest. } op, err := c.UpdateServiceBinding(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleClient_UpdateServiceLbPolicy() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.UpdateServiceLbPolicyRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#UpdateServiceLbPolicyRequest. } op, err := c.UpdateServiceLbPolicy(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleClient_UpdateTcpRoute() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.UpdateTcpRouteRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#UpdateTcpRouteRequest. } op, err := c.UpdateTcpRoute(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleClient_UpdateTlsRoute() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.UpdateTlsRouteRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#UpdateTlsRouteRequest. } op, err := c.UpdateTlsRoute(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } func ExampleClient_UpdateWasmPlugin() { 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &networkservicespb.UpdateWasmPluginRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1/networkservicespb#UpdateWasmPluginRequest. } op, err := c.UpdateWasmPlugin(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } 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 := networkservices.NewClient(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 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 := networkservices.NewClient(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 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &iampb.GetIamPolicyRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#GetIamPolicyRequest. } resp, err := c.GetIamPolicy(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &iampb.SetIamPolicyRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#SetIamPolicyRequest. } resp, err := c.SetIamPolicy(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } 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 := networkservices.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &iampb.TestIamPermissionsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#TestIamPermissionsRequest. } resp, err := c.TestIamPermissions(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } 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 := networkservices.NewClient(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 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 := networkservices.NewClient(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 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 := networkservices.NewClient(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 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 := networkservices.NewClient(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) } }