| // Copyright 2024 Google LLC |
| // |
| // Licensed under the Apache License, Version 2.0 (the "License"); |
| // you may not use this file except in compliance with the License. |
| // You may obtain a copy of the License at |
| // |
| // https://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| |
| // Code generated by protoc-gen-go_gapic. DO NOT EDIT. |
| |
| package deploy_test |
| |
| import ( |
| "context" |
| |
| deploy "cloud.google.com/go/deploy/apiv1" |
| deploypb "cloud.google.com/go/deploy/apiv1/deploypb" |
| iampb "cloud.google.com/go/iam/apiv1/iampb" |
| longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" |
| "google.golang.org/api/iterator" |
| locationpb "google.golang.org/genproto/googleapis/cloud/location" |
| ) |
| |
| func ExampleNewCloudDeployClient() { |
| 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 := deploy.NewCloudDeployClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| // TODO: Use client. |
| _ = c |
| } |
| |
| func ExampleNewCloudDeployRESTClient() { |
| 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 := deploy.NewCloudDeployRESTClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| // TODO: Use client. |
| _ = c |
| } |
| |
| func ExampleCloudDeployClient_AbandonRelease() { |
| 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 := deploy.NewCloudDeployClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &deploypb.AbandonReleaseRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/deploy/apiv1/deploypb#AbandonReleaseRequest. |
| } |
| resp, err := c.AbandonRelease(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleCloudDeployClient_AdvanceRollout() { |
| 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 := deploy.NewCloudDeployClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &deploypb.AdvanceRolloutRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/deploy/apiv1/deploypb#AdvanceRolloutRequest. |
| } |
| resp, err := c.AdvanceRollout(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleCloudDeployClient_ApproveRollout() { |
| 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 := deploy.NewCloudDeployClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &deploypb.ApproveRolloutRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/deploy/apiv1/deploypb#ApproveRolloutRequest. |
| } |
| resp, err := c.ApproveRollout(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleCloudDeployClient_CancelAutomationRun() { |
| 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 := deploy.NewCloudDeployClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &deploypb.CancelAutomationRunRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/deploy/apiv1/deploypb#CancelAutomationRunRequest. |
| } |
| resp, err := c.CancelAutomationRun(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleCloudDeployClient_CancelRollout() { |
| 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 := deploy.NewCloudDeployClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &deploypb.CancelRolloutRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/deploy/apiv1/deploypb#CancelRolloutRequest. |
| } |
| resp, err := c.CancelRollout(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleCloudDeployClient_CreateAutomation() { |
| 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 := deploy.NewCloudDeployClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &deploypb.CreateAutomationRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/deploy/apiv1/deploypb#CreateAutomationRequest. |
| } |
| op, err := c.CreateAutomation(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| resp, err := op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleCloudDeployClient_CreateCustomTargetType() { |
| 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 := deploy.NewCloudDeployClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &deploypb.CreateCustomTargetTypeRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/deploy/apiv1/deploypb#CreateCustomTargetTypeRequest. |
| } |
| op, err := c.CreateCustomTargetType(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| resp, err := op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleCloudDeployClient_CreateDeliveryPipeline() { |
| 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 := deploy.NewCloudDeployClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &deploypb.CreateDeliveryPipelineRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/deploy/apiv1/deploypb#CreateDeliveryPipelineRequest. |
| } |
| op, err := c.CreateDeliveryPipeline(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| resp, err := op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleCloudDeployClient_CreateRelease() { |
| 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 := deploy.NewCloudDeployClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &deploypb.CreateReleaseRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/deploy/apiv1/deploypb#CreateReleaseRequest. |
| } |
| op, err := c.CreateRelease(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| resp, err := op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleCloudDeployClient_CreateRollout() { |
| 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 := deploy.NewCloudDeployClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &deploypb.CreateRolloutRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/deploy/apiv1/deploypb#CreateRolloutRequest. |
| } |
| op, err := c.CreateRollout(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| resp, err := op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleCloudDeployClient_CreateTarget() { |
| 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 := deploy.NewCloudDeployClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &deploypb.CreateTargetRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/deploy/apiv1/deploypb#CreateTargetRequest. |
| } |
| op, err := c.CreateTarget(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| resp, err := op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleCloudDeployClient_DeleteAutomation() { |
| 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 := deploy.NewCloudDeployClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &deploypb.DeleteAutomationRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/deploy/apiv1/deploypb#DeleteAutomationRequest. |
| } |
| op, err := c.DeleteAutomation(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| err = op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleCloudDeployClient_DeleteCustomTargetType() { |
| 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 := deploy.NewCloudDeployClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &deploypb.DeleteCustomTargetTypeRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/deploy/apiv1/deploypb#DeleteCustomTargetTypeRequest. |
| } |
| op, err := c.DeleteCustomTargetType(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| err = op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleCloudDeployClient_DeleteDeliveryPipeline() { |
| 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 := deploy.NewCloudDeployClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &deploypb.DeleteDeliveryPipelineRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/deploy/apiv1/deploypb#DeleteDeliveryPipelineRequest. |
| } |
| op, err := c.DeleteDeliveryPipeline(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| err = op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleCloudDeployClient_DeleteTarget() { |
| 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 := deploy.NewCloudDeployClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &deploypb.DeleteTargetRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/deploy/apiv1/deploypb#DeleteTargetRequest. |
| } |
| op, err := c.DeleteTarget(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| err = op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleCloudDeployClient_GetAutomation() { |
| 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 := deploy.NewCloudDeployClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &deploypb.GetAutomationRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/deploy/apiv1/deploypb#GetAutomationRequest. |
| } |
| resp, err := c.GetAutomation(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleCloudDeployClient_GetAutomationRun() { |
| 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 := deploy.NewCloudDeployClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &deploypb.GetAutomationRunRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/deploy/apiv1/deploypb#GetAutomationRunRequest. |
| } |
| resp, err := c.GetAutomationRun(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleCloudDeployClient_GetConfig() { |
| 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 := deploy.NewCloudDeployClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &deploypb.GetConfigRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/deploy/apiv1/deploypb#GetConfigRequest. |
| } |
| resp, err := c.GetConfig(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleCloudDeployClient_GetCustomTargetType() { |
| 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 := deploy.NewCloudDeployClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &deploypb.GetCustomTargetTypeRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/deploy/apiv1/deploypb#GetCustomTargetTypeRequest. |
| } |
| resp, err := c.GetCustomTargetType(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleCloudDeployClient_GetDeliveryPipeline() { |
| 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 := deploy.NewCloudDeployClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &deploypb.GetDeliveryPipelineRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/deploy/apiv1/deploypb#GetDeliveryPipelineRequest. |
| } |
| resp, err := c.GetDeliveryPipeline(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleCloudDeployClient_GetJobRun() { |
| 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 := deploy.NewCloudDeployClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &deploypb.GetJobRunRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/deploy/apiv1/deploypb#GetJobRunRequest. |
| } |
| resp, err := c.GetJobRun(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleCloudDeployClient_GetRelease() { |
| 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 := deploy.NewCloudDeployClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &deploypb.GetReleaseRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/deploy/apiv1/deploypb#GetReleaseRequest. |
| } |
| resp, err := c.GetRelease(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleCloudDeployClient_GetRollout() { |
| 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 := deploy.NewCloudDeployClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &deploypb.GetRolloutRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/deploy/apiv1/deploypb#GetRolloutRequest. |
| } |
| resp, err := c.GetRollout(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleCloudDeployClient_GetTarget() { |
| 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 := deploy.NewCloudDeployClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &deploypb.GetTargetRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/deploy/apiv1/deploypb#GetTargetRequest. |
| } |
| resp, err := c.GetTarget(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleCloudDeployClient_IgnoreJob() { |
| 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 := deploy.NewCloudDeployClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &deploypb.IgnoreJobRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/deploy/apiv1/deploypb#IgnoreJobRequest. |
| } |
| resp, err := c.IgnoreJob(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleCloudDeployClient_ListAutomationRuns() { |
| 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 := deploy.NewCloudDeployClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &deploypb.ListAutomationRunsRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/deploy/apiv1/deploypb#ListAutomationRunsRequest. |
| } |
| it := c.ListAutomationRuns(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.(*deploypb.ListAutomationRunsResponse) |
| } |
| } |
| |
| func ExampleCloudDeployClient_ListAutomations() { |
| 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 := deploy.NewCloudDeployClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &deploypb.ListAutomationsRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/deploy/apiv1/deploypb#ListAutomationsRequest. |
| } |
| it := c.ListAutomations(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.(*deploypb.ListAutomationsResponse) |
| } |
| } |
| |
| func ExampleCloudDeployClient_ListCustomTargetTypes() { |
| 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 := deploy.NewCloudDeployClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &deploypb.ListCustomTargetTypesRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/deploy/apiv1/deploypb#ListCustomTargetTypesRequest. |
| } |
| it := c.ListCustomTargetTypes(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.(*deploypb.ListCustomTargetTypesResponse) |
| } |
| } |
| |
| func ExampleCloudDeployClient_ListDeliveryPipelines() { |
| 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 := deploy.NewCloudDeployClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &deploypb.ListDeliveryPipelinesRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/deploy/apiv1/deploypb#ListDeliveryPipelinesRequest. |
| } |
| it := c.ListDeliveryPipelines(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.(*deploypb.ListDeliveryPipelinesResponse) |
| } |
| } |
| |
| func ExampleCloudDeployClient_ListJobRuns() { |
| 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 := deploy.NewCloudDeployClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &deploypb.ListJobRunsRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/deploy/apiv1/deploypb#ListJobRunsRequest. |
| } |
| it := c.ListJobRuns(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.(*deploypb.ListJobRunsResponse) |
| } |
| } |
| |
| func ExampleCloudDeployClient_ListReleases() { |
| 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 := deploy.NewCloudDeployClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &deploypb.ListReleasesRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/deploy/apiv1/deploypb#ListReleasesRequest. |
| } |
| it := c.ListReleases(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.(*deploypb.ListReleasesResponse) |
| } |
| } |
| |
| func ExampleCloudDeployClient_ListRollouts() { |
| 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 := deploy.NewCloudDeployClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &deploypb.ListRolloutsRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/deploy/apiv1/deploypb#ListRolloutsRequest. |
| } |
| it := c.ListRollouts(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.(*deploypb.ListRolloutsResponse) |
| } |
| } |
| |
| func ExampleCloudDeployClient_ListTargets() { |
| 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 := deploy.NewCloudDeployClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &deploypb.ListTargetsRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/deploy/apiv1/deploypb#ListTargetsRequest. |
| } |
| it := c.ListTargets(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.(*deploypb.ListTargetsResponse) |
| } |
| } |
| |
| func ExampleCloudDeployClient_RetryJob() { |
| 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 := deploy.NewCloudDeployClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &deploypb.RetryJobRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/deploy/apiv1/deploypb#RetryJobRequest. |
| } |
| resp, err := c.RetryJob(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleCloudDeployClient_RollbackTarget() { |
| 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 := deploy.NewCloudDeployClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &deploypb.RollbackTargetRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/deploy/apiv1/deploypb#RollbackTargetRequest. |
| } |
| resp, err := c.RollbackTarget(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleCloudDeployClient_TerminateJobRun() { |
| 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 := deploy.NewCloudDeployClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &deploypb.TerminateJobRunRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/deploy/apiv1/deploypb#TerminateJobRunRequest. |
| } |
| resp, err := c.TerminateJobRun(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleCloudDeployClient_UpdateAutomation() { |
| 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 := deploy.NewCloudDeployClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &deploypb.UpdateAutomationRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/deploy/apiv1/deploypb#UpdateAutomationRequest. |
| } |
| op, err := c.UpdateAutomation(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| resp, err := op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleCloudDeployClient_UpdateCustomTargetType() { |
| 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 := deploy.NewCloudDeployClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &deploypb.UpdateCustomTargetTypeRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/deploy/apiv1/deploypb#UpdateCustomTargetTypeRequest. |
| } |
| op, err := c.UpdateCustomTargetType(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| resp, err := op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleCloudDeployClient_UpdateDeliveryPipeline() { |
| 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 := deploy.NewCloudDeployClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &deploypb.UpdateDeliveryPipelineRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/deploy/apiv1/deploypb#UpdateDeliveryPipelineRequest. |
| } |
| op, err := c.UpdateDeliveryPipeline(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| resp, err := op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleCloudDeployClient_UpdateTarget() { |
| 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 := deploy.NewCloudDeployClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &deploypb.UpdateTargetRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/deploy/apiv1/deploypb#UpdateTargetRequest. |
| } |
| op, err := c.UpdateTarget(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| |
| resp, err := op.Wait(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleCloudDeployClient_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 := deploy.NewCloudDeployClient(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 ExampleCloudDeployClient_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 := deploy.NewCloudDeployClient(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 ExampleCloudDeployClient_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 := deploy.NewCloudDeployClient(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 ExampleCloudDeployClient_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 := deploy.NewCloudDeployClient(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 ExampleCloudDeployClient_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 := deploy.NewCloudDeployClient(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 ExampleCloudDeployClient_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 := deploy.NewCloudDeployClient(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 ExampleCloudDeployClient_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 := deploy.NewCloudDeployClient(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 ExampleCloudDeployClient_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 := deploy.NewCloudDeployClient(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 ExampleCloudDeployClient_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 := deploy.NewCloudDeployClient(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) |
| } |
| } |