From 8ed231997dc150f04cfce39e1be0898e84b3ed2b Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Tue, 27 Dec 2022 14:04:06 -0700 Subject: [PATCH] chore(run): regen snippets for run/apiv2 --- internal/generated/snippets/go.mod | 18 +- internal/generated/snippets/go.sum | 8 +- .../ExecutionsClient/DeleteExecution/main.go | 58 + .../ExecutionsClient/DeleteOperation/main.go | 52 + .../ExecutionsClient/GetExecution/main.go | 53 + .../ExecutionsClient/GetOperation/main.go | 54 + .../ExecutionsClient/ListExecutions/main.go | 60 + .../ExecutionsClient/ListOperations/main.go | 61 + .../run/apiv2/JobsClient/CreateJob/main.go | 58 + .../run/apiv2/JobsClient/DeleteJob/main.go | 58 + .../apiv2/JobsClient/DeleteOperation/main.go | 52 + .../run/apiv2/JobsClient/GetIamPolicy/main.go | 54 + .../run/apiv2/JobsClient/GetJob/main.go | 53 + .../run/apiv2/JobsClient/GetOperation/main.go | 54 + .../run/apiv2/JobsClient/ListJobs/main.go | 60 + .../apiv2/JobsClient/ListOperations/main.go | 61 + .../run/apiv2/JobsClient/RunJob/main.go | 58 + .../run/apiv2/JobsClient/SetIamPolicy/main.go | 54 + .../JobsClient/TestIamPermissions/main.go | 54 + .../run/apiv2/JobsClient/UpdateJob/main.go | 58 + .../RevisionsClient/DeleteOperation/main.go | 52 + .../RevisionsClient/DeleteRevision/main.go | 9 +- .../RevisionsClient/GetOperation/main.go | 54 + .../apiv2/RevisionsClient/GetRevision/main.go | 9 +- .../RevisionsClient/ListOperations/main.go | 61 + .../RevisionsClient/ListRevisions/main.go | 9 +- .../ServicesClient/CreateService/main.go | 9 +- .../ServicesClient/DeleteOperation/main.go | 52 + .../ServicesClient/DeleteService/main.go | 9 +- .../apiv2/ServicesClient/GetIamPolicy/main.go | 6 + .../apiv2/ServicesClient/GetOperation/main.go | 54 + .../apiv2/ServicesClient/GetService/main.go | 9 +- .../ServicesClient/ListOperations/main.go | 61 + .../apiv2/ServicesClient/ListServices/main.go | 9 +- .../apiv2/ServicesClient/SetIamPolicy/main.go | 6 + .../ServicesClient/TestIamPermissions/main.go | 6 + .../ServicesClient/UpdateService/main.go | 9 +- .../apiv2/TasksClient/DeleteOperation/main.go | 52 + .../apiv2/TasksClient/GetOperation/main.go | 54 + .../run/apiv2/TasksClient/GetTask/main.go | 53 + .../apiv2/TasksClient/ListOperations/main.go | 61 + .../run/apiv2/TasksClient/ListTasks/main.go | 60 + .../snippet_metadata.google.cloud.run.v2.json | 1850 +++++++++++++++++ 43 files changed, 3564 insertions(+), 28 deletions(-) create mode 100644 internal/generated/snippets/run/apiv2/ExecutionsClient/DeleteExecution/main.go create mode 100644 internal/generated/snippets/run/apiv2/ExecutionsClient/DeleteOperation/main.go create mode 100644 internal/generated/snippets/run/apiv2/ExecutionsClient/GetExecution/main.go create mode 100644 internal/generated/snippets/run/apiv2/ExecutionsClient/GetOperation/main.go create mode 100644 internal/generated/snippets/run/apiv2/ExecutionsClient/ListExecutions/main.go create mode 100644 internal/generated/snippets/run/apiv2/ExecutionsClient/ListOperations/main.go create mode 100644 internal/generated/snippets/run/apiv2/JobsClient/CreateJob/main.go create mode 100644 internal/generated/snippets/run/apiv2/JobsClient/DeleteJob/main.go create mode 100644 internal/generated/snippets/run/apiv2/JobsClient/DeleteOperation/main.go create mode 100644 internal/generated/snippets/run/apiv2/JobsClient/GetIamPolicy/main.go create mode 100644 internal/generated/snippets/run/apiv2/JobsClient/GetJob/main.go create mode 100644 internal/generated/snippets/run/apiv2/JobsClient/GetOperation/main.go create mode 100644 internal/generated/snippets/run/apiv2/JobsClient/ListJobs/main.go create mode 100644 internal/generated/snippets/run/apiv2/JobsClient/ListOperations/main.go create mode 100644 internal/generated/snippets/run/apiv2/JobsClient/RunJob/main.go create mode 100644 internal/generated/snippets/run/apiv2/JobsClient/SetIamPolicy/main.go create mode 100644 internal/generated/snippets/run/apiv2/JobsClient/TestIamPermissions/main.go create mode 100644 internal/generated/snippets/run/apiv2/JobsClient/UpdateJob/main.go create mode 100644 internal/generated/snippets/run/apiv2/RevisionsClient/DeleteOperation/main.go create mode 100644 internal/generated/snippets/run/apiv2/RevisionsClient/GetOperation/main.go create mode 100644 internal/generated/snippets/run/apiv2/RevisionsClient/ListOperations/main.go create mode 100644 internal/generated/snippets/run/apiv2/ServicesClient/DeleteOperation/main.go create mode 100644 internal/generated/snippets/run/apiv2/ServicesClient/GetOperation/main.go create mode 100644 internal/generated/snippets/run/apiv2/ServicesClient/ListOperations/main.go create mode 100644 internal/generated/snippets/run/apiv2/TasksClient/DeleteOperation/main.go create mode 100644 internal/generated/snippets/run/apiv2/TasksClient/GetOperation/main.go create mode 100644 internal/generated/snippets/run/apiv2/TasksClient/GetTask/main.go create mode 100644 internal/generated/snippets/run/apiv2/TasksClient/ListOperations/main.go create mode 100644 internal/generated/snippets/run/apiv2/TasksClient/ListTasks/main.go create mode 100644 internal/generated/snippets/run/apiv2/snippet_metadata.google.cloud.run.v2.json diff --git a/internal/generated/snippets/go.mod b/internal/generated/snippets/go.mod index b4c4ab54f5f..12b0a32f7dd 100644 --- a/internal/generated/snippets/go.mod +++ b/internal/generated/snippets/go.mod @@ -3,10 +3,10 @@ module cloud.google.com/go/internal/generated go 1.19 require ( - cloud.google.com/go v0.105.0 + cloud.google.com/go v0.107.0 cloud.google.com/go/accessapproval v1.5.0 cloud.google.com/go/accesscontextmanager v1.4.0 - cloud.google.com/go/aiplatform v1.27.0 + cloud.google.com/go/aiplatform v1.28.0 cloud.google.com/go/analytics v0.12.0 cloud.google.com/go/apigateway v1.4.0 cloud.google.com/go/apigeeconnect v1.4.0 @@ -29,11 +29,11 @@ require ( cloud.google.com/go/cloudbuild v1.4.0 cloud.google.com/go/clouddms v1.4.0 cloud.google.com/go/cloudtasks v1.8.0 - cloud.google.com/go/compute v1.13.0 + cloud.google.com/go/compute v1.14.0 cloud.google.com/go/contactcenterinsights v1.4.0 cloud.google.com/go/container v1.7.0 cloud.google.com/go/containeranalysis v0.6.0 - cloud.google.com/go/datacatalog v1.8.0 + cloud.google.com/go/datacatalog v1.8.1 cloud.google.com/go/dataflow v0.7.0 cloud.google.com/go/dataform v0.5.0 cloud.google.com/go/datafusion v1.5.0 @@ -65,7 +65,7 @@ require ( cloud.google.com/go/iap v1.5.0 cloud.google.com/go/ids v1.2.0 cloud.google.com/go/iot v1.4.0 - cloud.google.com/go/kms v1.6.0 + cloud.google.com/go/kms v1.7.0 cloud.google.com/go/language v1.8.0 cloud.google.com/go/lifesciences v0.6.0 cloud.google.com/go/logging v1.6.1 @@ -87,7 +87,7 @@ require ( cloud.google.com/go/phishingprotection v0.6.0 cloud.google.com/go/policytroubleshooter v1.4.0 cloud.google.com/go/privatecatalog v0.6.0 - cloud.google.com/go/pubsub v1.27.1 + cloud.google.com/go/pubsub v1.28.0 cloud.google.com/go/pubsublite v1.5.0 cloud.google.com/go/recaptchaenterprise v1.3.1 cloud.google.com/go/recommendationengine v0.6.0 @@ -128,7 +128,7 @@ require ( ) require ( - cloud.google.com/go/compute/metadata v0.2.1 // indirect + cloud.google.com/go/compute/metadata v0.2.2 // indirect cloud.google.com/go/recaptchaenterprise/v2 v2.5.0 // indirect cloud.google.com/go/vision/v2 v2.5.0 // indirect github.com/golang/protobuf v1.5.2 // indirect @@ -139,9 +139,9 @@ require ( golang.org/x/net v0.1.0 // indirect golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783 // indirect golang.org/x/sys v0.1.0 // indirect - golang.org/x/text v0.4.0 // indirect + golang.org/x/text v0.5.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/grpc v1.50.1 // indirect + google.golang.org/grpc v1.51.0 // indirect google.golang.org/protobuf v1.28.1 // indirect ) diff --git a/internal/generated/snippets/go.sum b/internal/generated/snippets/go.sum index 05cc4d04cf6..015758b6970 100644 --- a/internal/generated/snippets/go.sum +++ b/internal/generated/snippets/go.sum @@ -180,9 +180,10 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/time v0.1.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM= +golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -253,8 +254,9 @@ google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.50.1 h1:DS/BukOZWp8s6p4Dt/tOaJaTQyPyOoCcrjroHuCeLzY= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.51.0 h1:E1eGv1FTqoLIdnBCZufiSHgKjlqG6fKFf6pPWtMTh8U= +google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= diff --git a/internal/generated/snippets/run/apiv2/ExecutionsClient/DeleteExecution/main.go b/internal/generated/snippets/run/apiv2/ExecutionsClient/DeleteExecution/main.go new file mode 100644 index 00000000000..dee29f07819 --- /dev/null +++ b/internal/generated/snippets/run/apiv2/ExecutionsClient/DeleteExecution/main.go @@ -0,0 +1,58 @@ +// Copyright 2022 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 +// +// http://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 cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START run_v2_generated_Executions_DeleteExecution_sync] + +package main + +import ( + "context" + + run "cloud.google.com/go/run/apiv2" + runpb "cloud.google.com/go/run/apiv2/runpb" +) + +func main() { + 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 := run.NewExecutionsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &runpb.DeleteExecutionRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#DeleteExecutionRequest. + } + op, err := c.DeleteExecution(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END run_v2_generated_Executions_DeleteExecution_sync] diff --git a/internal/generated/snippets/run/apiv2/ExecutionsClient/DeleteOperation/main.go b/internal/generated/snippets/run/apiv2/ExecutionsClient/DeleteOperation/main.go new file mode 100644 index 00000000000..0dc39007ac8 --- /dev/null +++ b/internal/generated/snippets/run/apiv2/ExecutionsClient/DeleteOperation/main.go @@ -0,0 +1,52 @@ +// Copyright 2022 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 +// +// http://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 cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START run_v2_generated_Executions_DeleteOperation_sync] + +package main + +import ( + "context" + + run "cloud.google.com/go/run/apiv2" + + longrunningpb "google.golang.org/genproto/googleapis/longrunning" +) + +func main() { + 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 := run.NewExecutionsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.DeleteOperationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#DeleteOperationRequest. + } + err = c.DeleteOperation(ctx, req) + if err != nil { + // TODO: Handle error. + } +} + +// [END run_v2_generated_Executions_DeleteOperation_sync] diff --git a/internal/generated/snippets/run/apiv2/ExecutionsClient/GetExecution/main.go b/internal/generated/snippets/run/apiv2/ExecutionsClient/GetExecution/main.go new file mode 100644 index 00000000000..faf68cd2044 --- /dev/null +++ b/internal/generated/snippets/run/apiv2/ExecutionsClient/GetExecution/main.go @@ -0,0 +1,53 @@ +// Copyright 2022 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 +// +// http://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 cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START run_v2_generated_Executions_GetExecution_sync] + +package main + +import ( + "context" + + run "cloud.google.com/go/run/apiv2" + runpb "cloud.google.com/go/run/apiv2/runpb" +) + +func main() { + 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 := run.NewExecutionsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &runpb.GetExecutionRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#GetExecutionRequest. + } + resp, err := c.GetExecution(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END run_v2_generated_Executions_GetExecution_sync] diff --git a/internal/generated/snippets/run/apiv2/ExecutionsClient/GetOperation/main.go b/internal/generated/snippets/run/apiv2/ExecutionsClient/GetOperation/main.go new file mode 100644 index 00000000000..c418ca62526 --- /dev/null +++ b/internal/generated/snippets/run/apiv2/ExecutionsClient/GetOperation/main.go @@ -0,0 +1,54 @@ +// Copyright 2022 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 +// +// http://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 cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START run_v2_generated_Executions_GetOperation_sync] + +package main + +import ( + "context" + + run "cloud.google.com/go/run/apiv2" + + longrunningpb "google.golang.org/genproto/googleapis/longrunning" +) + +func main() { + 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 := run.NewExecutionsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.GetOperationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#GetOperationRequest. + } + resp, err := c.GetOperation(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END run_v2_generated_Executions_GetOperation_sync] diff --git a/internal/generated/snippets/run/apiv2/ExecutionsClient/ListExecutions/main.go b/internal/generated/snippets/run/apiv2/ExecutionsClient/ListExecutions/main.go new file mode 100644 index 00000000000..d61c95ddedf --- /dev/null +++ b/internal/generated/snippets/run/apiv2/ExecutionsClient/ListExecutions/main.go @@ -0,0 +1,60 @@ +// Copyright 2022 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 +// +// http://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 cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START run_v2_generated_Executions_ListExecutions_sync] + +package main + +import ( + "context" + + run "cloud.google.com/go/run/apiv2" + runpb "cloud.google.com/go/run/apiv2/runpb" + "google.golang.org/api/iterator" +) + +func main() { + 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 := run.NewExecutionsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &runpb.ListExecutionsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#ListExecutionsRequest. + } + it := c.ListExecutions(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END run_v2_generated_Executions_ListExecutions_sync] diff --git a/internal/generated/snippets/run/apiv2/ExecutionsClient/ListOperations/main.go b/internal/generated/snippets/run/apiv2/ExecutionsClient/ListOperations/main.go new file mode 100644 index 00000000000..4ea7ec94e46 --- /dev/null +++ b/internal/generated/snippets/run/apiv2/ExecutionsClient/ListOperations/main.go @@ -0,0 +1,61 @@ +// Copyright 2022 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 +// +// http://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 cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START run_v2_generated_Executions_ListOperations_sync] + +package main + +import ( + "context" + + run "cloud.google.com/go/run/apiv2" + "google.golang.org/api/iterator" + + longrunningpb "google.golang.org/genproto/googleapis/longrunning" +) + +func main() { + 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 := run.NewExecutionsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.ListOperationsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#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 + } +} + +// [END run_v2_generated_Executions_ListOperations_sync] diff --git a/internal/generated/snippets/run/apiv2/JobsClient/CreateJob/main.go b/internal/generated/snippets/run/apiv2/JobsClient/CreateJob/main.go new file mode 100644 index 00000000000..b03ce394248 --- /dev/null +++ b/internal/generated/snippets/run/apiv2/JobsClient/CreateJob/main.go @@ -0,0 +1,58 @@ +// Copyright 2022 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 +// +// http://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 cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START run_v2_generated_Jobs_CreateJob_sync] + +package main + +import ( + "context" + + run "cloud.google.com/go/run/apiv2" + runpb "cloud.google.com/go/run/apiv2/runpb" +) + +func main() { + 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 := run.NewJobsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &runpb.CreateJobRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#CreateJobRequest. + } + op, err := c.CreateJob(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END run_v2_generated_Jobs_CreateJob_sync] diff --git a/internal/generated/snippets/run/apiv2/JobsClient/DeleteJob/main.go b/internal/generated/snippets/run/apiv2/JobsClient/DeleteJob/main.go new file mode 100644 index 00000000000..52645b433e0 --- /dev/null +++ b/internal/generated/snippets/run/apiv2/JobsClient/DeleteJob/main.go @@ -0,0 +1,58 @@ +// Copyright 2022 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 +// +// http://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 cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START run_v2_generated_Jobs_DeleteJob_sync] + +package main + +import ( + "context" + + run "cloud.google.com/go/run/apiv2" + runpb "cloud.google.com/go/run/apiv2/runpb" +) + +func main() { + 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 := run.NewJobsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &runpb.DeleteJobRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#DeleteJobRequest. + } + op, err := c.DeleteJob(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END run_v2_generated_Jobs_DeleteJob_sync] diff --git a/internal/generated/snippets/run/apiv2/JobsClient/DeleteOperation/main.go b/internal/generated/snippets/run/apiv2/JobsClient/DeleteOperation/main.go new file mode 100644 index 00000000000..0275fae187c --- /dev/null +++ b/internal/generated/snippets/run/apiv2/JobsClient/DeleteOperation/main.go @@ -0,0 +1,52 @@ +// Copyright 2022 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 +// +// http://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 cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START run_v2_generated_Jobs_DeleteOperation_sync] + +package main + +import ( + "context" + + run "cloud.google.com/go/run/apiv2" + + longrunningpb "google.golang.org/genproto/googleapis/longrunning" +) + +func main() { + 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 := run.NewJobsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.DeleteOperationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#DeleteOperationRequest. + } + err = c.DeleteOperation(ctx, req) + if err != nil { + // TODO: Handle error. + } +} + +// [END run_v2_generated_Jobs_DeleteOperation_sync] diff --git a/internal/generated/snippets/run/apiv2/JobsClient/GetIamPolicy/main.go b/internal/generated/snippets/run/apiv2/JobsClient/GetIamPolicy/main.go new file mode 100644 index 00000000000..004414e8630 --- /dev/null +++ b/internal/generated/snippets/run/apiv2/JobsClient/GetIamPolicy/main.go @@ -0,0 +1,54 @@ +// Copyright 2022 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 +// +// http://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 cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START run_v2_generated_Jobs_GetIamPolicy_sync] + +package main + +import ( + "context" + + run "cloud.google.com/go/run/apiv2" + + iampb "google.golang.org/genproto/googleapis/iam/v1" +) + +func main() { + 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 := run.NewJobsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &iampb.GetIamPolicyRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/iam/v1#GetIamPolicyRequest. + } + resp, err := c.GetIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END run_v2_generated_Jobs_GetIamPolicy_sync] diff --git a/internal/generated/snippets/run/apiv2/JobsClient/GetJob/main.go b/internal/generated/snippets/run/apiv2/JobsClient/GetJob/main.go new file mode 100644 index 00000000000..fbd46147787 --- /dev/null +++ b/internal/generated/snippets/run/apiv2/JobsClient/GetJob/main.go @@ -0,0 +1,53 @@ +// Copyright 2022 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 +// +// http://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 cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START run_v2_generated_Jobs_GetJob_sync] + +package main + +import ( + "context" + + run "cloud.google.com/go/run/apiv2" + runpb "cloud.google.com/go/run/apiv2/runpb" +) + +func main() { + 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 := run.NewJobsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &runpb.GetJobRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#GetJobRequest. + } + resp, err := c.GetJob(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END run_v2_generated_Jobs_GetJob_sync] diff --git a/internal/generated/snippets/run/apiv2/JobsClient/GetOperation/main.go b/internal/generated/snippets/run/apiv2/JobsClient/GetOperation/main.go new file mode 100644 index 00000000000..12cd27d5ebd --- /dev/null +++ b/internal/generated/snippets/run/apiv2/JobsClient/GetOperation/main.go @@ -0,0 +1,54 @@ +// Copyright 2022 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 +// +// http://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 cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START run_v2_generated_Jobs_GetOperation_sync] + +package main + +import ( + "context" + + run "cloud.google.com/go/run/apiv2" + + longrunningpb "google.golang.org/genproto/googleapis/longrunning" +) + +func main() { + 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 := run.NewJobsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.GetOperationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#GetOperationRequest. + } + resp, err := c.GetOperation(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END run_v2_generated_Jobs_GetOperation_sync] diff --git a/internal/generated/snippets/run/apiv2/JobsClient/ListJobs/main.go b/internal/generated/snippets/run/apiv2/JobsClient/ListJobs/main.go new file mode 100644 index 00000000000..c1a823fe3a3 --- /dev/null +++ b/internal/generated/snippets/run/apiv2/JobsClient/ListJobs/main.go @@ -0,0 +1,60 @@ +// Copyright 2022 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 +// +// http://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 cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START run_v2_generated_Jobs_ListJobs_sync] + +package main + +import ( + "context" + + run "cloud.google.com/go/run/apiv2" + runpb "cloud.google.com/go/run/apiv2/runpb" + "google.golang.org/api/iterator" +) + +func main() { + 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 := run.NewJobsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &runpb.ListJobsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#ListJobsRequest. + } + it := c.ListJobs(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END run_v2_generated_Jobs_ListJobs_sync] diff --git a/internal/generated/snippets/run/apiv2/JobsClient/ListOperations/main.go b/internal/generated/snippets/run/apiv2/JobsClient/ListOperations/main.go new file mode 100644 index 00000000000..cc152105f2f --- /dev/null +++ b/internal/generated/snippets/run/apiv2/JobsClient/ListOperations/main.go @@ -0,0 +1,61 @@ +// Copyright 2022 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 +// +// http://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 cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START run_v2_generated_Jobs_ListOperations_sync] + +package main + +import ( + "context" + + run "cloud.google.com/go/run/apiv2" + "google.golang.org/api/iterator" + + longrunningpb "google.golang.org/genproto/googleapis/longrunning" +) + +func main() { + 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 := run.NewJobsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.ListOperationsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#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 + } +} + +// [END run_v2_generated_Jobs_ListOperations_sync] diff --git a/internal/generated/snippets/run/apiv2/JobsClient/RunJob/main.go b/internal/generated/snippets/run/apiv2/JobsClient/RunJob/main.go new file mode 100644 index 00000000000..f53f3dd0a5a --- /dev/null +++ b/internal/generated/snippets/run/apiv2/JobsClient/RunJob/main.go @@ -0,0 +1,58 @@ +// Copyright 2022 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 +// +// http://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 cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START run_v2_generated_Jobs_RunJob_sync] + +package main + +import ( + "context" + + run "cloud.google.com/go/run/apiv2" + runpb "cloud.google.com/go/run/apiv2/runpb" +) + +func main() { + 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 := run.NewJobsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &runpb.RunJobRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#RunJobRequest. + } + op, err := c.RunJob(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END run_v2_generated_Jobs_RunJob_sync] diff --git a/internal/generated/snippets/run/apiv2/JobsClient/SetIamPolicy/main.go b/internal/generated/snippets/run/apiv2/JobsClient/SetIamPolicy/main.go new file mode 100644 index 00000000000..25094237711 --- /dev/null +++ b/internal/generated/snippets/run/apiv2/JobsClient/SetIamPolicy/main.go @@ -0,0 +1,54 @@ +// Copyright 2022 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 +// +// http://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 cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START run_v2_generated_Jobs_SetIamPolicy_sync] + +package main + +import ( + "context" + + run "cloud.google.com/go/run/apiv2" + + iampb "google.golang.org/genproto/googleapis/iam/v1" +) + +func main() { + 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 := run.NewJobsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &iampb.SetIamPolicyRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/iam/v1#SetIamPolicyRequest. + } + resp, err := c.SetIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END run_v2_generated_Jobs_SetIamPolicy_sync] diff --git a/internal/generated/snippets/run/apiv2/JobsClient/TestIamPermissions/main.go b/internal/generated/snippets/run/apiv2/JobsClient/TestIamPermissions/main.go new file mode 100644 index 00000000000..f0bb7806a3f --- /dev/null +++ b/internal/generated/snippets/run/apiv2/JobsClient/TestIamPermissions/main.go @@ -0,0 +1,54 @@ +// Copyright 2022 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 +// +// http://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 cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START run_v2_generated_Jobs_TestIamPermissions_sync] + +package main + +import ( + "context" + + run "cloud.google.com/go/run/apiv2" + + iampb "google.golang.org/genproto/googleapis/iam/v1" +) + +func main() { + 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 := run.NewJobsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &iampb.TestIamPermissionsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/iam/v1#TestIamPermissionsRequest. + } + resp, err := c.TestIamPermissions(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END run_v2_generated_Jobs_TestIamPermissions_sync] diff --git a/internal/generated/snippets/run/apiv2/JobsClient/UpdateJob/main.go b/internal/generated/snippets/run/apiv2/JobsClient/UpdateJob/main.go new file mode 100644 index 00000000000..d32613a75f5 --- /dev/null +++ b/internal/generated/snippets/run/apiv2/JobsClient/UpdateJob/main.go @@ -0,0 +1,58 @@ +// Copyright 2022 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 +// +// http://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 cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START run_v2_generated_Jobs_UpdateJob_sync] + +package main + +import ( + "context" + + run "cloud.google.com/go/run/apiv2" + runpb "cloud.google.com/go/run/apiv2/runpb" +) + +func main() { + 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 := run.NewJobsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &runpb.UpdateJobRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#UpdateJobRequest. + } + op, err := c.UpdateJob(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END run_v2_generated_Jobs_UpdateJob_sync] diff --git a/internal/generated/snippets/run/apiv2/RevisionsClient/DeleteOperation/main.go b/internal/generated/snippets/run/apiv2/RevisionsClient/DeleteOperation/main.go new file mode 100644 index 00000000000..f423115f706 --- /dev/null +++ b/internal/generated/snippets/run/apiv2/RevisionsClient/DeleteOperation/main.go @@ -0,0 +1,52 @@ +// Copyright 2022 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 +// +// http://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 cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START run_v2_generated_Revisions_DeleteOperation_sync] + +package main + +import ( + "context" + + run "cloud.google.com/go/run/apiv2" + + longrunningpb "google.golang.org/genproto/googleapis/longrunning" +) + +func main() { + 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 := run.NewRevisionsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.DeleteOperationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#DeleteOperationRequest. + } + err = c.DeleteOperation(ctx, req) + if err != nil { + // TODO: Handle error. + } +} + +// [END run_v2_generated_Revisions_DeleteOperation_sync] diff --git a/internal/generated/snippets/run/apiv2/RevisionsClient/DeleteRevision/main.go b/internal/generated/snippets/run/apiv2/RevisionsClient/DeleteRevision/main.go index 2da5a07a9f5..6b630cf2b08 100644 --- a/internal/generated/snippets/run/apiv2/RevisionsClient/DeleteRevision/main.go +++ b/internal/generated/snippets/run/apiv2/RevisionsClient/DeleteRevision/main.go @@ -22,11 +22,16 @@ import ( "context" run "cloud.google.com/go/run/apiv2" - runpb "google.golang.org/genproto/googleapis/cloud/run/v2" + runpb "cloud.google.com/go/run/apiv2/runpb" ) func main() { 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 := run.NewRevisionsClient(ctx) if err != nil { // TODO: Handle error. @@ -35,7 +40,7 @@ func main() { req := &runpb.DeleteRevisionRequest{ // TODO: Fill request struct fields. - // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/run/v2#DeleteRevisionRequest. + // See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#DeleteRevisionRequest. } op, err := c.DeleteRevision(ctx, req) if err != nil { diff --git a/internal/generated/snippets/run/apiv2/RevisionsClient/GetOperation/main.go b/internal/generated/snippets/run/apiv2/RevisionsClient/GetOperation/main.go new file mode 100644 index 00000000000..0a047f7d4b7 --- /dev/null +++ b/internal/generated/snippets/run/apiv2/RevisionsClient/GetOperation/main.go @@ -0,0 +1,54 @@ +// Copyright 2022 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 +// +// http://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 cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START run_v2_generated_Revisions_GetOperation_sync] + +package main + +import ( + "context" + + run "cloud.google.com/go/run/apiv2" + + longrunningpb "google.golang.org/genproto/googleapis/longrunning" +) + +func main() { + 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 := run.NewRevisionsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.GetOperationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#GetOperationRequest. + } + resp, err := c.GetOperation(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END run_v2_generated_Revisions_GetOperation_sync] diff --git a/internal/generated/snippets/run/apiv2/RevisionsClient/GetRevision/main.go b/internal/generated/snippets/run/apiv2/RevisionsClient/GetRevision/main.go index e9cf893dffd..d0ef2ae7669 100644 --- a/internal/generated/snippets/run/apiv2/RevisionsClient/GetRevision/main.go +++ b/internal/generated/snippets/run/apiv2/RevisionsClient/GetRevision/main.go @@ -22,11 +22,16 @@ import ( "context" run "cloud.google.com/go/run/apiv2" - runpb "google.golang.org/genproto/googleapis/cloud/run/v2" + runpb "cloud.google.com/go/run/apiv2/runpb" ) func main() { 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 := run.NewRevisionsClient(ctx) if err != nil { // TODO: Handle error. @@ -35,7 +40,7 @@ func main() { req := &runpb.GetRevisionRequest{ // TODO: Fill request struct fields. - // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/run/v2#GetRevisionRequest. + // See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#GetRevisionRequest. } resp, err := c.GetRevision(ctx, req) if err != nil { diff --git a/internal/generated/snippets/run/apiv2/RevisionsClient/ListOperations/main.go b/internal/generated/snippets/run/apiv2/RevisionsClient/ListOperations/main.go new file mode 100644 index 00000000000..67947c77862 --- /dev/null +++ b/internal/generated/snippets/run/apiv2/RevisionsClient/ListOperations/main.go @@ -0,0 +1,61 @@ +// Copyright 2022 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 +// +// http://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 cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START run_v2_generated_Revisions_ListOperations_sync] + +package main + +import ( + "context" + + run "cloud.google.com/go/run/apiv2" + "google.golang.org/api/iterator" + + longrunningpb "google.golang.org/genproto/googleapis/longrunning" +) + +func main() { + 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 := run.NewRevisionsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.ListOperationsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#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 + } +} + +// [END run_v2_generated_Revisions_ListOperations_sync] diff --git a/internal/generated/snippets/run/apiv2/RevisionsClient/ListRevisions/main.go b/internal/generated/snippets/run/apiv2/RevisionsClient/ListRevisions/main.go index 5e40fcb7c38..e22d899d266 100644 --- a/internal/generated/snippets/run/apiv2/RevisionsClient/ListRevisions/main.go +++ b/internal/generated/snippets/run/apiv2/RevisionsClient/ListRevisions/main.go @@ -22,12 +22,17 @@ import ( "context" run "cloud.google.com/go/run/apiv2" + runpb "cloud.google.com/go/run/apiv2/runpb" "google.golang.org/api/iterator" - runpb "google.golang.org/genproto/googleapis/cloud/run/v2" ) func main() { 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 := run.NewRevisionsClient(ctx) if err != nil { // TODO: Handle error. @@ -36,7 +41,7 @@ func main() { req := &runpb.ListRevisionsRequest{ // TODO: Fill request struct fields. - // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/run/v2#ListRevisionsRequest. + // See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#ListRevisionsRequest. } it := c.ListRevisions(ctx, req) for { diff --git a/internal/generated/snippets/run/apiv2/ServicesClient/CreateService/main.go b/internal/generated/snippets/run/apiv2/ServicesClient/CreateService/main.go index 449cc0062ab..b5f5fa0b753 100644 --- a/internal/generated/snippets/run/apiv2/ServicesClient/CreateService/main.go +++ b/internal/generated/snippets/run/apiv2/ServicesClient/CreateService/main.go @@ -22,11 +22,16 @@ import ( "context" run "cloud.google.com/go/run/apiv2" - runpb "google.golang.org/genproto/googleapis/cloud/run/v2" + runpb "cloud.google.com/go/run/apiv2/runpb" ) func main() { 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 := run.NewServicesClient(ctx) if err != nil { // TODO: Handle error. @@ -35,7 +40,7 @@ func main() { req := &runpb.CreateServiceRequest{ // TODO: Fill request struct fields. - // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/run/v2#CreateServiceRequest. + // See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#CreateServiceRequest. } op, err := c.CreateService(ctx, req) if err != nil { diff --git a/internal/generated/snippets/run/apiv2/ServicesClient/DeleteOperation/main.go b/internal/generated/snippets/run/apiv2/ServicesClient/DeleteOperation/main.go new file mode 100644 index 00000000000..3f4e75dee54 --- /dev/null +++ b/internal/generated/snippets/run/apiv2/ServicesClient/DeleteOperation/main.go @@ -0,0 +1,52 @@ +// Copyright 2022 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 +// +// http://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 cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START run_v2_generated_Services_DeleteOperation_sync] + +package main + +import ( + "context" + + run "cloud.google.com/go/run/apiv2" + + longrunningpb "google.golang.org/genproto/googleapis/longrunning" +) + +func main() { + 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 := run.NewServicesClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.DeleteOperationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#DeleteOperationRequest. + } + err = c.DeleteOperation(ctx, req) + if err != nil { + // TODO: Handle error. + } +} + +// [END run_v2_generated_Services_DeleteOperation_sync] diff --git a/internal/generated/snippets/run/apiv2/ServicesClient/DeleteService/main.go b/internal/generated/snippets/run/apiv2/ServicesClient/DeleteService/main.go index 38bd3091335..d3091d96c1f 100644 --- a/internal/generated/snippets/run/apiv2/ServicesClient/DeleteService/main.go +++ b/internal/generated/snippets/run/apiv2/ServicesClient/DeleteService/main.go @@ -22,11 +22,16 @@ import ( "context" run "cloud.google.com/go/run/apiv2" - runpb "google.golang.org/genproto/googleapis/cloud/run/v2" + runpb "cloud.google.com/go/run/apiv2/runpb" ) func main() { 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 := run.NewServicesClient(ctx) if err != nil { // TODO: Handle error. @@ -35,7 +40,7 @@ func main() { req := &runpb.DeleteServiceRequest{ // TODO: Fill request struct fields. - // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/run/v2#DeleteServiceRequest. + // See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#DeleteServiceRequest. } op, err := c.DeleteService(ctx, req) if err != nil { diff --git a/internal/generated/snippets/run/apiv2/ServicesClient/GetIamPolicy/main.go b/internal/generated/snippets/run/apiv2/ServicesClient/GetIamPolicy/main.go index aa10578601f..5d1f298ec18 100644 --- a/internal/generated/snippets/run/apiv2/ServicesClient/GetIamPolicy/main.go +++ b/internal/generated/snippets/run/apiv2/ServicesClient/GetIamPolicy/main.go @@ -22,11 +22,17 @@ import ( "context" run "cloud.google.com/go/run/apiv2" + iampb "google.golang.org/genproto/googleapis/iam/v1" ) func main() { 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 := run.NewServicesClient(ctx) if err != nil { // TODO: Handle error. diff --git a/internal/generated/snippets/run/apiv2/ServicesClient/GetOperation/main.go b/internal/generated/snippets/run/apiv2/ServicesClient/GetOperation/main.go new file mode 100644 index 00000000000..b36ccdbfdfd --- /dev/null +++ b/internal/generated/snippets/run/apiv2/ServicesClient/GetOperation/main.go @@ -0,0 +1,54 @@ +// Copyright 2022 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 +// +// http://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 cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START run_v2_generated_Services_GetOperation_sync] + +package main + +import ( + "context" + + run "cloud.google.com/go/run/apiv2" + + longrunningpb "google.golang.org/genproto/googleapis/longrunning" +) + +func main() { + 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 := run.NewServicesClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.GetOperationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#GetOperationRequest. + } + resp, err := c.GetOperation(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END run_v2_generated_Services_GetOperation_sync] diff --git a/internal/generated/snippets/run/apiv2/ServicesClient/GetService/main.go b/internal/generated/snippets/run/apiv2/ServicesClient/GetService/main.go index cbcb8119262..c89698401e5 100644 --- a/internal/generated/snippets/run/apiv2/ServicesClient/GetService/main.go +++ b/internal/generated/snippets/run/apiv2/ServicesClient/GetService/main.go @@ -22,11 +22,16 @@ import ( "context" run "cloud.google.com/go/run/apiv2" - runpb "google.golang.org/genproto/googleapis/cloud/run/v2" + runpb "cloud.google.com/go/run/apiv2/runpb" ) func main() { 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 := run.NewServicesClient(ctx) if err != nil { // TODO: Handle error. @@ -35,7 +40,7 @@ func main() { req := &runpb.GetServiceRequest{ // TODO: Fill request struct fields. - // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/run/v2#GetServiceRequest. + // See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#GetServiceRequest. } resp, err := c.GetService(ctx, req) if err != nil { diff --git a/internal/generated/snippets/run/apiv2/ServicesClient/ListOperations/main.go b/internal/generated/snippets/run/apiv2/ServicesClient/ListOperations/main.go new file mode 100644 index 00000000000..1f6cf9f850f --- /dev/null +++ b/internal/generated/snippets/run/apiv2/ServicesClient/ListOperations/main.go @@ -0,0 +1,61 @@ +// Copyright 2022 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 +// +// http://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 cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START run_v2_generated_Services_ListOperations_sync] + +package main + +import ( + "context" + + run "cloud.google.com/go/run/apiv2" + "google.golang.org/api/iterator" + + longrunningpb "google.golang.org/genproto/googleapis/longrunning" +) + +func main() { + 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 := run.NewServicesClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.ListOperationsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#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 + } +} + +// [END run_v2_generated_Services_ListOperations_sync] diff --git a/internal/generated/snippets/run/apiv2/ServicesClient/ListServices/main.go b/internal/generated/snippets/run/apiv2/ServicesClient/ListServices/main.go index b09468dad48..f468f6a20a7 100644 --- a/internal/generated/snippets/run/apiv2/ServicesClient/ListServices/main.go +++ b/internal/generated/snippets/run/apiv2/ServicesClient/ListServices/main.go @@ -22,12 +22,17 @@ import ( "context" run "cloud.google.com/go/run/apiv2" + runpb "cloud.google.com/go/run/apiv2/runpb" "google.golang.org/api/iterator" - runpb "google.golang.org/genproto/googleapis/cloud/run/v2" ) func main() { 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 := run.NewServicesClient(ctx) if err != nil { // TODO: Handle error. @@ -36,7 +41,7 @@ func main() { req := &runpb.ListServicesRequest{ // TODO: Fill request struct fields. - // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/run/v2#ListServicesRequest. + // See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#ListServicesRequest. } it := c.ListServices(ctx, req) for { diff --git a/internal/generated/snippets/run/apiv2/ServicesClient/SetIamPolicy/main.go b/internal/generated/snippets/run/apiv2/ServicesClient/SetIamPolicy/main.go index d363fa8b804..8f0a2bd06be 100644 --- a/internal/generated/snippets/run/apiv2/ServicesClient/SetIamPolicy/main.go +++ b/internal/generated/snippets/run/apiv2/ServicesClient/SetIamPolicy/main.go @@ -22,11 +22,17 @@ import ( "context" run "cloud.google.com/go/run/apiv2" + iampb "google.golang.org/genproto/googleapis/iam/v1" ) func main() { 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 := run.NewServicesClient(ctx) if err != nil { // TODO: Handle error. diff --git a/internal/generated/snippets/run/apiv2/ServicesClient/TestIamPermissions/main.go b/internal/generated/snippets/run/apiv2/ServicesClient/TestIamPermissions/main.go index 50d02754bcb..e11a161626c 100644 --- a/internal/generated/snippets/run/apiv2/ServicesClient/TestIamPermissions/main.go +++ b/internal/generated/snippets/run/apiv2/ServicesClient/TestIamPermissions/main.go @@ -22,11 +22,17 @@ import ( "context" run "cloud.google.com/go/run/apiv2" + iampb "google.golang.org/genproto/googleapis/iam/v1" ) func main() { 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 := run.NewServicesClient(ctx) if err != nil { // TODO: Handle error. diff --git a/internal/generated/snippets/run/apiv2/ServicesClient/UpdateService/main.go b/internal/generated/snippets/run/apiv2/ServicesClient/UpdateService/main.go index 60d4d60529a..50decd0de25 100644 --- a/internal/generated/snippets/run/apiv2/ServicesClient/UpdateService/main.go +++ b/internal/generated/snippets/run/apiv2/ServicesClient/UpdateService/main.go @@ -22,11 +22,16 @@ import ( "context" run "cloud.google.com/go/run/apiv2" - runpb "google.golang.org/genproto/googleapis/cloud/run/v2" + runpb "cloud.google.com/go/run/apiv2/runpb" ) func main() { 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 := run.NewServicesClient(ctx) if err != nil { // TODO: Handle error. @@ -35,7 +40,7 @@ func main() { req := &runpb.UpdateServiceRequest{ // TODO: Fill request struct fields. - // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/run/v2#UpdateServiceRequest. + // See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#UpdateServiceRequest. } op, err := c.UpdateService(ctx, req) if err != nil { diff --git a/internal/generated/snippets/run/apiv2/TasksClient/DeleteOperation/main.go b/internal/generated/snippets/run/apiv2/TasksClient/DeleteOperation/main.go new file mode 100644 index 00000000000..6599ec2e199 --- /dev/null +++ b/internal/generated/snippets/run/apiv2/TasksClient/DeleteOperation/main.go @@ -0,0 +1,52 @@ +// Copyright 2022 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 +// +// http://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 cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START run_v2_generated_Tasks_DeleteOperation_sync] + +package main + +import ( + "context" + + run "cloud.google.com/go/run/apiv2" + + longrunningpb "google.golang.org/genproto/googleapis/longrunning" +) + +func main() { + 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 := run.NewTasksClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.DeleteOperationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#DeleteOperationRequest. + } + err = c.DeleteOperation(ctx, req) + if err != nil { + // TODO: Handle error. + } +} + +// [END run_v2_generated_Tasks_DeleteOperation_sync] diff --git a/internal/generated/snippets/run/apiv2/TasksClient/GetOperation/main.go b/internal/generated/snippets/run/apiv2/TasksClient/GetOperation/main.go new file mode 100644 index 00000000000..13e0dafe946 --- /dev/null +++ b/internal/generated/snippets/run/apiv2/TasksClient/GetOperation/main.go @@ -0,0 +1,54 @@ +// Copyright 2022 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 +// +// http://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 cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START run_v2_generated_Tasks_GetOperation_sync] + +package main + +import ( + "context" + + run "cloud.google.com/go/run/apiv2" + + longrunningpb "google.golang.org/genproto/googleapis/longrunning" +) + +func main() { + 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 := run.NewTasksClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.GetOperationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#GetOperationRequest. + } + resp, err := c.GetOperation(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END run_v2_generated_Tasks_GetOperation_sync] diff --git a/internal/generated/snippets/run/apiv2/TasksClient/GetTask/main.go b/internal/generated/snippets/run/apiv2/TasksClient/GetTask/main.go new file mode 100644 index 00000000000..2a59eed0a9b --- /dev/null +++ b/internal/generated/snippets/run/apiv2/TasksClient/GetTask/main.go @@ -0,0 +1,53 @@ +// Copyright 2022 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 +// +// http://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 cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START run_v2_generated_Tasks_GetTask_sync] + +package main + +import ( + "context" + + run "cloud.google.com/go/run/apiv2" + runpb "cloud.google.com/go/run/apiv2/runpb" +) + +func main() { + 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 := run.NewTasksClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &runpb.GetTaskRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#GetTaskRequest. + } + resp, err := c.GetTask(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END run_v2_generated_Tasks_GetTask_sync] diff --git a/internal/generated/snippets/run/apiv2/TasksClient/ListOperations/main.go b/internal/generated/snippets/run/apiv2/TasksClient/ListOperations/main.go new file mode 100644 index 00000000000..e50bf91513d --- /dev/null +++ b/internal/generated/snippets/run/apiv2/TasksClient/ListOperations/main.go @@ -0,0 +1,61 @@ +// Copyright 2022 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 +// +// http://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 cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START run_v2_generated_Tasks_ListOperations_sync] + +package main + +import ( + "context" + + run "cloud.google.com/go/run/apiv2" + "google.golang.org/api/iterator" + + longrunningpb "google.golang.org/genproto/googleapis/longrunning" +) + +func main() { + 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 := run.NewTasksClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.ListOperationsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#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 + } +} + +// [END run_v2_generated_Tasks_ListOperations_sync] diff --git a/internal/generated/snippets/run/apiv2/TasksClient/ListTasks/main.go b/internal/generated/snippets/run/apiv2/TasksClient/ListTasks/main.go new file mode 100644 index 00000000000..cfb23c2a457 --- /dev/null +++ b/internal/generated/snippets/run/apiv2/TasksClient/ListTasks/main.go @@ -0,0 +1,60 @@ +// Copyright 2022 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 +// +// http://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 cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START run_v2_generated_Tasks_ListTasks_sync] + +package main + +import ( + "context" + + run "cloud.google.com/go/run/apiv2" + runpb "cloud.google.com/go/run/apiv2/runpb" + "google.golang.org/api/iterator" +) + +func main() { + 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 := run.NewTasksClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &runpb.ListTasksRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#ListTasksRequest. + } + it := c.ListTasks(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END run_v2_generated_Tasks_ListTasks_sync] diff --git a/internal/generated/snippets/run/apiv2/snippet_metadata.google.cloud.run.v2.json b/internal/generated/snippets/run/apiv2/snippet_metadata.google.cloud.run.v2.json new file mode 100644 index 00000000000..bf2f10ed66c --- /dev/null +++ b/internal/generated/snippets/run/apiv2/snippet_metadata.google.cloud.run.v2.json @@ -0,0 +1,1850 @@ +{ + "clientLibrary": { + "name": "cloud.google.com/go/run/apiv2", + "version": "0.4.0", + "language": "GO", + "apis": [ + { + "id": "google.cloud.run.v2", + "version": "v2" + } + ] + }, + "snippets": [ + { + "regionTag": "run_v2_generated_Executions_DeleteExecution_sync", + "title": "run DeleteExecution Sample", + "description": "DeleteExecution deletes an Execution.", + "file": "ExecutionsClient/DeleteExecution/main.go", + "language": "GO", + "clientMethod": { + "shortName": "DeleteExecution", + "fullName": "google.cloud.run.v2.ExecutionsClient.DeleteExecution", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "runpb.DeleteExecutionRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "DeleteExecutionOperation", + "client": { + "shortName": "ExecutionsClient", + "fullName": "google.cloud.run.v2.ExecutionsClient" + }, + "method": { + "shortName": "DeleteExecution", + "fullName": "google.cloud.run.v2.Executions.DeleteExecution", + "service": { + "shortName": "Executions", + "fullName": "google.cloud.run.v2.Executions" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 58, + "type": "FULL" + } + ] + }, + { + "regionTag": "run_v2_generated_Executions_DeleteOperation_sync", + "title": "run DeleteOperation Sample", + "description": "DeleteOperation is a utility method from google.longrunning.Operations.", + "file": "ExecutionsClient/DeleteOperation/main.go", + "language": "GO", + "clientMethod": { + "shortName": "DeleteOperation", + "fullName": "google.cloud.run.v2.ExecutionsClient.DeleteOperation", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "longrunningpb.DeleteOperationRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "client": { + "shortName": "ExecutionsClient", + "fullName": "google.cloud.run.v2.ExecutionsClient" + }, + "method": { + "shortName": "DeleteOperation", + "fullName": "google.cloud.run.v2.Executions.DeleteOperation", + "service": { + "shortName": "Executions", + "fullName": "google.cloud.run.v2.Executions" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 52, + "type": "FULL" + } + ] + }, + { + "regionTag": "run_v2_generated_Executions_GetExecution_sync", + "title": "run GetExecution Sample", + "description": "GetExecution gets information about an Execution.", + "file": "ExecutionsClient/GetExecution/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetExecution", + "fullName": "google.cloud.run.v2.ExecutionsClient.GetExecution", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "runpb.GetExecutionRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "runpb.Execution", + "client": { + "shortName": "ExecutionsClient", + "fullName": "google.cloud.run.v2.ExecutionsClient" + }, + "method": { + "shortName": "GetExecution", + "fullName": "google.cloud.run.v2.Executions.GetExecution", + "service": { + "shortName": "Executions", + "fullName": "google.cloud.run.v2.Executions" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 53, + "type": "FULL" + } + ] + }, + { + "regionTag": "run_v2_generated_Executions_GetOperation_sync", + "title": "run GetOperation Sample", + "description": "GetOperation is a utility method from google.longrunning.Operations.", + "file": "ExecutionsClient/GetOperation/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetOperation", + "fullName": "google.cloud.run.v2.ExecutionsClient.GetOperation", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "longrunningpb.GetOperationRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "longrunningpb.Operation", + "client": { + "shortName": "ExecutionsClient", + "fullName": "google.cloud.run.v2.ExecutionsClient" + }, + "method": { + "shortName": "GetOperation", + "fullName": "google.cloud.run.v2.Executions.GetOperation", + "service": { + "shortName": "Executions", + "fullName": "google.cloud.run.v2.Executions" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 54, + "type": "FULL" + } + ] + }, + { + "regionTag": "run_v2_generated_Executions_ListExecutions_sync", + "title": "run ListExecutions Sample", + "description": "ListExecutions lists Executions from a Job.", + "file": "ExecutionsClient/ListExecutions/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListExecutions", + "fullName": "google.cloud.run.v2.ExecutionsClient.ListExecutions", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "runpb.ListExecutionsRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "ExecutionIterator", + "client": { + "shortName": "ExecutionsClient", + "fullName": "google.cloud.run.v2.ExecutionsClient" + }, + "method": { + "shortName": "ListExecutions", + "fullName": "google.cloud.run.v2.Executions.ListExecutions", + "service": { + "shortName": "Executions", + "fullName": "google.cloud.run.v2.Executions" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 60, + "type": "FULL" + } + ] + }, + { + "regionTag": "run_v2_generated_Executions_ListOperations_sync", + "title": "run ListOperations Sample", + "description": "ListOperations is a utility method from google.longrunning.Operations.", + "file": "ExecutionsClient/ListOperations/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListOperations", + "fullName": "google.cloud.run.v2.ExecutionsClient.ListOperations", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "longrunningpb.ListOperationsRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "OperationIterator", + "client": { + "shortName": "ExecutionsClient", + "fullName": "google.cloud.run.v2.ExecutionsClient" + }, + "method": { + "shortName": "ListOperations", + "fullName": "google.cloud.run.v2.Executions.ListOperations", + "service": { + "shortName": "Executions", + "fullName": "google.cloud.run.v2.Executions" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 61, + "type": "FULL" + } + ] + }, + { + "regionTag": "run_v2_generated_Jobs_CreateJob_sync", + "title": "run CreateJob Sample", + "description": "CreateJob creates a Job.", + "file": "JobsClient/CreateJob/main.go", + "language": "GO", + "clientMethod": { + "shortName": "CreateJob", + "fullName": "google.cloud.run.v2.JobsClient.CreateJob", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "runpb.CreateJobRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "CreateJobOperation", + "client": { + "shortName": "JobsClient", + "fullName": "google.cloud.run.v2.JobsClient" + }, + "method": { + "shortName": "CreateJob", + "fullName": "google.cloud.run.v2.Jobs.CreateJob", + "service": { + "shortName": "Jobs", + "fullName": "google.cloud.run.v2.Jobs" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 58, + "type": "FULL" + } + ] + }, + { + "regionTag": "run_v2_generated_Jobs_DeleteJob_sync", + "title": "run DeleteJob Sample", + "description": "DeleteJob deletes a Job.", + "file": "JobsClient/DeleteJob/main.go", + "language": "GO", + "clientMethod": { + "shortName": "DeleteJob", + "fullName": "google.cloud.run.v2.JobsClient.DeleteJob", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "runpb.DeleteJobRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "DeleteJobOperation", + "client": { + "shortName": "JobsClient", + "fullName": "google.cloud.run.v2.JobsClient" + }, + "method": { + "shortName": "DeleteJob", + "fullName": "google.cloud.run.v2.Jobs.DeleteJob", + "service": { + "shortName": "Jobs", + "fullName": "google.cloud.run.v2.Jobs" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 58, + "type": "FULL" + } + ] + }, + { + "regionTag": "run_v2_generated_Jobs_DeleteOperation_sync", + "title": "run DeleteOperation Sample", + "description": "DeleteOperation is a utility method from google.longrunning.Operations.", + "file": "JobsClient/DeleteOperation/main.go", + "language": "GO", + "clientMethod": { + "shortName": "DeleteOperation", + "fullName": "google.cloud.run.v2.JobsClient.DeleteOperation", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "longrunningpb.DeleteOperationRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "client": { + "shortName": "JobsClient", + "fullName": "google.cloud.run.v2.JobsClient" + }, + "method": { + "shortName": "DeleteOperation", + "fullName": "google.cloud.run.v2.Jobs.DeleteOperation", + "service": { + "shortName": "Jobs", + "fullName": "google.cloud.run.v2.Jobs" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 52, + "type": "FULL" + } + ] + }, + { + "regionTag": "run_v2_generated_Jobs_GetIamPolicy_sync", + "title": "run GetIamPolicy Sample", + "description": "GetIamPolicy gets the IAM Access Control policy currently in effect for the given Job.\nThis result does not include any inherited policies.", + "file": "JobsClient/GetIamPolicy/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.run.v2.JobsClient.GetIamPolicy", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "iampb.GetIamPolicyRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "iampb.Policy", + "client": { + "shortName": "JobsClient", + "fullName": "google.cloud.run.v2.JobsClient" + }, + "method": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.run.v2.Jobs.GetIamPolicy", + "service": { + "shortName": "Jobs", + "fullName": "google.cloud.run.v2.Jobs" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 54, + "type": "FULL" + } + ] + }, + { + "regionTag": "run_v2_generated_Jobs_GetJob_sync", + "title": "run GetJob Sample", + "description": "GetJob gets information about a Job.", + "file": "JobsClient/GetJob/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetJob", + "fullName": "google.cloud.run.v2.JobsClient.GetJob", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "runpb.GetJobRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "runpb.Job", + "client": { + "shortName": "JobsClient", + "fullName": "google.cloud.run.v2.JobsClient" + }, + "method": { + "shortName": "GetJob", + "fullName": "google.cloud.run.v2.Jobs.GetJob", + "service": { + "shortName": "Jobs", + "fullName": "google.cloud.run.v2.Jobs" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 53, + "type": "FULL" + } + ] + }, + { + "regionTag": "run_v2_generated_Jobs_GetOperation_sync", + "title": "run GetOperation Sample", + "description": "GetOperation is a utility method from google.longrunning.Operations.", + "file": "JobsClient/GetOperation/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetOperation", + "fullName": "google.cloud.run.v2.JobsClient.GetOperation", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "longrunningpb.GetOperationRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "longrunningpb.Operation", + "client": { + "shortName": "JobsClient", + "fullName": "google.cloud.run.v2.JobsClient" + }, + "method": { + "shortName": "GetOperation", + "fullName": "google.cloud.run.v2.Jobs.GetOperation", + "service": { + "shortName": "Jobs", + "fullName": "google.cloud.run.v2.Jobs" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 54, + "type": "FULL" + } + ] + }, + { + "regionTag": "run_v2_generated_Jobs_ListJobs_sync", + "title": "run ListJobs Sample", + "description": "ListJobs lists Jobs.", + "file": "JobsClient/ListJobs/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListJobs", + "fullName": "google.cloud.run.v2.JobsClient.ListJobs", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "runpb.ListJobsRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "JobIterator", + "client": { + "shortName": "JobsClient", + "fullName": "google.cloud.run.v2.JobsClient" + }, + "method": { + "shortName": "ListJobs", + "fullName": "google.cloud.run.v2.Jobs.ListJobs", + "service": { + "shortName": "Jobs", + "fullName": "google.cloud.run.v2.Jobs" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 60, + "type": "FULL" + } + ] + }, + { + "regionTag": "run_v2_generated_Jobs_ListOperations_sync", + "title": "run ListOperations Sample", + "description": "ListOperations is a utility method from google.longrunning.Operations.", + "file": "JobsClient/ListOperations/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListOperations", + "fullName": "google.cloud.run.v2.JobsClient.ListOperations", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "longrunningpb.ListOperationsRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "OperationIterator", + "client": { + "shortName": "JobsClient", + "fullName": "google.cloud.run.v2.JobsClient" + }, + "method": { + "shortName": "ListOperations", + "fullName": "google.cloud.run.v2.Jobs.ListOperations", + "service": { + "shortName": "Jobs", + "fullName": "google.cloud.run.v2.Jobs" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 61, + "type": "FULL" + } + ] + }, + { + "regionTag": "run_v2_generated_Jobs_RunJob_sync", + "title": "run RunJob Sample", + "description": "RunJob triggers creation of a new Execution of this Job.", + "file": "JobsClient/RunJob/main.go", + "language": "GO", + "clientMethod": { + "shortName": "RunJob", + "fullName": "google.cloud.run.v2.JobsClient.RunJob", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "runpb.RunJobRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "RunJobOperation", + "client": { + "shortName": "JobsClient", + "fullName": "google.cloud.run.v2.JobsClient" + }, + "method": { + "shortName": "RunJob", + "fullName": "google.cloud.run.v2.Jobs.RunJob", + "service": { + "shortName": "Jobs", + "fullName": "google.cloud.run.v2.Jobs" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 58, + "type": "FULL" + } + ] + }, + { + "regionTag": "run_v2_generated_Jobs_SetIamPolicy_sync", + "title": "run SetIamPolicy Sample", + "description": "SetIamPolicy sets the IAM Access control policy for the specified Job. Overwrites\nany existing policy.", + "file": "JobsClient/SetIamPolicy/main.go", + "language": "GO", + "clientMethod": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.run.v2.JobsClient.SetIamPolicy", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "iampb.SetIamPolicyRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "iampb.Policy", + "client": { + "shortName": "JobsClient", + "fullName": "google.cloud.run.v2.JobsClient" + }, + "method": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.run.v2.Jobs.SetIamPolicy", + "service": { + "shortName": "Jobs", + "fullName": "google.cloud.run.v2.Jobs" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 54, + "type": "FULL" + } + ] + }, + { + "regionTag": "run_v2_generated_Jobs_TestIamPermissions_sync", + "title": "run TestIamPermissions Sample", + "description": "TestIamPermissions returns permissions that a caller has on the specified Project.\n\nThere are no permissions required for making this API call.", + "file": "JobsClient/TestIamPermissions/main.go", + "language": "GO", + "clientMethod": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.run.v2.JobsClient.TestIamPermissions", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "iampb.TestIamPermissionsRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "iampb.TestIamPermissionsResponse", + "client": { + "shortName": "JobsClient", + "fullName": "google.cloud.run.v2.JobsClient" + }, + "method": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.run.v2.Jobs.TestIamPermissions", + "service": { + "shortName": "Jobs", + "fullName": "google.cloud.run.v2.Jobs" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 54, + "type": "FULL" + } + ] + }, + { + "regionTag": "run_v2_generated_Jobs_UpdateJob_sync", + "title": "run UpdateJob Sample", + "description": "UpdateJob updates a Job.", + "file": "JobsClient/UpdateJob/main.go", + "language": "GO", + "clientMethod": { + "shortName": "UpdateJob", + "fullName": "google.cloud.run.v2.JobsClient.UpdateJob", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "runpb.UpdateJobRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "UpdateJobOperation", + "client": { + "shortName": "JobsClient", + "fullName": "google.cloud.run.v2.JobsClient" + }, + "method": { + "shortName": "UpdateJob", + "fullName": "google.cloud.run.v2.Jobs.UpdateJob", + "service": { + "shortName": "Jobs", + "fullName": "google.cloud.run.v2.Jobs" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 58, + "type": "FULL" + } + ] + }, + { + "regionTag": "run_v2_generated_Revisions_DeleteOperation_sync", + "title": "run DeleteOperation Sample", + "description": "DeleteOperation is a utility method from google.longrunning.Operations.", + "file": "RevisionsClient/DeleteOperation/main.go", + "language": "GO", + "clientMethod": { + "shortName": "DeleteOperation", + "fullName": "google.cloud.run.v2.RevisionsClient.DeleteOperation", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "longrunningpb.DeleteOperationRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "client": { + "shortName": "RevisionsClient", + "fullName": "google.cloud.run.v2.RevisionsClient" + }, + "method": { + "shortName": "DeleteOperation", + "fullName": "google.cloud.run.v2.Revisions.DeleteOperation", + "service": { + "shortName": "Revisions", + "fullName": "google.cloud.run.v2.Revisions" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 52, + "type": "FULL" + } + ] + }, + { + "regionTag": "run_v2_generated_Revisions_DeleteRevision_sync", + "title": "run DeleteRevision Sample", + "description": "DeleteRevision deletes a Revision.", + "file": "RevisionsClient/DeleteRevision/main.go", + "language": "GO", + "clientMethod": { + "shortName": "DeleteRevision", + "fullName": "google.cloud.run.v2.RevisionsClient.DeleteRevision", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "runpb.DeleteRevisionRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "DeleteRevisionOperation", + "client": { + "shortName": "RevisionsClient", + "fullName": "google.cloud.run.v2.RevisionsClient" + }, + "method": { + "shortName": "DeleteRevision", + "fullName": "google.cloud.run.v2.Revisions.DeleteRevision", + "service": { + "shortName": "Revisions", + "fullName": "google.cloud.run.v2.Revisions" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 58, + "type": "FULL" + } + ] + }, + { + "regionTag": "run_v2_generated_Revisions_GetOperation_sync", + "title": "run GetOperation Sample", + "description": "GetOperation is a utility method from google.longrunning.Operations.", + "file": "RevisionsClient/GetOperation/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetOperation", + "fullName": "google.cloud.run.v2.RevisionsClient.GetOperation", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "longrunningpb.GetOperationRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "longrunningpb.Operation", + "client": { + "shortName": "RevisionsClient", + "fullName": "google.cloud.run.v2.RevisionsClient" + }, + "method": { + "shortName": "GetOperation", + "fullName": "google.cloud.run.v2.Revisions.GetOperation", + "service": { + "shortName": "Revisions", + "fullName": "google.cloud.run.v2.Revisions" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 54, + "type": "FULL" + } + ] + }, + { + "regionTag": "run_v2_generated_Revisions_GetRevision_sync", + "title": "run GetRevision Sample", + "description": "GetRevision gets information about a Revision.", + "file": "RevisionsClient/GetRevision/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetRevision", + "fullName": "google.cloud.run.v2.RevisionsClient.GetRevision", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "runpb.GetRevisionRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "runpb.Revision", + "client": { + "shortName": "RevisionsClient", + "fullName": "google.cloud.run.v2.RevisionsClient" + }, + "method": { + "shortName": "GetRevision", + "fullName": "google.cloud.run.v2.Revisions.GetRevision", + "service": { + "shortName": "Revisions", + "fullName": "google.cloud.run.v2.Revisions" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 53, + "type": "FULL" + } + ] + }, + { + "regionTag": "run_v2_generated_Revisions_ListOperations_sync", + "title": "run ListOperations Sample", + "description": "ListOperations is a utility method from google.longrunning.Operations.", + "file": "RevisionsClient/ListOperations/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListOperations", + "fullName": "google.cloud.run.v2.RevisionsClient.ListOperations", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "longrunningpb.ListOperationsRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "OperationIterator", + "client": { + "shortName": "RevisionsClient", + "fullName": "google.cloud.run.v2.RevisionsClient" + }, + "method": { + "shortName": "ListOperations", + "fullName": "google.cloud.run.v2.Revisions.ListOperations", + "service": { + "shortName": "Revisions", + "fullName": "google.cloud.run.v2.Revisions" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 61, + "type": "FULL" + } + ] + }, + { + "regionTag": "run_v2_generated_Revisions_ListRevisions_sync", + "title": "run ListRevisions Sample", + "description": "ListRevisions lists Revisions from a given Service, or from a given location.", + "file": "RevisionsClient/ListRevisions/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListRevisions", + "fullName": "google.cloud.run.v2.RevisionsClient.ListRevisions", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "runpb.ListRevisionsRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "RevisionIterator", + "client": { + "shortName": "RevisionsClient", + "fullName": "google.cloud.run.v2.RevisionsClient" + }, + "method": { + "shortName": "ListRevisions", + "fullName": "google.cloud.run.v2.Revisions.ListRevisions", + "service": { + "shortName": "Revisions", + "fullName": "google.cloud.run.v2.Revisions" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 60, + "type": "FULL" + } + ] + }, + { + "regionTag": "run_v2_generated_Services_CreateService_sync", + "title": "run CreateService Sample", + "description": "CreateService creates a new Service in a given project and location.", + "file": "ServicesClient/CreateService/main.go", + "language": "GO", + "clientMethod": { + "shortName": "CreateService", + "fullName": "google.cloud.run.v2.ServicesClient.CreateService", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "runpb.CreateServiceRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "CreateServiceOperation", + "client": { + "shortName": "ServicesClient", + "fullName": "google.cloud.run.v2.ServicesClient" + }, + "method": { + "shortName": "CreateService", + "fullName": "google.cloud.run.v2.Services.CreateService", + "service": { + "shortName": "Services", + "fullName": "google.cloud.run.v2.Services" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 58, + "type": "FULL" + } + ] + }, + { + "regionTag": "run_v2_generated_Services_DeleteOperation_sync", + "title": "run DeleteOperation Sample", + "description": "DeleteOperation is a utility method from google.longrunning.Operations.", + "file": "ServicesClient/DeleteOperation/main.go", + "language": "GO", + "clientMethod": { + "shortName": "DeleteOperation", + "fullName": "google.cloud.run.v2.ServicesClient.DeleteOperation", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "longrunningpb.DeleteOperationRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "client": { + "shortName": "ServicesClient", + "fullName": "google.cloud.run.v2.ServicesClient" + }, + "method": { + "shortName": "DeleteOperation", + "fullName": "google.cloud.run.v2.Services.DeleteOperation", + "service": { + "shortName": "Services", + "fullName": "google.cloud.run.v2.Services" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 52, + "type": "FULL" + } + ] + }, + { + "regionTag": "run_v2_generated_Services_DeleteService_sync", + "title": "run DeleteService Sample", + "description": "DeleteService deletes a Service.\nThis will cause the Service to stop serving traffic and will delete all\nrevisions.", + "file": "ServicesClient/DeleteService/main.go", + "language": "GO", + "clientMethod": { + "shortName": "DeleteService", + "fullName": "google.cloud.run.v2.ServicesClient.DeleteService", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "runpb.DeleteServiceRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "DeleteServiceOperation", + "client": { + "shortName": "ServicesClient", + "fullName": "google.cloud.run.v2.ServicesClient" + }, + "method": { + "shortName": "DeleteService", + "fullName": "google.cloud.run.v2.Services.DeleteService", + "service": { + "shortName": "Services", + "fullName": "google.cloud.run.v2.Services" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 58, + "type": "FULL" + } + ] + }, + { + "regionTag": "run_v2_generated_Services_GetIamPolicy_sync", + "title": "run GetIamPolicy Sample", + "description": "GetIamPolicy gets the IAM Access Control policy currently in effect for the given\nCloud Run Service. This result does not include any inherited policies.", + "file": "ServicesClient/GetIamPolicy/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.run.v2.ServicesClient.GetIamPolicy", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "iampb.GetIamPolicyRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "iampb.Policy", + "client": { + "shortName": "ServicesClient", + "fullName": "google.cloud.run.v2.ServicesClient" + }, + "method": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.run.v2.Services.GetIamPolicy", + "service": { + "shortName": "Services", + "fullName": "google.cloud.run.v2.Services" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 54, + "type": "FULL" + } + ] + }, + { + "regionTag": "run_v2_generated_Services_GetOperation_sync", + "title": "run GetOperation Sample", + "description": "GetOperation is a utility method from google.longrunning.Operations.", + "file": "ServicesClient/GetOperation/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetOperation", + "fullName": "google.cloud.run.v2.ServicesClient.GetOperation", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "longrunningpb.GetOperationRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "longrunningpb.Operation", + "client": { + "shortName": "ServicesClient", + "fullName": "google.cloud.run.v2.ServicesClient" + }, + "method": { + "shortName": "GetOperation", + "fullName": "google.cloud.run.v2.Services.GetOperation", + "service": { + "shortName": "Services", + "fullName": "google.cloud.run.v2.Services" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 54, + "type": "FULL" + } + ] + }, + { + "regionTag": "run_v2_generated_Services_GetService_sync", + "title": "run GetService Sample", + "description": "GetService gets information about a Service.", + "file": "ServicesClient/GetService/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetService", + "fullName": "google.cloud.run.v2.ServicesClient.GetService", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "runpb.GetServiceRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "runpb.Service", + "client": { + "shortName": "ServicesClient", + "fullName": "google.cloud.run.v2.ServicesClient" + }, + "method": { + "shortName": "GetService", + "fullName": "google.cloud.run.v2.Services.GetService", + "service": { + "shortName": "Services", + "fullName": "google.cloud.run.v2.Services" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 53, + "type": "FULL" + } + ] + }, + { + "regionTag": "run_v2_generated_Services_ListOperations_sync", + "title": "run ListOperations Sample", + "description": "ListOperations is a utility method from google.longrunning.Operations.", + "file": "ServicesClient/ListOperations/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListOperations", + "fullName": "google.cloud.run.v2.ServicesClient.ListOperations", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "longrunningpb.ListOperationsRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "OperationIterator", + "client": { + "shortName": "ServicesClient", + "fullName": "google.cloud.run.v2.ServicesClient" + }, + "method": { + "shortName": "ListOperations", + "fullName": "google.cloud.run.v2.Services.ListOperations", + "service": { + "shortName": "Services", + "fullName": "google.cloud.run.v2.Services" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 61, + "type": "FULL" + } + ] + }, + { + "regionTag": "run_v2_generated_Services_ListServices_sync", + "title": "run ListServices Sample", + "description": "ListServices lists Services.", + "file": "ServicesClient/ListServices/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListServices", + "fullName": "google.cloud.run.v2.ServicesClient.ListServices", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "runpb.ListServicesRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "ServiceIterator", + "client": { + "shortName": "ServicesClient", + "fullName": "google.cloud.run.v2.ServicesClient" + }, + "method": { + "shortName": "ListServices", + "fullName": "google.cloud.run.v2.Services.ListServices", + "service": { + "shortName": "Services", + "fullName": "google.cloud.run.v2.Services" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 60, + "type": "FULL" + } + ] + }, + { + "regionTag": "run_v2_generated_Services_SetIamPolicy_sync", + "title": "run SetIamPolicy Sample", + "description": "SetIamPolicy sets the IAM Access control policy for the specified Service. Overwrites\nany existing policy.", + "file": "ServicesClient/SetIamPolicy/main.go", + "language": "GO", + "clientMethod": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.run.v2.ServicesClient.SetIamPolicy", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "iampb.SetIamPolicyRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "iampb.Policy", + "client": { + "shortName": "ServicesClient", + "fullName": "google.cloud.run.v2.ServicesClient" + }, + "method": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.run.v2.Services.SetIamPolicy", + "service": { + "shortName": "Services", + "fullName": "google.cloud.run.v2.Services" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 54, + "type": "FULL" + } + ] + }, + { + "regionTag": "run_v2_generated_Services_TestIamPermissions_sync", + "title": "run TestIamPermissions Sample", + "description": "TestIamPermissions returns permissions that a caller has on the specified Project.\n\nThere are no permissions required for making this API call.", + "file": "ServicesClient/TestIamPermissions/main.go", + "language": "GO", + "clientMethod": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.run.v2.ServicesClient.TestIamPermissions", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "iampb.TestIamPermissionsRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "iampb.TestIamPermissionsResponse", + "client": { + "shortName": "ServicesClient", + "fullName": "google.cloud.run.v2.ServicesClient" + }, + "method": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.run.v2.Services.TestIamPermissions", + "service": { + "shortName": "Services", + "fullName": "google.cloud.run.v2.Services" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 54, + "type": "FULL" + } + ] + }, + { + "regionTag": "run_v2_generated_Services_UpdateService_sync", + "title": "run UpdateService Sample", + "description": "UpdateService updates a Service.", + "file": "ServicesClient/UpdateService/main.go", + "language": "GO", + "clientMethod": { + "shortName": "UpdateService", + "fullName": "google.cloud.run.v2.ServicesClient.UpdateService", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "runpb.UpdateServiceRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "UpdateServiceOperation", + "client": { + "shortName": "ServicesClient", + "fullName": "google.cloud.run.v2.ServicesClient" + }, + "method": { + "shortName": "UpdateService", + "fullName": "google.cloud.run.v2.Services.UpdateService", + "service": { + "shortName": "Services", + "fullName": "google.cloud.run.v2.Services" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 58, + "type": "FULL" + } + ] + }, + { + "regionTag": "run_v2_generated_Tasks_DeleteOperation_sync", + "title": "run DeleteOperation Sample", + "description": "DeleteOperation is a utility method from google.longrunning.Operations.", + "file": "TasksClient/DeleteOperation/main.go", + "language": "GO", + "clientMethod": { + "shortName": "DeleteOperation", + "fullName": "google.cloud.run.v2.TasksClient.DeleteOperation", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "longrunningpb.DeleteOperationRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "client": { + "shortName": "TasksClient", + "fullName": "google.cloud.run.v2.TasksClient" + }, + "method": { + "shortName": "DeleteOperation", + "fullName": "google.cloud.run.v2.Tasks.DeleteOperation", + "service": { + "shortName": "Tasks", + "fullName": "google.cloud.run.v2.Tasks" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 52, + "type": "FULL" + } + ] + }, + { + "regionTag": "run_v2_generated_Tasks_GetOperation_sync", + "title": "run GetOperation Sample", + "description": "GetOperation is a utility method from google.longrunning.Operations.", + "file": "TasksClient/GetOperation/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetOperation", + "fullName": "google.cloud.run.v2.TasksClient.GetOperation", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "longrunningpb.GetOperationRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "longrunningpb.Operation", + "client": { + "shortName": "TasksClient", + "fullName": "google.cloud.run.v2.TasksClient" + }, + "method": { + "shortName": "GetOperation", + "fullName": "google.cloud.run.v2.Tasks.GetOperation", + "service": { + "shortName": "Tasks", + "fullName": "google.cloud.run.v2.Tasks" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 54, + "type": "FULL" + } + ] + }, + { + "regionTag": "run_v2_generated_Tasks_GetTask_sync", + "title": "run GetTask Sample", + "description": "GetTask gets information about a Task.", + "file": "TasksClient/GetTask/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetTask", + "fullName": "google.cloud.run.v2.TasksClient.GetTask", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "runpb.GetTaskRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "runpb.Task", + "client": { + "shortName": "TasksClient", + "fullName": "google.cloud.run.v2.TasksClient" + }, + "method": { + "shortName": "GetTask", + "fullName": "google.cloud.run.v2.Tasks.GetTask", + "service": { + "shortName": "Tasks", + "fullName": "google.cloud.run.v2.Tasks" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 53, + "type": "FULL" + } + ] + }, + { + "regionTag": "run_v2_generated_Tasks_ListOperations_sync", + "title": "run ListOperations Sample", + "description": "ListOperations is a utility method from google.longrunning.Operations.", + "file": "TasksClient/ListOperations/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListOperations", + "fullName": "google.cloud.run.v2.TasksClient.ListOperations", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "longrunningpb.ListOperationsRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "OperationIterator", + "client": { + "shortName": "TasksClient", + "fullName": "google.cloud.run.v2.TasksClient" + }, + "method": { + "shortName": "ListOperations", + "fullName": "google.cloud.run.v2.Tasks.ListOperations", + "service": { + "shortName": "Tasks", + "fullName": "google.cloud.run.v2.Tasks" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 61, + "type": "FULL" + } + ] + }, + { + "regionTag": "run_v2_generated_Tasks_ListTasks_sync", + "title": "run ListTasks Sample", + "description": "ListTasks lists Tasks from an Execution of a Job.", + "file": "TasksClient/ListTasks/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListTasks", + "fullName": "google.cloud.run.v2.TasksClient.ListTasks", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "runpb.ListTasksRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "TaskIterator", + "client": { + "shortName": "TasksClient", + "fullName": "google.cloud.run.v2.TasksClient" + }, + "method": { + "shortName": "ListTasks", + "fullName": "google.cloud.run.v2.Tasks.ListTasks", + "service": { + "shortName": "Tasks", + "fullName": "google.cloud.run.v2.Tasks" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 60, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file