| // 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 dataform_test |
| |
| import ( |
| "context" |
| |
| dataform "cloud.google.com/go/dataform/apiv1beta1" |
| dataformpb "cloud.google.com/go/dataform/apiv1beta1/dataformpb" |
| iampb "cloud.google.com/go/iam/apiv1/iampb" |
| "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 := dataform.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 := dataform.NewRESTClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| // TODO: Use client. |
| _ = c |
| } |
| |
| func ExampleClient_CancelWorkflowInvocation() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.CancelWorkflowInvocationRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#CancelWorkflowInvocationRequest. |
| } |
| err = c.CancelWorkflowInvocation(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleClient_CommitRepositoryChanges() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.CommitRepositoryChangesRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#CommitRepositoryChangesRequest. |
| } |
| err = c.CommitRepositoryChanges(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleClient_CommitWorkspaceChanges() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.CommitWorkspaceChangesRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#CommitWorkspaceChangesRequest. |
| } |
| err = c.CommitWorkspaceChanges(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleClient_ComputeRepositoryAccessTokenStatus() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.ComputeRepositoryAccessTokenStatusRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#ComputeRepositoryAccessTokenStatusRequest. |
| } |
| resp, err := c.ComputeRepositoryAccessTokenStatus(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_CreateCompilationResult() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.CreateCompilationResultRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#CreateCompilationResultRequest. |
| } |
| resp, err := c.CreateCompilationResult(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_CreateReleaseConfig() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.CreateReleaseConfigRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#CreateReleaseConfigRequest. |
| } |
| resp, err := c.CreateReleaseConfig(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_CreateRepository() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.CreateRepositoryRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#CreateRepositoryRequest. |
| } |
| resp, err := c.CreateRepository(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_CreateWorkflowConfig() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.CreateWorkflowConfigRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#CreateWorkflowConfigRequest. |
| } |
| resp, err := c.CreateWorkflowConfig(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_CreateWorkflowInvocation() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.CreateWorkflowInvocationRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#CreateWorkflowInvocationRequest. |
| } |
| resp, err := c.CreateWorkflowInvocation(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_CreateWorkspace() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.CreateWorkspaceRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#CreateWorkspaceRequest. |
| } |
| resp, err := c.CreateWorkspace(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_DeleteReleaseConfig() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.DeleteReleaseConfigRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#DeleteReleaseConfigRequest. |
| } |
| err = c.DeleteReleaseConfig(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleClient_DeleteRepository() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.DeleteRepositoryRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#DeleteRepositoryRequest. |
| } |
| err = c.DeleteRepository(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleClient_DeleteWorkflowConfig() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.DeleteWorkflowConfigRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#DeleteWorkflowConfigRequest. |
| } |
| err = c.DeleteWorkflowConfig(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleClient_DeleteWorkflowInvocation() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.DeleteWorkflowInvocationRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#DeleteWorkflowInvocationRequest. |
| } |
| err = c.DeleteWorkflowInvocation(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleClient_DeleteWorkspace() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.DeleteWorkspaceRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#DeleteWorkspaceRequest. |
| } |
| err = c.DeleteWorkspace(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleClient_FetchFileDiff() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.FetchFileDiffRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#FetchFileDiffRequest. |
| } |
| resp, err := c.FetchFileDiff(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_FetchFileGitStatuses() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.FetchFileGitStatusesRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#FetchFileGitStatusesRequest. |
| } |
| resp, err := c.FetchFileGitStatuses(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_FetchGitAheadBehind() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.FetchGitAheadBehindRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#FetchGitAheadBehindRequest. |
| } |
| resp, err := c.FetchGitAheadBehind(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_FetchRemoteBranches() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.FetchRemoteBranchesRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#FetchRemoteBranchesRequest. |
| } |
| resp, err := c.FetchRemoteBranches(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_FetchRepositoryHistory() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.FetchRepositoryHistoryRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#FetchRepositoryHistoryRequest. |
| } |
| it := c.FetchRepositoryHistory(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.(*dataformpb.FetchRepositoryHistoryResponse) |
| } |
| } |
| |
| func ExampleClient_GetCompilationResult() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.GetCompilationResultRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#GetCompilationResultRequest. |
| } |
| resp, err := c.GetCompilationResult(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_GetReleaseConfig() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.GetReleaseConfigRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#GetReleaseConfigRequest. |
| } |
| resp, err := c.GetReleaseConfig(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_GetRepository() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.GetRepositoryRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#GetRepositoryRequest. |
| } |
| resp, err := c.GetRepository(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_GetWorkflowConfig() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.GetWorkflowConfigRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#GetWorkflowConfigRequest. |
| } |
| resp, err := c.GetWorkflowConfig(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_GetWorkflowInvocation() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.GetWorkflowInvocationRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#GetWorkflowInvocationRequest. |
| } |
| resp, err := c.GetWorkflowInvocation(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_GetWorkspace() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.GetWorkspaceRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#GetWorkspaceRequest. |
| } |
| resp, err := c.GetWorkspace(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_InstallNpmPackages() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.InstallNpmPackagesRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#InstallNpmPackagesRequest. |
| } |
| resp, err := c.InstallNpmPackages(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_ListCompilationResults() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.ListCompilationResultsRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#ListCompilationResultsRequest. |
| } |
| it := c.ListCompilationResults(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.(*dataformpb.ListCompilationResultsResponse) |
| } |
| } |
| |
| func ExampleClient_ListReleaseConfigs() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.ListReleaseConfigsRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#ListReleaseConfigsRequest. |
| } |
| it := c.ListReleaseConfigs(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.(*dataformpb.ListReleaseConfigsResponse) |
| } |
| } |
| |
| func ExampleClient_ListRepositories() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.ListRepositoriesRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#ListRepositoriesRequest. |
| } |
| it := c.ListRepositories(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.(*dataformpb.ListRepositoriesResponse) |
| } |
| } |
| |
| func ExampleClient_ListWorkflowConfigs() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.ListWorkflowConfigsRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#ListWorkflowConfigsRequest. |
| } |
| it := c.ListWorkflowConfigs(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.(*dataformpb.ListWorkflowConfigsResponse) |
| } |
| } |
| |
| func ExampleClient_ListWorkflowInvocations() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.ListWorkflowInvocationsRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#ListWorkflowInvocationsRequest. |
| } |
| it := c.ListWorkflowInvocations(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.(*dataformpb.ListWorkflowInvocationsResponse) |
| } |
| } |
| |
| func ExampleClient_ListWorkspaces() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.ListWorkspacesRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#ListWorkspacesRequest. |
| } |
| it := c.ListWorkspaces(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.(*dataformpb.ListWorkspacesResponse) |
| } |
| } |
| |
| func ExampleClient_MakeDirectory() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.MakeDirectoryRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#MakeDirectoryRequest. |
| } |
| resp, err := c.MakeDirectory(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_MoveDirectory() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.MoveDirectoryRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#MoveDirectoryRequest. |
| } |
| resp, err := c.MoveDirectory(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_MoveFile() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.MoveFileRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#MoveFileRequest. |
| } |
| resp, err := c.MoveFile(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_PullGitCommits() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.PullGitCommitsRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#PullGitCommitsRequest. |
| } |
| err = c.PullGitCommits(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleClient_PushGitCommits() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.PushGitCommitsRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#PushGitCommitsRequest. |
| } |
| err = c.PushGitCommits(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleClient_QueryCompilationResultActions() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.QueryCompilationResultActionsRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#QueryCompilationResultActionsRequest. |
| } |
| it := c.QueryCompilationResultActions(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.(*dataformpb.QueryCompilationResultActionsResponse) |
| } |
| } |
| |
| func ExampleClient_QueryDirectoryContents() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.QueryDirectoryContentsRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#QueryDirectoryContentsRequest. |
| } |
| it := c.QueryDirectoryContents(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.(*dataformpb.QueryDirectoryContentsResponse) |
| } |
| } |
| |
| func ExampleClient_QueryRepositoryDirectoryContents() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.QueryRepositoryDirectoryContentsRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#QueryRepositoryDirectoryContentsRequest. |
| } |
| it := c.QueryRepositoryDirectoryContents(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.(*dataformpb.QueryRepositoryDirectoryContentsResponse) |
| } |
| } |
| |
| func ExampleClient_QueryWorkflowInvocationActions() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.QueryWorkflowInvocationActionsRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#QueryWorkflowInvocationActionsRequest. |
| } |
| it := c.QueryWorkflowInvocationActions(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.(*dataformpb.QueryWorkflowInvocationActionsResponse) |
| } |
| } |
| |
| func ExampleClient_ReadFile() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.ReadFileRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#ReadFileRequest. |
| } |
| resp, err := c.ReadFile(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_ReadRepositoryFile() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.ReadRepositoryFileRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#ReadRepositoryFileRequest. |
| } |
| resp, err := c.ReadRepositoryFile(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_RemoveDirectory() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.RemoveDirectoryRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#RemoveDirectoryRequest. |
| } |
| err = c.RemoveDirectory(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleClient_RemoveFile() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.RemoveFileRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#RemoveFileRequest. |
| } |
| err = c.RemoveFile(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleClient_ResetWorkspaceChanges() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.ResetWorkspaceChangesRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#ResetWorkspaceChangesRequest. |
| } |
| err = c.ResetWorkspaceChanges(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| } |
| |
| func ExampleClient_UpdateReleaseConfig() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.UpdateReleaseConfigRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#UpdateReleaseConfigRequest. |
| } |
| resp, err := c.UpdateReleaseConfig(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_UpdateRepository() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.UpdateRepositoryRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#UpdateRepositoryRequest. |
| } |
| resp, err := c.UpdateRepository(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_UpdateWorkflowConfig() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.UpdateWorkflowConfigRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#UpdateWorkflowConfigRequest. |
| } |
| resp, err := c.UpdateWorkflowConfig(ctx, req) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| // TODO: Use resp. |
| _ = resp |
| } |
| |
| func ExampleClient_WriteFile() { |
| 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 := dataform.NewClient(ctx) |
| if err != nil { |
| // TODO: Handle error. |
| } |
| defer c.Close() |
| |
| req := &dataformpb.WriteFileRequest{ |
| // TODO: Fill request struct fields. |
| // See https://pkg.go.dev/cloud.google.com/go/dataform/apiv1beta1/dataformpb#WriteFileRequest. |
| } |
| resp, err := c.WriteFile(ctx, req) |
| 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 := dataform.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 := dataform.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 := dataform.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 := dataform.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 := dataform.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 |
| } |