diff --git a/internal/generated/snippets/go.mod b/internal/generated/snippets/go.mod index d055e9ac080..19d530e55fe 100644 --- a/internal/generated/snippets/go.mod +++ b/internal/generated/snippets/go.mod @@ -86,6 +86,7 @@ require ( cloud.google.com/go/resourcemanager v1.0.0 cloud.google.com/go/resourcesettings v1.0.0 cloud.google.com/go/retail v1.0.0 + cloud.google.com/go/run v0.0.0-00010101000000-000000000000 cloud.google.com/go/scheduler v1.0.0 cloud.google.com/go/secretmanager v1.0.0 cloud.google.com/go/security v1.1.1 @@ -112,8 +113,8 @@ require ( cloud.google.com/go/websecurityscanner v1.0.0 cloud.google.com/go/workflows v1.1.0 github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - google.golang.org/api v0.73.0 - google.golang.org/genproto v0.0.0-20220329135034-5a5e19f58d62 + google.golang.org/api v0.74.0 + google.golang.org/genproto v0.0.0-20220329172620-7be39ac1afc7 ) replace cloud.google.com/go/storagetransfer => ../../../storagetransfer @@ -339,3 +340,5 @@ replace cloud.google.com/go/dataplex => ../../../dataplex replace cloud.google.com/go/certificatemanager => ../../../certificatemanager replace cloud.google.com/go/optimization => ../../../optimization + +replace cloud.google.com/go/run => ../../../run diff --git a/internal/generated/snippets/go.sum b/internal/generated/snippets/go.sum index c9a3e4221cc..8d454bd234e 100644 --- a/internal/generated/snippets/go.sum +++ b/internal/generated/snippets/go.sum @@ -106,8 +106,9 @@ golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLd golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220325170049-de3da57026de h1:pZB1TWnKi+o4bENlbzAgLrEbY4RMYmUIRobMcSmfeYc= +golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= @@ -138,8 +139,9 @@ golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5 h1:y/woIyUBFbpQGKS0u1aHF/40WUDnek3fPOyD08H5Vng= golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886 h1:eJv7u3ksNXoLbGSKuv2s/SIO4tJVxc/A+MTpzxDgz/Q= +golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -167,8 +169,9 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8= -google.golang.org/api v0.73.0 h1:O9bThUh35K1rvUrQwTUQ1eqLC/IYyzUpWavYIO2EXvo= google.golang.org/api v0.73.0/go.mod h1:lbd/q6BRFJbdpV6OUCXstVeiI5mL/d3/WifG7iNKnjI= +google.golang.org/api v0.74.0 h1:ExR2D+5TYIrMphWgs5JCgwRhEDlPDXXrLwHHMgPHTXE= +google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= @@ -189,9 +192,11 @@ google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2I google.golang.org/genproto v0.0.0-20220317150908-0efb43f6373e/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= google.golang.org/genproto v0.0.0-20220322021311-435b647f9ef2/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= google.golang.org/genproto v0.0.0-20220323144105-ec3c684e5b14/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= +google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= google.golang.org/genproto v0.0.0-20220328180837-c47567c462d1/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220329135034-5a5e19f58d62 h1:IPy3YJ7uYPB1sDNJRs/b7Dgs6KxwMyGYgtIgDnKgEyw= google.golang.org/genproto v0.0.0-20220329135034-5a5e19f58d62/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220329172620-7be39ac1afc7 h1:HOL66YCI20JvN2hVk6o2YIp9i/3RvzVUz82PqNr7fXw= +google.golang.org/genproto v0.0.0-20220329172620-7be39ac1afc7/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= diff --git a/internal/generated/snippets/run/apiv2/RevisionsClient/DeleteRevision/main.go b/internal/generated/snippets/run/apiv2/RevisionsClient/DeleteRevision/main.go new file mode 100644 index 00000000000..2da5a07a9f5 --- /dev/null +++ b/internal/generated/snippets/run/apiv2/RevisionsClient/DeleteRevision/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_Revisions_DeleteRevision_sync] + +package main + +import ( + "context" + + run "cloud.google.com/go/run/apiv2" + runpb "google.golang.org/genproto/googleapis/cloud/run/v2" +) + +func main() { + ctx := context.Background() + c, err := run.NewRevisionsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &runpb.DeleteRevisionRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/run/v2#DeleteRevisionRequest. + } + op, err := c.DeleteRevision(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_Revisions_DeleteRevision_sync] diff --git a/internal/generated/snippets/run/apiv2/RevisionsClient/GetRevision/main.go b/internal/generated/snippets/run/apiv2/RevisionsClient/GetRevision/main.go new file mode 100644 index 00000000000..e9cf893dffd --- /dev/null +++ b/internal/generated/snippets/run/apiv2/RevisionsClient/GetRevision/main.go @@ -0,0 +1,48 @@ +// 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_GetRevision_sync] + +package main + +import ( + "context" + + run "cloud.google.com/go/run/apiv2" + runpb "google.golang.org/genproto/googleapis/cloud/run/v2" +) + +func main() { + ctx := context.Background() + c, err := run.NewRevisionsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &runpb.GetRevisionRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/run/v2#GetRevisionRequest. + } + resp, err := c.GetRevision(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END run_v2_generated_Revisions_GetRevision_sync] diff --git a/internal/generated/snippets/run/apiv2/RevisionsClient/ListRevisions/main.go b/internal/generated/snippets/run/apiv2/RevisionsClient/ListRevisions/main.go new file mode 100644 index 00000000000..5e40fcb7c38 --- /dev/null +++ b/internal/generated/snippets/run/apiv2/RevisionsClient/ListRevisions/main.go @@ -0,0 +1,55 @@ +// 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_ListRevisions_sync] + +package main + +import ( + "context" + + run "cloud.google.com/go/run/apiv2" + "google.golang.org/api/iterator" + runpb "google.golang.org/genproto/googleapis/cloud/run/v2" +) + +func main() { + ctx := context.Background() + c, err := run.NewRevisionsClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &runpb.ListRevisionsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/run/v2#ListRevisionsRequest. + } + it := c.ListRevisions(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_ListRevisions_sync] diff --git a/internal/generated/snippets/run/apiv2/ServicesClient/CreateService/main.go b/internal/generated/snippets/run/apiv2/ServicesClient/CreateService/main.go new file mode 100644 index 00000000000..449cc0062ab --- /dev/null +++ b/internal/generated/snippets/run/apiv2/ServicesClient/CreateService/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_Services_CreateService_sync] + +package main + +import ( + "context" + + run "cloud.google.com/go/run/apiv2" + runpb "google.golang.org/genproto/googleapis/cloud/run/v2" +) + +func main() { + ctx := context.Background() + c, err := run.NewServicesClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &runpb.CreateServiceRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/run/v2#CreateServiceRequest. + } + op, err := c.CreateService(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_Services_CreateService_sync] diff --git a/internal/generated/snippets/run/apiv2/ServicesClient/DeleteService/main.go b/internal/generated/snippets/run/apiv2/ServicesClient/DeleteService/main.go new file mode 100644 index 00000000000..38bd3091335 --- /dev/null +++ b/internal/generated/snippets/run/apiv2/ServicesClient/DeleteService/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_Services_DeleteService_sync] + +package main + +import ( + "context" + + run "cloud.google.com/go/run/apiv2" + runpb "google.golang.org/genproto/googleapis/cloud/run/v2" +) + +func main() { + ctx := context.Background() + c, err := run.NewServicesClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &runpb.DeleteServiceRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/run/v2#DeleteServiceRequest. + } + op, err := c.DeleteService(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_Services_DeleteService_sync] diff --git a/internal/generated/snippets/run/apiv2/ServicesClient/GetIamPolicy/main.go b/internal/generated/snippets/run/apiv2/ServicesClient/GetIamPolicy/main.go new file mode 100644 index 00000000000..aa10578601f --- /dev/null +++ b/internal/generated/snippets/run/apiv2/ServicesClient/GetIamPolicy/main.go @@ -0,0 +1,48 @@ +// 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_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() + c, err := run.NewServicesClient(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_Services_GetIamPolicy_sync] diff --git a/internal/generated/snippets/run/apiv2/ServicesClient/GetService/main.go b/internal/generated/snippets/run/apiv2/ServicesClient/GetService/main.go new file mode 100644 index 00000000000..cbcb8119262 --- /dev/null +++ b/internal/generated/snippets/run/apiv2/ServicesClient/GetService/main.go @@ -0,0 +1,48 @@ +// 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_GetService_sync] + +package main + +import ( + "context" + + run "cloud.google.com/go/run/apiv2" + runpb "google.golang.org/genproto/googleapis/cloud/run/v2" +) + +func main() { + ctx := context.Background() + c, err := run.NewServicesClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &runpb.GetServiceRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/run/v2#GetServiceRequest. + } + resp, err := c.GetService(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END run_v2_generated_Services_GetService_sync] diff --git a/internal/generated/snippets/run/apiv2/ServicesClient/ListServices/main.go b/internal/generated/snippets/run/apiv2/ServicesClient/ListServices/main.go new file mode 100644 index 00000000000..b09468dad48 --- /dev/null +++ b/internal/generated/snippets/run/apiv2/ServicesClient/ListServices/main.go @@ -0,0 +1,55 @@ +// 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_ListServices_sync] + +package main + +import ( + "context" + + run "cloud.google.com/go/run/apiv2" + "google.golang.org/api/iterator" + runpb "google.golang.org/genproto/googleapis/cloud/run/v2" +) + +func main() { + ctx := context.Background() + c, err := run.NewServicesClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &runpb.ListServicesRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/run/v2#ListServicesRequest. + } + it := c.ListServices(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_ListServices_sync] diff --git a/internal/generated/snippets/run/apiv2/ServicesClient/SetIamPolicy/main.go b/internal/generated/snippets/run/apiv2/ServicesClient/SetIamPolicy/main.go new file mode 100644 index 00000000000..d363fa8b804 --- /dev/null +++ b/internal/generated/snippets/run/apiv2/ServicesClient/SetIamPolicy/main.go @@ -0,0 +1,48 @@ +// 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_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() + c, err := run.NewServicesClient(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_Services_SetIamPolicy_sync] diff --git a/internal/generated/snippets/run/apiv2/ServicesClient/TestIamPermissions/main.go b/internal/generated/snippets/run/apiv2/ServicesClient/TestIamPermissions/main.go new file mode 100644 index 00000000000..50d02754bcb --- /dev/null +++ b/internal/generated/snippets/run/apiv2/ServicesClient/TestIamPermissions/main.go @@ -0,0 +1,48 @@ +// 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_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() + c, err := run.NewServicesClient(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_Services_TestIamPermissions_sync] diff --git a/internal/generated/snippets/run/apiv2/ServicesClient/UpdateService/main.go b/internal/generated/snippets/run/apiv2/ServicesClient/UpdateService/main.go new file mode 100644 index 00000000000..60d4d60529a --- /dev/null +++ b/internal/generated/snippets/run/apiv2/ServicesClient/UpdateService/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_Services_UpdateService_sync] + +package main + +import ( + "context" + + run "cloud.google.com/go/run/apiv2" + runpb "google.golang.org/genproto/googleapis/cloud/run/v2" +) + +func main() { + ctx := context.Background() + c, err := run.NewServicesClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &runpb.UpdateServiceRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/run/v2#UpdateServiceRequest. + } + op, err := c.UpdateService(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_Services_UpdateService_sync]