| // Copyright 2023 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 baremetalsolution_test |
| |
| import ( |
| "context" |
| |
| baremetalsolution "cloud.google.com/go/baremetalsolution/apiv2" |
| baremetalsolutionpb "cloud.google.com/go/baremetalsolution/apiv2/baremetalsolutionpb" |
| "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 := baremetalsolution.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 := baremetalsolution.NewRESTClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| // TODO: Use client. |
| _ = c |
| } |
| |
| func ExampleClient_ListInstances() { |
| 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 := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &baremetalsolutionpb.ListInstancesRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/baremetalsolution/apiv2/baremetalsolutionpb#ListInstancesRequest. |
| } |
| it := c.ListInstances(ctx, req) |
| for { |
| resp, err := it.Next() |
| if err == iterator.Done { |
| break |
| } |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| } |
| |
| func ExampleClient_GetInstance() { |
| 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 := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &baremetalsolutionpb.GetInstanceRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/baremetalsolution/apiv2/baremetalsolutionpb#GetInstanceRequest. |
| } |
| resp, err := c.GetInstance(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_UpdateInstance() { |
| 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 := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &baremetalsolutionpb.UpdateInstanceRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/baremetalsolution/apiv2/baremetalsolutionpb#UpdateInstanceRequest. |
| } |
| op, err := c.UpdateInstance(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_ResetInstance() { |
| 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 := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &baremetalsolutionpb.ResetInstanceRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/baremetalsolution/apiv2/baremetalsolutionpb#ResetInstanceRequest. |
| } |
| op, err := c.ResetInstance(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_StartInstance() { |
| 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 := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &baremetalsolutionpb.StartInstanceRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/baremetalsolution/apiv2/baremetalsolutionpb#StartInstanceRequest. |
| } |
| op, err := c.StartInstance(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_StopInstance() { |
| 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 := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &baremetalsolutionpb.StopInstanceRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/baremetalsolution/apiv2/baremetalsolutionpb#StopInstanceRequest. |
| } |
| op, err := c.StopInstance(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_DetachLun() { |
| 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 := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &baremetalsolutionpb.DetachLunRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/baremetalsolution/apiv2/baremetalsolutionpb#DetachLunRequest. |
| } |
| op, err := c.DetachLun(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_ListVolumes() { |
| 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 := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &baremetalsolutionpb.ListVolumesRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/baremetalsolution/apiv2/baremetalsolutionpb#ListVolumesRequest. |
| } |
| it := c.ListVolumes(ctx, req) |
| for { |
| resp, err := it.Next() |
| if err == iterator.Done { |
| break |
| } |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| } |
| |
| func ExampleClient_GetVolume() { |
| 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 := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &baremetalsolutionpb.GetVolumeRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/baremetalsolution/apiv2/baremetalsolutionpb#GetVolumeRequest. |
| } |
| resp, err := c.GetVolume(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_UpdateVolume() { |
| 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 := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &baremetalsolutionpb.UpdateVolumeRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/baremetalsolution/apiv2/baremetalsolutionpb#UpdateVolumeRequest. |
| } |
| op, err := c.UpdateVolume(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_ResizeVolume() { |
| 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 := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &baremetalsolutionpb.ResizeVolumeRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/baremetalsolution/apiv2/baremetalsolutionpb#ResizeVolumeRequest. |
| } |
| op, err := c.ResizeVolume(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_ListNetworks() { |
| 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 := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &baremetalsolutionpb.ListNetworksRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/baremetalsolution/apiv2/baremetalsolutionpb#ListNetworksRequest. |
| } |
| it := c.ListNetworks(ctx, req) |
| for { |
| resp, err := it.Next() |
| if err == iterator.Done { |
| break |
| } |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| } |
| |
| func ExampleClient_ListNetworkUsage() { |
| 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 := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &baremetalsolutionpb.ListNetworkUsageRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/baremetalsolution/apiv2/baremetalsolutionpb#ListNetworkUsageRequest. |
| } |
| resp, err := c.ListNetworkUsage(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_GetNetwork() { |
| 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 := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &baremetalsolutionpb.GetNetworkRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/baremetalsolution/apiv2/baremetalsolutionpb#GetNetworkRequest. |
| } |
| resp, err := c.GetNetwork(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_UpdateNetwork() { |
| 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 := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &baremetalsolutionpb.UpdateNetworkRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/baremetalsolution/apiv2/baremetalsolutionpb#UpdateNetworkRequest. |
| } |
| op, err := c.UpdateNetwork(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_GetLun() { |
| 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 := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &baremetalsolutionpb.GetLunRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/baremetalsolution/apiv2/baremetalsolutionpb#GetLunRequest. |
| } |
| resp, err := c.GetLun(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_ListLuns() { |
| 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 := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &baremetalsolutionpb.ListLunsRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/baremetalsolution/apiv2/baremetalsolutionpb#ListLunsRequest. |
| } |
| it := c.ListLuns(ctx, req) |
| for { |
| resp, err := it.Next() |
| if err == iterator.Done { |
| break |
| } |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| } |
| |
| func ExampleClient_GetNfsShare() { |
| 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 := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &baremetalsolutionpb.GetNfsShareRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/baremetalsolution/apiv2/baremetalsolutionpb#GetNfsShareRequest. |
| } |
| resp, err := c.GetNfsShare(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_ListNfsShares() { |
| 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 := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &baremetalsolutionpb.ListNfsSharesRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/baremetalsolution/apiv2/baremetalsolutionpb#ListNfsSharesRequest. |
| } |
| it := c.ListNfsShares(ctx, req) |
| for { |
| resp, err := it.Next() |
| if err == iterator.Done { |
| break |
| } |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| } |
| |
| func ExampleClient_UpdateNfsShare() { |
| 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 := baremetalsolution.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &baremetalsolutionpb.UpdateNfsShareRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/baremetalsolution/apiv2/baremetalsolutionpb#UpdateNfsShareRequest. |
| } |
| op, err := c.UpdateNfsShare(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 := baremetalsolution.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 := baremetalsolution.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 |
| } |
| } |