From 1540fecbae4ffc0781b872ddf9c80015e56312d2 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 18 May 2022 22:10:08 +0000 Subject: [PATCH] chore(all): auto-regenerate gapics MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is an auto-generated regeneration of the gapic clients by cloud.google.com/go/internal/gapicgen. Once the corresponding genproto PR is submitted, genbot will update this PR with a newer dependency to the newer version of genproto and assign reviewers to this PR. If you have been assigned to review this PR, please: - Ensure that the version of genproto in go.mod has been updated. - Ensure that CI is passing. If it's failing, it requires your manual attention. - Approve and submit this PR if you believe it's ready to ship. Corresponding genproto PR: https://github.com/googleapis/go-genproto/pull/809 Changes: feat(accessapproval): add config for invalidate RPC PiperOrigin-RevId: 449558143 Source-Link: https://github.com/googleapis/googleapis/commit/9dbfb83b4f0e029e3c6a52c5a157b8f6cc720ecb feat(storage/internal)!: Change GCS gRPC API to get user billing project from gRPC metadata instead of CommonRequestParams, and remove latter PiperOrigin-RevId: 449498085 Source-Link: https://github.com/googleapis/googleapis/commit/d4444af5e7bb30e666629b23bb1c03d926316029 feat(asset): Add SavedQuery CURD support feat: Add tags support feat!:*Add RelatedAsset and deprecate RelatedAssets for relationship GA *The previous representation of the relationship feature is deprecated and unimplemented. The RelatedAsset message represents the new stable format. PiperOrigin-RevId: 449306805 Source-Link: https://github.com/googleapis/googleapis/commit/3d7bd9d4a8772e0c7e1d39a2763e1914bfb5963d feat(recaptchaenterprise): Add support for Password Check through the private_password_leak_verification field in the reCAPTCHA Assessment PiperOrigin-RevId: 449202953 Source-Link: https://github.com/googleapis/googleapis/commit/e2ed48f522fa5ca5f2d9c5eaf93b0b6e90cdc6a8 fix(gkebackup): use GkeBackup instead of Gkebackup in csharp, ruby, and php PiperOrigin-RevId: 449074031 Source-Link: https://github.com/googleapis/googleapis/commit/3ce5771036f4f828583c73846b27a895cc9b8e37 Synchronize new proto/yaml changes. PiperOrigin-RevId: 449052112 Source-Link: https://github.com/googleapis/googleapis/commit/3150afaab93bb09fc6331ea2665708b5cb30a4ec feat(pubsub): add BigQuery configuration for subscriptions PiperOrigin-RevId: 449031535 Source-Link: https://github.com/googleapis/googleapis/commit/feec34dfac930eb0ab8c3e72ff5794c3f4c5924d feat(datastream): Include the location mixin client PiperOrigin-RevId: 448542863 Source-Link: https://github.com/googleapis/googleapis/commit/ac491879a1ee2a1b658723b117ae659f703e2795 feat(security/privateca): Provide interfaces for location and IAM policy calls PiperOrigin-RevId: 448542420 Source-Link: https://github.com/googleapis/googleapis/commit/59174f7f665534b7999cb6c2bfde9ece09875ead feat(iap): add the TunnelDestGroup-related methods and types feat: add ReauthSettings to the UpdateIapSettingsRequest PiperOrigin-RevId: 448510642 Source-Link: https://github.com/googleapis/googleapis/commit/dd6f8dfcb01c2dae1a4321aea28e206809647a58 chore(gkebackup): prepare for the v1 release of google/cloud/gkebackup PiperOrigin-RevId: 448503189 Source-Link: https://github.com/googleapis/googleapis/commit/10bc133b66c4911e605379db627223ccef3b390c fix(analytics/admin): CustomDimension and CustomMetric resource configuration in Analytics Admin API PiperOrigin-RevId: 448304423 Source-Link: https://github.com/googleapis/googleapis/commit/d018d545db5eeddcd43920d91133629a592b5e57 feat(aiplatform): add display_name and metadata to ModelEvaluation in aiplatform model_evaluation.proto PiperOrigin-RevId: 448160148 Source-Link: https://github.com/googleapis/googleapis/commit/936ab3594a2ae46e799fc4146580045f2c710c46 docs(speech): Update client libraries for v1p1beta1 api PiperOrigin-RevId: 447572837 Source-Link: https://github.com/googleapis/googleapis/commit/10c88bb5c489c8ad1edb0e7f6a17cdd07147966e feat(speech): Add adaptation proto for v1 api PiperOrigin-RevId: 447561222 Source-Link: https://github.com/googleapis/googleapis/commit/ec9193e2e36c891d76586ed9d9c8c4a61777b8ad feat(gkemulticloud): Added support for other languages.Clients can now use this library to create gke clusters in cloud providers such as AWS and Azure PiperOrigin-RevId: 447537600 Source-Link: https://github.com/googleapis/googleapis/commit/02e4eb06118e2b4227cbce6cf7ef1c2077dd9746 fix(bigquery/dataexchange): Include common protos in google-cloud-bigquery-data_exchange-v1beta1 PiperOrigin-RevId: 447522170 Source-Link: https://github.com/googleapis/googleapis/commit/6781fcd391bc7d70bcfb11864afd89fe126584ef fix(run)!: Updates pre-release Cloud Run v2 Preview client libraries to work with the latest API revision PiperOrigin-RevId: 447174265 Source-Link: https://github.com/googleapis/googleapis/commit/185ba8a93af77b432652a90f800ea3835406c18b feat(aiplatform): add template_metadata to PipelineJob in aiplatform v1beta1 pipeline_job.proto PiperOrigin-RevId: 447082691 Source-Link: https://github.com/googleapis/googleapis/commit/02b3022b93e5c3d2fb13f4a296634b5d7e992c69 docs(dialogflow/cx): update the doc on diagnostic info PiperOrigin-RevId: 446890999 Source-Link: https://github.com/googleapis/googleapis/commit/044c5184ee9bf69c54294ba8ff844fe037d2d9d0 fix(vision)!: removed fields from SafeSearchAnnotation message PiperOrigin-RevId: 446836546 Source-Link: https://github.com/googleapis/googleapis/commit/ca177711769263962940f8b23657710dc8c0ffcd docs(dialogflow): add the fields for setting CX virtual agent session parameters PiperOrigin-RevId: 446825520 Source-Link: https://github.com/googleapis/googleapis/commit/f6bb25583b9b7320c9642a28fde9101b492da930 chore(bigquery/dataexchange): Fill out Ruby analyticshub configs PiperOrigin-RevId: 446815657 Source-Link: https://github.com/googleapis/googleapis/commit/cdd27734029a8030502323840cef2c8314b99182 feat(dialogflow/cx): add audio export settings to security settings docs: update the doc on diagnostic info PiperOrigin-RevId: 446763565 Source-Link: https://github.com/googleapis/googleapis/commit/2d07d513b2e12e8d6f1e5823dd2626bb6f0a4f16 feat(appengine): add Application.service_account feat: add client library method signature to retrieve Application by name feat: add Service.labels feat: add Version.app_engine_apis feat: add VpcAccessConnector.egress_setting PiperOrigin-RevId: 446641753 Source-Link: https://github.com/googleapis/googleapis/commit/cd7a3e5ea0ba6f184a76353504b643b312f6889f --- appengine/apiv1/applications_client.go | 2 + asset/apiv1/asset_client.go | 277 +++- asset/apiv1/asset_client_example_test.go | 124 ++ asset/apiv1/gapic_metadata.json | 30 + iap/apiv1/gapic_metadata.json | 25 + .../identity_aware_proxy_admin_client.go | 240 ++- ...y_aware_proxy_admin_client_example_test.go | 105 ++ .../identity_aware_proxyo_auth_client.go | 11 +- .../snippet_metadata.google.appengine.v1.json | 2 +- .../BatchGetEffectiveIamPolicies/main.go | 48 + .../apiv1/Client/CreateSavedQuery/main.go | 48 + .../apiv1/Client/DeleteSavedQuery/main.go | 46 + .../asset/apiv1/Client/GetSavedQuery/main.go | 48 + .../apiv1/Client/ListSavedQueries/main.go | 55 + .../apiv1/Client/UpdateSavedQuery/main.go | 48 + ...nippet_metadata.google.cloud.asset.v1.json | 279 +++- ...data.google.cloud.assuredworkloads.v1.json | 2 +- ...google.cloud.assuredworkloads.v1beta1.json | 2 +- ...a.google.cloud.bigquery.connection.v1.json | 2 +- ...gle.cloud.bigquery.connection.v1beta1.json | 2 +- ...e.cloud.bigquery.dataexchange.v1beta1.json | 2 +- ...google.cloud.bigquery.datatransfer.v1.json | 2 +- ...ta.google.cloud.bigquery.migration.v2.json | 2 +- ...ogle.cloud.bigquery.migration.v2alpha.json | 2 +- ....google.cloud.bigquery.reservation.v1.json | 2 +- ...le.cloud.bigquery.reservation.v1beta1.json | 2 +- ...data.google.cloud.bigquery.storage.v1.json | 2 +- ...google.cloud.bigquery.storage.v1beta1.json | 2 +- ...google.cloud.bigquery.storage.v1beta2.json | 2 +- .../CreateAttestor/main.go | 48 + .../DeleteAttestor/main.go | 46 + .../GetAttestor/main.go | 48 + .../GetPolicy/main.go | 48 + .../ListAttestors/main.go | 55 + .../UpdateAttestor/main.go | 48 + .../UpdatePolicy/main.go | 48 + .../GetSystemPolicy/main.go | 48 + .../ValidateAttestationOccurrence/main.go | 48 + ...a.google.cloud.binaryauthorization.v1.json | 428 ++++++ ...gle.cloud.binaryauthorization.v1beta1.json | 2 +- ...et_metadata.google.datastore.admin.v1.json | 2 +- .../Client/CreateConnectionProfile/main.go | 53 + .../Client/CreatePrivateConnection/main.go | 53 + .../apiv1/Client/CreateRoute/main.go | 53 + .../apiv1/Client/CreateStream/main.go | 53 + .../Client/DeleteConnectionProfile/main.go | 51 + .../Client/DeletePrivateConnection/main.go | 51 + .../apiv1/Client/DeleteRoute/main.go | 51 + .../apiv1/Client/DeleteStream/main.go | 51 + .../Client/DiscoverConnectionProfile/main.go | 48 + .../apiv1/Client/FetchStaticIps/main.go | 55 + .../apiv1/Client/GetConnectionProfile/main.go | 48 + .../apiv1/Client/GetLocation/main.go | 48 + .../apiv1/Client/GetPrivateConnection/main.go | 48 + .../datastream/apiv1/Client/GetRoute/main.go | 48 + .../datastream/apiv1/Client/GetStream/main.go | 48 + .../apiv1/Client/GetStreamObject/main.go | 48 + .../Client/ListConnectionProfiles/main.go | 55 + .../apiv1/Client/ListLocations/main.go | 55 + .../Client/ListPrivateConnections/main.go | 55 + .../apiv1/Client/ListRoutes/main.go | 55 + .../apiv1/Client/ListStreamObjects/main.go | 55 + .../apiv1/Client/ListStreams/main.go | 55 + .../apiv1/Client/LookupStreamObject/main.go | 48 + .../apiv1/Client/StartBackfillJob/main.go | 48 + .../apiv1/Client/StopBackfillJob/main.go | 48 + .../Client/UpdateConnectionProfile/main.go | 53 + .../apiv1/Client/UpdateStream/main.go | 53 + ...t_metadata.google.cloud.datastream.v1.json | 1257 ++++++++++++++++ ...data.google.cloud.datastream.v1alpha1.json | 2 +- .../BackupForGKEClient/CreateBackup/main.go | 53 + .../CreateBackupPlan/main.go | 53 + .../BackupForGKEClient/CreateRestore/main.go | 53 + .../CreateRestorePlan/main.go | 53 + .../BackupForGKEClient/DeleteBackup/main.go | 51 + .../DeleteBackupPlan/main.go | 51 + .../BackupForGKEClient/DeleteRestore/main.go | 51 + .../DeleteRestorePlan/main.go | 51 + .../BackupForGKEClient/GetBackup/main.go | 48 + .../BackupForGKEClient/GetBackupPlan/main.go | 48 + .../BackupForGKEClient/GetRestore/main.go | 48 + .../BackupForGKEClient/GetRestorePlan/main.go | 48 + .../GetVolumeBackup/main.go | 48 + .../GetVolumeRestore/main.go | 48 + .../ListBackupPlans/main.go | 55 + .../BackupForGKEClient/ListBackups/main.go | 55 + .../ListRestorePlans/main.go | 55 + .../BackupForGKEClient/ListRestores/main.go | 55 + .../ListVolumeBackups/main.go | 55 + .../ListVolumeRestores/main.go | 55 + .../BackupForGKEClient/UpdateBackup/main.go | 53 + .../UpdateBackupPlan/main.go | 53 + .../BackupForGKEClient/UpdateRestore/main.go | 53 + .../UpdateRestorePlan/main.go | 53 + ...et_metadata.google.cloud.gkebackup.v1.json | 1119 ++++++++++++++ .../CreateAwsCluster/main.go | 53 + .../CreateAwsNodePool/main.go | 53 + .../DeleteAwsCluster/main.go | 51 + .../DeleteAwsNodePool/main.go | 51 + .../GenerateAwsAccessToken/main.go | 48 + .../AwsClustersClient/GetAwsCluster/main.go | 48 + .../AwsClustersClient/GetAwsNodePool/main.go | 48 + .../GetAwsServerConfig/main.go | 48 + .../AwsClustersClient/ListAwsClusters/main.go | 55 + .../ListAwsNodePools/main.go | 55 + .../UpdateAwsCluster/main.go | 53 + .../UpdateAwsNodePool/main.go | 53 + .../CreateAzureClient/main.go | 53 + .../CreateAzureCluster/main.go | 53 + .../CreateAzureNodePool/main.go | 53 + .../DeleteAzureClient/main.go | 51 + .../DeleteAzureCluster/main.go | 51 + .../DeleteAzureNodePool/main.go | 51 + .../GenerateAzureAccessToken/main.go | 48 + .../GetAzureClient/main.go | 48 + .../GetAzureCluster/main.go | 48 + .../GetAzureNodePool/main.go | 48 + .../GetAzureServerConfig/main.go | 48 + .../ListAzureClients/main.go | 55 + .../ListAzureClusters/main.go | 55 + .../ListAzureNodePools/main.go | 55 + .../UpdateAzureCluster/main.go | 53 + .../UpdateAzureNodePool/main.go | 53 + ...etadata.google.cloud.gkemulticloud.v1.json | 1303 +++++++++++++++++ internal/generated/snippets/go.mod | 8 +- internal/generated/snippets/go.sum | 12 +- run/apiv2/revisions_client.go | 35 +- run/apiv2/services_client.go | 57 +- speech/apiv1/adaptation_client.go | 572 ++++++++ .../apiv1/adaptation_client_example_test.go | 245 ++++ speech/apiv1/gapic_metadata.json | 59 + 131 files changed, 10950 insertions(+), 74 deletions(-) create mode 100644 internal/generated/snippets/asset/apiv1/Client/BatchGetEffectiveIamPolicies/main.go create mode 100644 internal/generated/snippets/asset/apiv1/Client/CreateSavedQuery/main.go create mode 100644 internal/generated/snippets/asset/apiv1/Client/DeleteSavedQuery/main.go create mode 100644 internal/generated/snippets/asset/apiv1/Client/GetSavedQuery/main.go create mode 100644 internal/generated/snippets/asset/apiv1/Client/ListSavedQueries/main.go create mode 100644 internal/generated/snippets/asset/apiv1/Client/UpdateSavedQuery/main.go create mode 100644 internal/generated/snippets/binaryauthorization/apiv1/BinauthzManagementClient/CreateAttestor/main.go create mode 100644 internal/generated/snippets/binaryauthorization/apiv1/BinauthzManagementClient/DeleteAttestor/main.go create mode 100644 internal/generated/snippets/binaryauthorization/apiv1/BinauthzManagementClient/GetAttestor/main.go create mode 100644 internal/generated/snippets/binaryauthorization/apiv1/BinauthzManagementClient/GetPolicy/main.go create mode 100644 internal/generated/snippets/binaryauthorization/apiv1/BinauthzManagementClient/ListAttestors/main.go create mode 100644 internal/generated/snippets/binaryauthorization/apiv1/BinauthzManagementClient/UpdateAttestor/main.go create mode 100644 internal/generated/snippets/binaryauthorization/apiv1/BinauthzManagementClient/UpdatePolicy/main.go create mode 100644 internal/generated/snippets/binaryauthorization/apiv1/SystemPolicyClient/GetSystemPolicy/main.go create mode 100644 internal/generated/snippets/binaryauthorization/apiv1/ValidationHelperClient/ValidateAttestationOccurrence/main.go create mode 100644 internal/generated/snippets/binaryauthorization/apiv1/snippet_metadata.google.cloud.binaryauthorization.v1.json create mode 100644 internal/generated/snippets/datastream/apiv1/Client/CreateConnectionProfile/main.go create mode 100644 internal/generated/snippets/datastream/apiv1/Client/CreatePrivateConnection/main.go create mode 100644 internal/generated/snippets/datastream/apiv1/Client/CreateRoute/main.go create mode 100644 internal/generated/snippets/datastream/apiv1/Client/CreateStream/main.go create mode 100644 internal/generated/snippets/datastream/apiv1/Client/DeleteConnectionProfile/main.go create mode 100644 internal/generated/snippets/datastream/apiv1/Client/DeletePrivateConnection/main.go create mode 100644 internal/generated/snippets/datastream/apiv1/Client/DeleteRoute/main.go create mode 100644 internal/generated/snippets/datastream/apiv1/Client/DeleteStream/main.go create mode 100644 internal/generated/snippets/datastream/apiv1/Client/DiscoverConnectionProfile/main.go create mode 100644 internal/generated/snippets/datastream/apiv1/Client/FetchStaticIps/main.go create mode 100644 internal/generated/snippets/datastream/apiv1/Client/GetConnectionProfile/main.go create mode 100644 internal/generated/snippets/datastream/apiv1/Client/GetLocation/main.go create mode 100644 internal/generated/snippets/datastream/apiv1/Client/GetPrivateConnection/main.go create mode 100644 internal/generated/snippets/datastream/apiv1/Client/GetRoute/main.go create mode 100644 internal/generated/snippets/datastream/apiv1/Client/GetStream/main.go create mode 100644 internal/generated/snippets/datastream/apiv1/Client/GetStreamObject/main.go create mode 100644 internal/generated/snippets/datastream/apiv1/Client/ListConnectionProfiles/main.go create mode 100644 internal/generated/snippets/datastream/apiv1/Client/ListLocations/main.go create mode 100644 internal/generated/snippets/datastream/apiv1/Client/ListPrivateConnections/main.go create mode 100644 internal/generated/snippets/datastream/apiv1/Client/ListRoutes/main.go create mode 100644 internal/generated/snippets/datastream/apiv1/Client/ListStreamObjects/main.go create mode 100644 internal/generated/snippets/datastream/apiv1/Client/ListStreams/main.go create mode 100644 internal/generated/snippets/datastream/apiv1/Client/LookupStreamObject/main.go create mode 100644 internal/generated/snippets/datastream/apiv1/Client/StartBackfillJob/main.go create mode 100644 internal/generated/snippets/datastream/apiv1/Client/StopBackfillJob/main.go create mode 100644 internal/generated/snippets/datastream/apiv1/Client/UpdateConnectionProfile/main.go create mode 100644 internal/generated/snippets/datastream/apiv1/Client/UpdateStream/main.go create mode 100644 internal/generated/snippets/datastream/apiv1/snippet_metadata.google.cloud.datastream.v1.json create mode 100644 internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/CreateBackup/main.go create mode 100644 internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/CreateBackupPlan/main.go create mode 100644 internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/CreateRestore/main.go create mode 100644 internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/CreateRestorePlan/main.go create mode 100644 internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/DeleteBackup/main.go create mode 100644 internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/DeleteBackupPlan/main.go create mode 100644 internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/DeleteRestore/main.go create mode 100644 internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/DeleteRestorePlan/main.go create mode 100644 internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/GetBackup/main.go create mode 100644 internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/GetBackupPlan/main.go create mode 100644 internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/GetRestore/main.go create mode 100644 internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/GetRestorePlan/main.go create mode 100644 internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/GetVolumeBackup/main.go create mode 100644 internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/GetVolumeRestore/main.go create mode 100644 internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/ListBackupPlans/main.go create mode 100644 internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/ListBackups/main.go create mode 100644 internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/ListRestorePlans/main.go create mode 100644 internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/ListRestores/main.go create mode 100644 internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/ListVolumeBackups/main.go create mode 100644 internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/ListVolumeRestores/main.go create mode 100644 internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/UpdateBackup/main.go create mode 100644 internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/UpdateBackupPlan/main.go create mode 100644 internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/UpdateRestore/main.go create mode 100644 internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/UpdateRestorePlan/main.go create mode 100644 internal/generated/snippets/gkebackup/apiv1/snippet_metadata.google.cloud.gkebackup.v1.json create mode 100644 internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/CreateAwsCluster/main.go create mode 100644 internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/CreateAwsNodePool/main.go create mode 100644 internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/DeleteAwsCluster/main.go create mode 100644 internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/DeleteAwsNodePool/main.go create mode 100644 internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/GenerateAwsAccessToken/main.go create mode 100644 internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/GetAwsCluster/main.go create mode 100644 internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/GetAwsNodePool/main.go create mode 100644 internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/GetAwsServerConfig/main.go create mode 100644 internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/ListAwsClusters/main.go create mode 100644 internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/ListAwsNodePools/main.go create mode 100644 internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/UpdateAwsCluster/main.go create mode 100644 internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/UpdateAwsNodePool/main.go create mode 100644 internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/CreateAzureClient/main.go create mode 100644 internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/CreateAzureCluster/main.go create mode 100644 internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/CreateAzureNodePool/main.go create mode 100644 internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/DeleteAzureClient/main.go create mode 100644 internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/DeleteAzureCluster/main.go create mode 100644 internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/DeleteAzureNodePool/main.go create mode 100644 internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/GenerateAzureAccessToken/main.go create mode 100644 internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/GetAzureClient/main.go create mode 100644 internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/GetAzureCluster/main.go create mode 100644 internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/GetAzureNodePool/main.go create mode 100644 internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/GetAzureServerConfig/main.go create mode 100644 internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/ListAzureClients/main.go create mode 100644 internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/ListAzureClusters/main.go create mode 100644 internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/ListAzureNodePools/main.go create mode 100644 internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/UpdateAzureCluster/main.go create mode 100644 internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/UpdateAzureNodePool/main.go create mode 100644 internal/generated/snippets/gkemulticloud/apiv1/snippet_metadata.google.cloud.gkemulticloud.v1.json create mode 100644 speech/apiv1/adaptation_client.go create mode 100644 speech/apiv1/adaptation_client_example_test.go diff --git a/appengine/apiv1/applications_client.go b/appengine/apiv1/applications_client.go index 22e6eaf831ca..8fd430d236a4 100644 --- a/appengine/apiv1/applications_client.go +++ b/appengine/apiv1/applications_client.go @@ -148,6 +148,8 @@ func (c *ApplicationsClient) CreateApplicationOperation(name string) *CreateAppl // auth_domain - Google authentication domain for controlling user access to the application. // // default_cookie_expiration - Cookie expiration policy for the application. +// +// iap - Identity-Aware Proxy properties for the application. func (c *ApplicationsClient) UpdateApplication(ctx context.Context, req *appenginepb.UpdateApplicationRequest, opts ...gax.CallOption) (*UpdateApplicationOperation, error) { return c.internalClient.UpdateApplication(ctx, req, opts...) } diff --git a/asset/apiv1/asset_client.go b/asset/apiv1/asset_client.go index c924cb2cb4d0..d13520549688 100644 --- a/asset/apiv1/asset_client.go +++ b/asset/apiv1/asset_client.go @@ -42,19 +42,25 @@ var newClientHook clientHook // CallOptions contains the retry settings for each method of Client. type CallOptions struct { - ExportAssets []gax.CallOption - ListAssets []gax.CallOption - BatchGetAssetsHistory []gax.CallOption - CreateFeed []gax.CallOption - GetFeed []gax.CallOption - ListFeeds []gax.CallOption - UpdateFeed []gax.CallOption - DeleteFeed []gax.CallOption - SearchAllResources []gax.CallOption - SearchAllIamPolicies []gax.CallOption - AnalyzeIamPolicy []gax.CallOption - AnalyzeIamPolicyLongrunning []gax.CallOption - AnalyzeMove []gax.CallOption + ExportAssets []gax.CallOption + ListAssets []gax.CallOption + BatchGetAssetsHistory []gax.CallOption + CreateFeed []gax.CallOption + GetFeed []gax.CallOption + ListFeeds []gax.CallOption + UpdateFeed []gax.CallOption + DeleteFeed []gax.CallOption + SearchAllResources []gax.CallOption + SearchAllIamPolicies []gax.CallOption + AnalyzeIamPolicy []gax.CallOption + AnalyzeIamPolicyLongrunning []gax.CallOption + AnalyzeMove []gax.CallOption + CreateSavedQuery []gax.CallOption + GetSavedQuery []gax.CallOption + ListSavedQueries []gax.CallOption + UpdateSavedQuery []gax.CallOption + DeleteSavedQuery []gax.CallOption + BatchGetEffectiveIamPolicies []gax.CallOption } func defaultGRPCClientOptions() []option.ClientOption { @@ -167,8 +173,14 @@ func defaultCallOptions() *CallOptions { }) }), }, - AnalyzeIamPolicyLongrunning: []gax.CallOption{}, - AnalyzeMove: []gax.CallOption{}, + AnalyzeIamPolicyLongrunning: []gax.CallOption{}, + AnalyzeMove: []gax.CallOption{}, + CreateSavedQuery: []gax.CallOption{}, + GetSavedQuery: []gax.CallOption{}, + ListSavedQueries: []gax.CallOption{}, + UpdateSavedQuery: []gax.CallOption{}, + DeleteSavedQuery: []gax.CallOption{}, + BatchGetEffectiveIamPolicies: []gax.CallOption{}, } } @@ -192,6 +204,12 @@ type internalClient interface { AnalyzeIamPolicyLongrunning(context.Context, *assetpb.AnalyzeIamPolicyLongrunningRequest, ...gax.CallOption) (*AnalyzeIamPolicyLongrunningOperation, error) AnalyzeIamPolicyLongrunningOperation(name string) *AnalyzeIamPolicyLongrunningOperation AnalyzeMove(context.Context, *assetpb.AnalyzeMoveRequest, ...gax.CallOption) (*assetpb.AnalyzeMoveResponse, error) + CreateSavedQuery(context.Context, *assetpb.CreateSavedQueryRequest, ...gax.CallOption) (*assetpb.SavedQuery, error) + GetSavedQuery(context.Context, *assetpb.GetSavedQueryRequest, ...gax.CallOption) (*assetpb.SavedQuery, error) + ListSavedQueries(context.Context, *assetpb.ListSavedQueriesRequest, ...gax.CallOption) *SavedQueryIterator + UpdateSavedQuery(context.Context, *assetpb.UpdateSavedQueryRequest, ...gax.CallOption) (*assetpb.SavedQuery, error) + DeleteSavedQuery(context.Context, *assetpb.DeleteSavedQueryRequest, ...gax.CallOption) error + BatchGetEffectiveIamPolicies(context.Context, *assetpb.BatchGetEffectiveIamPoliciesRequest, ...gax.CallOption) (*assetpb.BatchGetEffectiveIamPoliciesResponse, error) } // Client is a client for interacting with Cloud Asset API. @@ -236,13 +254,14 @@ func (c *Client) Connection() *grpc.ClientConn { // ExportAssets exports assets with time and resource types to a given Cloud Storage // location/BigQuery table. For Cloud Storage location destinations, the // output format is newline-delimited JSON. Each line represents a -// google.cloud.asset.v1.Asset in the JSON format; for BigQuery table -// destinations, the output table stores the fields in asset proto as columns. -// This API implements the google.longrunning.Operation API -// , which allows you to keep track of the export. We recommend intervals of -// at least 2 seconds with exponential retry to poll the export operation -// result. For regular-size resource parent, the export operation usually -// finishes within 5 minutes. +// google.cloud.asset.v1.Asset in the JSON +// format; for BigQuery table destinations, the output table stores the fields +// in asset Protobuf as columns. This API implements the +// google.longrunning.Operation API, which +// allows you to keep track of the export. We recommend intervals of at least +// 2 seconds with exponential retry to poll the export operation result. For +// regular-size resource parent, the export operation usually finishes within +// 5 minutes. func (c *Client) ExportAssets(ctx context.Context, req *assetpb.ExportAssetsRequest, opts ...gax.CallOption) (*ExportAssetsOperation, error) { return c.internalClient.ExportAssets(ctx, req, opts...) } @@ -322,11 +341,12 @@ func (c *Client) AnalyzeIamPolicy(ctx context.Context, req *assetpb.AnalyzeIamPo // accesses on which resources, and writes the analysis results to a Google // Cloud Storage or a BigQuery destination. For Cloud Storage destination, the // output format is the JSON format that represents a -// AnalyzeIamPolicyResponse. This method implements the -// google.longrunning.Operation, which allows you to track the operation -// status. We recommend intervals of at least 2 seconds with exponential -// backoff retry to poll the operation result. The metadata contains the -// metadata for the long-running operation. +// AnalyzeIamPolicyResponse. +// This method implements the +// google.longrunning.Operation, which allows +// you to track the operation status. We recommend intervals of at least 2 +// seconds with exponential backoff retry to poll the operation result. The +// metadata contains the metadata for the long-running operation. func (c *Client) AnalyzeIamPolicyLongrunning(ctx context.Context, req *assetpb.AnalyzeIamPolicyLongrunningRequest, opts ...gax.CallOption) (*AnalyzeIamPolicyLongrunningOperation, error) { return c.internalClient.AnalyzeIamPolicyLongrunning(ctx, req, opts...) } @@ -346,6 +366,36 @@ func (c *Client) AnalyzeMove(ctx context.Context, req *assetpb.AnalyzeMoveReques return c.internalClient.AnalyzeMove(ctx, req, opts...) } +// CreateSavedQuery creates a saved query in a parent project/folder/organization. +func (c *Client) CreateSavedQuery(ctx context.Context, req *assetpb.CreateSavedQueryRequest, opts ...gax.CallOption) (*assetpb.SavedQuery, error) { + return c.internalClient.CreateSavedQuery(ctx, req, opts...) +} + +// GetSavedQuery gets details about a saved query. +func (c *Client) GetSavedQuery(ctx context.Context, req *assetpb.GetSavedQueryRequest, opts ...gax.CallOption) (*assetpb.SavedQuery, error) { + return c.internalClient.GetSavedQuery(ctx, req, opts...) +} + +// ListSavedQueries lists all saved queries in a parent project/folder/organization. +func (c *Client) ListSavedQueries(ctx context.Context, req *assetpb.ListSavedQueriesRequest, opts ...gax.CallOption) *SavedQueryIterator { + return c.internalClient.ListSavedQueries(ctx, req, opts...) +} + +// UpdateSavedQuery updates a saved query. +func (c *Client) UpdateSavedQuery(ctx context.Context, req *assetpb.UpdateSavedQueryRequest, opts ...gax.CallOption) (*assetpb.SavedQuery, error) { + return c.internalClient.UpdateSavedQuery(ctx, req, opts...) +} + +// DeleteSavedQuery deletes a saved query. +func (c *Client) DeleteSavedQuery(ctx context.Context, req *assetpb.DeleteSavedQueryRequest, opts ...gax.CallOption) error { + return c.internalClient.DeleteSavedQuery(ctx, req, opts...) +} + +// BatchGetEffectiveIamPolicies gets effective IAM policies for a batch of resources. +func (c *Client) BatchGetEffectiveIamPolicies(ctx context.Context, req *assetpb.BatchGetEffectiveIamPoliciesRequest, opts ...gax.CallOption) (*assetpb.BatchGetEffectiveIamPoliciesResponse, error) { + return c.internalClient.BatchGetEffectiveIamPolicies(ctx, req, opts...) +} + // gRPCClient is a client for interacting with Cloud Asset API over gRPC transport. // // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. @@ -792,6 +842,132 @@ func (c *gRPCClient) AnalyzeMove(ctx context.Context, req *assetpb.AnalyzeMoveRe return resp, nil } +func (c *gRPCClient) CreateSavedQuery(ctx context.Context, req *assetpb.CreateSavedQueryRequest, opts ...gax.CallOption) (*assetpb.SavedQuery, error) { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).CreateSavedQuery[0:len((*c.CallOptions).CreateSavedQuery):len((*c.CallOptions).CreateSavedQuery)], opts...) + var resp *assetpb.SavedQuery + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.CreateSavedQuery(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) GetSavedQuery(ctx context.Context, req *assetpb.GetSavedQueryRequest, opts ...gax.CallOption) (*assetpb.SavedQuery, error) { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).GetSavedQuery[0:len((*c.CallOptions).GetSavedQuery):len((*c.CallOptions).GetSavedQuery)], opts...) + var resp *assetpb.SavedQuery + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.GetSavedQuery(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) ListSavedQueries(ctx context.Context, req *assetpb.ListSavedQueriesRequest, opts ...gax.CallOption) *SavedQueryIterator { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).ListSavedQueries[0:len((*c.CallOptions).ListSavedQueries):len((*c.CallOptions).ListSavedQueries)], opts...) + it := &SavedQueryIterator{} + req = proto.Clone(req).(*assetpb.ListSavedQueriesRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]*assetpb.SavedQuery, string, error) { + resp := &assetpb.ListSavedQueriesResponse{} + if pageToken != "" { + req.PageToken = pageToken + } + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else if pageSize != 0 { + req.PageSize = int32(pageSize) + } + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.ListSavedQueries(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, "", err + } + + it.Response = resp + return resp.GetSavedQueries(), resp.GetNextPageToken(), nil + } + fetch := func(pageSize int, pageToken string) (string, error) { + items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) + if err != nil { + return "", err + } + it.items = append(it.items, items...) + return nextPageToken, nil + } + + it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) + it.pageInfo.MaxSize = int(req.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + + return it +} + +func (c *gRPCClient) UpdateSavedQuery(ctx context.Context, req *assetpb.UpdateSavedQueryRequest, opts ...gax.CallOption) (*assetpb.SavedQuery, error) { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "saved_query.name", url.QueryEscape(req.GetSavedQuery().GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).UpdateSavedQuery[0:len((*c.CallOptions).UpdateSavedQuery):len((*c.CallOptions).UpdateSavedQuery)], opts...) + var resp *assetpb.SavedQuery + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.UpdateSavedQuery(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *gRPCClient) DeleteSavedQuery(ctx context.Context, req *assetpb.DeleteSavedQueryRequest, opts ...gax.CallOption) error { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).DeleteSavedQuery[0:len((*c.CallOptions).DeleteSavedQuery):len((*c.CallOptions).DeleteSavedQuery)], opts...) + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + _, err = c.client.DeleteSavedQuery(ctx, req, settings.GRPC...) + return err + }, opts...) + return err +} + +func (c *gRPCClient) BatchGetEffectiveIamPolicies(ctx context.Context, req *assetpb.BatchGetEffectiveIamPoliciesRequest, opts ...gax.CallOption) (*assetpb.BatchGetEffectiveIamPoliciesResponse, error) { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "scope", url.QueryEscape(req.GetScope()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).BatchGetEffectiveIamPolicies[0:len((*c.CallOptions).BatchGetEffectiveIamPolicies):len((*c.CallOptions).BatchGetEffectiveIamPolicies)], opts...) + var resp *assetpb.BatchGetEffectiveIamPoliciesResponse + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.client.BatchGetEffectiveIamPolicies(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + // AnalyzeIamPolicyLongrunningOperation manages a long-running operation from AnalyzeIamPolicyLongrunning. type AnalyzeIamPolicyLongrunningOperation struct { lro *longrunning.Operation @@ -1070,3 +1246,50 @@ func (it *ResourceSearchResultIterator) takeBuf() interface{} { it.items = nil return b } + +// SavedQueryIterator manages a stream of *assetpb.SavedQuery. +type SavedQueryIterator struct { + items []*assetpb.SavedQuery + pageInfo *iterator.PageInfo + nextFunc func() error + + // Response is the raw response for the current page. + // It must be cast to the RPC response type. + // Calling Next() or InternalFetch() updates this value. + Response interface{} + + // InternalFetch is for use by the Google Cloud Libraries only. + // It is not part of the stable interface of this package. + // + // InternalFetch returns results from a single call to the underlying RPC. + // The number of results is no greater than pageSize. + // If there are no more results, nextPageToken is empty and err is nil. + InternalFetch func(pageSize int, pageToken string) (results []*assetpb.SavedQuery, nextPageToken string, err error) +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (it *SavedQueryIterator) PageInfo() *iterator.PageInfo { + return it.pageInfo +} + +// Next returns the next result. Its second return value is iterator.Done if there are no more +// results. Once Next returns Done, all subsequent calls will return Done. +func (it *SavedQueryIterator) Next() (*assetpb.SavedQuery, error) { + var item *assetpb.SavedQuery + if err := it.nextFunc(); err != nil { + return item, err + } + item = it.items[0] + it.items = it.items[1:] + return item, nil +} + +func (it *SavedQueryIterator) bufLen() int { + return len(it.items) +} + +func (it *SavedQueryIterator) takeBuf() interface{} { + b := it.items + it.items = nil + return b +} diff --git a/asset/apiv1/asset_client_example_test.go b/asset/apiv1/asset_client_example_test.go index 1f260cb5b82b..fee01cdc23ab 100644 --- a/asset/apiv1/asset_client_example_test.go +++ b/asset/apiv1/asset_client_example_test.go @@ -321,3 +321,127 @@ func ExampleClient_AnalyzeMove() { // TODO: Use resp. _ = resp } + +func ExampleClient_CreateSavedQuery() { + ctx := context.Background() + c, err := asset.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &assetpb.CreateSavedQueryRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/asset/v1#CreateSavedQueryRequest. + } + resp, err := c.CreateSavedQuery(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_GetSavedQuery() { + ctx := context.Background() + c, err := asset.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &assetpb.GetSavedQueryRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/asset/v1#GetSavedQueryRequest. + } + resp, err := c.GetSavedQuery(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_ListSavedQueries() { + ctx := context.Background() + c, err := asset.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &assetpb.ListSavedQueriesRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/asset/v1#ListSavedQueriesRequest. + } + it := c.ListSavedQueries(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +func ExampleClient_UpdateSavedQuery() { + ctx := context.Background() + c, err := asset.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &assetpb.UpdateSavedQueryRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/asset/v1#UpdateSavedQueryRequest. + } + resp, err := c.UpdateSavedQuery(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleClient_DeleteSavedQuery() { + ctx := context.Background() + c, err := asset.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &assetpb.DeleteSavedQueryRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/asset/v1#DeleteSavedQueryRequest. + } + err = c.DeleteSavedQuery(ctx, req) + if err != nil { + // TODO: Handle error. + } +} + +func ExampleClient_BatchGetEffectiveIamPolicies() { + ctx := context.Background() + c, err := asset.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &assetpb.BatchGetEffectiveIamPoliciesRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/asset/v1#BatchGetEffectiveIamPoliciesRequest. + } + resp, err := c.BatchGetEffectiveIamPolicies(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/asset/apiv1/gapic_metadata.json b/asset/apiv1/gapic_metadata.json index ead3be78df42..a2646d4354f7 100644 --- a/asset/apiv1/gapic_metadata.json +++ b/asset/apiv1/gapic_metadata.json @@ -30,16 +30,31 @@ "BatchGetAssetsHistory" ] }, + "BatchGetEffectiveIamPolicies": { + "methods": [ + "BatchGetEffectiveIamPolicies" + ] + }, "CreateFeed": { "methods": [ "CreateFeed" ] }, + "CreateSavedQuery": { + "methods": [ + "CreateSavedQuery" + ] + }, "DeleteFeed": { "methods": [ "DeleteFeed" ] }, + "DeleteSavedQuery": { + "methods": [ + "DeleteSavedQuery" + ] + }, "ExportAssets": { "methods": [ "ExportAssets" @@ -50,6 +65,11 @@ "GetFeed" ] }, + "GetSavedQuery": { + "methods": [ + "GetSavedQuery" + ] + }, "ListAssets": { "methods": [ "ListAssets" @@ -60,6 +80,11 @@ "ListFeeds" ] }, + "ListSavedQueries": { + "methods": [ + "ListSavedQueries" + ] + }, "SearchAllIamPolicies": { "methods": [ "SearchAllIamPolicies" @@ -74,6 +99,11 @@ "methods": [ "UpdateFeed" ] + }, + "UpdateSavedQuery": { + "methods": [ + "UpdateSavedQuery" + ] } } } diff --git a/iap/apiv1/gapic_metadata.json b/iap/apiv1/gapic_metadata.json index c70a2063398e..0b35c9a922cd 100644 --- a/iap/apiv1/gapic_metadata.json +++ b/iap/apiv1/gapic_metadata.json @@ -10,6 +10,16 @@ "grpc": { "libraryClient": "IdentityAwareProxyAdminClient", "rpcs": { + "CreateTunnelDestGroup": { + "methods": [ + "CreateTunnelDestGroup" + ] + }, + "DeleteTunnelDestGroup": { + "methods": [ + "DeleteTunnelDestGroup" + ] + }, "GetIamPolicy": { "methods": [ "GetIamPolicy" @@ -20,6 +30,16 @@ "GetIapSettings" ] }, + "GetTunnelDestGroup": { + "methods": [ + "GetTunnelDestGroup" + ] + }, + "ListTunnelDestGroups": { + "methods": [ + "ListTunnelDestGroups" + ] + }, "SetIamPolicy": { "methods": [ "SetIamPolicy" @@ -34,6 +54,11 @@ "methods": [ "UpdateIapSettings" ] + }, + "UpdateTunnelDestGroup": { + "methods": [ + "UpdateTunnelDestGroup" + ] } } } diff --git a/iap/apiv1/identity_aware_proxy_admin_client.go b/iap/apiv1/identity_aware_proxy_admin_client.go index 30368ad9c14a..33b52b3adf0d 100644 --- a/iap/apiv1/identity_aware_proxy_admin_client.go +++ b/iap/apiv1/identity_aware_proxy_admin_client.go @@ -24,6 +24,7 @@ import ( "time" gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/iterator" "google.golang.org/api/option" "google.golang.org/api/option/internaloption" gtransport "google.golang.org/api/transport/grpc" @@ -31,17 +32,23 @@ import ( iampb "google.golang.org/genproto/googleapis/iam/v1" "google.golang.org/grpc" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" ) var newIdentityAwareProxyAdminClientHook clientHook // IdentityAwareProxyAdminCallOptions contains the retry settings for each method of IdentityAwareProxyAdminClient. type IdentityAwareProxyAdminCallOptions struct { - SetIamPolicy []gax.CallOption - GetIamPolicy []gax.CallOption - TestIamPermissions []gax.CallOption - GetIapSettings []gax.CallOption - UpdateIapSettings []gax.CallOption + SetIamPolicy []gax.CallOption + GetIamPolicy []gax.CallOption + TestIamPermissions []gax.CallOption + GetIapSettings []gax.CallOption + UpdateIapSettings []gax.CallOption + ListTunnelDestGroups []gax.CallOption + CreateTunnelDestGroup []gax.CallOption + GetTunnelDestGroup []gax.CallOption + DeleteTunnelDestGroup []gax.CallOption + UpdateTunnelDestGroup []gax.CallOption } func defaultIdentityAwareProxyAdminGRPCClientOptions() []option.ClientOption { @@ -58,11 +65,16 @@ func defaultIdentityAwareProxyAdminGRPCClientOptions() []option.ClientOption { func defaultIdentityAwareProxyAdminCallOptions() *IdentityAwareProxyAdminCallOptions { return &IdentityAwareProxyAdminCallOptions{ - SetIamPolicy: []gax.CallOption{}, - GetIamPolicy: []gax.CallOption{}, - TestIamPermissions: []gax.CallOption{}, - GetIapSettings: []gax.CallOption{}, - UpdateIapSettings: []gax.CallOption{}, + SetIamPolicy: []gax.CallOption{}, + GetIamPolicy: []gax.CallOption{}, + TestIamPermissions: []gax.CallOption{}, + GetIapSettings: []gax.CallOption{}, + UpdateIapSettings: []gax.CallOption{}, + ListTunnelDestGroups: []gax.CallOption{}, + CreateTunnelDestGroup: []gax.CallOption{}, + GetTunnelDestGroup: []gax.CallOption{}, + DeleteTunnelDestGroup: []gax.CallOption{}, + UpdateTunnelDestGroup: []gax.CallOption{}, } } @@ -76,6 +88,11 @@ type internalIdentityAwareProxyAdminClient interface { TestIamPermissions(context.Context, *iampb.TestIamPermissionsRequest, ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) GetIapSettings(context.Context, *iappb.GetIapSettingsRequest, ...gax.CallOption) (*iappb.IapSettings, error) UpdateIapSettings(context.Context, *iappb.UpdateIapSettingsRequest, ...gax.CallOption) (*iappb.IapSettings, error) + ListTunnelDestGroups(context.Context, *iappb.ListTunnelDestGroupsRequest, ...gax.CallOption) *TunnelDestGroupIterator + CreateTunnelDestGroup(context.Context, *iappb.CreateTunnelDestGroupRequest, ...gax.CallOption) (*iappb.TunnelDestGroup, error) + GetTunnelDestGroup(context.Context, *iappb.GetTunnelDestGroupRequest, ...gax.CallOption) (*iappb.TunnelDestGroup, error) + DeleteTunnelDestGroup(context.Context, *iappb.DeleteTunnelDestGroupRequest, ...gax.CallOption) error + UpdateTunnelDestGroup(context.Context, *iappb.UpdateTunnelDestGroupRequest, ...gax.CallOption) (*iappb.TunnelDestGroup, error) } // IdentityAwareProxyAdminClient is a client for interacting with Cloud Identity-Aware Proxy API. @@ -147,6 +164,33 @@ func (c *IdentityAwareProxyAdminClient) UpdateIapSettings(ctx context.Context, r return c.internalClient.UpdateIapSettings(ctx, req, opts...) } +// ListTunnelDestGroups lists the existing TunnelDestGroups. To group across all locations, use a +// - as the location ID. For example: +// /v1/projects/123/iap_tunnel/locations/-/destGroups +func (c *IdentityAwareProxyAdminClient) ListTunnelDestGroups(ctx context.Context, req *iappb.ListTunnelDestGroupsRequest, opts ...gax.CallOption) *TunnelDestGroupIterator { + return c.internalClient.ListTunnelDestGroups(ctx, req, opts...) +} + +// CreateTunnelDestGroup creates a new TunnelDestGroup. +func (c *IdentityAwareProxyAdminClient) CreateTunnelDestGroup(ctx context.Context, req *iappb.CreateTunnelDestGroupRequest, opts ...gax.CallOption) (*iappb.TunnelDestGroup, error) { + return c.internalClient.CreateTunnelDestGroup(ctx, req, opts...) +} + +// GetTunnelDestGroup retrieves an existing TunnelDestGroup. +func (c *IdentityAwareProxyAdminClient) GetTunnelDestGroup(ctx context.Context, req *iappb.GetTunnelDestGroupRequest, opts ...gax.CallOption) (*iappb.TunnelDestGroup, error) { + return c.internalClient.GetTunnelDestGroup(ctx, req, opts...) +} + +// DeleteTunnelDestGroup deletes a TunnelDestGroup. +func (c *IdentityAwareProxyAdminClient) DeleteTunnelDestGroup(ctx context.Context, req *iappb.DeleteTunnelDestGroupRequest, opts ...gax.CallOption) error { + return c.internalClient.DeleteTunnelDestGroup(ctx, req, opts...) +} + +// UpdateTunnelDestGroup updates a TunnelDestGroup. +func (c *IdentityAwareProxyAdminClient) UpdateTunnelDestGroup(ctx context.Context, req *iappb.UpdateTunnelDestGroupRequest, opts ...gax.CallOption) (*iappb.TunnelDestGroup, error) { + return c.internalClient.UpdateTunnelDestGroup(ctx, req, opts...) +} + // identityAwareProxyAdminGRPCClient is a client for interacting with Cloud Identity-Aware Proxy API over gRPC transport. // // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. @@ -336,3 +380,179 @@ func (c *identityAwareProxyAdminGRPCClient) UpdateIapSettings(ctx context.Contex } return resp, nil } + +func (c *identityAwareProxyAdminGRPCClient) ListTunnelDestGroups(ctx context.Context, req *iappb.ListTunnelDestGroupsRequest, opts ...gax.CallOption) *TunnelDestGroupIterator { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).ListTunnelDestGroups[0:len((*c.CallOptions).ListTunnelDestGroups):len((*c.CallOptions).ListTunnelDestGroups)], opts...) + it := &TunnelDestGroupIterator{} + req = proto.Clone(req).(*iappb.ListTunnelDestGroupsRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]*iappb.TunnelDestGroup, string, error) { + resp := &iappb.ListTunnelDestGroupsResponse{} + if pageToken != "" { + req.PageToken = pageToken + } + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else if pageSize != 0 { + req.PageSize = int32(pageSize) + } + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.identityAwareProxyAdminClient.ListTunnelDestGroups(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, "", err + } + + it.Response = resp + return resp.GetTunnelDestGroups(), resp.GetNextPageToken(), nil + } + fetch := func(pageSize int, pageToken string) (string, error) { + items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) + if err != nil { + return "", err + } + it.items = append(it.items, items...) + return nextPageToken, nil + } + + it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) + it.pageInfo.MaxSize = int(req.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + + return it +} + +func (c *identityAwareProxyAdminGRPCClient) CreateTunnelDestGroup(ctx context.Context, req *iappb.CreateTunnelDestGroupRequest, opts ...gax.CallOption) (*iappb.TunnelDestGroup, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).CreateTunnelDestGroup[0:len((*c.CallOptions).CreateTunnelDestGroup):len((*c.CallOptions).CreateTunnelDestGroup)], opts...) + var resp *iappb.TunnelDestGroup + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.identityAwareProxyAdminClient.CreateTunnelDestGroup(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *identityAwareProxyAdminGRPCClient) GetTunnelDestGroup(ctx context.Context, req *iappb.GetTunnelDestGroupRequest, opts ...gax.CallOption) (*iappb.TunnelDestGroup, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).GetTunnelDestGroup[0:len((*c.CallOptions).GetTunnelDestGroup):len((*c.CallOptions).GetTunnelDestGroup)], opts...) + var resp *iappb.TunnelDestGroup + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.identityAwareProxyAdminClient.GetTunnelDestGroup(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *identityAwareProxyAdminGRPCClient) DeleteTunnelDestGroup(ctx context.Context, req *iappb.DeleteTunnelDestGroupRequest, opts ...gax.CallOption) error { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).DeleteTunnelDestGroup[0:len((*c.CallOptions).DeleteTunnelDestGroup):len((*c.CallOptions).DeleteTunnelDestGroup)], opts...) + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + _, err = c.identityAwareProxyAdminClient.DeleteTunnelDestGroup(ctx, req, settings.GRPC...) + return err + }, opts...) + return err +} + +func (c *identityAwareProxyAdminGRPCClient) UpdateTunnelDestGroup(ctx context.Context, req *iappb.UpdateTunnelDestGroupRequest, opts ...gax.CallOption) (*iappb.TunnelDestGroup, error) { + if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines { + cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond) + defer cancel() + ctx = cctx + } + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "tunnel_dest_group.name", url.QueryEscape(req.GetTunnelDestGroup().GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).UpdateTunnelDestGroup[0:len((*c.CallOptions).UpdateTunnelDestGroup):len((*c.CallOptions).UpdateTunnelDestGroup)], opts...) + var resp *iappb.TunnelDestGroup + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.identityAwareProxyAdminClient.UpdateTunnelDestGroup(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +// TunnelDestGroupIterator manages a stream of *iappb.TunnelDestGroup. +type TunnelDestGroupIterator struct { + items []*iappb.TunnelDestGroup + pageInfo *iterator.PageInfo + nextFunc func() error + + // Response is the raw response for the current page. + // It must be cast to the RPC response type. + // Calling Next() or InternalFetch() updates this value. + Response interface{} + + // InternalFetch is for use by the Google Cloud Libraries only. + // It is not part of the stable interface of this package. + // + // InternalFetch returns results from a single call to the underlying RPC. + // The number of results is no greater than pageSize. + // If there are no more results, nextPageToken is empty and err is nil. + InternalFetch func(pageSize int, pageToken string) (results []*iappb.TunnelDestGroup, nextPageToken string, err error) +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (it *TunnelDestGroupIterator) PageInfo() *iterator.PageInfo { + return it.pageInfo +} + +// Next returns the next result. Its second return value is iterator.Done if there are no more +// results. Once Next returns Done, all subsequent calls will return Done. +func (it *TunnelDestGroupIterator) Next() (*iappb.TunnelDestGroup, error) { + var item *iappb.TunnelDestGroup + if err := it.nextFunc(); err != nil { + return item, err + } + item = it.items[0] + it.items = it.items[1:] + return item, nil +} + +func (it *TunnelDestGroupIterator) bufLen() int { + return len(it.items) +} + +func (it *TunnelDestGroupIterator) takeBuf() interface{} { + b := it.items + it.items = nil + return b +} diff --git a/iap/apiv1/identity_aware_proxy_admin_client_example_test.go b/iap/apiv1/identity_aware_proxy_admin_client_example_test.go index 14c60dc0eb66..59d76ce2651d 100644 --- a/iap/apiv1/identity_aware_proxy_admin_client_example_test.go +++ b/iap/apiv1/identity_aware_proxy_admin_client_example_test.go @@ -20,6 +20,7 @@ import ( "context" iap "cloud.google.com/go/iap/apiv1" + "google.golang.org/api/iterator" iappb "google.golang.org/genproto/googleapis/cloud/iap/v1" iampb "google.golang.org/genproto/googleapis/iam/v1" ) @@ -135,3 +136,107 @@ func ExampleIdentityAwareProxyAdminClient_UpdateIapSettings() { // TODO: Use resp. _ = resp } + +func ExampleIdentityAwareProxyAdminClient_ListTunnelDestGroups() { + ctx := context.Background() + c, err := iap.NewIdentityAwareProxyAdminClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &iappb.ListTunnelDestGroupsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/iap/v1#ListTunnelDestGroupsRequest. + } + it := c.ListTunnelDestGroups(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +func ExampleIdentityAwareProxyAdminClient_CreateTunnelDestGroup() { + ctx := context.Background() + c, err := iap.NewIdentityAwareProxyAdminClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &iappb.CreateTunnelDestGroupRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/iap/v1#CreateTunnelDestGroupRequest. + } + resp, err := c.CreateTunnelDestGroup(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleIdentityAwareProxyAdminClient_GetTunnelDestGroup() { + ctx := context.Background() + c, err := iap.NewIdentityAwareProxyAdminClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &iappb.GetTunnelDestGroupRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/iap/v1#GetTunnelDestGroupRequest. + } + resp, err := c.GetTunnelDestGroup(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleIdentityAwareProxyAdminClient_DeleteTunnelDestGroup() { + ctx := context.Background() + c, err := iap.NewIdentityAwareProxyAdminClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &iappb.DeleteTunnelDestGroupRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/iap/v1#DeleteTunnelDestGroupRequest. + } + err = c.DeleteTunnelDestGroup(ctx, req) + if err != nil { + // TODO: Handle error. + } +} + +func ExampleIdentityAwareProxyAdminClient_UpdateTunnelDestGroup() { + ctx := context.Background() + c, err := iap.NewIdentityAwareProxyAdminClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &iappb.UpdateTunnelDestGroupRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/iap/v1#UpdateTunnelDestGroupRequest. + } + resp, err := c.UpdateTunnelDestGroup(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/iap/apiv1/identity_aware_proxyo_auth_client.go b/iap/apiv1/identity_aware_proxyo_auth_client.go index 9d02d692d35f..a50eb4439165 100644 --- a/iap/apiv1/identity_aware_proxyo_auth_client.go +++ b/iap/apiv1/identity_aware_proxyo_auth_client.go @@ -131,11 +131,12 @@ func (c *IdentityAwareProxyOAuthClient) ListBrands(ctx context.Context, req *iap // CreateBrand constructs a new OAuth brand for the project if one does not exist. // The created brand is “internal only”, meaning that OAuth clients created -// under it only accept requests from users who belong to the same G Suite -// organization as the project. The brand is created in an un-reviewed status. -// NOTE: The “internal only” status can be manually changed in the Google -// Cloud console. Requires that a brand does not already exist for the -// project, and that the specified support email is owned by the caller. +// under it only accept requests from users who belong to the same Google +// Workspace organization as the project. The brand is created in an +// un-reviewed status. NOTE: The “internal only” status can be manually +// changed in the Google Cloud Console. Requires that a brand does not already +// exist for the project, and that the specified support email is owned by the +// caller. func (c *IdentityAwareProxyOAuthClient) CreateBrand(ctx context.Context, req *iappb.CreateBrandRequest, opts ...gax.CallOption) (*iappb.Brand, error) { return c.internalClient.CreateBrand(ctx, req, opts...) } diff --git a/internal/generated/snippets/appengine/apiv1/snippet_metadata.google.appengine.v1.json b/internal/generated/snippets/appengine/apiv1/snippet_metadata.google.appengine.v1.json index f267f2ab35a9..657467a40124 100644 --- a/internal/generated/snippets/appengine/apiv1/snippet_metadata.google.appengine.v1.json +++ b/internal/generated/snippets/appengine/apiv1/snippet_metadata.google.appengine.v1.json @@ -152,7 +152,7 @@ { "regionTag": "appengine_v1_generated_Applications_UpdateApplication_sync", "title": "appengine UpdateApplication Sample", - "description": "UpdateApplication updates the specified Application resource.\nYou can update the following fields: \n\n auth_domain - Google authentication domain for controlling user access to the application.\n\n default_cookie_expiration - Cookie expiration policy for the application.", + "description": "UpdateApplication updates the specified Application resource.\nYou can update the following fields: \n\n auth_domain - Google authentication domain for controlling user access to the application.\n\n default_cookie_expiration - Cookie expiration policy for the application.\n\n iap - Identity-Aware Proxy properties for the application.", "file": "ApplicationsClient/UpdateApplication/main.go", "language": "GO", "clientMethod": { diff --git a/internal/generated/snippets/asset/apiv1/Client/BatchGetEffectiveIamPolicies/main.go b/internal/generated/snippets/asset/apiv1/Client/BatchGetEffectiveIamPolicies/main.go new file mode 100644 index 000000000000..55a42fb87ef8 --- /dev/null +++ b/internal/generated/snippets/asset/apiv1/Client/BatchGetEffectiveIamPolicies/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 cloudasset_v1_generated_AssetService_BatchGetEffectiveIamPolicies_sync] + +package main + +import ( + "context" + + asset "cloud.google.com/go/asset/apiv1" + assetpb "google.golang.org/genproto/googleapis/cloud/asset/v1" +) + +func main() { + ctx := context.Background() + c, err := asset.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &assetpb.BatchGetEffectiveIamPoliciesRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/asset/v1#BatchGetEffectiveIamPoliciesRequest. + } + resp, err := c.BatchGetEffectiveIamPolicies(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END cloudasset_v1_generated_AssetService_BatchGetEffectiveIamPolicies_sync] diff --git a/internal/generated/snippets/asset/apiv1/Client/CreateSavedQuery/main.go b/internal/generated/snippets/asset/apiv1/Client/CreateSavedQuery/main.go new file mode 100644 index 000000000000..cefc825850eb --- /dev/null +++ b/internal/generated/snippets/asset/apiv1/Client/CreateSavedQuery/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 cloudasset_v1_generated_AssetService_CreateSavedQuery_sync] + +package main + +import ( + "context" + + asset "cloud.google.com/go/asset/apiv1" + assetpb "google.golang.org/genproto/googleapis/cloud/asset/v1" +) + +func main() { + ctx := context.Background() + c, err := asset.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &assetpb.CreateSavedQueryRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/asset/v1#CreateSavedQueryRequest. + } + resp, err := c.CreateSavedQuery(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END cloudasset_v1_generated_AssetService_CreateSavedQuery_sync] diff --git a/internal/generated/snippets/asset/apiv1/Client/DeleteSavedQuery/main.go b/internal/generated/snippets/asset/apiv1/Client/DeleteSavedQuery/main.go new file mode 100644 index 000000000000..47a7e8ec78d0 --- /dev/null +++ b/internal/generated/snippets/asset/apiv1/Client/DeleteSavedQuery/main.go @@ -0,0 +1,46 @@ +// 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 cloudasset_v1_generated_AssetService_DeleteSavedQuery_sync] + +package main + +import ( + "context" + + asset "cloud.google.com/go/asset/apiv1" + assetpb "google.golang.org/genproto/googleapis/cloud/asset/v1" +) + +func main() { + ctx := context.Background() + c, err := asset.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &assetpb.DeleteSavedQueryRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/asset/v1#DeleteSavedQueryRequest. + } + err = c.DeleteSavedQuery(ctx, req) + if err != nil { + // TODO: Handle error. + } +} + +// [END cloudasset_v1_generated_AssetService_DeleteSavedQuery_sync] diff --git a/internal/generated/snippets/asset/apiv1/Client/GetSavedQuery/main.go b/internal/generated/snippets/asset/apiv1/Client/GetSavedQuery/main.go new file mode 100644 index 000000000000..c3a4037a85cd --- /dev/null +++ b/internal/generated/snippets/asset/apiv1/Client/GetSavedQuery/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 cloudasset_v1_generated_AssetService_GetSavedQuery_sync] + +package main + +import ( + "context" + + asset "cloud.google.com/go/asset/apiv1" + assetpb "google.golang.org/genproto/googleapis/cloud/asset/v1" +) + +func main() { + ctx := context.Background() + c, err := asset.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &assetpb.GetSavedQueryRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/asset/v1#GetSavedQueryRequest. + } + resp, err := c.GetSavedQuery(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END cloudasset_v1_generated_AssetService_GetSavedQuery_sync] diff --git a/internal/generated/snippets/asset/apiv1/Client/ListSavedQueries/main.go b/internal/generated/snippets/asset/apiv1/Client/ListSavedQueries/main.go new file mode 100644 index 000000000000..42cf479e0414 --- /dev/null +++ b/internal/generated/snippets/asset/apiv1/Client/ListSavedQueries/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 cloudasset_v1_generated_AssetService_ListSavedQueries_sync] + +package main + +import ( + "context" + + asset "cloud.google.com/go/asset/apiv1" + "google.golang.org/api/iterator" + assetpb "google.golang.org/genproto/googleapis/cloud/asset/v1" +) + +func main() { + ctx := context.Background() + c, err := asset.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &assetpb.ListSavedQueriesRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/asset/v1#ListSavedQueriesRequest. + } + it := c.ListSavedQueries(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END cloudasset_v1_generated_AssetService_ListSavedQueries_sync] diff --git a/internal/generated/snippets/asset/apiv1/Client/UpdateSavedQuery/main.go b/internal/generated/snippets/asset/apiv1/Client/UpdateSavedQuery/main.go new file mode 100644 index 000000000000..6a37bba872ff --- /dev/null +++ b/internal/generated/snippets/asset/apiv1/Client/UpdateSavedQuery/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 cloudasset_v1_generated_AssetService_UpdateSavedQuery_sync] + +package main + +import ( + "context" + + asset "cloud.google.com/go/asset/apiv1" + assetpb "google.golang.org/genproto/googleapis/cloud/asset/v1" +) + +func main() { + ctx := context.Background() + c, err := asset.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &assetpb.UpdateSavedQueryRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/asset/v1#UpdateSavedQueryRequest. + } + resp, err := c.UpdateSavedQuery(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END cloudasset_v1_generated_AssetService_UpdateSavedQuery_sync] diff --git a/internal/generated/snippets/asset/apiv1/snippet_metadata.google.cloud.asset.v1.json b/internal/generated/snippets/asset/apiv1/snippet_metadata.google.cloud.asset.v1.json index ec3d00c57363..8fde67a0fb5c 100644 --- a/internal/generated/snippets/asset/apiv1/snippet_metadata.google.cloud.asset.v1.json +++ b/internal/generated/snippets/asset/apiv1/snippet_metadata.google.cloud.asset.v1.json @@ -60,7 +60,7 @@ { "regionTag": "cloudasset_v1_generated_AssetService_AnalyzeIamPolicyLongrunning_sync", "title": "cloudasset AnalyzeIamPolicyLongrunning Sample", - "description": "AnalyzeIamPolicyLongrunning analyzes IAM policies asynchronously to answer which identities have what\naccesses on which resources, and writes the analysis results to a Google\nCloud Storage or a BigQuery destination. For Cloud Storage destination, the\noutput format is the JSON format that represents a\nAnalyzeIamPolicyResponse. This method implements the\ngoogle.longrunning.Operation, which allows you to track the operation\nstatus. We recommend intervals of at least 2 seconds with exponential\nbackoff retry to poll the operation result. The metadata contains the\nmetadata for the long-running operation.", + "description": "AnalyzeIamPolicyLongrunning analyzes IAM policies asynchronously to answer which identities have what\naccesses on which resources, and writes the analysis results to a Google\nCloud Storage or a BigQuery destination. For Cloud Storage destination, the\noutput format is the JSON format that represents a\nAnalyzeIamPolicyResponse.\nThis method implements the\ngoogle.longrunning.Operation, which allows\nyou to track the operation status. We recommend intervals of at least 2\nseconds with exponential backoff retry to poll the operation result. The\nmetadata contains the metadata for the long-running operation.", "file": "Client/AnalyzeIamPolicyLongrunning/main.go", "language": "GO", "clientMethod": { @@ -195,6 +195,52 @@ } ] }, + { + "regionTag": "cloudasset_v1_generated_AssetService_BatchGetEffectiveIamPolicies_sync", + "title": "cloudasset BatchGetEffectiveIamPolicies Sample", + "description": "BatchGetEffectiveIamPolicies gets effective IAM policies for a batch of resources.", + "file": "Client/BatchGetEffectiveIamPolicies/main.go", + "language": "GO", + "clientMethod": { + "shortName": "BatchGetEffectiveIamPolicies", + "fullName": "google.cloud.asset.v1.Client.BatchGetEffectiveIamPolicies", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "assetpb.BatchGetEffectiveIamPoliciesRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "assetpb.BatchGetEffectiveIamPoliciesResponse", + "client": { + "shortName": "Client", + "fullName": "google.cloud.asset.v1.Client" + }, + "method": { + "shortName": "BatchGetEffectiveIamPolicies", + "fullName": "google.cloud.asset.v1.AssetService.BatchGetEffectiveIamPolicies", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, { "regionTag": "cloudasset_v1_generated_AssetService_CreateFeed_sync", "title": "cloudasset CreateFeed Sample", @@ -241,6 +287,52 @@ } ] }, + { + "regionTag": "cloudasset_v1_generated_AssetService_CreateSavedQuery_sync", + "title": "cloudasset CreateSavedQuery Sample", + "description": "CreateSavedQuery creates a saved query in a parent project/folder/organization.", + "file": "Client/CreateSavedQuery/main.go", + "language": "GO", + "clientMethod": { + "shortName": "CreateSavedQuery", + "fullName": "google.cloud.asset.v1.Client.CreateSavedQuery", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "assetpb.CreateSavedQueryRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "assetpb.SavedQuery", + "client": { + "shortName": "Client", + "fullName": "google.cloud.asset.v1.Client" + }, + "method": { + "shortName": "CreateSavedQuery", + "fullName": "google.cloud.asset.v1.AssetService.CreateSavedQuery", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, { "regionTag": "cloudasset_v1_generated_AssetService_DeleteFeed_sync", "title": "cloudasset DeleteFeed Sample", @@ -286,10 +378,55 @@ } ] }, + { + "regionTag": "cloudasset_v1_generated_AssetService_DeleteSavedQuery_sync", + "title": "cloudasset DeleteSavedQuery Sample", + "description": "DeleteSavedQuery deletes a saved query.", + "file": "Client/DeleteSavedQuery/main.go", + "language": "GO", + "clientMethod": { + "shortName": "DeleteSavedQuery", + "fullName": "google.cloud.asset.v1.Client.DeleteSavedQuery", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "assetpb.DeleteSavedQueryRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "client": { + "shortName": "Client", + "fullName": "google.cloud.asset.v1.Client" + }, + "method": { + "shortName": "DeleteSavedQuery", + "fullName": "google.cloud.asset.v1.AssetService.DeleteSavedQuery", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 45, + "type": "FULL" + } + ] + }, { "regionTag": "cloudasset_v1_generated_AssetService_ExportAssets_sync", "title": "cloudasset ExportAssets Sample", - "description": "ExportAssets exports assets with time and resource types to a given Cloud Storage\nlocation/BigQuery table. For Cloud Storage location destinations, the\noutput format is newline-delimited JSON. Each line represents a\ngoogle.cloud.asset.v1.Asset in the JSON format; for BigQuery table\ndestinations, the output table stores the fields in asset proto as columns.\nThis API implements the google.longrunning.Operation API\n, which allows you to keep track of the export. We recommend intervals of\nat least 2 seconds with exponential retry to poll the export operation\nresult. For regular-size resource parent, the export operation usually\nfinishes within 5 minutes.", + "description": "ExportAssets exports assets with time and resource types to a given Cloud Storage\nlocation/BigQuery table. For Cloud Storage location destinations, the\noutput format is newline-delimited JSON. Each line represents a\ngoogle.cloud.asset.v1.Asset in the JSON\nformat; for BigQuery table destinations, the output table stores the fields\nin asset Protobuf as columns. This API implements the\ngoogle.longrunning.Operation API, which\nallows you to keep track of the export. We recommend intervals of at least\n2 seconds with exponential retry to poll the export operation result. For\nregular-size resource parent, the export operation usually finishes within\n5 minutes.", "file": "Client/ExportAssets/main.go", "language": "GO", "clientMethod": { @@ -378,6 +515,52 @@ } ] }, + { + "regionTag": "cloudasset_v1_generated_AssetService_GetSavedQuery_sync", + "title": "cloudasset GetSavedQuery Sample", + "description": "GetSavedQuery gets details about a saved query.", + "file": "Client/GetSavedQuery/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetSavedQuery", + "fullName": "google.cloud.asset.v1.Client.GetSavedQuery", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "assetpb.GetSavedQueryRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "assetpb.SavedQuery", + "client": { + "shortName": "Client", + "fullName": "google.cloud.asset.v1.Client" + }, + "method": { + "shortName": "GetSavedQuery", + "fullName": "google.cloud.asset.v1.AssetService.GetSavedQuery", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, { "regionTag": "cloudasset_v1_generated_AssetService_ListAssets_sync", "title": "cloudasset ListAssets Sample", @@ -470,6 +653,52 @@ } ] }, + { + "regionTag": "cloudasset_v1_generated_AssetService_ListSavedQueries_sync", + "title": "cloudasset ListSavedQueries Sample", + "description": "ListSavedQueries lists all saved queries in a parent project/folder/organization.", + "file": "Client/ListSavedQueries/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListSavedQueries", + "fullName": "google.cloud.asset.v1.Client.ListSavedQueries", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "assetpb.ListSavedQueriesRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "SavedQueryIterator", + "client": { + "shortName": "Client", + "fullName": "google.cloud.asset.v1.Client" + }, + "method": { + "shortName": "ListSavedQueries", + "fullName": "google.cloud.asset.v1.AssetService.ListSavedQueries", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 54, + "type": "FULL" + } + ] + }, { "regionTag": "cloudasset_v1_generated_AssetService_SearchAllIamPolicies_sync", "title": "cloudasset SearchAllIamPolicies Sample", @@ -607,6 +836,52 @@ "type": "FULL" } ] + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_UpdateSavedQuery_sync", + "title": "cloudasset UpdateSavedQuery Sample", + "description": "UpdateSavedQuery updates a saved query.", + "file": "Client/UpdateSavedQuery/main.go", + "language": "GO", + "clientMethod": { + "shortName": "UpdateSavedQuery", + "fullName": "google.cloud.asset.v1.Client.UpdateSavedQuery", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "assetpb.UpdateSavedQueryRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "assetpb.SavedQuery", + "client": { + "shortName": "Client", + "fullName": "google.cloud.asset.v1.Client" + }, + "method": { + "shortName": "UpdateSavedQuery", + "fullName": "google.cloud.asset.v1.AssetService.UpdateSavedQuery", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] } ] } \ No newline at end of file diff --git a/internal/generated/snippets/assuredworkloads/apiv1/snippet_metadata.google.cloud.assuredworkloads.v1.json b/internal/generated/snippets/assuredworkloads/apiv1/snippet_metadata.google.cloud.assuredworkloads.v1.json index 2e407e586de7..61aae2969b87 100644 --- a/internal/generated/snippets/assuredworkloads/apiv1/snippet_metadata.google.cloud.assuredworkloads.v1.json +++ b/internal/generated/snippets/assuredworkloads/apiv1/snippet_metadata.google.cloud.assuredworkloads.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "cloud.google.com/go/assuredworkloads/apiv1", - "version": "0.5.0", + "version": "0.6.0", "language": "GO", "apis": [ { diff --git a/internal/generated/snippets/assuredworkloads/apiv1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json b/internal/generated/snippets/assuredworkloads/apiv1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json index b32386dc8e51..9594f4f221c7 100644 --- a/internal/generated/snippets/assuredworkloads/apiv1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json +++ b/internal/generated/snippets/assuredworkloads/apiv1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "cloud.google.com/go/assuredworkloads/apiv1beta1", - "version": "0.5.0", + "version": "0.6.0", "language": "GO", "apis": [ { diff --git a/internal/generated/snippets/bigquery/connection/apiv1/snippet_metadata.google.cloud.bigquery.connection.v1.json b/internal/generated/snippets/bigquery/connection/apiv1/snippet_metadata.google.cloud.bigquery.connection.v1.json index 4623b3d03df0..76701b1baa9c 100644 --- a/internal/generated/snippets/bigquery/connection/apiv1/snippet_metadata.google.cloud.bigquery.connection.v1.json +++ b/internal/generated/snippets/bigquery/connection/apiv1/snippet_metadata.google.cloud.bigquery.connection.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "cloud.google.com/go/bigquery/connection/apiv1", - "version": "1.31.0", + "version": "1.32.0", "language": "GO", "apis": [ { diff --git a/internal/generated/snippets/bigquery/connection/apiv1beta1/snippet_metadata.google.cloud.bigquery.connection.v1beta1.json b/internal/generated/snippets/bigquery/connection/apiv1beta1/snippet_metadata.google.cloud.bigquery.connection.v1beta1.json index aa857d581a72..a9866af2c860 100644 --- a/internal/generated/snippets/bigquery/connection/apiv1beta1/snippet_metadata.google.cloud.bigquery.connection.v1beta1.json +++ b/internal/generated/snippets/bigquery/connection/apiv1beta1/snippet_metadata.google.cloud.bigquery.connection.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "cloud.google.com/go/bigquery/connection/apiv1beta1", - "version": "1.31.0", + "version": "1.32.0", "language": "GO", "apis": [ { diff --git a/internal/generated/snippets/bigquery/dataexchange/apiv1beta1/snippet_metadata.google.cloud.bigquery.dataexchange.v1beta1.json b/internal/generated/snippets/bigquery/dataexchange/apiv1beta1/snippet_metadata.google.cloud.bigquery.dataexchange.v1beta1.json index 958500d1aca7..f6849edfa60d 100644 --- a/internal/generated/snippets/bigquery/dataexchange/apiv1beta1/snippet_metadata.google.cloud.bigquery.dataexchange.v1beta1.json +++ b/internal/generated/snippets/bigquery/dataexchange/apiv1beta1/snippet_metadata.google.cloud.bigquery.dataexchange.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "cloud.google.com/go/bigquery/dataexchange/apiv1beta1", - "version": "1.31.0", + "version": "1.32.0", "language": "GO", "apis": [ { diff --git a/internal/generated/snippets/bigquery/datatransfer/apiv1/snippet_metadata.google.cloud.bigquery.datatransfer.v1.json b/internal/generated/snippets/bigquery/datatransfer/apiv1/snippet_metadata.google.cloud.bigquery.datatransfer.v1.json index 63cc9849ea60..7f088c90d7ef 100644 --- a/internal/generated/snippets/bigquery/datatransfer/apiv1/snippet_metadata.google.cloud.bigquery.datatransfer.v1.json +++ b/internal/generated/snippets/bigquery/datatransfer/apiv1/snippet_metadata.google.cloud.bigquery.datatransfer.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "cloud.google.com/go/bigquery/datatransfer/apiv1", - "version": "1.31.0", + "version": "1.32.0", "language": "GO", "apis": [ { diff --git a/internal/generated/snippets/bigquery/migration/apiv2/snippet_metadata.google.cloud.bigquery.migration.v2.json b/internal/generated/snippets/bigquery/migration/apiv2/snippet_metadata.google.cloud.bigquery.migration.v2.json index 1b3f532cd213..4b5108fc9c11 100644 --- a/internal/generated/snippets/bigquery/migration/apiv2/snippet_metadata.google.cloud.bigquery.migration.v2.json +++ b/internal/generated/snippets/bigquery/migration/apiv2/snippet_metadata.google.cloud.bigquery.migration.v2.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "cloud.google.com/go/bigquery/migration/apiv2", - "version": "1.31.0", + "version": "1.32.0", "language": "GO", "apis": [ { diff --git a/internal/generated/snippets/bigquery/migration/apiv2alpha/snippet_metadata.google.cloud.bigquery.migration.v2alpha.json b/internal/generated/snippets/bigquery/migration/apiv2alpha/snippet_metadata.google.cloud.bigquery.migration.v2alpha.json index 81940304cbc6..045b6fca142f 100644 --- a/internal/generated/snippets/bigquery/migration/apiv2alpha/snippet_metadata.google.cloud.bigquery.migration.v2alpha.json +++ b/internal/generated/snippets/bigquery/migration/apiv2alpha/snippet_metadata.google.cloud.bigquery.migration.v2alpha.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "cloud.google.com/go/bigquery/migration/apiv2alpha", - "version": "1.31.0", + "version": "1.32.0", "language": "GO", "apis": [ { diff --git a/internal/generated/snippets/bigquery/reservation/apiv1/snippet_metadata.google.cloud.bigquery.reservation.v1.json b/internal/generated/snippets/bigquery/reservation/apiv1/snippet_metadata.google.cloud.bigquery.reservation.v1.json index c281345e94d7..3228b6051371 100644 --- a/internal/generated/snippets/bigquery/reservation/apiv1/snippet_metadata.google.cloud.bigquery.reservation.v1.json +++ b/internal/generated/snippets/bigquery/reservation/apiv1/snippet_metadata.google.cloud.bigquery.reservation.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "cloud.google.com/go/bigquery/reservation/apiv1", - "version": "1.31.0", + "version": "1.32.0", "language": "GO", "apis": [ { diff --git a/internal/generated/snippets/bigquery/reservation/apiv1beta1/snippet_metadata.google.cloud.bigquery.reservation.v1beta1.json b/internal/generated/snippets/bigquery/reservation/apiv1beta1/snippet_metadata.google.cloud.bigquery.reservation.v1beta1.json index d2bb3cf96b03..08ea5e33f90b 100644 --- a/internal/generated/snippets/bigquery/reservation/apiv1beta1/snippet_metadata.google.cloud.bigquery.reservation.v1beta1.json +++ b/internal/generated/snippets/bigquery/reservation/apiv1beta1/snippet_metadata.google.cloud.bigquery.reservation.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "cloud.google.com/go/bigquery/reservation/apiv1beta1", - "version": "1.31.0", + "version": "1.32.0", "language": "GO", "apis": [ { diff --git a/internal/generated/snippets/bigquery/storage/apiv1/snippet_metadata.google.cloud.bigquery.storage.v1.json b/internal/generated/snippets/bigquery/storage/apiv1/snippet_metadata.google.cloud.bigquery.storage.v1.json index 467338d885f4..d8e76c4261e8 100644 --- a/internal/generated/snippets/bigquery/storage/apiv1/snippet_metadata.google.cloud.bigquery.storage.v1.json +++ b/internal/generated/snippets/bigquery/storage/apiv1/snippet_metadata.google.cloud.bigquery.storage.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "cloud.google.com/go/bigquery/storage/apiv1", - "version": "1.31.0", + "version": "1.32.0", "language": "GO", "apis": [ { diff --git a/internal/generated/snippets/bigquery/storage/apiv1beta1/snippet_metadata.google.cloud.bigquery.storage.v1beta1.json b/internal/generated/snippets/bigquery/storage/apiv1beta1/snippet_metadata.google.cloud.bigquery.storage.v1beta1.json index 6cde1089f404..178e2e873722 100644 --- a/internal/generated/snippets/bigquery/storage/apiv1beta1/snippet_metadata.google.cloud.bigquery.storage.v1beta1.json +++ b/internal/generated/snippets/bigquery/storage/apiv1beta1/snippet_metadata.google.cloud.bigquery.storage.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "cloud.google.com/go/bigquery/storage/apiv1beta1", - "version": "1.31.0", + "version": "1.32.0", "language": "GO", "apis": [ { diff --git a/internal/generated/snippets/bigquery/storage/apiv1beta2/snippet_metadata.google.cloud.bigquery.storage.v1beta2.json b/internal/generated/snippets/bigquery/storage/apiv1beta2/snippet_metadata.google.cloud.bigquery.storage.v1beta2.json index 56a2554f1d19..dda5ad48a659 100644 --- a/internal/generated/snippets/bigquery/storage/apiv1beta2/snippet_metadata.google.cloud.bigquery.storage.v1beta2.json +++ b/internal/generated/snippets/bigquery/storage/apiv1beta2/snippet_metadata.google.cloud.bigquery.storage.v1beta2.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "cloud.google.com/go/bigquery/storage/apiv1beta2", - "version": "1.31.0", + "version": "1.32.0", "language": "GO", "apis": [ { diff --git a/internal/generated/snippets/binaryauthorization/apiv1/BinauthzManagementClient/CreateAttestor/main.go b/internal/generated/snippets/binaryauthorization/apiv1/BinauthzManagementClient/CreateAttestor/main.go new file mode 100644 index 000000000000..e9447f57ce62 --- /dev/null +++ b/internal/generated/snippets/binaryauthorization/apiv1/BinauthzManagementClient/CreateAttestor/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 binaryauthorization_v1_generated_BinauthzManagementServiceV1_CreateAttestor_sync] + +package main + +import ( + "context" + + binaryauthorization "cloud.google.com/go/binaryauthorization/apiv1" + binaryauthorizationpb "google.golang.org/genproto/googleapis/cloud/binaryauthorization/v1" +) + +func main() { + ctx := context.Background() + c, err := binaryauthorization.NewBinauthzManagementClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &binaryauthorizationpb.CreateAttestorRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/binaryauthorization/v1#CreateAttestorRequest. + } + resp, err := c.CreateAttestor(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END binaryauthorization_v1_generated_BinauthzManagementServiceV1_CreateAttestor_sync] diff --git a/internal/generated/snippets/binaryauthorization/apiv1/BinauthzManagementClient/DeleteAttestor/main.go b/internal/generated/snippets/binaryauthorization/apiv1/BinauthzManagementClient/DeleteAttestor/main.go new file mode 100644 index 000000000000..85671bc00b72 --- /dev/null +++ b/internal/generated/snippets/binaryauthorization/apiv1/BinauthzManagementClient/DeleteAttestor/main.go @@ -0,0 +1,46 @@ +// 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 binaryauthorization_v1_generated_BinauthzManagementServiceV1_DeleteAttestor_sync] + +package main + +import ( + "context" + + binaryauthorization "cloud.google.com/go/binaryauthorization/apiv1" + binaryauthorizationpb "google.golang.org/genproto/googleapis/cloud/binaryauthorization/v1" +) + +func main() { + ctx := context.Background() + c, err := binaryauthorization.NewBinauthzManagementClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &binaryauthorizationpb.DeleteAttestorRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/binaryauthorization/v1#DeleteAttestorRequest. + } + err = c.DeleteAttestor(ctx, req) + if err != nil { + // TODO: Handle error. + } +} + +// [END binaryauthorization_v1_generated_BinauthzManagementServiceV1_DeleteAttestor_sync] diff --git a/internal/generated/snippets/binaryauthorization/apiv1/BinauthzManagementClient/GetAttestor/main.go b/internal/generated/snippets/binaryauthorization/apiv1/BinauthzManagementClient/GetAttestor/main.go new file mode 100644 index 000000000000..5c89d58a33cb --- /dev/null +++ b/internal/generated/snippets/binaryauthorization/apiv1/BinauthzManagementClient/GetAttestor/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 binaryauthorization_v1_generated_BinauthzManagementServiceV1_GetAttestor_sync] + +package main + +import ( + "context" + + binaryauthorization "cloud.google.com/go/binaryauthorization/apiv1" + binaryauthorizationpb "google.golang.org/genproto/googleapis/cloud/binaryauthorization/v1" +) + +func main() { + ctx := context.Background() + c, err := binaryauthorization.NewBinauthzManagementClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &binaryauthorizationpb.GetAttestorRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/binaryauthorization/v1#GetAttestorRequest. + } + resp, err := c.GetAttestor(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END binaryauthorization_v1_generated_BinauthzManagementServiceV1_GetAttestor_sync] diff --git a/internal/generated/snippets/binaryauthorization/apiv1/BinauthzManagementClient/GetPolicy/main.go b/internal/generated/snippets/binaryauthorization/apiv1/BinauthzManagementClient/GetPolicy/main.go new file mode 100644 index 000000000000..2e7ddcce0ad5 --- /dev/null +++ b/internal/generated/snippets/binaryauthorization/apiv1/BinauthzManagementClient/GetPolicy/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 binaryauthorization_v1_generated_BinauthzManagementServiceV1_GetPolicy_sync] + +package main + +import ( + "context" + + binaryauthorization "cloud.google.com/go/binaryauthorization/apiv1" + binaryauthorizationpb "google.golang.org/genproto/googleapis/cloud/binaryauthorization/v1" +) + +func main() { + ctx := context.Background() + c, err := binaryauthorization.NewBinauthzManagementClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &binaryauthorizationpb.GetPolicyRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/binaryauthorization/v1#GetPolicyRequest. + } + resp, err := c.GetPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END binaryauthorization_v1_generated_BinauthzManagementServiceV1_GetPolicy_sync] diff --git a/internal/generated/snippets/binaryauthorization/apiv1/BinauthzManagementClient/ListAttestors/main.go b/internal/generated/snippets/binaryauthorization/apiv1/BinauthzManagementClient/ListAttestors/main.go new file mode 100644 index 000000000000..5d9d18214b7c --- /dev/null +++ b/internal/generated/snippets/binaryauthorization/apiv1/BinauthzManagementClient/ListAttestors/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 binaryauthorization_v1_generated_BinauthzManagementServiceV1_ListAttestors_sync] + +package main + +import ( + "context" + + binaryauthorization "cloud.google.com/go/binaryauthorization/apiv1" + "google.golang.org/api/iterator" + binaryauthorizationpb "google.golang.org/genproto/googleapis/cloud/binaryauthorization/v1" +) + +func main() { + ctx := context.Background() + c, err := binaryauthorization.NewBinauthzManagementClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &binaryauthorizationpb.ListAttestorsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/binaryauthorization/v1#ListAttestorsRequest. + } + it := c.ListAttestors(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END binaryauthorization_v1_generated_BinauthzManagementServiceV1_ListAttestors_sync] diff --git a/internal/generated/snippets/binaryauthorization/apiv1/BinauthzManagementClient/UpdateAttestor/main.go b/internal/generated/snippets/binaryauthorization/apiv1/BinauthzManagementClient/UpdateAttestor/main.go new file mode 100644 index 000000000000..43ae5c849680 --- /dev/null +++ b/internal/generated/snippets/binaryauthorization/apiv1/BinauthzManagementClient/UpdateAttestor/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 binaryauthorization_v1_generated_BinauthzManagementServiceV1_UpdateAttestor_sync] + +package main + +import ( + "context" + + binaryauthorization "cloud.google.com/go/binaryauthorization/apiv1" + binaryauthorizationpb "google.golang.org/genproto/googleapis/cloud/binaryauthorization/v1" +) + +func main() { + ctx := context.Background() + c, err := binaryauthorization.NewBinauthzManagementClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &binaryauthorizationpb.UpdateAttestorRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/binaryauthorization/v1#UpdateAttestorRequest. + } + resp, err := c.UpdateAttestor(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END binaryauthorization_v1_generated_BinauthzManagementServiceV1_UpdateAttestor_sync] diff --git a/internal/generated/snippets/binaryauthorization/apiv1/BinauthzManagementClient/UpdatePolicy/main.go b/internal/generated/snippets/binaryauthorization/apiv1/BinauthzManagementClient/UpdatePolicy/main.go new file mode 100644 index 000000000000..75c5d9bae8b4 --- /dev/null +++ b/internal/generated/snippets/binaryauthorization/apiv1/BinauthzManagementClient/UpdatePolicy/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 binaryauthorization_v1_generated_BinauthzManagementServiceV1_UpdatePolicy_sync] + +package main + +import ( + "context" + + binaryauthorization "cloud.google.com/go/binaryauthorization/apiv1" + binaryauthorizationpb "google.golang.org/genproto/googleapis/cloud/binaryauthorization/v1" +) + +func main() { + ctx := context.Background() + c, err := binaryauthorization.NewBinauthzManagementClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &binaryauthorizationpb.UpdatePolicyRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/binaryauthorization/v1#UpdatePolicyRequest. + } + resp, err := c.UpdatePolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END binaryauthorization_v1_generated_BinauthzManagementServiceV1_UpdatePolicy_sync] diff --git a/internal/generated/snippets/binaryauthorization/apiv1/SystemPolicyClient/GetSystemPolicy/main.go b/internal/generated/snippets/binaryauthorization/apiv1/SystemPolicyClient/GetSystemPolicy/main.go new file mode 100644 index 000000000000..63b723b45d6a --- /dev/null +++ b/internal/generated/snippets/binaryauthorization/apiv1/SystemPolicyClient/GetSystemPolicy/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 binaryauthorization_v1_generated_SystemPolicyV1_GetSystemPolicy_sync] + +package main + +import ( + "context" + + binaryauthorization "cloud.google.com/go/binaryauthorization/apiv1" + binaryauthorizationpb "google.golang.org/genproto/googleapis/cloud/binaryauthorization/v1" +) + +func main() { + ctx := context.Background() + c, err := binaryauthorization.NewSystemPolicyClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &binaryauthorizationpb.GetSystemPolicyRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/binaryauthorization/v1#GetSystemPolicyRequest. + } + resp, err := c.GetSystemPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END binaryauthorization_v1_generated_SystemPolicyV1_GetSystemPolicy_sync] diff --git a/internal/generated/snippets/binaryauthorization/apiv1/ValidationHelperClient/ValidateAttestationOccurrence/main.go b/internal/generated/snippets/binaryauthorization/apiv1/ValidationHelperClient/ValidateAttestationOccurrence/main.go new file mode 100644 index 000000000000..89c0e5d28eac --- /dev/null +++ b/internal/generated/snippets/binaryauthorization/apiv1/ValidationHelperClient/ValidateAttestationOccurrence/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 binaryauthorization_v1_generated_ValidationHelperV1_ValidateAttestationOccurrence_sync] + +package main + +import ( + "context" + + binaryauthorization "cloud.google.com/go/binaryauthorization/apiv1" + binaryauthorizationpb "google.golang.org/genproto/googleapis/cloud/binaryauthorization/v1" +) + +func main() { + ctx := context.Background() + c, err := binaryauthorization.NewValidationHelperClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &binaryauthorizationpb.ValidateAttestationOccurrenceRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/binaryauthorization/v1#ValidateAttestationOccurrenceRequest. + } + resp, err := c.ValidateAttestationOccurrence(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END binaryauthorization_v1_generated_ValidationHelperV1_ValidateAttestationOccurrence_sync] diff --git a/internal/generated/snippets/binaryauthorization/apiv1/snippet_metadata.google.cloud.binaryauthorization.v1.json b/internal/generated/snippets/binaryauthorization/apiv1/snippet_metadata.google.cloud.binaryauthorization.v1.json new file mode 100644 index 000000000000..7147d24cfa76 --- /dev/null +++ b/internal/generated/snippets/binaryauthorization/apiv1/snippet_metadata.google.cloud.binaryauthorization.v1.json @@ -0,0 +1,428 @@ +{ + "clientLibrary": { + "name": "cloud.google.com/go/binaryauthorization/apiv1", + "version": "0.5.0", + "language": "GO", + "apis": [ + { + "id": "google.cloud.binaryauthorization.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "binaryauthorization_v1_generated_BinauthzManagementServiceV1_CreateAttestor_sync", + "title": "binaryauthorization CreateAttestor Sample", + "description": "CreateAttestor creates an attestor, and returns a copy of the new\nattestor. Returns NOT_FOUND if the project does not exist,\nINVALID_ARGUMENT if the request is malformed, ALREADY_EXISTS if the\nattestor already exists.", + "file": "BinauthzManagementClient/CreateAttestor/main.go", + "language": "GO", + "clientMethod": { + "shortName": "CreateAttestor", + "fullName": "google.cloud.binaryauthorization.v1.BinauthzManagementClient.CreateAttestor", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "binaryauthorizationpb.CreateAttestorRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "binaryauthorizationpb.Attestor", + "client": { + "shortName": "BinauthzManagementClient", + "fullName": "google.cloud.binaryauthorization.v1.BinauthzManagementClient" + }, + "method": { + "shortName": "CreateAttestor", + "fullName": "google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1.CreateAttestor", + "service": { + "shortName": "BinauthzManagementServiceV1", + "fullName": "google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "binaryauthorization_v1_generated_BinauthzManagementServiceV1_DeleteAttestor_sync", + "title": "binaryauthorization DeleteAttestor Sample", + "description": "DeleteAttestor deletes an attestor. Returns NOT_FOUND if the\nattestor does not exist.", + "file": "BinauthzManagementClient/DeleteAttestor/main.go", + "language": "GO", + "clientMethod": { + "shortName": "DeleteAttestor", + "fullName": "google.cloud.binaryauthorization.v1.BinauthzManagementClient.DeleteAttestor", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "binaryauthorizationpb.DeleteAttestorRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "client": { + "shortName": "BinauthzManagementClient", + "fullName": "google.cloud.binaryauthorization.v1.BinauthzManagementClient" + }, + "method": { + "shortName": "DeleteAttestor", + "fullName": "google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1.DeleteAttestor", + "service": { + "shortName": "BinauthzManagementServiceV1", + "fullName": "google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 45, + "type": "FULL" + } + ] + }, + { + "regionTag": "binaryauthorization_v1_generated_BinauthzManagementServiceV1_GetAttestor_sync", + "title": "binaryauthorization GetAttestor Sample", + "description": "GetAttestor gets an attestor.\nReturns NOT_FOUND if the attestor does not exist.", + "file": "BinauthzManagementClient/GetAttestor/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetAttestor", + "fullName": "google.cloud.binaryauthorization.v1.BinauthzManagementClient.GetAttestor", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "binaryauthorizationpb.GetAttestorRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "binaryauthorizationpb.Attestor", + "client": { + "shortName": "BinauthzManagementClient", + "fullName": "google.cloud.binaryauthorization.v1.BinauthzManagementClient" + }, + "method": { + "shortName": "GetAttestor", + "fullName": "google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1.GetAttestor", + "service": { + "shortName": "BinauthzManagementServiceV1", + "fullName": "google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "binaryauthorization_v1_generated_BinauthzManagementServiceV1_GetPolicy_sync", + "title": "binaryauthorization GetPolicy Sample", + "description": "GetPolicy a policy specifies the attestors that must attest to\na container image, before the project is allowed to deploy that\nimage. There is at most one policy per project. All image admission\nrequests are permitted if a project has no policy.\n\nGets the policy for this project. Returns a default\npolicy if the project does not have one.", + "file": "BinauthzManagementClient/GetPolicy/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetPolicy", + "fullName": "google.cloud.binaryauthorization.v1.BinauthzManagementClient.GetPolicy", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "binaryauthorizationpb.GetPolicyRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "binaryauthorizationpb.Policy", + "client": { + "shortName": "BinauthzManagementClient", + "fullName": "google.cloud.binaryauthorization.v1.BinauthzManagementClient" + }, + "method": { + "shortName": "GetPolicy", + "fullName": "google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1.GetPolicy", + "service": { + "shortName": "BinauthzManagementServiceV1", + "fullName": "google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "binaryauthorization_v1_generated_BinauthzManagementServiceV1_ListAttestors_sync", + "title": "binaryauthorization ListAttestors Sample", + "description": "ListAttestors lists attestors.\nReturns INVALID_ARGUMENT if the project does not exist.", + "file": "BinauthzManagementClient/ListAttestors/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListAttestors", + "fullName": "google.cloud.binaryauthorization.v1.BinauthzManagementClient.ListAttestors", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "binaryauthorizationpb.ListAttestorsRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "AttestorIterator", + "client": { + "shortName": "BinauthzManagementClient", + "fullName": "google.cloud.binaryauthorization.v1.BinauthzManagementClient" + }, + "method": { + "shortName": "ListAttestors", + "fullName": "google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1.ListAttestors", + "service": { + "shortName": "BinauthzManagementServiceV1", + "fullName": "google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 54, + "type": "FULL" + } + ] + }, + { + "regionTag": "binaryauthorization_v1_generated_BinauthzManagementServiceV1_UpdateAttestor_sync", + "title": "binaryauthorization UpdateAttestor Sample", + "description": "UpdateAttestor updates an attestor.\nReturns NOT_FOUND if the attestor does not exist.", + "file": "BinauthzManagementClient/UpdateAttestor/main.go", + "language": "GO", + "clientMethod": { + "shortName": "UpdateAttestor", + "fullName": "google.cloud.binaryauthorization.v1.BinauthzManagementClient.UpdateAttestor", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "binaryauthorizationpb.UpdateAttestorRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "binaryauthorizationpb.Attestor", + "client": { + "shortName": "BinauthzManagementClient", + "fullName": "google.cloud.binaryauthorization.v1.BinauthzManagementClient" + }, + "method": { + "shortName": "UpdateAttestor", + "fullName": "google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1.UpdateAttestor", + "service": { + "shortName": "BinauthzManagementServiceV1", + "fullName": "google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "binaryauthorization_v1_generated_BinauthzManagementServiceV1_UpdatePolicy_sync", + "title": "binaryauthorization UpdatePolicy Sample", + "description": "UpdatePolicy creates or updates a project’s policy, and returns a copy of the\nnew policy. A policy is always updated as a whole, to avoid race\nconditions with concurrent policy enforcement (or management!)\nrequests. Returns NOT_FOUND if the project does not exist, INVALID_ARGUMENT\nif the request is malformed.", + "file": "BinauthzManagementClient/UpdatePolicy/main.go", + "language": "GO", + "clientMethod": { + "shortName": "UpdatePolicy", + "fullName": "google.cloud.binaryauthorization.v1.BinauthzManagementClient.UpdatePolicy", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "binaryauthorizationpb.UpdatePolicyRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "binaryauthorizationpb.Policy", + "client": { + "shortName": "BinauthzManagementClient", + "fullName": "google.cloud.binaryauthorization.v1.BinauthzManagementClient" + }, + "method": { + "shortName": "UpdatePolicy", + "fullName": "google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1.UpdatePolicy", + "service": { + "shortName": "BinauthzManagementServiceV1", + "fullName": "google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "binaryauthorization_v1_generated_SystemPolicyV1_GetSystemPolicy_sync", + "title": "binaryauthorization GetSystemPolicy Sample", + "description": "GetSystemPolicy gets the current system policy in the specified location.", + "file": "SystemPolicyClient/GetSystemPolicy/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetSystemPolicy", + "fullName": "google.cloud.binaryauthorization.v1.SystemPolicyClient.GetSystemPolicy", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "binaryauthorizationpb.GetSystemPolicyRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "binaryauthorizationpb.Policy", + "client": { + "shortName": "SystemPolicyClient", + "fullName": "google.cloud.binaryauthorization.v1.SystemPolicyClient" + }, + "method": { + "shortName": "GetSystemPolicy", + "fullName": "google.cloud.binaryauthorization.v1.SystemPolicyV1.GetSystemPolicy", + "service": { + "shortName": "SystemPolicyV1", + "fullName": "google.cloud.binaryauthorization.v1.SystemPolicyV1" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "binaryauthorization_v1_generated_ValidationHelperV1_ValidateAttestationOccurrence_sync", + "title": "binaryauthorization ValidateAttestationOccurrence Sample", + "description": "ValidateAttestationOccurrence returns whether the given Attestation for the given image URI\nwas signed by the given Attestor", + "file": "ValidationHelperClient/ValidateAttestationOccurrence/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ValidateAttestationOccurrence", + "fullName": "google.cloud.binaryauthorization.v1.ValidationHelperClient.ValidateAttestationOccurrence", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "binaryauthorizationpb.ValidateAttestationOccurrenceRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "binaryauthorizationpb.ValidateAttestationOccurrenceResponse", + "client": { + "shortName": "ValidationHelperClient", + "fullName": "google.cloud.binaryauthorization.v1.ValidationHelperClient" + }, + "method": { + "shortName": "ValidateAttestationOccurrence", + "fullName": "google.cloud.binaryauthorization.v1.ValidationHelperV1.ValidateAttestationOccurrence", + "service": { + "shortName": "ValidationHelperV1", + "fullName": "google.cloud.binaryauthorization.v1.ValidationHelperV1" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/internal/generated/snippets/binaryauthorization/apiv1beta1/snippet_metadata.google.cloud.binaryauthorization.v1beta1.json b/internal/generated/snippets/binaryauthorization/apiv1beta1/snippet_metadata.google.cloud.binaryauthorization.v1beta1.json index 0f7900a3b7c5..be6d9553e0b8 100644 --- a/internal/generated/snippets/binaryauthorization/apiv1beta1/snippet_metadata.google.cloud.binaryauthorization.v1beta1.json +++ b/internal/generated/snippets/binaryauthorization/apiv1beta1/snippet_metadata.google.cloud.binaryauthorization.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "cloud.google.com/go/binaryauthorization/apiv1beta1", - "version": "0.4.0", + "version": "0.5.0", "language": "GO", "apis": [ { diff --git a/internal/generated/snippets/datastore/admin/apiv1/snippet_metadata.google.datastore.admin.v1.json b/internal/generated/snippets/datastore/admin/apiv1/snippet_metadata.google.datastore.admin.v1.json index 97ae6fae0b0e..89fef2a54e9a 100644 --- a/internal/generated/snippets/datastore/admin/apiv1/snippet_metadata.google.datastore.admin.v1.json +++ b/internal/generated/snippets/datastore/admin/apiv1/snippet_metadata.google.datastore.admin.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "cloud.google.com/go/datastore/admin/apiv1", - "version": "1.6.0", + "version": "1.7.0", "language": "GO", "apis": [ { diff --git a/internal/generated/snippets/datastream/apiv1/Client/CreateConnectionProfile/main.go b/internal/generated/snippets/datastream/apiv1/Client/CreateConnectionProfile/main.go new file mode 100644 index 000000000000..0e753f56d5f5 --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1/Client/CreateConnectionProfile/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 datastream_v1_generated_Datastream_CreateConnectionProfile_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.CreateConnectionProfileRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datastream/v1#CreateConnectionProfileRequest. + } + op, err := c.CreateConnectionProfile(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END datastream_v1_generated_Datastream_CreateConnectionProfile_sync] diff --git a/internal/generated/snippets/datastream/apiv1/Client/CreatePrivateConnection/main.go b/internal/generated/snippets/datastream/apiv1/Client/CreatePrivateConnection/main.go new file mode 100644 index 000000000000..07e1e3d4ddeb --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1/Client/CreatePrivateConnection/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 datastream_v1_generated_Datastream_CreatePrivateConnection_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.CreatePrivateConnectionRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datastream/v1#CreatePrivateConnectionRequest. + } + op, err := c.CreatePrivateConnection(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END datastream_v1_generated_Datastream_CreatePrivateConnection_sync] diff --git a/internal/generated/snippets/datastream/apiv1/Client/CreateRoute/main.go b/internal/generated/snippets/datastream/apiv1/Client/CreateRoute/main.go new file mode 100644 index 000000000000..d2f4d033e384 --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1/Client/CreateRoute/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 datastream_v1_generated_Datastream_CreateRoute_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.CreateRouteRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datastream/v1#CreateRouteRequest. + } + op, err := c.CreateRoute(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END datastream_v1_generated_Datastream_CreateRoute_sync] diff --git a/internal/generated/snippets/datastream/apiv1/Client/CreateStream/main.go b/internal/generated/snippets/datastream/apiv1/Client/CreateStream/main.go new file mode 100644 index 000000000000..a393de9e3801 --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1/Client/CreateStream/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 datastream_v1_generated_Datastream_CreateStream_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.CreateStreamRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datastream/v1#CreateStreamRequest. + } + op, err := c.CreateStream(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END datastream_v1_generated_Datastream_CreateStream_sync] diff --git a/internal/generated/snippets/datastream/apiv1/Client/DeleteConnectionProfile/main.go b/internal/generated/snippets/datastream/apiv1/Client/DeleteConnectionProfile/main.go new file mode 100644 index 000000000000..211f5f9b0033 --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1/Client/DeleteConnectionProfile/main.go @@ -0,0 +1,51 @@ +// 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 datastream_v1_generated_Datastream_DeleteConnectionProfile_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.DeleteConnectionProfileRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datastream/v1#DeleteConnectionProfileRequest. + } + op, err := c.DeleteConnectionProfile(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +// [END datastream_v1_generated_Datastream_DeleteConnectionProfile_sync] diff --git a/internal/generated/snippets/datastream/apiv1/Client/DeletePrivateConnection/main.go b/internal/generated/snippets/datastream/apiv1/Client/DeletePrivateConnection/main.go new file mode 100644 index 000000000000..355b1e0ea584 --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1/Client/DeletePrivateConnection/main.go @@ -0,0 +1,51 @@ +// 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 datastream_v1_generated_Datastream_DeletePrivateConnection_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.DeletePrivateConnectionRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datastream/v1#DeletePrivateConnectionRequest. + } + op, err := c.DeletePrivateConnection(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +// [END datastream_v1_generated_Datastream_DeletePrivateConnection_sync] diff --git a/internal/generated/snippets/datastream/apiv1/Client/DeleteRoute/main.go b/internal/generated/snippets/datastream/apiv1/Client/DeleteRoute/main.go new file mode 100644 index 000000000000..3063a3f65bb0 --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1/Client/DeleteRoute/main.go @@ -0,0 +1,51 @@ +// 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 datastream_v1_generated_Datastream_DeleteRoute_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.DeleteRouteRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datastream/v1#DeleteRouteRequest. + } + op, err := c.DeleteRoute(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +// [END datastream_v1_generated_Datastream_DeleteRoute_sync] diff --git a/internal/generated/snippets/datastream/apiv1/Client/DeleteStream/main.go b/internal/generated/snippets/datastream/apiv1/Client/DeleteStream/main.go new file mode 100644 index 000000000000..76ac882f6d8b --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1/Client/DeleteStream/main.go @@ -0,0 +1,51 @@ +// 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 datastream_v1_generated_Datastream_DeleteStream_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.DeleteStreamRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datastream/v1#DeleteStreamRequest. + } + op, err := c.DeleteStream(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +// [END datastream_v1_generated_Datastream_DeleteStream_sync] diff --git a/internal/generated/snippets/datastream/apiv1/Client/DiscoverConnectionProfile/main.go b/internal/generated/snippets/datastream/apiv1/Client/DiscoverConnectionProfile/main.go new file mode 100644 index 000000000000..e4d248b8df72 --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1/Client/DiscoverConnectionProfile/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 datastream_v1_generated_Datastream_DiscoverConnectionProfile_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.DiscoverConnectionProfileRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datastream/v1#DiscoverConnectionProfileRequest. + } + resp, err := c.DiscoverConnectionProfile(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END datastream_v1_generated_Datastream_DiscoverConnectionProfile_sync] diff --git a/internal/generated/snippets/datastream/apiv1/Client/FetchStaticIps/main.go b/internal/generated/snippets/datastream/apiv1/Client/FetchStaticIps/main.go new file mode 100644 index 000000000000..6e2943a0e936 --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1/Client/FetchStaticIps/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 datastream_v1_generated_Datastream_FetchStaticIps_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1" + "google.golang.org/api/iterator" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.FetchStaticIpsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datastream/v1#FetchStaticIpsRequest. + } + it := c.FetchStaticIps(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END datastream_v1_generated_Datastream_FetchStaticIps_sync] diff --git a/internal/generated/snippets/datastream/apiv1/Client/GetConnectionProfile/main.go b/internal/generated/snippets/datastream/apiv1/Client/GetConnectionProfile/main.go new file mode 100644 index 000000000000..891512726344 --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1/Client/GetConnectionProfile/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 datastream_v1_generated_Datastream_GetConnectionProfile_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.GetConnectionProfileRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datastream/v1#GetConnectionProfileRequest. + } + resp, err := c.GetConnectionProfile(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END datastream_v1_generated_Datastream_GetConnectionProfile_sync] diff --git a/internal/generated/snippets/datastream/apiv1/Client/GetLocation/main.go b/internal/generated/snippets/datastream/apiv1/Client/GetLocation/main.go new file mode 100644 index 000000000000..5b69417b40da --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1/Client/GetLocation/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 datastream_v1_generated_Datastream_GetLocation_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1" + locationpb "google.golang.org/genproto/googleapis/cloud/location" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &locationpb.GetLocationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#GetLocationRequest. + } + resp, err := c.GetLocation(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END datastream_v1_generated_Datastream_GetLocation_sync] diff --git a/internal/generated/snippets/datastream/apiv1/Client/GetPrivateConnection/main.go b/internal/generated/snippets/datastream/apiv1/Client/GetPrivateConnection/main.go new file mode 100644 index 000000000000..25c812c2b833 --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1/Client/GetPrivateConnection/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 datastream_v1_generated_Datastream_GetPrivateConnection_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.GetPrivateConnectionRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datastream/v1#GetPrivateConnectionRequest. + } + resp, err := c.GetPrivateConnection(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END datastream_v1_generated_Datastream_GetPrivateConnection_sync] diff --git a/internal/generated/snippets/datastream/apiv1/Client/GetRoute/main.go b/internal/generated/snippets/datastream/apiv1/Client/GetRoute/main.go new file mode 100644 index 000000000000..667885f5fb1f --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1/Client/GetRoute/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 datastream_v1_generated_Datastream_GetRoute_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.GetRouteRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datastream/v1#GetRouteRequest. + } + resp, err := c.GetRoute(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END datastream_v1_generated_Datastream_GetRoute_sync] diff --git a/internal/generated/snippets/datastream/apiv1/Client/GetStream/main.go b/internal/generated/snippets/datastream/apiv1/Client/GetStream/main.go new file mode 100644 index 000000000000..e58e7b4d6c6c --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1/Client/GetStream/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 datastream_v1_generated_Datastream_GetStream_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.GetStreamRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datastream/v1#GetStreamRequest. + } + resp, err := c.GetStream(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END datastream_v1_generated_Datastream_GetStream_sync] diff --git a/internal/generated/snippets/datastream/apiv1/Client/GetStreamObject/main.go b/internal/generated/snippets/datastream/apiv1/Client/GetStreamObject/main.go new file mode 100644 index 000000000000..4f994be13b77 --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1/Client/GetStreamObject/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 datastream_v1_generated_Datastream_GetStreamObject_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.GetStreamObjectRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datastream/v1#GetStreamObjectRequest. + } + resp, err := c.GetStreamObject(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END datastream_v1_generated_Datastream_GetStreamObject_sync] diff --git a/internal/generated/snippets/datastream/apiv1/Client/ListConnectionProfiles/main.go b/internal/generated/snippets/datastream/apiv1/Client/ListConnectionProfiles/main.go new file mode 100644 index 000000000000..34d4facaee03 --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1/Client/ListConnectionProfiles/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 datastream_v1_generated_Datastream_ListConnectionProfiles_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1" + "google.golang.org/api/iterator" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.ListConnectionProfilesRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datastream/v1#ListConnectionProfilesRequest. + } + it := c.ListConnectionProfiles(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END datastream_v1_generated_Datastream_ListConnectionProfiles_sync] diff --git a/internal/generated/snippets/datastream/apiv1/Client/ListLocations/main.go b/internal/generated/snippets/datastream/apiv1/Client/ListLocations/main.go new file mode 100644 index 000000000000..8f1148d2e582 --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1/Client/ListLocations/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 datastream_v1_generated_Datastream_ListLocations_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1" + "google.golang.org/api/iterator" + locationpb "google.golang.org/genproto/googleapis/cloud/location" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &locationpb.ListLocationsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest. + } + it := c.ListLocations(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END datastream_v1_generated_Datastream_ListLocations_sync] diff --git a/internal/generated/snippets/datastream/apiv1/Client/ListPrivateConnections/main.go b/internal/generated/snippets/datastream/apiv1/Client/ListPrivateConnections/main.go new file mode 100644 index 000000000000..a1d6c5fa1bcb --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1/Client/ListPrivateConnections/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 datastream_v1_generated_Datastream_ListPrivateConnections_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1" + "google.golang.org/api/iterator" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.ListPrivateConnectionsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datastream/v1#ListPrivateConnectionsRequest. + } + it := c.ListPrivateConnections(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END datastream_v1_generated_Datastream_ListPrivateConnections_sync] diff --git a/internal/generated/snippets/datastream/apiv1/Client/ListRoutes/main.go b/internal/generated/snippets/datastream/apiv1/Client/ListRoutes/main.go new file mode 100644 index 000000000000..8c6e37a5fccf --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1/Client/ListRoutes/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 datastream_v1_generated_Datastream_ListRoutes_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1" + "google.golang.org/api/iterator" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.ListRoutesRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datastream/v1#ListRoutesRequest. + } + it := c.ListRoutes(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END datastream_v1_generated_Datastream_ListRoutes_sync] diff --git a/internal/generated/snippets/datastream/apiv1/Client/ListStreamObjects/main.go b/internal/generated/snippets/datastream/apiv1/Client/ListStreamObjects/main.go new file mode 100644 index 000000000000..588ef5132fb6 --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1/Client/ListStreamObjects/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 datastream_v1_generated_Datastream_ListStreamObjects_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1" + "google.golang.org/api/iterator" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.ListStreamObjectsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datastream/v1#ListStreamObjectsRequest. + } + it := c.ListStreamObjects(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END datastream_v1_generated_Datastream_ListStreamObjects_sync] diff --git a/internal/generated/snippets/datastream/apiv1/Client/ListStreams/main.go b/internal/generated/snippets/datastream/apiv1/Client/ListStreams/main.go new file mode 100644 index 000000000000..5bab1fd2ddd8 --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1/Client/ListStreams/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 datastream_v1_generated_Datastream_ListStreams_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1" + "google.golang.org/api/iterator" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.ListStreamsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datastream/v1#ListStreamsRequest. + } + it := c.ListStreams(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END datastream_v1_generated_Datastream_ListStreams_sync] diff --git a/internal/generated/snippets/datastream/apiv1/Client/LookupStreamObject/main.go b/internal/generated/snippets/datastream/apiv1/Client/LookupStreamObject/main.go new file mode 100644 index 000000000000..bfa394df0fc4 --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1/Client/LookupStreamObject/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 datastream_v1_generated_Datastream_LookupStreamObject_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.LookupStreamObjectRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datastream/v1#LookupStreamObjectRequest. + } + resp, err := c.LookupStreamObject(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END datastream_v1_generated_Datastream_LookupStreamObject_sync] diff --git a/internal/generated/snippets/datastream/apiv1/Client/StartBackfillJob/main.go b/internal/generated/snippets/datastream/apiv1/Client/StartBackfillJob/main.go new file mode 100644 index 000000000000..bd8f5b96757c --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1/Client/StartBackfillJob/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 datastream_v1_generated_Datastream_StartBackfillJob_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.StartBackfillJobRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datastream/v1#StartBackfillJobRequest. + } + resp, err := c.StartBackfillJob(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END datastream_v1_generated_Datastream_StartBackfillJob_sync] diff --git a/internal/generated/snippets/datastream/apiv1/Client/StopBackfillJob/main.go b/internal/generated/snippets/datastream/apiv1/Client/StopBackfillJob/main.go new file mode 100644 index 000000000000..dc1b9c4a2140 --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1/Client/StopBackfillJob/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 datastream_v1_generated_Datastream_StopBackfillJob_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.StopBackfillJobRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datastream/v1#StopBackfillJobRequest. + } + resp, err := c.StopBackfillJob(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END datastream_v1_generated_Datastream_StopBackfillJob_sync] diff --git a/internal/generated/snippets/datastream/apiv1/Client/UpdateConnectionProfile/main.go b/internal/generated/snippets/datastream/apiv1/Client/UpdateConnectionProfile/main.go new file mode 100644 index 000000000000..9367142faafa --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1/Client/UpdateConnectionProfile/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 datastream_v1_generated_Datastream_UpdateConnectionProfile_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.UpdateConnectionProfileRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datastream/v1#UpdateConnectionProfileRequest. + } + op, err := c.UpdateConnectionProfile(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END datastream_v1_generated_Datastream_UpdateConnectionProfile_sync] diff --git a/internal/generated/snippets/datastream/apiv1/Client/UpdateStream/main.go b/internal/generated/snippets/datastream/apiv1/Client/UpdateStream/main.go new file mode 100644 index 000000000000..7756ca89de92 --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1/Client/UpdateStream/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 datastream_v1_generated_Datastream_UpdateStream_sync] + +package main + +import ( + "context" + + datastream "cloud.google.com/go/datastream/apiv1" + datastreampb "google.golang.org/genproto/googleapis/cloud/datastream/v1" +) + +func main() { + ctx := context.Background() + c, err := datastream.NewClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &datastreampb.UpdateStreamRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/datastream/v1#UpdateStreamRequest. + } + op, err := c.UpdateStream(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END datastream_v1_generated_Datastream_UpdateStream_sync] diff --git a/internal/generated/snippets/datastream/apiv1/snippet_metadata.google.cloud.datastream.v1.json b/internal/generated/snippets/datastream/apiv1/snippet_metadata.google.cloud.datastream.v1.json new file mode 100644 index 000000000000..a9281e2d7fab --- /dev/null +++ b/internal/generated/snippets/datastream/apiv1/snippet_metadata.google.cloud.datastream.v1.json @@ -0,0 +1,1257 @@ +{ + "clientLibrary": { + "name": "cloud.google.com/go/datastream/apiv1", + "version": "0.4.0", + "language": "GO", + "apis": [ + { + "id": "google.cloud.datastream.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "datastream_v1_generated_Datastream_CreateConnectionProfile_sync", + "title": "datastream CreateConnectionProfile Sample", + "description": "CreateConnectionProfile use this method to create a connection profile in a project and location.", + "file": "Client/CreateConnectionProfile/main.go", + "language": "GO", + "clientMethod": { + "shortName": "CreateConnectionProfile", + "fullName": "google.cloud.datastream.v1.Client.CreateConnectionProfile", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "datastreampb.CreateConnectionProfileRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "CreateConnectionProfileOperation", + "client": { + "shortName": "Client", + "fullName": "google.cloud.datastream.v1.Client" + }, + "method": { + "shortName": "CreateConnectionProfile", + "fullName": "google.cloud.datastream.v1.Datastream.CreateConnectionProfile", + "service": { + "shortName": "Datastream", + "fullName": "google.cloud.datastream.v1.Datastream" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 52, + "type": "FULL" + } + ] + }, + { + "regionTag": "datastream_v1_generated_Datastream_CreatePrivateConnection_sync", + "title": "datastream CreatePrivateConnection Sample", + "description": "CreatePrivateConnection use this method to create a private connectivity configuration.", + "file": "Client/CreatePrivateConnection/main.go", + "language": "GO", + "clientMethod": { + "shortName": "CreatePrivateConnection", + "fullName": "google.cloud.datastream.v1.Client.CreatePrivateConnection", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "datastreampb.CreatePrivateConnectionRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "CreatePrivateConnectionOperation", + "client": { + "shortName": "Client", + "fullName": "google.cloud.datastream.v1.Client" + }, + "method": { + "shortName": "CreatePrivateConnection", + "fullName": "google.cloud.datastream.v1.Datastream.CreatePrivateConnection", + "service": { + "shortName": "Datastream", + "fullName": "google.cloud.datastream.v1.Datastream" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 52, + "type": "FULL" + } + ] + }, + { + "regionTag": "datastream_v1_generated_Datastream_CreateRoute_sync", + "title": "datastream CreateRoute Sample", + "description": "CreateRoute use this method to create a route for a private connectivity configuration\nin a project and location.", + "file": "Client/CreateRoute/main.go", + "language": "GO", + "clientMethod": { + "shortName": "CreateRoute", + "fullName": "google.cloud.datastream.v1.Client.CreateRoute", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "datastreampb.CreateRouteRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "CreateRouteOperation", + "client": { + "shortName": "Client", + "fullName": "google.cloud.datastream.v1.Client" + }, + "method": { + "shortName": "CreateRoute", + "fullName": "google.cloud.datastream.v1.Datastream.CreateRoute", + "service": { + "shortName": "Datastream", + "fullName": "google.cloud.datastream.v1.Datastream" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 52, + "type": "FULL" + } + ] + }, + { + "regionTag": "datastream_v1_generated_Datastream_CreateStream_sync", + "title": "datastream CreateStream Sample", + "description": "CreateStream use this method to create a stream.", + "file": "Client/CreateStream/main.go", + "language": "GO", + "clientMethod": { + "shortName": "CreateStream", + "fullName": "google.cloud.datastream.v1.Client.CreateStream", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "datastreampb.CreateStreamRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "CreateStreamOperation", + "client": { + "shortName": "Client", + "fullName": "google.cloud.datastream.v1.Client" + }, + "method": { + "shortName": "CreateStream", + "fullName": "google.cloud.datastream.v1.Datastream.CreateStream", + "service": { + "shortName": "Datastream", + "fullName": "google.cloud.datastream.v1.Datastream" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 52, + "type": "FULL" + } + ] + }, + { + "regionTag": "datastream_v1_generated_Datastream_DeleteConnectionProfile_sync", + "title": "datastream DeleteConnectionProfile Sample", + "description": "DeleteConnectionProfile use this method to delete a connection profile.", + "file": "Client/DeleteConnectionProfile/main.go", + "language": "GO", + "clientMethod": { + "shortName": "DeleteConnectionProfile", + "fullName": "google.cloud.datastream.v1.Client.DeleteConnectionProfile", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "datastreampb.DeleteConnectionProfileRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "DeleteConnectionProfileOperation", + "client": { + "shortName": "Client", + "fullName": "google.cloud.datastream.v1.Client" + }, + "method": { + "shortName": "DeleteConnectionProfile", + "fullName": "google.cloud.datastream.v1.Datastream.DeleteConnectionProfile", + "service": { + "shortName": "Datastream", + "fullName": "google.cloud.datastream.v1.Datastream" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 50, + "type": "FULL" + } + ] + }, + { + "regionTag": "datastream_v1_generated_Datastream_DeletePrivateConnection_sync", + "title": "datastream DeletePrivateConnection Sample", + "description": "DeletePrivateConnection use this method to delete a private connectivity configuration.", + "file": "Client/DeletePrivateConnection/main.go", + "language": "GO", + "clientMethod": { + "shortName": "DeletePrivateConnection", + "fullName": "google.cloud.datastream.v1.Client.DeletePrivateConnection", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "datastreampb.DeletePrivateConnectionRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "DeletePrivateConnectionOperation", + "client": { + "shortName": "Client", + "fullName": "google.cloud.datastream.v1.Client" + }, + "method": { + "shortName": "DeletePrivateConnection", + "fullName": "google.cloud.datastream.v1.Datastream.DeletePrivateConnection", + "service": { + "shortName": "Datastream", + "fullName": "google.cloud.datastream.v1.Datastream" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 50, + "type": "FULL" + } + ] + }, + { + "regionTag": "datastream_v1_generated_Datastream_DeleteRoute_sync", + "title": "datastream DeleteRoute Sample", + "description": "DeleteRoute use this method to delete a route.", + "file": "Client/DeleteRoute/main.go", + "language": "GO", + "clientMethod": { + "shortName": "DeleteRoute", + "fullName": "google.cloud.datastream.v1.Client.DeleteRoute", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "datastreampb.DeleteRouteRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "DeleteRouteOperation", + "client": { + "shortName": "Client", + "fullName": "google.cloud.datastream.v1.Client" + }, + "method": { + "shortName": "DeleteRoute", + "fullName": "google.cloud.datastream.v1.Datastream.DeleteRoute", + "service": { + "shortName": "Datastream", + "fullName": "google.cloud.datastream.v1.Datastream" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 50, + "type": "FULL" + } + ] + }, + { + "regionTag": "datastream_v1_generated_Datastream_DeleteStream_sync", + "title": "datastream DeleteStream Sample", + "description": "DeleteStream use this method to delete a stream.", + "file": "Client/DeleteStream/main.go", + "language": "GO", + "clientMethod": { + "shortName": "DeleteStream", + "fullName": "google.cloud.datastream.v1.Client.DeleteStream", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "datastreampb.DeleteStreamRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "DeleteStreamOperation", + "client": { + "shortName": "Client", + "fullName": "google.cloud.datastream.v1.Client" + }, + "method": { + "shortName": "DeleteStream", + "fullName": "google.cloud.datastream.v1.Datastream.DeleteStream", + "service": { + "shortName": "Datastream", + "fullName": "google.cloud.datastream.v1.Datastream" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 50, + "type": "FULL" + } + ] + }, + { + "regionTag": "datastream_v1_generated_Datastream_DiscoverConnectionProfile_sync", + "title": "datastream DiscoverConnectionProfile Sample", + "description": "DiscoverConnectionProfile use this method to discover a connection profile.\nThe discover API call exposes the data objects and metadata belonging to\nthe profile. Typically, a request returns children data objects of a\nparent data object that’s optionally supplied in the request.", + "file": "Client/DiscoverConnectionProfile/main.go", + "language": "GO", + "clientMethod": { + "shortName": "DiscoverConnectionProfile", + "fullName": "google.cloud.datastream.v1.Client.DiscoverConnectionProfile", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "datastreampb.DiscoverConnectionProfileRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "datastreampb.DiscoverConnectionProfileResponse", + "client": { + "shortName": "Client", + "fullName": "google.cloud.datastream.v1.Client" + }, + "method": { + "shortName": "DiscoverConnectionProfile", + "fullName": "google.cloud.datastream.v1.Datastream.DiscoverConnectionProfile", + "service": { + "shortName": "Datastream", + "fullName": "google.cloud.datastream.v1.Datastream" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "datastream_v1_generated_Datastream_FetchStaticIps_sync", + "title": "datastream FetchStaticIps Sample", + "description": "FetchStaticIps the FetchStaticIps API call exposes the static IP addresses used by\nDatastream.", + "file": "Client/FetchStaticIps/main.go", + "language": "GO", + "clientMethod": { + "shortName": "FetchStaticIps", + "fullName": "google.cloud.datastream.v1.Client.FetchStaticIps", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "datastreampb.FetchStaticIpsRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "StringIterator", + "client": { + "shortName": "Client", + "fullName": "google.cloud.datastream.v1.Client" + }, + "method": { + "shortName": "FetchStaticIps", + "fullName": "google.cloud.datastream.v1.Datastream.FetchStaticIps", + "service": { + "shortName": "Datastream", + "fullName": "google.cloud.datastream.v1.Datastream" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 54, + "type": "FULL" + } + ] + }, + { + "regionTag": "datastream_v1_generated_Datastream_GetConnectionProfile_sync", + "title": "datastream GetConnectionProfile Sample", + "description": "GetConnectionProfile use this method to get details about a connection profile.", + "file": "Client/GetConnectionProfile/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetConnectionProfile", + "fullName": "google.cloud.datastream.v1.Client.GetConnectionProfile", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "datastreampb.GetConnectionProfileRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "datastreampb.ConnectionProfile", + "client": { + "shortName": "Client", + "fullName": "google.cloud.datastream.v1.Client" + }, + "method": { + "shortName": "GetConnectionProfile", + "fullName": "google.cloud.datastream.v1.Datastream.GetConnectionProfile", + "service": { + "shortName": "Datastream", + "fullName": "google.cloud.datastream.v1.Datastream" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "datastream_v1_generated_Datastream_GetLocation_sync", + "title": "datastream GetLocation Sample", + "description": "GetLocation gets information about a location.", + "file": "Client/GetLocation/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetLocation", + "fullName": "google.cloud.datastream.v1.Client.GetLocation", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "locationpb.GetLocationRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "locationpb.Location", + "client": { + "shortName": "Client", + "fullName": "google.cloud.datastream.v1.Client" + }, + "method": { + "shortName": "GetLocation", + "fullName": "google.cloud.datastream.v1.Datastream.GetLocation", + "service": { + "shortName": "Datastream", + "fullName": "google.cloud.datastream.v1.Datastream" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "datastream_v1_generated_Datastream_GetPrivateConnection_sync", + "title": "datastream GetPrivateConnection Sample", + "description": "GetPrivateConnection use this method to get details about a private connectivity configuration.", + "file": "Client/GetPrivateConnection/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetPrivateConnection", + "fullName": "google.cloud.datastream.v1.Client.GetPrivateConnection", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "datastreampb.GetPrivateConnectionRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "datastreampb.PrivateConnection", + "client": { + "shortName": "Client", + "fullName": "google.cloud.datastream.v1.Client" + }, + "method": { + "shortName": "GetPrivateConnection", + "fullName": "google.cloud.datastream.v1.Datastream.GetPrivateConnection", + "service": { + "shortName": "Datastream", + "fullName": "google.cloud.datastream.v1.Datastream" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "datastream_v1_generated_Datastream_GetRoute_sync", + "title": "datastream GetRoute Sample", + "description": "GetRoute use this method to get details about a route.", + "file": "Client/GetRoute/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetRoute", + "fullName": "google.cloud.datastream.v1.Client.GetRoute", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "datastreampb.GetRouteRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "datastreampb.Route", + "client": { + "shortName": "Client", + "fullName": "google.cloud.datastream.v1.Client" + }, + "method": { + "shortName": "GetRoute", + "fullName": "google.cloud.datastream.v1.Datastream.GetRoute", + "service": { + "shortName": "Datastream", + "fullName": "google.cloud.datastream.v1.Datastream" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "datastream_v1_generated_Datastream_GetStream_sync", + "title": "datastream GetStream Sample", + "description": "GetStream use this method to get details about a stream.", + "file": "Client/GetStream/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetStream", + "fullName": "google.cloud.datastream.v1.Client.GetStream", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "datastreampb.GetStreamRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "datastreampb.Stream", + "client": { + "shortName": "Client", + "fullName": "google.cloud.datastream.v1.Client" + }, + "method": { + "shortName": "GetStream", + "fullName": "google.cloud.datastream.v1.Datastream.GetStream", + "service": { + "shortName": "Datastream", + "fullName": "google.cloud.datastream.v1.Datastream" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "datastream_v1_generated_Datastream_GetStreamObject_sync", + "title": "datastream GetStreamObject Sample", + "description": "GetStreamObject use this method to get details about a stream object.", + "file": "Client/GetStreamObject/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetStreamObject", + "fullName": "google.cloud.datastream.v1.Client.GetStreamObject", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "datastreampb.GetStreamObjectRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "datastreampb.StreamObject", + "client": { + "shortName": "Client", + "fullName": "google.cloud.datastream.v1.Client" + }, + "method": { + "shortName": "GetStreamObject", + "fullName": "google.cloud.datastream.v1.Datastream.GetStreamObject", + "service": { + "shortName": "Datastream", + "fullName": "google.cloud.datastream.v1.Datastream" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "datastream_v1_generated_Datastream_ListConnectionProfiles_sync", + "title": "datastream ListConnectionProfiles Sample", + "description": "ListConnectionProfiles use this method to list connection profiles created in a project and\nlocation.", + "file": "Client/ListConnectionProfiles/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListConnectionProfiles", + "fullName": "google.cloud.datastream.v1.Client.ListConnectionProfiles", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "datastreampb.ListConnectionProfilesRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "ConnectionProfileIterator", + "client": { + "shortName": "Client", + "fullName": "google.cloud.datastream.v1.Client" + }, + "method": { + "shortName": "ListConnectionProfiles", + "fullName": "google.cloud.datastream.v1.Datastream.ListConnectionProfiles", + "service": { + "shortName": "Datastream", + "fullName": "google.cloud.datastream.v1.Datastream" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 54, + "type": "FULL" + } + ] + }, + { + "regionTag": "datastream_v1_generated_Datastream_ListLocations_sync", + "title": "datastream ListLocations Sample", + "description": "ListLocations lists information about the supported locations for this service.", + "file": "Client/ListLocations/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListLocations", + "fullName": "google.cloud.datastream.v1.Client.ListLocations", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "locationpb.ListLocationsRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "LocationIterator", + "client": { + "shortName": "Client", + "fullName": "google.cloud.datastream.v1.Client" + }, + "method": { + "shortName": "ListLocations", + "fullName": "google.cloud.datastream.v1.Datastream.ListLocations", + "service": { + "shortName": "Datastream", + "fullName": "google.cloud.datastream.v1.Datastream" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 54, + "type": "FULL" + } + ] + }, + { + "regionTag": "datastream_v1_generated_Datastream_ListPrivateConnections_sync", + "title": "datastream ListPrivateConnections Sample", + "description": "ListPrivateConnections use this method to list private connectivity configurations in a project\nand location.", + "file": "Client/ListPrivateConnections/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListPrivateConnections", + "fullName": "google.cloud.datastream.v1.Client.ListPrivateConnections", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "datastreampb.ListPrivateConnectionsRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "PrivateConnectionIterator", + "client": { + "shortName": "Client", + "fullName": "google.cloud.datastream.v1.Client" + }, + "method": { + "shortName": "ListPrivateConnections", + "fullName": "google.cloud.datastream.v1.Datastream.ListPrivateConnections", + "service": { + "shortName": "Datastream", + "fullName": "google.cloud.datastream.v1.Datastream" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 54, + "type": "FULL" + } + ] + }, + { + "regionTag": "datastream_v1_generated_Datastream_ListRoutes_sync", + "title": "datastream ListRoutes Sample", + "description": "ListRoutes use this method to list routes created for a private connectivity\nconfiguration in a project and location.", + "file": "Client/ListRoutes/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListRoutes", + "fullName": "google.cloud.datastream.v1.Client.ListRoutes", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "datastreampb.ListRoutesRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "RouteIterator", + "client": { + "shortName": "Client", + "fullName": "google.cloud.datastream.v1.Client" + }, + "method": { + "shortName": "ListRoutes", + "fullName": "google.cloud.datastream.v1.Datastream.ListRoutes", + "service": { + "shortName": "Datastream", + "fullName": "google.cloud.datastream.v1.Datastream" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 54, + "type": "FULL" + } + ] + }, + { + "regionTag": "datastream_v1_generated_Datastream_ListStreamObjects_sync", + "title": "datastream ListStreamObjects Sample", + "description": "ListStreamObjects use this method to list the objects of a specific stream.", + "file": "Client/ListStreamObjects/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListStreamObjects", + "fullName": "google.cloud.datastream.v1.Client.ListStreamObjects", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "datastreampb.ListStreamObjectsRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "StreamObjectIterator", + "client": { + "shortName": "Client", + "fullName": "google.cloud.datastream.v1.Client" + }, + "method": { + "shortName": "ListStreamObjects", + "fullName": "google.cloud.datastream.v1.Datastream.ListStreamObjects", + "service": { + "shortName": "Datastream", + "fullName": "google.cloud.datastream.v1.Datastream" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 54, + "type": "FULL" + } + ] + }, + { + "regionTag": "datastream_v1_generated_Datastream_ListStreams_sync", + "title": "datastream ListStreams Sample", + "description": "ListStreams use this method to list streams in a project and location.", + "file": "Client/ListStreams/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListStreams", + "fullName": "google.cloud.datastream.v1.Client.ListStreams", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "datastreampb.ListStreamsRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "StreamIterator", + "client": { + "shortName": "Client", + "fullName": "google.cloud.datastream.v1.Client" + }, + "method": { + "shortName": "ListStreams", + "fullName": "google.cloud.datastream.v1.Datastream.ListStreams", + "service": { + "shortName": "Datastream", + "fullName": "google.cloud.datastream.v1.Datastream" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 54, + "type": "FULL" + } + ] + }, + { + "regionTag": "datastream_v1_generated_Datastream_LookupStreamObject_sync", + "title": "datastream LookupStreamObject Sample", + "description": "LookupStreamObject use this method to look up a stream object by its source object identifier.", + "file": "Client/LookupStreamObject/main.go", + "language": "GO", + "clientMethod": { + "shortName": "LookupStreamObject", + "fullName": "google.cloud.datastream.v1.Client.LookupStreamObject", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "datastreampb.LookupStreamObjectRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "datastreampb.StreamObject", + "client": { + "shortName": "Client", + "fullName": "google.cloud.datastream.v1.Client" + }, + "method": { + "shortName": "LookupStreamObject", + "fullName": "google.cloud.datastream.v1.Datastream.LookupStreamObject", + "service": { + "shortName": "Datastream", + "fullName": "google.cloud.datastream.v1.Datastream" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "datastream_v1_generated_Datastream_StartBackfillJob_sync", + "title": "datastream StartBackfillJob Sample", + "description": "StartBackfillJob use this method to start a backfill job for the specified stream object.", + "file": "Client/StartBackfillJob/main.go", + "language": "GO", + "clientMethod": { + "shortName": "StartBackfillJob", + "fullName": "google.cloud.datastream.v1.Client.StartBackfillJob", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "datastreampb.StartBackfillJobRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "datastreampb.StartBackfillJobResponse", + "client": { + "shortName": "Client", + "fullName": "google.cloud.datastream.v1.Client" + }, + "method": { + "shortName": "StartBackfillJob", + "fullName": "google.cloud.datastream.v1.Datastream.StartBackfillJob", + "service": { + "shortName": "Datastream", + "fullName": "google.cloud.datastream.v1.Datastream" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "datastream_v1_generated_Datastream_StopBackfillJob_sync", + "title": "datastream StopBackfillJob Sample", + "description": "StopBackfillJob use this method to stop a backfill job for the specified stream object.", + "file": "Client/StopBackfillJob/main.go", + "language": "GO", + "clientMethod": { + "shortName": "StopBackfillJob", + "fullName": "google.cloud.datastream.v1.Client.StopBackfillJob", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "datastreampb.StopBackfillJobRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "datastreampb.StopBackfillJobResponse", + "client": { + "shortName": "Client", + "fullName": "google.cloud.datastream.v1.Client" + }, + "method": { + "shortName": "StopBackfillJob", + "fullName": "google.cloud.datastream.v1.Datastream.StopBackfillJob", + "service": { + "shortName": "Datastream", + "fullName": "google.cloud.datastream.v1.Datastream" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "datastream_v1_generated_Datastream_UpdateConnectionProfile_sync", + "title": "datastream UpdateConnectionProfile Sample", + "description": "UpdateConnectionProfile use this method to update the parameters of a connection profile.", + "file": "Client/UpdateConnectionProfile/main.go", + "language": "GO", + "clientMethod": { + "shortName": "UpdateConnectionProfile", + "fullName": "google.cloud.datastream.v1.Client.UpdateConnectionProfile", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "datastreampb.UpdateConnectionProfileRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "UpdateConnectionProfileOperation", + "client": { + "shortName": "Client", + "fullName": "google.cloud.datastream.v1.Client" + }, + "method": { + "shortName": "UpdateConnectionProfile", + "fullName": "google.cloud.datastream.v1.Datastream.UpdateConnectionProfile", + "service": { + "shortName": "Datastream", + "fullName": "google.cloud.datastream.v1.Datastream" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 52, + "type": "FULL" + } + ] + }, + { + "regionTag": "datastream_v1_generated_Datastream_UpdateStream_sync", + "title": "datastream UpdateStream Sample", + "description": "UpdateStream use this method to update the configuration of a stream.", + "file": "Client/UpdateStream/main.go", + "language": "GO", + "clientMethod": { + "shortName": "UpdateStream", + "fullName": "google.cloud.datastream.v1.Client.UpdateStream", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "datastreampb.UpdateStreamRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "UpdateStreamOperation", + "client": { + "shortName": "Client", + "fullName": "google.cloud.datastream.v1.Client" + }, + "method": { + "shortName": "UpdateStream", + "fullName": "google.cloud.datastream.v1.Datastream.UpdateStream", + "service": { + "shortName": "Datastream", + "fullName": "google.cloud.datastream.v1.Datastream" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 52, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/internal/generated/snippets/datastream/apiv1alpha1/snippet_metadata.google.cloud.datastream.v1alpha1.json b/internal/generated/snippets/datastream/apiv1alpha1/snippet_metadata.google.cloud.datastream.v1alpha1.json index a1631ff59a9a..2214d61524af 100644 --- a/internal/generated/snippets/datastream/apiv1alpha1/snippet_metadata.google.cloud.datastream.v1alpha1.json +++ b/internal/generated/snippets/datastream/apiv1alpha1/snippet_metadata.google.cloud.datastream.v1alpha1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "cloud.google.com/go/datastream/apiv1alpha1", - "version": "0.3.0", + "version": "0.4.0", "language": "GO", "apis": [ { diff --git a/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/CreateBackup/main.go b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/CreateBackup/main.go new file mode 100644 index 000000000000..8917e7c7d847 --- /dev/null +++ b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/CreateBackup/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 gkebackup_v1_generated_BackupForGKE_CreateBackup_sync] + +package main + +import ( + "context" + + gkebackup "cloud.google.com/go/gkebackup/apiv1" + gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1" +) + +func main() { + ctx := context.Background() + c, err := gkebackup.NewBackupForGKEClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkebackuppb.CreateBackupRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#CreateBackupRequest. + } + op, err := c.CreateBackup(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END gkebackup_v1_generated_BackupForGKE_CreateBackup_sync] diff --git a/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/CreateBackupPlan/main.go b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/CreateBackupPlan/main.go new file mode 100644 index 000000000000..d34a0c69468c --- /dev/null +++ b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/CreateBackupPlan/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 gkebackup_v1_generated_BackupForGKE_CreateBackupPlan_sync] + +package main + +import ( + "context" + + gkebackup "cloud.google.com/go/gkebackup/apiv1" + gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1" +) + +func main() { + ctx := context.Background() + c, err := gkebackup.NewBackupForGKEClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkebackuppb.CreateBackupPlanRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#CreateBackupPlanRequest. + } + op, err := c.CreateBackupPlan(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END gkebackup_v1_generated_BackupForGKE_CreateBackupPlan_sync] diff --git a/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/CreateRestore/main.go b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/CreateRestore/main.go new file mode 100644 index 000000000000..29bcd8cea294 --- /dev/null +++ b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/CreateRestore/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 gkebackup_v1_generated_BackupForGKE_CreateRestore_sync] + +package main + +import ( + "context" + + gkebackup "cloud.google.com/go/gkebackup/apiv1" + gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1" +) + +func main() { + ctx := context.Background() + c, err := gkebackup.NewBackupForGKEClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkebackuppb.CreateRestoreRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#CreateRestoreRequest. + } + op, err := c.CreateRestore(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END gkebackup_v1_generated_BackupForGKE_CreateRestore_sync] diff --git a/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/CreateRestorePlan/main.go b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/CreateRestorePlan/main.go new file mode 100644 index 000000000000..eb94a23a6c58 --- /dev/null +++ b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/CreateRestorePlan/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 gkebackup_v1_generated_BackupForGKE_CreateRestorePlan_sync] + +package main + +import ( + "context" + + gkebackup "cloud.google.com/go/gkebackup/apiv1" + gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1" +) + +func main() { + ctx := context.Background() + c, err := gkebackup.NewBackupForGKEClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkebackuppb.CreateRestorePlanRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#CreateRestorePlanRequest. + } + op, err := c.CreateRestorePlan(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END gkebackup_v1_generated_BackupForGKE_CreateRestorePlan_sync] diff --git a/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/DeleteBackup/main.go b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/DeleteBackup/main.go new file mode 100644 index 000000000000..0c9f160f0c3f --- /dev/null +++ b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/DeleteBackup/main.go @@ -0,0 +1,51 @@ +// 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 gkebackup_v1_generated_BackupForGKE_DeleteBackup_sync] + +package main + +import ( + "context" + + gkebackup "cloud.google.com/go/gkebackup/apiv1" + gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1" +) + +func main() { + ctx := context.Background() + c, err := gkebackup.NewBackupForGKEClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkebackuppb.DeleteBackupRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#DeleteBackupRequest. + } + op, err := c.DeleteBackup(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +// [END gkebackup_v1_generated_BackupForGKE_DeleteBackup_sync] diff --git a/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/DeleteBackupPlan/main.go b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/DeleteBackupPlan/main.go new file mode 100644 index 000000000000..c0cafa0c9585 --- /dev/null +++ b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/DeleteBackupPlan/main.go @@ -0,0 +1,51 @@ +// 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 gkebackup_v1_generated_BackupForGKE_DeleteBackupPlan_sync] + +package main + +import ( + "context" + + gkebackup "cloud.google.com/go/gkebackup/apiv1" + gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1" +) + +func main() { + ctx := context.Background() + c, err := gkebackup.NewBackupForGKEClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkebackuppb.DeleteBackupPlanRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#DeleteBackupPlanRequest. + } + op, err := c.DeleteBackupPlan(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +// [END gkebackup_v1_generated_BackupForGKE_DeleteBackupPlan_sync] diff --git a/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/DeleteRestore/main.go b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/DeleteRestore/main.go new file mode 100644 index 000000000000..a6d178905165 --- /dev/null +++ b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/DeleteRestore/main.go @@ -0,0 +1,51 @@ +// 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 gkebackup_v1_generated_BackupForGKE_DeleteRestore_sync] + +package main + +import ( + "context" + + gkebackup "cloud.google.com/go/gkebackup/apiv1" + gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1" +) + +func main() { + ctx := context.Background() + c, err := gkebackup.NewBackupForGKEClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkebackuppb.DeleteRestoreRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#DeleteRestoreRequest. + } + op, err := c.DeleteRestore(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +// [END gkebackup_v1_generated_BackupForGKE_DeleteRestore_sync] diff --git a/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/DeleteRestorePlan/main.go b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/DeleteRestorePlan/main.go new file mode 100644 index 000000000000..3e4e83ffd40f --- /dev/null +++ b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/DeleteRestorePlan/main.go @@ -0,0 +1,51 @@ +// 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 gkebackup_v1_generated_BackupForGKE_DeleteRestorePlan_sync] + +package main + +import ( + "context" + + gkebackup "cloud.google.com/go/gkebackup/apiv1" + gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1" +) + +func main() { + ctx := context.Background() + c, err := gkebackup.NewBackupForGKEClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkebackuppb.DeleteRestorePlanRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#DeleteRestorePlanRequest. + } + op, err := c.DeleteRestorePlan(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +// [END gkebackup_v1_generated_BackupForGKE_DeleteRestorePlan_sync] diff --git a/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/GetBackup/main.go b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/GetBackup/main.go new file mode 100644 index 000000000000..1051efd498fb --- /dev/null +++ b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/GetBackup/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 gkebackup_v1_generated_BackupForGKE_GetBackup_sync] + +package main + +import ( + "context" + + gkebackup "cloud.google.com/go/gkebackup/apiv1" + gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1" +) + +func main() { + ctx := context.Background() + c, err := gkebackup.NewBackupForGKEClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkebackuppb.GetBackupRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#GetBackupRequest. + } + resp, err := c.GetBackup(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END gkebackup_v1_generated_BackupForGKE_GetBackup_sync] diff --git a/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/GetBackupPlan/main.go b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/GetBackupPlan/main.go new file mode 100644 index 000000000000..2830fd83949b --- /dev/null +++ b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/GetBackupPlan/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 gkebackup_v1_generated_BackupForGKE_GetBackupPlan_sync] + +package main + +import ( + "context" + + gkebackup "cloud.google.com/go/gkebackup/apiv1" + gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1" +) + +func main() { + ctx := context.Background() + c, err := gkebackup.NewBackupForGKEClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkebackuppb.GetBackupPlanRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#GetBackupPlanRequest. + } + resp, err := c.GetBackupPlan(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END gkebackup_v1_generated_BackupForGKE_GetBackupPlan_sync] diff --git a/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/GetRestore/main.go b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/GetRestore/main.go new file mode 100644 index 000000000000..7b4dd433e4c1 --- /dev/null +++ b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/GetRestore/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 gkebackup_v1_generated_BackupForGKE_GetRestore_sync] + +package main + +import ( + "context" + + gkebackup "cloud.google.com/go/gkebackup/apiv1" + gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1" +) + +func main() { + ctx := context.Background() + c, err := gkebackup.NewBackupForGKEClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkebackuppb.GetRestoreRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#GetRestoreRequest. + } + resp, err := c.GetRestore(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END gkebackup_v1_generated_BackupForGKE_GetRestore_sync] diff --git a/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/GetRestorePlan/main.go b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/GetRestorePlan/main.go new file mode 100644 index 000000000000..a6d681fc7c3c --- /dev/null +++ b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/GetRestorePlan/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 gkebackup_v1_generated_BackupForGKE_GetRestorePlan_sync] + +package main + +import ( + "context" + + gkebackup "cloud.google.com/go/gkebackup/apiv1" + gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1" +) + +func main() { + ctx := context.Background() + c, err := gkebackup.NewBackupForGKEClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkebackuppb.GetRestorePlanRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#GetRestorePlanRequest. + } + resp, err := c.GetRestorePlan(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END gkebackup_v1_generated_BackupForGKE_GetRestorePlan_sync] diff --git a/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/GetVolumeBackup/main.go b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/GetVolumeBackup/main.go new file mode 100644 index 000000000000..a87a76080d85 --- /dev/null +++ b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/GetVolumeBackup/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 gkebackup_v1_generated_BackupForGKE_GetVolumeBackup_sync] + +package main + +import ( + "context" + + gkebackup "cloud.google.com/go/gkebackup/apiv1" + gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1" +) + +func main() { + ctx := context.Background() + c, err := gkebackup.NewBackupForGKEClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkebackuppb.GetVolumeBackupRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#GetVolumeBackupRequest. + } + resp, err := c.GetVolumeBackup(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END gkebackup_v1_generated_BackupForGKE_GetVolumeBackup_sync] diff --git a/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/GetVolumeRestore/main.go b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/GetVolumeRestore/main.go new file mode 100644 index 000000000000..bf2ced511bea --- /dev/null +++ b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/GetVolumeRestore/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 gkebackup_v1_generated_BackupForGKE_GetVolumeRestore_sync] + +package main + +import ( + "context" + + gkebackup "cloud.google.com/go/gkebackup/apiv1" + gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1" +) + +func main() { + ctx := context.Background() + c, err := gkebackup.NewBackupForGKEClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkebackuppb.GetVolumeRestoreRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#GetVolumeRestoreRequest. + } + resp, err := c.GetVolumeRestore(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END gkebackup_v1_generated_BackupForGKE_GetVolumeRestore_sync] diff --git a/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/ListBackupPlans/main.go b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/ListBackupPlans/main.go new file mode 100644 index 000000000000..70caa16f3eb5 --- /dev/null +++ b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/ListBackupPlans/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 gkebackup_v1_generated_BackupForGKE_ListBackupPlans_sync] + +package main + +import ( + "context" + + gkebackup "cloud.google.com/go/gkebackup/apiv1" + "google.golang.org/api/iterator" + gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1" +) + +func main() { + ctx := context.Background() + c, err := gkebackup.NewBackupForGKEClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkebackuppb.ListBackupPlansRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#ListBackupPlansRequest. + } + it := c.ListBackupPlans(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END gkebackup_v1_generated_BackupForGKE_ListBackupPlans_sync] diff --git a/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/ListBackups/main.go b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/ListBackups/main.go new file mode 100644 index 000000000000..8d216f34cedb --- /dev/null +++ b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/ListBackups/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 gkebackup_v1_generated_BackupForGKE_ListBackups_sync] + +package main + +import ( + "context" + + gkebackup "cloud.google.com/go/gkebackup/apiv1" + "google.golang.org/api/iterator" + gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1" +) + +func main() { + ctx := context.Background() + c, err := gkebackup.NewBackupForGKEClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkebackuppb.ListBackupsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#ListBackupsRequest. + } + it := c.ListBackups(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END gkebackup_v1_generated_BackupForGKE_ListBackups_sync] diff --git a/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/ListRestorePlans/main.go b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/ListRestorePlans/main.go new file mode 100644 index 000000000000..d4369a7835b6 --- /dev/null +++ b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/ListRestorePlans/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 gkebackup_v1_generated_BackupForGKE_ListRestorePlans_sync] + +package main + +import ( + "context" + + gkebackup "cloud.google.com/go/gkebackup/apiv1" + "google.golang.org/api/iterator" + gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1" +) + +func main() { + ctx := context.Background() + c, err := gkebackup.NewBackupForGKEClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkebackuppb.ListRestorePlansRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#ListRestorePlansRequest. + } + it := c.ListRestorePlans(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END gkebackup_v1_generated_BackupForGKE_ListRestorePlans_sync] diff --git a/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/ListRestores/main.go b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/ListRestores/main.go new file mode 100644 index 000000000000..f59b6ec0abc9 --- /dev/null +++ b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/ListRestores/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 gkebackup_v1_generated_BackupForGKE_ListRestores_sync] + +package main + +import ( + "context" + + gkebackup "cloud.google.com/go/gkebackup/apiv1" + "google.golang.org/api/iterator" + gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1" +) + +func main() { + ctx := context.Background() + c, err := gkebackup.NewBackupForGKEClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkebackuppb.ListRestoresRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#ListRestoresRequest. + } + it := c.ListRestores(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END gkebackup_v1_generated_BackupForGKE_ListRestores_sync] diff --git a/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/ListVolumeBackups/main.go b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/ListVolumeBackups/main.go new file mode 100644 index 000000000000..ac832bc38f05 --- /dev/null +++ b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/ListVolumeBackups/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 gkebackup_v1_generated_BackupForGKE_ListVolumeBackups_sync] + +package main + +import ( + "context" + + gkebackup "cloud.google.com/go/gkebackup/apiv1" + "google.golang.org/api/iterator" + gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1" +) + +func main() { + ctx := context.Background() + c, err := gkebackup.NewBackupForGKEClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkebackuppb.ListVolumeBackupsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#ListVolumeBackupsRequest. + } + it := c.ListVolumeBackups(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END gkebackup_v1_generated_BackupForGKE_ListVolumeBackups_sync] diff --git a/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/ListVolumeRestores/main.go b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/ListVolumeRestores/main.go new file mode 100644 index 000000000000..f887c1834c3a --- /dev/null +++ b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/ListVolumeRestores/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 gkebackup_v1_generated_BackupForGKE_ListVolumeRestores_sync] + +package main + +import ( + "context" + + gkebackup "cloud.google.com/go/gkebackup/apiv1" + "google.golang.org/api/iterator" + gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1" +) + +func main() { + ctx := context.Background() + c, err := gkebackup.NewBackupForGKEClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkebackuppb.ListVolumeRestoresRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#ListVolumeRestoresRequest. + } + it := c.ListVolumeRestores(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END gkebackup_v1_generated_BackupForGKE_ListVolumeRestores_sync] diff --git a/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/UpdateBackup/main.go b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/UpdateBackup/main.go new file mode 100644 index 000000000000..c8735619a005 --- /dev/null +++ b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/UpdateBackup/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 gkebackup_v1_generated_BackupForGKE_UpdateBackup_sync] + +package main + +import ( + "context" + + gkebackup "cloud.google.com/go/gkebackup/apiv1" + gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1" +) + +func main() { + ctx := context.Background() + c, err := gkebackup.NewBackupForGKEClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkebackuppb.UpdateBackupRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#UpdateBackupRequest. + } + op, err := c.UpdateBackup(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END gkebackup_v1_generated_BackupForGKE_UpdateBackup_sync] diff --git a/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/UpdateBackupPlan/main.go b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/UpdateBackupPlan/main.go new file mode 100644 index 000000000000..53685adde773 --- /dev/null +++ b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/UpdateBackupPlan/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 gkebackup_v1_generated_BackupForGKE_UpdateBackupPlan_sync] + +package main + +import ( + "context" + + gkebackup "cloud.google.com/go/gkebackup/apiv1" + gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1" +) + +func main() { + ctx := context.Background() + c, err := gkebackup.NewBackupForGKEClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkebackuppb.UpdateBackupPlanRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#UpdateBackupPlanRequest. + } + op, err := c.UpdateBackupPlan(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END gkebackup_v1_generated_BackupForGKE_UpdateBackupPlan_sync] diff --git a/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/UpdateRestore/main.go b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/UpdateRestore/main.go new file mode 100644 index 000000000000..5d0dad5769f7 --- /dev/null +++ b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/UpdateRestore/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 gkebackup_v1_generated_BackupForGKE_UpdateRestore_sync] + +package main + +import ( + "context" + + gkebackup "cloud.google.com/go/gkebackup/apiv1" + gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1" +) + +func main() { + ctx := context.Background() + c, err := gkebackup.NewBackupForGKEClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkebackuppb.UpdateRestoreRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#UpdateRestoreRequest. + } + op, err := c.UpdateRestore(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END gkebackup_v1_generated_BackupForGKE_UpdateRestore_sync] diff --git a/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/UpdateRestorePlan/main.go b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/UpdateRestorePlan/main.go new file mode 100644 index 000000000000..f874bf838a24 --- /dev/null +++ b/internal/generated/snippets/gkebackup/apiv1/BackupForGKEClient/UpdateRestorePlan/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 gkebackup_v1_generated_BackupForGKE_UpdateRestorePlan_sync] + +package main + +import ( + "context" + + gkebackup "cloud.google.com/go/gkebackup/apiv1" + gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1" +) + +func main() { + ctx := context.Background() + c, err := gkebackup.NewBackupForGKEClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkebackuppb.UpdateRestorePlanRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#UpdateRestorePlanRequest. + } + op, err := c.UpdateRestorePlan(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END gkebackup_v1_generated_BackupForGKE_UpdateRestorePlan_sync] diff --git a/internal/generated/snippets/gkebackup/apiv1/snippet_metadata.google.cloud.gkebackup.v1.json b/internal/generated/snippets/gkebackup/apiv1/snippet_metadata.google.cloud.gkebackup.v1.json new file mode 100644 index 000000000000..240e68b46d64 --- /dev/null +++ b/internal/generated/snippets/gkebackup/apiv1/snippet_metadata.google.cloud.gkebackup.v1.json @@ -0,0 +1,1119 @@ +{ + "clientLibrary": { + "name": "cloud.google.com/go/gkebackup/apiv1", + "version": "0.1.0", + "language": "GO", + "apis": [ + { + "id": "google.cloud.gkebackup.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_CreateBackup_sync", + "title": "gkebackup CreateBackup Sample", + "description": "CreateBackup creates a Backup for the given BackupPlan.", + "file": "BackupForGKEClient/CreateBackup/main.go", + "language": "GO", + "clientMethod": { + "shortName": "CreateBackup", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient.CreateBackup", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkebackuppb.CreateBackupRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "CreateBackupOperation", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "CreateBackup", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.CreateBackup", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 52, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_CreateBackupPlan_sync", + "title": "gkebackup CreateBackupPlan Sample", + "description": "CreateBackupPlan creates a new BackupPlan in a given location.", + "file": "BackupForGKEClient/CreateBackupPlan/main.go", + "language": "GO", + "clientMethod": { + "shortName": "CreateBackupPlan", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient.CreateBackupPlan", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkebackuppb.CreateBackupPlanRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "CreateBackupPlanOperation", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "CreateBackupPlan", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.CreateBackupPlan", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 52, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_CreateRestore_sync", + "title": "gkebackup CreateRestore Sample", + "description": "CreateRestore creates a new Restore for the given RestorePlan.", + "file": "BackupForGKEClient/CreateRestore/main.go", + "language": "GO", + "clientMethod": { + "shortName": "CreateRestore", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient.CreateRestore", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkebackuppb.CreateRestoreRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "CreateRestoreOperation", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "CreateRestore", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.CreateRestore", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 52, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_CreateRestorePlan_sync", + "title": "gkebackup CreateRestorePlan Sample", + "description": "CreateRestorePlan creates a new RestorePlan in a given location.", + "file": "BackupForGKEClient/CreateRestorePlan/main.go", + "language": "GO", + "clientMethod": { + "shortName": "CreateRestorePlan", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient.CreateRestorePlan", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkebackuppb.CreateRestorePlanRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "CreateRestorePlanOperation", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "CreateRestorePlan", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.CreateRestorePlan", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 52, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_DeleteBackup_sync", + "title": "gkebackup DeleteBackup Sample", + "description": "DeleteBackup deletes an existing Backup.", + "file": "BackupForGKEClient/DeleteBackup/main.go", + "language": "GO", + "clientMethod": { + "shortName": "DeleteBackup", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient.DeleteBackup", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkebackuppb.DeleteBackupRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "DeleteBackupOperation", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "DeleteBackup", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.DeleteBackup", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 50, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_DeleteBackupPlan_sync", + "title": "gkebackup DeleteBackupPlan Sample", + "description": "DeleteBackupPlan deletes an existing BackupPlan.", + "file": "BackupForGKEClient/DeleteBackupPlan/main.go", + "language": "GO", + "clientMethod": { + "shortName": "DeleteBackupPlan", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient.DeleteBackupPlan", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkebackuppb.DeleteBackupPlanRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "DeleteBackupPlanOperation", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "DeleteBackupPlan", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.DeleteBackupPlan", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 50, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_DeleteRestore_sync", + "title": "gkebackup DeleteRestore Sample", + "description": "DeleteRestore deletes an existing Restore.", + "file": "BackupForGKEClient/DeleteRestore/main.go", + "language": "GO", + "clientMethod": { + "shortName": "DeleteRestore", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient.DeleteRestore", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkebackuppb.DeleteRestoreRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "DeleteRestoreOperation", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "DeleteRestore", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.DeleteRestore", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 50, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_DeleteRestorePlan_sync", + "title": "gkebackup DeleteRestorePlan Sample", + "description": "DeleteRestorePlan deletes an existing RestorePlan.", + "file": "BackupForGKEClient/DeleteRestorePlan/main.go", + "language": "GO", + "clientMethod": { + "shortName": "DeleteRestorePlan", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient.DeleteRestorePlan", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkebackuppb.DeleteRestorePlanRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "DeleteRestorePlanOperation", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "DeleteRestorePlan", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.DeleteRestorePlan", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 50, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_GetBackup_sync", + "title": "gkebackup GetBackup Sample", + "description": "GetBackup retrieve the details of a single Backup.", + "file": "BackupForGKEClient/GetBackup/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetBackup", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient.GetBackup", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkebackuppb.GetBackupRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "gkebackuppb.Backup", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "GetBackup", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.GetBackup", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_GetBackupPlan_sync", + "title": "gkebackup GetBackupPlan Sample", + "description": "GetBackupPlan retrieve the details of a single BackupPlan.", + "file": "BackupForGKEClient/GetBackupPlan/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetBackupPlan", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient.GetBackupPlan", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkebackuppb.GetBackupPlanRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "gkebackuppb.BackupPlan", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "GetBackupPlan", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.GetBackupPlan", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_GetRestore_sync", + "title": "gkebackup GetRestore Sample", + "description": "GetRestore retrieves the details of a single Restore.", + "file": "BackupForGKEClient/GetRestore/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetRestore", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient.GetRestore", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkebackuppb.GetRestoreRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "gkebackuppb.Restore", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "GetRestore", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.GetRestore", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_GetRestorePlan_sync", + "title": "gkebackup GetRestorePlan Sample", + "description": "GetRestorePlan retrieve the details of a single RestorePlan.", + "file": "BackupForGKEClient/GetRestorePlan/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetRestorePlan", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient.GetRestorePlan", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkebackuppb.GetRestorePlanRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "gkebackuppb.RestorePlan", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "GetRestorePlan", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.GetRestorePlan", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_GetVolumeBackup_sync", + "title": "gkebackup GetVolumeBackup Sample", + "description": "GetVolumeBackup retrieve the details of a single VolumeBackup.", + "file": "BackupForGKEClient/GetVolumeBackup/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetVolumeBackup", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient.GetVolumeBackup", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkebackuppb.GetVolumeBackupRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "gkebackuppb.VolumeBackup", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "GetVolumeBackup", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.GetVolumeBackup", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_GetVolumeRestore_sync", + "title": "gkebackup GetVolumeRestore Sample", + "description": "GetVolumeRestore retrieve the details of a single VolumeRestore.", + "file": "BackupForGKEClient/GetVolumeRestore/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetVolumeRestore", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient.GetVolumeRestore", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkebackuppb.GetVolumeRestoreRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "gkebackuppb.VolumeRestore", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "GetVolumeRestore", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.GetVolumeRestore", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_ListBackupPlans_sync", + "title": "gkebackup ListBackupPlans Sample", + "description": "ListBackupPlans lists BackupPlans in a given location.", + "file": "BackupForGKEClient/ListBackupPlans/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListBackupPlans", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient.ListBackupPlans", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkebackuppb.ListBackupPlansRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "BackupPlanIterator", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "ListBackupPlans", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.ListBackupPlans", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 54, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_ListBackups_sync", + "title": "gkebackup ListBackups Sample", + "description": "ListBackups lists the Backups for a given BackupPlan.", + "file": "BackupForGKEClient/ListBackups/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListBackups", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient.ListBackups", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkebackuppb.ListBackupsRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "BackupIterator", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "ListBackups", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.ListBackups", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 54, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_ListRestorePlans_sync", + "title": "gkebackup ListRestorePlans Sample", + "description": "ListRestorePlans lists RestorePlans in a given location.", + "file": "BackupForGKEClient/ListRestorePlans/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListRestorePlans", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient.ListRestorePlans", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkebackuppb.ListRestorePlansRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "RestorePlanIterator", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "ListRestorePlans", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.ListRestorePlans", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 54, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_ListRestores_sync", + "title": "gkebackup ListRestores Sample", + "description": "ListRestores lists the Restores for a given RestorePlan.", + "file": "BackupForGKEClient/ListRestores/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListRestores", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient.ListRestores", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkebackuppb.ListRestoresRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "RestoreIterator", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "ListRestores", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.ListRestores", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 54, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_ListVolumeBackups_sync", + "title": "gkebackup ListVolumeBackups Sample", + "description": "ListVolumeBackups lists the VolumeBackups for a given Backup.", + "file": "BackupForGKEClient/ListVolumeBackups/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListVolumeBackups", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient.ListVolumeBackups", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkebackuppb.ListVolumeBackupsRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "VolumeBackupIterator", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "ListVolumeBackups", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.ListVolumeBackups", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 54, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_ListVolumeRestores_sync", + "title": "gkebackup ListVolumeRestores Sample", + "description": "ListVolumeRestores lists the VolumeRestores for a given Restore.", + "file": "BackupForGKEClient/ListVolumeRestores/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListVolumeRestores", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient.ListVolumeRestores", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkebackuppb.ListVolumeRestoresRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "VolumeRestoreIterator", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "ListVolumeRestores", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.ListVolumeRestores", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 54, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_UpdateBackup_sync", + "title": "gkebackup UpdateBackup Sample", + "description": "UpdateBackup update a Backup.", + "file": "BackupForGKEClient/UpdateBackup/main.go", + "language": "GO", + "clientMethod": { + "shortName": "UpdateBackup", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient.UpdateBackup", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkebackuppb.UpdateBackupRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "UpdateBackupOperation", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "UpdateBackup", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.UpdateBackup", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 52, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_UpdateBackupPlan_sync", + "title": "gkebackup UpdateBackupPlan Sample", + "description": "UpdateBackupPlan update a BackupPlan.", + "file": "BackupForGKEClient/UpdateBackupPlan/main.go", + "language": "GO", + "clientMethod": { + "shortName": "UpdateBackupPlan", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient.UpdateBackupPlan", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkebackuppb.UpdateBackupPlanRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "UpdateBackupPlanOperation", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "UpdateBackupPlan", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.UpdateBackupPlan", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 52, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_UpdateRestore_sync", + "title": "gkebackup UpdateRestore Sample", + "description": "UpdateRestore update a Restore.", + "file": "BackupForGKEClient/UpdateRestore/main.go", + "language": "GO", + "clientMethod": { + "shortName": "UpdateRestore", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient.UpdateRestore", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkebackuppb.UpdateRestoreRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "UpdateRestoreOperation", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "UpdateRestore", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.UpdateRestore", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 52, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkebackup_v1_generated_BackupForGKE_UpdateRestorePlan_sync", + "title": "gkebackup UpdateRestorePlan Sample", + "description": "UpdateRestorePlan update a RestorePlan.", + "file": "BackupForGKEClient/UpdateRestorePlan/main.go", + "language": "GO", + "clientMethod": { + "shortName": "UpdateRestorePlan", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient.UpdateRestorePlan", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkebackuppb.UpdateRestorePlanRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "UpdateRestorePlanOperation", + "client": { + "shortName": "BackupForGKEClient", + "fullName": "google.cloud.gkebackup.v1.BackupForGKEClient" + }, + "method": { + "shortName": "UpdateRestorePlan", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE.UpdateRestorePlan", + "service": { + "shortName": "BackupForGKE", + "fullName": "google.cloud.gkebackup.v1.BackupForGKE" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 52, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/CreateAwsCluster/main.go b/internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/CreateAwsCluster/main.go new file mode 100644 index 000000000000..1628c2a69989 --- /dev/null +++ b/internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/CreateAwsCluster/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 gkemulticloud_v1_generated_AwsClusters_CreateAwsCluster_sync] + +package main + +import ( + "context" + + gkemulticloud "cloud.google.com/go/gkemulticloud/apiv1" + gkemulticloudpb "google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1" +) + +func main() { + ctx := context.Background() + c, err := gkemulticloud.NewAwsClustersClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkemulticloudpb.CreateAwsClusterRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1#CreateAwsClusterRequest. + } + op, err := c.CreateAwsCluster(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END gkemulticloud_v1_generated_AwsClusters_CreateAwsCluster_sync] diff --git a/internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/CreateAwsNodePool/main.go b/internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/CreateAwsNodePool/main.go new file mode 100644 index 000000000000..fc8bae5dd1a2 --- /dev/null +++ b/internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/CreateAwsNodePool/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 gkemulticloud_v1_generated_AwsClusters_CreateAwsNodePool_sync] + +package main + +import ( + "context" + + gkemulticloud "cloud.google.com/go/gkemulticloud/apiv1" + gkemulticloudpb "google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1" +) + +func main() { + ctx := context.Background() + c, err := gkemulticloud.NewAwsClustersClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkemulticloudpb.CreateAwsNodePoolRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1#CreateAwsNodePoolRequest. + } + op, err := c.CreateAwsNodePool(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END gkemulticloud_v1_generated_AwsClusters_CreateAwsNodePool_sync] diff --git a/internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/DeleteAwsCluster/main.go b/internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/DeleteAwsCluster/main.go new file mode 100644 index 000000000000..9bace2f4335c --- /dev/null +++ b/internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/DeleteAwsCluster/main.go @@ -0,0 +1,51 @@ +// 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 gkemulticloud_v1_generated_AwsClusters_DeleteAwsCluster_sync] + +package main + +import ( + "context" + + gkemulticloud "cloud.google.com/go/gkemulticloud/apiv1" + gkemulticloudpb "google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1" +) + +func main() { + ctx := context.Background() + c, err := gkemulticloud.NewAwsClustersClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkemulticloudpb.DeleteAwsClusterRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1#DeleteAwsClusterRequest. + } + op, err := c.DeleteAwsCluster(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +// [END gkemulticloud_v1_generated_AwsClusters_DeleteAwsCluster_sync] diff --git a/internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/DeleteAwsNodePool/main.go b/internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/DeleteAwsNodePool/main.go new file mode 100644 index 000000000000..3cd9f9f3da79 --- /dev/null +++ b/internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/DeleteAwsNodePool/main.go @@ -0,0 +1,51 @@ +// 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 gkemulticloud_v1_generated_AwsClusters_DeleteAwsNodePool_sync] + +package main + +import ( + "context" + + gkemulticloud "cloud.google.com/go/gkemulticloud/apiv1" + gkemulticloudpb "google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1" +) + +func main() { + ctx := context.Background() + c, err := gkemulticloud.NewAwsClustersClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkemulticloudpb.DeleteAwsNodePoolRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1#DeleteAwsNodePoolRequest. + } + op, err := c.DeleteAwsNodePool(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +// [END gkemulticloud_v1_generated_AwsClusters_DeleteAwsNodePool_sync] diff --git a/internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/GenerateAwsAccessToken/main.go b/internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/GenerateAwsAccessToken/main.go new file mode 100644 index 000000000000..67d61126ec54 --- /dev/null +++ b/internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/GenerateAwsAccessToken/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 gkemulticloud_v1_generated_AwsClusters_GenerateAwsAccessToken_sync] + +package main + +import ( + "context" + + gkemulticloud "cloud.google.com/go/gkemulticloud/apiv1" + gkemulticloudpb "google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1" +) + +func main() { + ctx := context.Background() + c, err := gkemulticloud.NewAwsClustersClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkemulticloudpb.GenerateAwsAccessTokenRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1#GenerateAwsAccessTokenRequest. + } + resp, err := c.GenerateAwsAccessToken(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END gkemulticloud_v1_generated_AwsClusters_GenerateAwsAccessToken_sync] diff --git a/internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/GetAwsCluster/main.go b/internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/GetAwsCluster/main.go new file mode 100644 index 000000000000..243a15b79da6 --- /dev/null +++ b/internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/GetAwsCluster/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 gkemulticloud_v1_generated_AwsClusters_GetAwsCluster_sync] + +package main + +import ( + "context" + + gkemulticloud "cloud.google.com/go/gkemulticloud/apiv1" + gkemulticloudpb "google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1" +) + +func main() { + ctx := context.Background() + c, err := gkemulticloud.NewAwsClustersClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkemulticloudpb.GetAwsClusterRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1#GetAwsClusterRequest. + } + resp, err := c.GetAwsCluster(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END gkemulticloud_v1_generated_AwsClusters_GetAwsCluster_sync] diff --git a/internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/GetAwsNodePool/main.go b/internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/GetAwsNodePool/main.go new file mode 100644 index 000000000000..c03e947d6423 --- /dev/null +++ b/internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/GetAwsNodePool/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 gkemulticloud_v1_generated_AwsClusters_GetAwsNodePool_sync] + +package main + +import ( + "context" + + gkemulticloud "cloud.google.com/go/gkemulticloud/apiv1" + gkemulticloudpb "google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1" +) + +func main() { + ctx := context.Background() + c, err := gkemulticloud.NewAwsClustersClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkemulticloudpb.GetAwsNodePoolRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1#GetAwsNodePoolRequest. + } + resp, err := c.GetAwsNodePool(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END gkemulticloud_v1_generated_AwsClusters_GetAwsNodePool_sync] diff --git a/internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/GetAwsServerConfig/main.go b/internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/GetAwsServerConfig/main.go new file mode 100644 index 000000000000..6ed2a1a36775 --- /dev/null +++ b/internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/GetAwsServerConfig/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 gkemulticloud_v1_generated_AwsClusters_GetAwsServerConfig_sync] + +package main + +import ( + "context" + + gkemulticloud "cloud.google.com/go/gkemulticloud/apiv1" + gkemulticloudpb "google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1" +) + +func main() { + ctx := context.Background() + c, err := gkemulticloud.NewAwsClustersClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkemulticloudpb.GetAwsServerConfigRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1#GetAwsServerConfigRequest. + } + resp, err := c.GetAwsServerConfig(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END gkemulticloud_v1_generated_AwsClusters_GetAwsServerConfig_sync] diff --git a/internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/ListAwsClusters/main.go b/internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/ListAwsClusters/main.go new file mode 100644 index 000000000000..803bfaf8e7c5 --- /dev/null +++ b/internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/ListAwsClusters/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 gkemulticloud_v1_generated_AwsClusters_ListAwsClusters_sync] + +package main + +import ( + "context" + + gkemulticloud "cloud.google.com/go/gkemulticloud/apiv1" + "google.golang.org/api/iterator" + gkemulticloudpb "google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1" +) + +func main() { + ctx := context.Background() + c, err := gkemulticloud.NewAwsClustersClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkemulticloudpb.ListAwsClustersRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1#ListAwsClustersRequest. + } + it := c.ListAwsClusters(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END gkemulticloud_v1_generated_AwsClusters_ListAwsClusters_sync] diff --git a/internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/ListAwsNodePools/main.go b/internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/ListAwsNodePools/main.go new file mode 100644 index 000000000000..0b6b669e5112 --- /dev/null +++ b/internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/ListAwsNodePools/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 gkemulticloud_v1_generated_AwsClusters_ListAwsNodePools_sync] + +package main + +import ( + "context" + + gkemulticloud "cloud.google.com/go/gkemulticloud/apiv1" + "google.golang.org/api/iterator" + gkemulticloudpb "google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1" +) + +func main() { + ctx := context.Background() + c, err := gkemulticloud.NewAwsClustersClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkemulticloudpb.ListAwsNodePoolsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1#ListAwsNodePoolsRequest. + } + it := c.ListAwsNodePools(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END gkemulticloud_v1_generated_AwsClusters_ListAwsNodePools_sync] diff --git a/internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/UpdateAwsCluster/main.go b/internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/UpdateAwsCluster/main.go new file mode 100644 index 000000000000..a372d342b774 --- /dev/null +++ b/internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/UpdateAwsCluster/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 gkemulticloud_v1_generated_AwsClusters_UpdateAwsCluster_sync] + +package main + +import ( + "context" + + gkemulticloud "cloud.google.com/go/gkemulticloud/apiv1" + gkemulticloudpb "google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1" +) + +func main() { + ctx := context.Background() + c, err := gkemulticloud.NewAwsClustersClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkemulticloudpb.UpdateAwsClusterRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1#UpdateAwsClusterRequest. + } + op, err := c.UpdateAwsCluster(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END gkemulticloud_v1_generated_AwsClusters_UpdateAwsCluster_sync] diff --git a/internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/UpdateAwsNodePool/main.go b/internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/UpdateAwsNodePool/main.go new file mode 100644 index 000000000000..5a544420cc91 --- /dev/null +++ b/internal/generated/snippets/gkemulticloud/apiv1/AwsClustersClient/UpdateAwsNodePool/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 gkemulticloud_v1_generated_AwsClusters_UpdateAwsNodePool_sync] + +package main + +import ( + "context" + + gkemulticloud "cloud.google.com/go/gkemulticloud/apiv1" + gkemulticloudpb "google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1" +) + +func main() { + ctx := context.Background() + c, err := gkemulticloud.NewAwsClustersClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkemulticloudpb.UpdateAwsNodePoolRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1#UpdateAwsNodePoolRequest. + } + op, err := c.UpdateAwsNodePool(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END gkemulticloud_v1_generated_AwsClusters_UpdateAwsNodePool_sync] diff --git a/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/CreateAzureClient/main.go b/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/CreateAzureClient/main.go new file mode 100644 index 000000000000..121c642c00ef --- /dev/null +++ b/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/CreateAzureClient/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 gkemulticloud_v1_generated_AzureClusters_CreateAzureClient_sync] + +package main + +import ( + "context" + + gkemulticloud "cloud.google.com/go/gkemulticloud/apiv1" + gkemulticloudpb "google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1" +) + +func main() { + ctx := context.Background() + c, err := gkemulticloud.NewAzureClustersClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkemulticloudpb.CreateAzureClientRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1#CreateAzureClientRequest. + } + op, err := c.CreateAzureClient(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END gkemulticloud_v1_generated_AzureClusters_CreateAzureClient_sync] diff --git a/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/CreateAzureCluster/main.go b/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/CreateAzureCluster/main.go new file mode 100644 index 000000000000..2abb93bf4607 --- /dev/null +++ b/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/CreateAzureCluster/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 gkemulticloud_v1_generated_AzureClusters_CreateAzureCluster_sync] + +package main + +import ( + "context" + + gkemulticloud "cloud.google.com/go/gkemulticloud/apiv1" + gkemulticloudpb "google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1" +) + +func main() { + ctx := context.Background() + c, err := gkemulticloud.NewAzureClustersClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkemulticloudpb.CreateAzureClusterRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1#CreateAzureClusterRequest. + } + op, err := c.CreateAzureCluster(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END gkemulticloud_v1_generated_AzureClusters_CreateAzureCluster_sync] diff --git a/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/CreateAzureNodePool/main.go b/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/CreateAzureNodePool/main.go new file mode 100644 index 000000000000..0580e6934528 --- /dev/null +++ b/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/CreateAzureNodePool/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 gkemulticloud_v1_generated_AzureClusters_CreateAzureNodePool_sync] + +package main + +import ( + "context" + + gkemulticloud "cloud.google.com/go/gkemulticloud/apiv1" + gkemulticloudpb "google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1" +) + +func main() { + ctx := context.Background() + c, err := gkemulticloud.NewAzureClustersClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkemulticloudpb.CreateAzureNodePoolRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1#CreateAzureNodePoolRequest. + } + op, err := c.CreateAzureNodePool(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END gkemulticloud_v1_generated_AzureClusters_CreateAzureNodePool_sync] diff --git a/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/DeleteAzureClient/main.go b/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/DeleteAzureClient/main.go new file mode 100644 index 000000000000..ef4f31d0582a --- /dev/null +++ b/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/DeleteAzureClient/main.go @@ -0,0 +1,51 @@ +// 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 gkemulticloud_v1_generated_AzureClusters_DeleteAzureClient_sync] + +package main + +import ( + "context" + + gkemulticloud "cloud.google.com/go/gkemulticloud/apiv1" + gkemulticloudpb "google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1" +) + +func main() { + ctx := context.Background() + c, err := gkemulticloud.NewAzureClustersClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkemulticloudpb.DeleteAzureClientRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1#DeleteAzureClientRequest. + } + op, err := c.DeleteAzureClient(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +// [END gkemulticloud_v1_generated_AzureClusters_DeleteAzureClient_sync] diff --git a/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/DeleteAzureCluster/main.go b/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/DeleteAzureCluster/main.go new file mode 100644 index 000000000000..e8225f9cf24d --- /dev/null +++ b/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/DeleteAzureCluster/main.go @@ -0,0 +1,51 @@ +// 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 gkemulticloud_v1_generated_AzureClusters_DeleteAzureCluster_sync] + +package main + +import ( + "context" + + gkemulticloud "cloud.google.com/go/gkemulticloud/apiv1" + gkemulticloudpb "google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1" +) + +func main() { + ctx := context.Background() + c, err := gkemulticloud.NewAzureClustersClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkemulticloudpb.DeleteAzureClusterRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1#DeleteAzureClusterRequest. + } + op, err := c.DeleteAzureCluster(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +// [END gkemulticloud_v1_generated_AzureClusters_DeleteAzureCluster_sync] diff --git a/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/DeleteAzureNodePool/main.go b/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/DeleteAzureNodePool/main.go new file mode 100644 index 000000000000..df9faa849121 --- /dev/null +++ b/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/DeleteAzureNodePool/main.go @@ -0,0 +1,51 @@ +// 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 gkemulticloud_v1_generated_AzureClusters_DeleteAzureNodePool_sync] + +package main + +import ( + "context" + + gkemulticloud "cloud.google.com/go/gkemulticloud/apiv1" + gkemulticloudpb "google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1" +) + +func main() { + ctx := context.Background() + c, err := gkemulticloud.NewAzureClustersClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkemulticloudpb.DeleteAzureNodePoolRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1#DeleteAzureNodePoolRequest. + } + op, err := c.DeleteAzureNodePool(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +// [END gkemulticloud_v1_generated_AzureClusters_DeleteAzureNodePool_sync] diff --git a/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/GenerateAzureAccessToken/main.go b/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/GenerateAzureAccessToken/main.go new file mode 100644 index 000000000000..7c632f484dab --- /dev/null +++ b/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/GenerateAzureAccessToken/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 gkemulticloud_v1_generated_AzureClusters_GenerateAzureAccessToken_sync] + +package main + +import ( + "context" + + gkemulticloud "cloud.google.com/go/gkemulticloud/apiv1" + gkemulticloudpb "google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1" +) + +func main() { + ctx := context.Background() + c, err := gkemulticloud.NewAzureClustersClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkemulticloudpb.GenerateAzureAccessTokenRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1#GenerateAzureAccessTokenRequest. + } + resp, err := c.GenerateAzureAccessToken(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END gkemulticloud_v1_generated_AzureClusters_GenerateAzureAccessToken_sync] diff --git a/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/GetAzureClient/main.go b/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/GetAzureClient/main.go new file mode 100644 index 000000000000..83d7c2f8f19e --- /dev/null +++ b/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/GetAzureClient/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 gkemulticloud_v1_generated_AzureClusters_GetAzureClient_sync] + +package main + +import ( + "context" + + gkemulticloud "cloud.google.com/go/gkemulticloud/apiv1" + gkemulticloudpb "google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1" +) + +func main() { + ctx := context.Background() + c, err := gkemulticloud.NewAzureClustersClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkemulticloudpb.GetAzureClientRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1#GetAzureClientRequest. + } + resp, err := c.GetAzureClient(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END gkemulticloud_v1_generated_AzureClusters_GetAzureClient_sync] diff --git a/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/GetAzureCluster/main.go b/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/GetAzureCluster/main.go new file mode 100644 index 000000000000..f0e49ad7690a --- /dev/null +++ b/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/GetAzureCluster/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 gkemulticloud_v1_generated_AzureClusters_GetAzureCluster_sync] + +package main + +import ( + "context" + + gkemulticloud "cloud.google.com/go/gkemulticloud/apiv1" + gkemulticloudpb "google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1" +) + +func main() { + ctx := context.Background() + c, err := gkemulticloud.NewAzureClustersClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkemulticloudpb.GetAzureClusterRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1#GetAzureClusterRequest. + } + resp, err := c.GetAzureCluster(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END gkemulticloud_v1_generated_AzureClusters_GetAzureCluster_sync] diff --git a/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/GetAzureNodePool/main.go b/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/GetAzureNodePool/main.go new file mode 100644 index 000000000000..5e5c8ad3e0fa --- /dev/null +++ b/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/GetAzureNodePool/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 gkemulticloud_v1_generated_AzureClusters_GetAzureNodePool_sync] + +package main + +import ( + "context" + + gkemulticloud "cloud.google.com/go/gkemulticloud/apiv1" + gkemulticloudpb "google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1" +) + +func main() { + ctx := context.Background() + c, err := gkemulticloud.NewAzureClustersClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkemulticloudpb.GetAzureNodePoolRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1#GetAzureNodePoolRequest. + } + resp, err := c.GetAzureNodePool(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END gkemulticloud_v1_generated_AzureClusters_GetAzureNodePool_sync] diff --git a/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/GetAzureServerConfig/main.go b/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/GetAzureServerConfig/main.go new file mode 100644 index 000000000000..31c3175386bf --- /dev/null +++ b/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/GetAzureServerConfig/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 gkemulticloud_v1_generated_AzureClusters_GetAzureServerConfig_sync] + +package main + +import ( + "context" + + gkemulticloud "cloud.google.com/go/gkemulticloud/apiv1" + gkemulticloudpb "google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1" +) + +func main() { + ctx := context.Background() + c, err := gkemulticloud.NewAzureClustersClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkemulticloudpb.GetAzureServerConfigRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1#GetAzureServerConfigRequest. + } + resp, err := c.GetAzureServerConfig(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END gkemulticloud_v1_generated_AzureClusters_GetAzureServerConfig_sync] diff --git a/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/ListAzureClients/main.go b/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/ListAzureClients/main.go new file mode 100644 index 000000000000..c7bebd92b2b5 --- /dev/null +++ b/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/ListAzureClients/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 gkemulticloud_v1_generated_AzureClusters_ListAzureClients_sync] + +package main + +import ( + "context" + + gkemulticloud "cloud.google.com/go/gkemulticloud/apiv1" + "google.golang.org/api/iterator" + gkemulticloudpb "google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1" +) + +func main() { + ctx := context.Background() + c, err := gkemulticloud.NewAzureClustersClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkemulticloudpb.ListAzureClientsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1#ListAzureClientsRequest. + } + it := c.ListAzureClients(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END gkemulticloud_v1_generated_AzureClusters_ListAzureClients_sync] diff --git a/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/ListAzureClusters/main.go b/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/ListAzureClusters/main.go new file mode 100644 index 000000000000..5acd82d4804a --- /dev/null +++ b/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/ListAzureClusters/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 gkemulticloud_v1_generated_AzureClusters_ListAzureClusters_sync] + +package main + +import ( + "context" + + gkemulticloud "cloud.google.com/go/gkemulticloud/apiv1" + "google.golang.org/api/iterator" + gkemulticloudpb "google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1" +) + +func main() { + ctx := context.Background() + c, err := gkemulticloud.NewAzureClustersClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkemulticloudpb.ListAzureClustersRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1#ListAzureClustersRequest. + } + it := c.ListAzureClusters(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END gkemulticloud_v1_generated_AzureClusters_ListAzureClusters_sync] diff --git a/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/ListAzureNodePools/main.go b/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/ListAzureNodePools/main.go new file mode 100644 index 000000000000..72f1aa80aa95 --- /dev/null +++ b/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/ListAzureNodePools/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 gkemulticloud_v1_generated_AzureClusters_ListAzureNodePools_sync] + +package main + +import ( + "context" + + gkemulticloud "cloud.google.com/go/gkemulticloud/apiv1" + "google.golang.org/api/iterator" + gkemulticloudpb "google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1" +) + +func main() { + ctx := context.Background() + c, err := gkemulticloud.NewAzureClustersClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkemulticloudpb.ListAzureNodePoolsRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1#ListAzureNodePoolsRequest. + } + it := c.ListAzureNodePools(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END gkemulticloud_v1_generated_AzureClusters_ListAzureNodePools_sync] diff --git a/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/UpdateAzureCluster/main.go b/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/UpdateAzureCluster/main.go new file mode 100644 index 000000000000..9c0727d15b67 --- /dev/null +++ b/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/UpdateAzureCluster/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 gkemulticloud_v1_generated_AzureClusters_UpdateAzureCluster_sync] + +package main + +import ( + "context" + + gkemulticloud "cloud.google.com/go/gkemulticloud/apiv1" + gkemulticloudpb "google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1" +) + +func main() { + ctx := context.Background() + c, err := gkemulticloud.NewAzureClustersClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkemulticloudpb.UpdateAzureClusterRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1#UpdateAzureClusterRequest. + } + op, err := c.UpdateAzureCluster(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END gkemulticloud_v1_generated_AzureClusters_UpdateAzureCluster_sync] diff --git a/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/UpdateAzureNodePool/main.go b/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/UpdateAzureNodePool/main.go new file mode 100644 index 000000000000..c381caa66ca1 --- /dev/null +++ b/internal/generated/snippets/gkemulticloud/apiv1/AzureClustersClient/UpdateAzureNodePool/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 gkemulticloud_v1_generated_AzureClusters_UpdateAzureNodePool_sync] + +package main + +import ( + "context" + + gkemulticloud "cloud.google.com/go/gkemulticloud/apiv1" + gkemulticloudpb "google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1" +) + +func main() { + ctx := context.Background() + c, err := gkemulticloud.NewAzureClustersClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &gkemulticloudpb.UpdateAzureNodePoolRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/gkemulticloud/v1#UpdateAzureNodePoolRequest. + } + op, err := c.UpdateAzureNodePool(ctx, req) + if err != nil { + // TODO: Handle error. + } + + resp, err := op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END gkemulticloud_v1_generated_AzureClusters_UpdateAzureNodePool_sync] diff --git a/internal/generated/snippets/gkemulticloud/apiv1/snippet_metadata.google.cloud.gkemulticloud.v1.json b/internal/generated/snippets/gkemulticloud/apiv1/snippet_metadata.google.cloud.gkemulticloud.v1.json new file mode 100644 index 000000000000..8f769e82cf3b --- /dev/null +++ b/internal/generated/snippets/gkemulticloud/apiv1/snippet_metadata.google.cloud.gkemulticloud.v1.json @@ -0,0 +1,1303 @@ +{ + "clientLibrary": { + "name": "cloud.google.com/go/gkemulticloud/apiv1", + "version": "0.1.0", + "language": "GO", + "apis": [ + { + "id": "google.cloud.gkemulticloud.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "gkemulticloud_v1_generated_AwsClusters_CreateAwsCluster_sync", + "title": "gkemulticloud CreateAwsCluster Sample", + "description": "CreateAwsCluster creates a new AwsCluster resource on a given GCP project and region.\n\nIf successful, the response contains a newly created\nOperation resource that can be\ndescribed to track the status of the operation.", + "file": "AwsClustersClient/CreateAwsCluster/main.go", + "language": "GO", + "clientMethod": { + "shortName": "CreateAwsCluster", + "fullName": "google.cloud.gkemulticloud.v1.AwsClustersClient.CreateAwsCluster", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkemulticloudpb.CreateAwsClusterRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "CreateAwsClusterOperation", + "client": { + "shortName": "AwsClustersClient", + "fullName": "google.cloud.gkemulticloud.v1.AwsClustersClient" + }, + "method": { + "shortName": "CreateAwsCluster", + "fullName": "google.cloud.gkemulticloud.v1.AwsClusters.CreateAwsCluster", + "service": { + "shortName": "AwsClusters", + "fullName": "google.cloud.gkemulticloud.v1.AwsClusters" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 52, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkemulticloud_v1_generated_AwsClusters_CreateAwsNodePool_sync", + "title": "gkemulticloud CreateAwsNodePool Sample", + "description": "CreateAwsNodePool creates a new AwsNodePool, attached to a given AwsCluster.\n\nIf successful, the response contains a newly created\nOperation resource that can be\ndescribed to track the status of the operation.", + "file": "AwsClustersClient/CreateAwsNodePool/main.go", + "language": "GO", + "clientMethod": { + "shortName": "CreateAwsNodePool", + "fullName": "google.cloud.gkemulticloud.v1.AwsClustersClient.CreateAwsNodePool", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkemulticloudpb.CreateAwsNodePoolRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "CreateAwsNodePoolOperation", + "client": { + "shortName": "AwsClustersClient", + "fullName": "google.cloud.gkemulticloud.v1.AwsClustersClient" + }, + "method": { + "shortName": "CreateAwsNodePool", + "fullName": "google.cloud.gkemulticloud.v1.AwsClusters.CreateAwsNodePool", + "service": { + "shortName": "AwsClusters", + "fullName": "google.cloud.gkemulticloud.v1.AwsClusters" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 52, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkemulticloud_v1_generated_AwsClusters_DeleteAwsCluster_sync", + "title": "gkemulticloud DeleteAwsCluster Sample", + "description": "DeleteAwsCluster deletes a specific AwsCluster resource.\n\nFails if the cluster has one or more associated AwsNodePool\nresources.\n\nIf successful, the response contains a newly created\nOperation resource that can be\ndescribed to track the status of the operation.", + "file": "AwsClustersClient/DeleteAwsCluster/main.go", + "language": "GO", + "clientMethod": { + "shortName": "DeleteAwsCluster", + "fullName": "google.cloud.gkemulticloud.v1.AwsClustersClient.DeleteAwsCluster", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkemulticloudpb.DeleteAwsClusterRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "DeleteAwsClusterOperation", + "client": { + "shortName": "AwsClustersClient", + "fullName": "google.cloud.gkemulticloud.v1.AwsClustersClient" + }, + "method": { + "shortName": "DeleteAwsCluster", + "fullName": "google.cloud.gkemulticloud.v1.AwsClusters.DeleteAwsCluster", + "service": { + "shortName": "AwsClusters", + "fullName": "google.cloud.gkemulticloud.v1.AwsClusters" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 50, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkemulticloud_v1_generated_AwsClusters_DeleteAwsNodePool_sync", + "title": "gkemulticloud DeleteAwsNodePool Sample", + "description": "DeleteAwsNodePool deletes a specific AwsNodePool resource.\n\nIf successful, the response contains a newly created\nOperation resource that can be\ndescribed to track the status of the operation.", + "file": "AwsClustersClient/DeleteAwsNodePool/main.go", + "language": "GO", + "clientMethod": { + "shortName": "DeleteAwsNodePool", + "fullName": "google.cloud.gkemulticloud.v1.AwsClustersClient.DeleteAwsNodePool", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkemulticloudpb.DeleteAwsNodePoolRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "DeleteAwsNodePoolOperation", + "client": { + "shortName": "AwsClustersClient", + "fullName": "google.cloud.gkemulticloud.v1.AwsClustersClient" + }, + "method": { + "shortName": "DeleteAwsNodePool", + "fullName": "google.cloud.gkemulticloud.v1.AwsClusters.DeleteAwsNodePool", + "service": { + "shortName": "AwsClusters", + "fullName": "google.cloud.gkemulticloud.v1.AwsClusters" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 50, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkemulticloud_v1_generated_AwsClusters_GenerateAwsAccessToken_sync", + "title": "gkemulticloud GenerateAwsAccessToken Sample", + "description": "GenerateAwsAccessToken generates a short-lived access token to authenticate to a given\nAwsCluster resource.", + "file": "AwsClustersClient/GenerateAwsAccessToken/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GenerateAwsAccessToken", + "fullName": "google.cloud.gkemulticloud.v1.AwsClustersClient.GenerateAwsAccessToken", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkemulticloudpb.GenerateAwsAccessTokenRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "gkemulticloudpb.GenerateAwsAccessTokenResponse", + "client": { + "shortName": "AwsClustersClient", + "fullName": "google.cloud.gkemulticloud.v1.AwsClustersClient" + }, + "method": { + "shortName": "GenerateAwsAccessToken", + "fullName": "google.cloud.gkemulticloud.v1.AwsClusters.GenerateAwsAccessToken", + "service": { + "shortName": "AwsClusters", + "fullName": "google.cloud.gkemulticloud.v1.AwsClusters" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkemulticloud_v1_generated_AwsClusters_GetAwsCluster_sync", + "title": "gkemulticloud GetAwsCluster Sample", + "description": "GetAwsCluster describes a specific AwsCluster resource.", + "file": "AwsClustersClient/GetAwsCluster/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetAwsCluster", + "fullName": "google.cloud.gkemulticloud.v1.AwsClustersClient.GetAwsCluster", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkemulticloudpb.GetAwsClusterRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "gkemulticloudpb.AwsCluster", + "client": { + "shortName": "AwsClustersClient", + "fullName": "google.cloud.gkemulticloud.v1.AwsClustersClient" + }, + "method": { + "shortName": "GetAwsCluster", + "fullName": "google.cloud.gkemulticloud.v1.AwsClusters.GetAwsCluster", + "service": { + "shortName": "AwsClusters", + "fullName": "google.cloud.gkemulticloud.v1.AwsClusters" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkemulticloud_v1_generated_AwsClusters_GetAwsNodePool_sync", + "title": "gkemulticloud GetAwsNodePool Sample", + "description": "GetAwsNodePool describes a specific AwsNodePool resource.", + "file": "AwsClustersClient/GetAwsNodePool/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetAwsNodePool", + "fullName": "google.cloud.gkemulticloud.v1.AwsClustersClient.GetAwsNodePool", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkemulticloudpb.GetAwsNodePoolRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "gkemulticloudpb.AwsNodePool", + "client": { + "shortName": "AwsClustersClient", + "fullName": "google.cloud.gkemulticloud.v1.AwsClustersClient" + }, + "method": { + "shortName": "GetAwsNodePool", + "fullName": "google.cloud.gkemulticloud.v1.AwsClusters.GetAwsNodePool", + "service": { + "shortName": "AwsClusters", + "fullName": "google.cloud.gkemulticloud.v1.AwsClusters" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkemulticloud_v1_generated_AwsClusters_GetAwsServerConfig_sync", + "title": "gkemulticloud GetAwsServerConfig Sample", + "description": "GetAwsServerConfig returns information, such as supported AWS regions and Kubernetes\nversions, on a given Google Cloud location.", + "file": "AwsClustersClient/GetAwsServerConfig/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetAwsServerConfig", + "fullName": "google.cloud.gkemulticloud.v1.AwsClustersClient.GetAwsServerConfig", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkemulticloudpb.GetAwsServerConfigRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "gkemulticloudpb.AwsServerConfig", + "client": { + "shortName": "AwsClustersClient", + "fullName": "google.cloud.gkemulticloud.v1.AwsClustersClient" + }, + "method": { + "shortName": "GetAwsServerConfig", + "fullName": "google.cloud.gkemulticloud.v1.AwsClusters.GetAwsServerConfig", + "service": { + "shortName": "AwsClusters", + "fullName": "google.cloud.gkemulticloud.v1.AwsClusters" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkemulticloud_v1_generated_AwsClusters_ListAwsClusters_sync", + "title": "gkemulticloud ListAwsClusters Sample", + "description": "ListAwsClusters lists all AwsCluster resources on a given Google Cloud project and\nregion.", + "file": "AwsClustersClient/ListAwsClusters/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListAwsClusters", + "fullName": "google.cloud.gkemulticloud.v1.AwsClustersClient.ListAwsClusters", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkemulticloudpb.ListAwsClustersRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "AwsClusterIterator", + "client": { + "shortName": "AwsClustersClient", + "fullName": "google.cloud.gkemulticloud.v1.AwsClustersClient" + }, + "method": { + "shortName": "ListAwsClusters", + "fullName": "google.cloud.gkemulticloud.v1.AwsClusters.ListAwsClusters", + "service": { + "shortName": "AwsClusters", + "fullName": "google.cloud.gkemulticloud.v1.AwsClusters" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 54, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkemulticloud_v1_generated_AwsClusters_ListAwsNodePools_sync", + "title": "gkemulticloud ListAwsNodePools Sample", + "description": "ListAwsNodePools lists all AwsNodePool resources on a given AwsCluster.", + "file": "AwsClustersClient/ListAwsNodePools/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListAwsNodePools", + "fullName": "google.cloud.gkemulticloud.v1.AwsClustersClient.ListAwsNodePools", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkemulticloudpb.ListAwsNodePoolsRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "AwsNodePoolIterator", + "client": { + "shortName": "AwsClustersClient", + "fullName": "google.cloud.gkemulticloud.v1.AwsClustersClient" + }, + "method": { + "shortName": "ListAwsNodePools", + "fullName": "google.cloud.gkemulticloud.v1.AwsClusters.ListAwsNodePools", + "service": { + "shortName": "AwsClusters", + "fullName": "google.cloud.gkemulticloud.v1.AwsClusters" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 54, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkemulticloud_v1_generated_AwsClusters_UpdateAwsCluster_sync", + "title": "gkemulticloud UpdateAwsCluster Sample", + "description": "UpdateAwsCluster updates an AwsCluster.", + "file": "AwsClustersClient/UpdateAwsCluster/main.go", + "language": "GO", + "clientMethod": { + "shortName": "UpdateAwsCluster", + "fullName": "google.cloud.gkemulticloud.v1.AwsClustersClient.UpdateAwsCluster", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkemulticloudpb.UpdateAwsClusterRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "UpdateAwsClusterOperation", + "client": { + "shortName": "AwsClustersClient", + "fullName": "google.cloud.gkemulticloud.v1.AwsClustersClient" + }, + "method": { + "shortName": "UpdateAwsCluster", + "fullName": "google.cloud.gkemulticloud.v1.AwsClusters.UpdateAwsCluster", + "service": { + "shortName": "AwsClusters", + "fullName": "google.cloud.gkemulticloud.v1.AwsClusters" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 52, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkemulticloud_v1_generated_AwsClusters_UpdateAwsNodePool_sync", + "title": "gkemulticloud UpdateAwsNodePool Sample", + "description": "UpdateAwsNodePool updates an AwsNodePool.", + "file": "AwsClustersClient/UpdateAwsNodePool/main.go", + "language": "GO", + "clientMethod": { + "shortName": "UpdateAwsNodePool", + "fullName": "google.cloud.gkemulticloud.v1.AwsClustersClient.UpdateAwsNodePool", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkemulticloudpb.UpdateAwsNodePoolRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "UpdateAwsNodePoolOperation", + "client": { + "shortName": "AwsClustersClient", + "fullName": "google.cloud.gkemulticloud.v1.AwsClustersClient" + }, + "method": { + "shortName": "UpdateAwsNodePool", + "fullName": "google.cloud.gkemulticloud.v1.AwsClusters.UpdateAwsNodePool", + "service": { + "shortName": "AwsClusters", + "fullName": "google.cloud.gkemulticloud.v1.AwsClusters" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 52, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkemulticloud_v1_generated_AzureClusters_CreateAzureClient_sync", + "title": "gkemulticloud CreateAzureClient Sample", + "description": "CreateAzureClient creates a new AzureClient resource on a given Google Cloud project\nand region.\n\nAzureClient resources hold client authentication\ninformation needed by the Anthos Multicloud API to manage Azure resources\non your Azure subscription on your behalf.\n\nIf successful, the response contains a newly created\nOperation resource that can be\ndescribed to track the status of the operation.", + "file": "AzureClustersClient/CreateAzureClient/main.go", + "language": "GO", + "clientMethod": { + "shortName": "CreateAzureClient", + "fullName": "google.cloud.gkemulticloud.v1.AzureClustersClient.CreateAzureClient", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkemulticloudpb.CreateAzureClientRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "CreateAzureClientOperation", + "client": { + "shortName": "AzureClustersClient", + "fullName": "google.cloud.gkemulticloud.v1.AzureClustersClient" + }, + "method": { + "shortName": "CreateAzureClient", + "fullName": "google.cloud.gkemulticloud.v1.AzureClusters.CreateAzureClient", + "service": { + "shortName": "AzureClusters", + "fullName": "google.cloud.gkemulticloud.v1.AzureClusters" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 52, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkemulticloud_v1_generated_AzureClusters_CreateAzureCluster_sync", + "title": "gkemulticloud CreateAzureCluster Sample", + "description": "CreateAzureCluster creates a new AzureCluster resource on a given GCP project and region.\n\nIf successful, the response contains a newly created\nOperation resource that can be\ndescribed to track the status of the operation.", + "file": "AzureClustersClient/CreateAzureCluster/main.go", + "language": "GO", + "clientMethod": { + "shortName": "CreateAzureCluster", + "fullName": "google.cloud.gkemulticloud.v1.AzureClustersClient.CreateAzureCluster", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkemulticloudpb.CreateAzureClusterRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "CreateAzureClusterOperation", + "client": { + "shortName": "AzureClustersClient", + "fullName": "google.cloud.gkemulticloud.v1.AzureClustersClient" + }, + "method": { + "shortName": "CreateAzureCluster", + "fullName": "google.cloud.gkemulticloud.v1.AzureClusters.CreateAzureCluster", + "service": { + "shortName": "AzureClusters", + "fullName": "google.cloud.gkemulticloud.v1.AzureClusters" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 52, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkemulticloud_v1_generated_AzureClusters_CreateAzureNodePool_sync", + "title": "gkemulticloud CreateAzureNodePool Sample", + "description": "CreateAzureNodePool creates a new AzureNodePool, attached to a given AzureCluster.\n\nIf successful, the response contains a newly created\nOperation resource that can be\ndescribed to track the status of the operation.", + "file": "AzureClustersClient/CreateAzureNodePool/main.go", + "language": "GO", + "clientMethod": { + "shortName": "CreateAzureNodePool", + "fullName": "google.cloud.gkemulticloud.v1.AzureClustersClient.CreateAzureNodePool", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkemulticloudpb.CreateAzureNodePoolRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "CreateAzureNodePoolOperation", + "client": { + "shortName": "AzureClustersClient", + "fullName": "google.cloud.gkemulticloud.v1.AzureClustersClient" + }, + "method": { + "shortName": "CreateAzureNodePool", + "fullName": "google.cloud.gkemulticloud.v1.AzureClusters.CreateAzureNodePool", + "service": { + "shortName": "AzureClusters", + "fullName": "google.cloud.gkemulticloud.v1.AzureClusters" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 52, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkemulticloud_v1_generated_AzureClusters_DeleteAzureClient_sync", + "title": "gkemulticloud DeleteAzureClient Sample", + "description": "DeleteAzureClient deletes a specific AzureClient resource.\n\nIf the client is used by one or more clusters, deletion will\nfail and a FAILED_PRECONDITION error will be returned.\n\nIf successful, the response contains a newly created\nOperation resource that can be\ndescribed to track the status of the operation.", + "file": "AzureClustersClient/DeleteAzureClient/main.go", + "language": "GO", + "clientMethod": { + "shortName": "DeleteAzureClient", + "fullName": "google.cloud.gkemulticloud.v1.AzureClustersClient.DeleteAzureClient", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkemulticloudpb.DeleteAzureClientRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "DeleteAzureClientOperation", + "client": { + "shortName": "AzureClustersClient", + "fullName": "google.cloud.gkemulticloud.v1.AzureClustersClient" + }, + "method": { + "shortName": "DeleteAzureClient", + "fullName": "google.cloud.gkemulticloud.v1.AzureClusters.DeleteAzureClient", + "service": { + "shortName": "AzureClusters", + "fullName": "google.cloud.gkemulticloud.v1.AzureClusters" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 50, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkemulticloud_v1_generated_AzureClusters_DeleteAzureCluster_sync", + "title": "gkemulticloud DeleteAzureCluster Sample", + "description": "DeleteAzureCluster deletes a specific AzureCluster resource.\n\nFails if the cluster has one or more associated AzureNodePool\nresources.\n\nIf successful, the response contains a newly created\nOperation resource that can be\ndescribed to track the status of the operation.", + "file": "AzureClustersClient/DeleteAzureCluster/main.go", + "language": "GO", + "clientMethod": { + "shortName": "DeleteAzureCluster", + "fullName": "google.cloud.gkemulticloud.v1.AzureClustersClient.DeleteAzureCluster", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkemulticloudpb.DeleteAzureClusterRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "DeleteAzureClusterOperation", + "client": { + "shortName": "AzureClustersClient", + "fullName": "google.cloud.gkemulticloud.v1.AzureClustersClient" + }, + "method": { + "shortName": "DeleteAzureCluster", + "fullName": "google.cloud.gkemulticloud.v1.AzureClusters.DeleteAzureCluster", + "service": { + "shortName": "AzureClusters", + "fullName": "google.cloud.gkemulticloud.v1.AzureClusters" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 50, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkemulticloud_v1_generated_AzureClusters_DeleteAzureNodePool_sync", + "title": "gkemulticloud DeleteAzureNodePool Sample", + "description": "DeleteAzureNodePool deletes a specific AzureNodePool resource.\n\nIf successful, the response contains a newly created\nOperation resource that can be\ndescribed to track the status of the operation.", + "file": "AzureClustersClient/DeleteAzureNodePool/main.go", + "language": "GO", + "clientMethod": { + "shortName": "DeleteAzureNodePool", + "fullName": "google.cloud.gkemulticloud.v1.AzureClustersClient.DeleteAzureNodePool", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkemulticloudpb.DeleteAzureNodePoolRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "DeleteAzureNodePoolOperation", + "client": { + "shortName": "AzureClustersClient", + "fullName": "google.cloud.gkemulticloud.v1.AzureClustersClient" + }, + "method": { + "shortName": "DeleteAzureNodePool", + "fullName": "google.cloud.gkemulticloud.v1.AzureClusters.DeleteAzureNodePool", + "service": { + "shortName": "AzureClusters", + "fullName": "google.cloud.gkemulticloud.v1.AzureClusters" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 50, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkemulticloud_v1_generated_AzureClusters_GenerateAzureAccessToken_sync", + "title": "gkemulticloud GenerateAzureAccessToken Sample", + "description": "GenerateAzureAccessToken generates a short-lived access token to authenticate to a given\nAzureCluster resource.", + "file": "AzureClustersClient/GenerateAzureAccessToken/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GenerateAzureAccessToken", + "fullName": "google.cloud.gkemulticloud.v1.AzureClustersClient.GenerateAzureAccessToken", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkemulticloudpb.GenerateAzureAccessTokenRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "gkemulticloudpb.GenerateAzureAccessTokenResponse", + "client": { + "shortName": "AzureClustersClient", + "fullName": "google.cloud.gkemulticloud.v1.AzureClustersClient" + }, + "method": { + "shortName": "GenerateAzureAccessToken", + "fullName": "google.cloud.gkemulticloud.v1.AzureClusters.GenerateAzureAccessToken", + "service": { + "shortName": "AzureClusters", + "fullName": "google.cloud.gkemulticloud.v1.AzureClusters" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkemulticloud_v1_generated_AzureClusters_GetAzureClient_sync", + "title": "gkemulticloud GetAzureClient Sample", + "description": "GetAzureClient describes a specific AzureClient resource.", + "file": "AzureClustersClient/GetAzureClient/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetAzureClient", + "fullName": "google.cloud.gkemulticloud.v1.AzureClustersClient.GetAzureClient", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkemulticloudpb.GetAzureClientRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "gkemulticloudpb.AzureClient", + "client": { + "shortName": "AzureClustersClient", + "fullName": "google.cloud.gkemulticloud.v1.AzureClustersClient" + }, + "method": { + "shortName": "GetAzureClient", + "fullName": "google.cloud.gkemulticloud.v1.AzureClusters.GetAzureClient", + "service": { + "shortName": "AzureClusters", + "fullName": "google.cloud.gkemulticloud.v1.AzureClusters" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkemulticloud_v1_generated_AzureClusters_GetAzureCluster_sync", + "title": "gkemulticloud GetAzureCluster Sample", + "description": "GetAzureCluster describes a specific AzureCluster resource.", + "file": "AzureClustersClient/GetAzureCluster/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetAzureCluster", + "fullName": "google.cloud.gkemulticloud.v1.AzureClustersClient.GetAzureCluster", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkemulticloudpb.GetAzureClusterRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "gkemulticloudpb.AzureCluster", + "client": { + "shortName": "AzureClustersClient", + "fullName": "google.cloud.gkemulticloud.v1.AzureClustersClient" + }, + "method": { + "shortName": "GetAzureCluster", + "fullName": "google.cloud.gkemulticloud.v1.AzureClusters.GetAzureCluster", + "service": { + "shortName": "AzureClusters", + "fullName": "google.cloud.gkemulticloud.v1.AzureClusters" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkemulticloud_v1_generated_AzureClusters_GetAzureNodePool_sync", + "title": "gkemulticloud GetAzureNodePool Sample", + "description": "GetAzureNodePool describes a specific AzureNodePool resource.", + "file": "AzureClustersClient/GetAzureNodePool/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetAzureNodePool", + "fullName": "google.cloud.gkemulticloud.v1.AzureClustersClient.GetAzureNodePool", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkemulticloudpb.GetAzureNodePoolRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "gkemulticloudpb.AzureNodePool", + "client": { + "shortName": "AzureClustersClient", + "fullName": "google.cloud.gkemulticloud.v1.AzureClustersClient" + }, + "method": { + "shortName": "GetAzureNodePool", + "fullName": "google.cloud.gkemulticloud.v1.AzureClusters.GetAzureNodePool", + "service": { + "shortName": "AzureClusters", + "fullName": "google.cloud.gkemulticloud.v1.AzureClusters" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkemulticloud_v1_generated_AzureClusters_GetAzureServerConfig_sync", + "title": "gkemulticloud GetAzureServerConfig Sample", + "description": "GetAzureServerConfig returns information, such as supported Azure regions and Kubernetes\nversions, on a given Google Cloud location.", + "file": "AzureClustersClient/GetAzureServerConfig/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetAzureServerConfig", + "fullName": "google.cloud.gkemulticloud.v1.AzureClustersClient.GetAzureServerConfig", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkemulticloudpb.GetAzureServerConfigRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "gkemulticloudpb.AzureServerConfig", + "client": { + "shortName": "AzureClustersClient", + "fullName": "google.cloud.gkemulticloud.v1.AzureClustersClient" + }, + "method": { + "shortName": "GetAzureServerConfig", + "fullName": "google.cloud.gkemulticloud.v1.AzureClusters.GetAzureServerConfig", + "service": { + "shortName": "AzureClusters", + "fullName": "google.cloud.gkemulticloud.v1.AzureClusters" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 47, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkemulticloud_v1_generated_AzureClusters_ListAzureClients_sync", + "title": "gkemulticloud ListAzureClients Sample", + "description": "ListAzureClients lists all AzureClient resources on a given Google Cloud project and\nregion.", + "file": "AzureClustersClient/ListAzureClients/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListAzureClients", + "fullName": "google.cloud.gkemulticloud.v1.AzureClustersClient.ListAzureClients", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkemulticloudpb.ListAzureClientsRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "AzureClientIterator", + "client": { + "shortName": "AzureClustersClient", + "fullName": "google.cloud.gkemulticloud.v1.AzureClustersClient" + }, + "method": { + "shortName": "ListAzureClients", + "fullName": "google.cloud.gkemulticloud.v1.AzureClusters.ListAzureClients", + "service": { + "shortName": "AzureClusters", + "fullName": "google.cloud.gkemulticloud.v1.AzureClusters" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 54, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkemulticloud_v1_generated_AzureClusters_ListAzureClusters_sync", + "title": "gkemulticloud ListAzureClusters Sample", + "description": "ListAzureClusters lists all AzureCluster resources on a given Google Cloud project and\nregion.", + "file": "AzureClustersClient/ListAzureClusters/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListAzureClusters", + "fullName": "google.cloud.gkemulticloud.v1.AzureClustersClient.ListAzureClusters", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkemulticloudpb.ListAzureClustersRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "AzureClusterIterator", + "client": { + "shortName": "AzureClustersClient", + "fullName": "google.cloud.gkemulticloud.v1.AzureClustersClient" + }, + "method": { + "shortName": "ListAzureClusters", + "fullName": "google.cloud.gkemulticloud.v1.AzureClusters.ListAzureClusters", + "service": { + "shortName": "AzureClusters", + "fullName": "google.cloud.gkemulticloud.v1.AzureClusters" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 54, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkemulticloud_v1_generated_AzureClusters_ListAzureNodePools_sync", + "title": "gkemulticloud ListAzureNodePools Sample", + "description": "ListAzureNodePools lists all AzureNodePool resources on a given AzureCluster.", + "file": "AzureClustersClient/ListAzureNodePools/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListAzureNodePools", + "fullName": "google.cloud.gkemulticloud.v1.AzureClustersClient.ListAzureNodePools", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkemulticloudpb.ListAzureNodePoolsRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "AzureNodePoolIterator", + "client": { + "shortName": "AzureClustersClient", + "fullName": "google.cloud.gkemulticloud.v1.AzureClustersClient" + }, + "method": { + "shortName": "ListAzureNodePools", + "fullName": "google.cloud.gkemulticloud.v1.AzureClusters.ListAzureNodePools", + "service": { + "shortName": "AzureClusters", + "fullName": "google.cloud.gkemulticloud.v1.AzureClusters" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 54, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkemulticloud_v1_generated_AzureClusters_UpdateAzureCluster_sync", + "title": "gkemulticloud UpdateAzureCluster Sample", + "description": "UpdateAzureCluster updates an AzureCluster.", + "file": "AzureClustersClient/UpdateAzureCluster/main.go", + "language": "GO", + "clientMethod": { + "shortName": "UpdateAzureCluster", + "fullName": "google.cloud.gkemulticloud.v1.AzureClustersClient.UpdateAzureCluster", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkemulticloudpb.UpdateAzureClusterRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "UpdateAzureClusterOperation", + "client": { + "shortName": "AzureClustersClient", + "fullName": "google.cloud.gkemulticloud.v1.AzureClustersClient" + }, + "method": { + "shortName": "UpdateAzureCluster", + "fullName": "google.cloud.gkemulticloud.v1.AzureClusters.UpdateAzureCluster", + "service": { + "shortName": "AzureClusters", + "fullName": "google.cloud.gkemulticloud.v1.AzureClusters" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 52, + "type": "FULL" + } + ] + }, + { + "regionTag": "gkemulticloud_v1_generated_AzureClusters_UpdateAzureNodePool_sync", + "title": "gkemulticloud UpdateAzureNodePool Sample", + "description": "UpdateAzureNodePool updates an AzureNodePool.", + "file": "AzureClustersClient/UpdateAzureNodePool/main.go", + "language": "GO", + "clientMethod": { + "shortName": "UpdateAzureNodePool", + "fullName": "google.cloud.gkemulticloud.v1.AzureClustersClient.UpdateAzureNodePool", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "gkemulticloudpb.UpdateAzureNodePoolRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "UpdateAzureNodePoolOperation", + "client": { + "shortName": "AzureClustersClient", + "fullName": "google.cloud.gkemulticloud.v1.AzureClustersClient" + }, + "method": { + "shortName": "UpdateAzureNodePool", + "fullName": "google.cloud.gkemulticloud.v1.AzureClusters.UpdateAzureNodePool", + "service": { + "shortName": "AzureClusters", + "fullName": "google.cloud.gkemulticloud.v1.AzureClusters" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 52, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/internal/generated/snippets/go.mod b/internal/generated/snippets/go.mod index f6fdc535b3f6..bb510e20fbf9 100644 --- a/internal/generated/snippets/go.mod +++ b/internal/generated/snippets/go.mod @@ -49,8 +49,10 @@ require ( cloud.google.com/go/firestore v1.6.1 cloud.google.com/go/functions v1.1.0 cloud.google.com/go/gaming v1.0.0 + cloud.google.com/go/gkebackup v0.0.0-00010101000000-000000000000 cloud.google.com/go/gkeconnect v0.1.0 cloud.google.com/go/gkehub v0.2.0 + cloud.google.com/go/gkemulticloud v0.0.0-00010101000000-000000000000 cloud.google.com/go/gsuiteaddons v1.0.0 cloud.google.com/go/iam v0.3.0 cloud.google.com/go/iap v1.0.0 @@ -113,7 +115,7 @@ 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.78.0 + google.golang.org/api v0.79.0 google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3 ) @@ -342,3 +344,7 @@ replace cloud.google.com/go/certificatemanager => ../../../certificatemanager replace cloud.google.com/go/optimization => ../../../optimization replace cloud.google.com/go/run => ../../../run + +replace cloud.google.com/go/gkebackup => ../../../gkebackup + +replace cloud.google.com/go/gkemulticloud => ../../../gkemulticloud diff --git a/internal/generated/snippets/go.sum b/internal/generated/snippets/go.sum index 65ea3c54496f..d264cc0342ef 100644 --- a/internal/generated/snippets/go.sum +++ b/internal/generated/snippets/go.sum @@ -65,8 +65,9 @@ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5m github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= -github.com/googleapis/gax-go/v2 v2.3.0 h1:nRJtk3y8Fm770D42QV6T90ZnvFZyk7agSo3Q+Z9p3WI= github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= +github.com/googleapis/gax-go/v2 v2.4.0 h1:dS9eYAjhrE2RjmzYw2XAPvcXfmcQLtFEQWn0CR82awk= +github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -148,8 +149,9 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba h1:AyHWHCBVlIYI5rgEM3o+1PLd0sLPcIAoaUckGQMaWtw= golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6 h1:nonptSpoQ4vQjyraW20DXPAglgQfVnM9ZC6MmNLMR60= +golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/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= @@ -181,8 +183,9 @@ google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRR google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= google.golang.org/api v0.76.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= google.golang.org/api v0.77.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= -google.golang.org/api v0.78.0 h1:5ewPyCwP43C3i8B6C2Kb+eVAevbnke2xR8VbcSWjS4I= google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= +google.golang.org/api v0.79.0 h1:vaOcm0WdXvhGkci9a0+CcQVZqSRjN8ksSBlWv99f8Pg= +google.golang.org/api v0.79.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= 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= @@ -227,8 +230,9 @@ google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnD google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= -google.golang.org/grpc v1.46.0 h1:oCjezcn6g6A75TGoKYBPgKmVBLexhYLM6MebdrPApP8= google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.46.2 h1:u+MLGgVf7vRdjEYZ8wDFhAVNmhkbJ5hmrA1LMWK1CAQ= +google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= 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/run/apiv2/revisions_client.go b/run/apiv2/revisions_client.go index 8a53975f3c62..7a3e234c4aed 100644 --- a/run/apiv2/revisions_client.go +++ b/run/apiv2/revisions_client.go @@ -21,6 +21,8 @@ import ( "fmt" "math" "net/url" + "regexp" + "strings" "time" "cloud.google.com/go/longrunning" @@ -234,7 +236,16 @@ func (c *revisionsGRPCClient) Close() error { } func (c *revisionsGRPCClient) GetRevision(ctx context.Context, req *runpb.GetRevisionRequest, opts ...gax.CallOption) (*runpb.Revision, error) { - md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + routingHeaders := "" + routingHeadersMap := make(map[string]string) + if reg := regexp.MustCompile("projects/[^/]+/locations/(?P[^/]+)(?:/.*)?"); reg.MatchString(req.GetName()) && len(url.QueryEscape(reg.FindStringSubmatch(req.GetName())[1])) > 0 { + routingHeadersMap["location"] = url.QueryEscape(reg.FindStringSubmatch(req.GetName())[1]) + } + for headerName, headerValue := range routingHeadersMap { + routingHeaders = fmt.Sprintf("%s%s=%s&", routingHeaders, headerName, headerValue) + } + routingHeaders = strings.TrimSuffix(routingHeaders, "&") + md := metadata.Pairs("x-goog-request-params", routingHeaders) ctx = insertMetadata(ctx, c.xGoogMetadata, md) opts = append((*c.CallOptions).GetRevision[0:len((*c.CallOptions).GetRevision):len((*c.CallOptions).GetRevision)], opts...) @@ -251,7 +262,16 @@ func (c *revisionsGRPCClient) GetRevision(ctx context.Context, req *runpb.GetRev } func (c *revisionsGRPCClient) ListRevisions(ctx context.Context, req *runpb.ListRevisionsRequest, opts ...gax.CallOption) *RevisionIterator { - md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))) + routingHeaders := "" + routingHeadersMap := make(map[string]string) + if reg := regexp.MustCompile("projects/[^/]+/locations/(?P[^/]+)(?:/.*)?"); reg.MatchString(req.GetParent()) && len(url.QueryEscape(reg.FindStringSubmatch(req.GetParent())[1])) > 0 { + routingHeadersMap["location"] = url.QueryEscape(reg.FindStringSubmatch(req.GetParent())[1]) + } + for headerName, headerValue := range routingHeadersMap { + routingHeaders = fmt.Sprintf("%s%s=%s&", routingHeaders, headerName, headerValue) + } + routingHeaders = strings.TrimSuffix(routingHeaders, "&") + md := metadata.Pairs("x-goog-request-params", routingHeaders) ctx = insertMetadata(ctx, c.xGoogMetadata, md) opts = append((*c.CallOptions).ListRevisions[0:len((*c.CallOptions).ListRevisions):len((*c.CallOptions).ListRevisions)], opts...) @@ -296,7 +316,16 @@ func (c *revisionsGRPCClient) ListRevisions(ctx context.Context, req *runpb.List } func (c *revisionsGRPCClient) DeleteRevision(ctx context.Context, req *runpb.DeleteRevisionRequest, opts ...gax.CallOption) (*DeleteRevisionOperation, error) { - md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + routingHeaders := "" + routingHeadersMap := make(map[string]string) + if reg := regexp.MustCompile("projects/[^/]+/locations/(?P[^/]+)(?:/.*)?"); reg.MatchString(req.GetName()) && len(url.QueryEscape(reg.FindStringSubmatch(req.GetName())[1])) > 0 { + routingHeadersMap["location"] = url.QueryEscape(reg.FindStringSubmatch(req.GetName())[1]) + } + for headerName, headerValue := range routingHeadersMap { + routingHeaders = fmt.Sprintf("%s%s=%s&", routingHeaders, headerName, headerValue) + } + routingHeaders = strings.TrimSuffix(routingHeaders, "&") + md := metadata.Pairs("x-goog-request-params", routingHeaders) ctx = insertMetadata(ctx, c.xGoogMetadata, md) opts = append((*c.CallOptions).DeleteRevision[0:len((*c.CallOptions).DeleteRevision):len((*c.CallOptions).DeleteRevision)], opts...) diff --git a/run/apiv2/services_client.go b/run/apiv2/services_client.go index 5eb6201de8aa..664d18e3c02b 100644 --- a/run/apiv2/services_client.go +++ b/run/apiv2/services_client.go @@ -21,6 +21,8 @@ import ( "fmt" "math" "net/url" + "regexp" + "strings" "time" "cloud.google.com/go/longrunning" @@ -321,7 +323,16 @@ func (c *servicesGRPCClient) CreateService(ctx context.Context, req *runpb.Creat defer cancel() ctx = cctx } - md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))) + routingHeaders := "" + routingHeadersMap := make(map[string]string) + if reg := regexp.MustCompile("projects/[^/]+/locations/(?P[^/]+)"); reg.MatchString(req.GetParent()) && len(url.QueryEscape(reg.FindStringSubmatch(req.GetParent())[1])) > 0 { + routingHeadersMap["location"] = url.QueryEscape(reg.FindStringSubmatch(req.GetParent())[1]) + } + for headerName, headerValue := range routingHeadersMap { + routingHeaders = fmt.Sprintf("%s%s=%s&", routingHeaders, headerName, headerValue) + } + routingHeaders = strings.TrimSuffix(routingHeaders, "&") + md := metadata.Pairs("x-goog-request-params", routingHeaders) ctx = insertMetadata(ctx, c.xGoogMetadata, md) opts = append((*c.CallOptions).CreateService[0:len((*c.CallOptions).CreateService):len((*c.CallOptions).CreateService)], opts...) @@ -345,7 +356,16 @@ func (c *servicesGRPCClient) GetService(ctx context.Context, req *runpb.GetServi defer cancel() ctx = cctx } - md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + routingHeaders := "" + routingHeadersMap := make(map[string]string) + if reg := regexp.MustCompile("projects/[^/]+/locations/(?P[^/]+)(?:/.*)?"); reg.MatchString(req.GetName()) && len(url.QueryEscape(reg.FindStringSubmatch(req.GetName())[1])) > 0 { + routingHeadersMap["location"] = url.QueryEscape(reg.FindStringSubmatch(req.GetName())[1]) + } + for headerName, headerValue := range routingHeadersMap { + routingHeaders = fmt.Sprintf("%s%s=%s&", routingHeaders, headerName, headerValue) + } + routingHeaders = strings.TrimSuffix(routingHeaders, "&") + md := metadata.Pairs("x-goog-request-params", routingHeaders) ctx = insertMetadata(ctx, c.xGoogMetadata, md) opts = append((*c.CallOptions).GetService[0:len((*c.CallOptions).GetService):len((*c.CallOptions).GetService)], opts...) @@ -362,7 +382,16 @@ func (c *servicesGRPCClient) GetService(ctx context.Context, req *runpb.GetServi } func (c *servicesGRPCClient) ListServices(ctx context.Context, req *runpb.ListServicesRequest, opts ...gax.CallOption) *ServiceIterator { - md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))) + routingHeaders := "" + routingHeadersMap := make(map[string]string) + if reg := regexp.MustCompile("projects/[^/]+/locations/(?P[^/]+)"); reg.MatchString(req.GetParent()) && len(url.QueryEscape(reg.FindStringSubmatch(req.GetParent())[1])) > 0 { + routingHeadersMap["location"] = url.QueryEscape(reg.FindStringSubmatch(req.GetParent())[1]) + } + for headerName, headerValue := range routingHeadersMap { + routingHeaders = fmt.Sprintf("%s%s=%s&", routingHeaders, headerName, headerValue) + } + routingHeaders = strings.TrimSuffix(routingHeaders, "&") + md := metadata.Pairs("x-goog-request-params", routingHeaders) ctx = insertMetadata(ctx, c.xGoogMetadata, md) opts = append((*c.CallOptions).ListServices[0:len((*c.CallOptions).ListServices):len((*c.CallOptions).ListServices)], opts...) @@ -412,7 +441,16 @@ func (c *servicesGRPCClient) UpdateService(ctx context.Context, req *runpb.Updat defer cancel() ctx = cctx } - md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "service.name", url.QueryEscape(req.GetService().GetName()))) + routingHeaders := "" + routingHeadersMap := make(map[string]string) + if reg := regexp.MustCompile("projects/[^/]+/locations/(?P[^/]+)(?:/.*)?"); reg.MatchString(req.GetService().GetName()) && len(url.QueryEscape(reg.FindStringSubmatch(req.GetService().GetName())[1])) > 0 { + routingHeadersMap["location"] = url.QueryEscape(reg.FindStringSubmatch(req.GetService().GetName())[1]) + } + for headerName, headerValue := range routingHeadersMap { + routingHeaders = fmt.Sprintf("%s%s=%s&", routingHeaders, headerName, headerValue) + } + routingHeaders = strings.TrimSuffix(routingHeaders, "&") + md := metadata.Pairs("x-goog-request-params", routingHeaders) ctx = insertMetadata(ctx, c.xGoogMetadata, md) opts = append((*c.CallOptions).UpdateService[0:len((*c.CallOptions).UpdateService):len((*c.CallOptions).UpdateService)], opts...) @@ -436,7 +474,16 @@ func (c *servicesGRPCClient) DeleteService(ctx context.Context, req *runpb.Delet defer cancel() ctx = cctx } - md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + routingHeaders := "" + routingHeadersMap := make(map[string]string) + if reg := regexp.MustCompile("projects/[^/]+/locations/(?P[^/]+)(?:/.*)?"); reg.MatchString(req.GetName()) && len(url.QueryEscape(reg.FindStringSubmatch(req.GetName())[1])) > 0 { + routingHeadersMap["location"] = url.QueryEscape(reg.FindStringSubmatch(req.GetName())[1]) + } + for headerName, headerValue := range routingHeadersMap { + routingHeaders = fmt.Sprintf("%s%s=%s&", routingHeaders, headerName, headerValue) + } + routingHeaders = strings.TrimSuffix(routingHeaders, "&") + md := metadata.Pairs("x-goog-request-params", routingHeaders) ctx = insertMetadata(ctx, c.xGoogMetadata, md) opts = append((*c.CallOptions).DeleteService[0:len((*c.CallOptions).DeleteService):len((*c.CallOptions).DeleteService)], opts...) diff --git a/speech/apiv1/adaptation_client.go b/speech/apiv1/adaptation_client.go new file mode 100644 index 000000000000..998311dda897 --- /dev/null +++ b/speech/apiv1/adaptation_client.go @@ -0,0 +1,572 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go_gapic. DO NOT EDIT. + +package speech + +import ( + "context" + "fmt" + "math" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/iterator" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + gtransport "google.golang.org/api/transport/grpc" + speechpb "google.golang.org/genproto/googleapis/cloud/speech/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/proto" +) + +var newAdaptationClientHook clientHook + +// AdaptationCallOptions contains the retry settings for each method of AdaptationClient. +type AdaptationCallOptions struct { + CreatePhraseSet []gax.CallOption + GetPhraseSet []gax.CallOption + ListPhraseSet []gax.CallOption + UpdatePhraseSet []gax.CallOption + DeletePhraseSet []gax.CallOption + CreateCustomClass []gax.CallOption + GetCustomClass []gax.CallOption + ListCustomClasses []gax.CallOption + UpdateCustomClass []gax.CallOption + DeleteCustomClass []gax.CallOption +} + +func defaultAdaptationGRPCClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("speech.googleapis.com:443"), + internaloption.WithDefaultMTLSEndpoint("speech.mtls.googleapis.com:443"), + internaloption.WithDefaultAudience("https://speech.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), + option.WithGRPCDialOption(grpc.WithDefaultCallOptions( + grpc.MaxCallRecvMsgSize(math.MaxInt32))), + } +} + +func defaultAdaptationCallOptions() *AdaptationCallOptions { + return &AdaptationCallOptions{ + CreatePhraseSet: []gax.CallOption{}, + GetPhraseSet: []gax.CallOption{}, + ListPhraseSet: []gax.CallOption{}, + UpdatePhraseSet: []gax.CallOption{}, + DeletePhraseSet: []gax.CallOption{}, + CreateCustomClass: []gax.CallOption{}, + GetCustomClass: []gax.CallOption{}, + ListCustomClasses: []gax.CallOption{}, + UpdateCustomClass: []gax.CallOption{}, + DeleteCustomClass: []gax.CallOption{}, + } +} + +// internalAdaptationClient is an interface that defines the methods availaible from Cloud Speech-to-Text API. +type internalAdaptationClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + CreatePhraseSet(context.Context, *speechpb.CreatePhraseSetRequest, ...gax.CallOption) (*speechpb.PhraseSet, error) + GetPhraseSet(context.Context, *speechpb.GetPhraseSetRequest, ...gax.CallOption) (*speechpb.PhraseSet, error) + ListPhraseSet(context.Context, *speechpb.ListPhraseSetRequest, ...gax.CallOption) *PhraseSetIterator + UpdatePhraseSet(context.Context, *speechpb.UpdatePhraseSetRequest, ...gax.CallOption) (*speechpb.PhraseSet, error) + DeletePhraseSet(context.Context, *speechpb.DeletePhraseSetRequest, ...gax.CallOption) error + CreateCustomClass(context.Context, *speechpb.CreateCustomClassRequest, ...gax.CallOption) (*speechpb.CustomClass, error) + GetCustomClass(context.Context, *speechpb.GetCustomClassRequest, ...gax.CallOption) (*speechpb.CustomClass, error) + ListCustomClasses(context.Context, *speechpb.ListCustomClassesRequest, ...gax.CallOption) *CustomClassIterator + UpdateCustomClass(context.Context, *speechpb.UpdateCustomClassRequest, ...gax.CallOption) (*speechpb.CustomClass, error) + DeleteCustomClass(context.Context, *speechpb.DeleteCustomClassRequest, ...gax.CallOption) error +} + +// AdaptationClient is a client for interacting with Cloud Speech-to-Text API. +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +// +// Service that implements Google Cloud Speech Adaptation API. +type AdaptationClient struct { + // The internal transport-dependent client. + internalClient internalAdaptationClient + + // The call options for this service. + CallOptions *AdaptationCallOptions +} + +// Wrapper methods routed to the internal client. + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *AdaptationClient) Close() error { + return c.internalClient.Close() +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *AdaptationClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *AdaptationClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// CreatePhraseSet create a set of phrase hints. Each item in the set can be a single word or +// a multi-word phrase. The items in the PhraseSet are favored by the +// recognition model when you send a call that includes the PhraseSet. +func (c *AdaptationClient) CreatePhraseSet(ctx context.Context, req *speechpb.CreatePhraseSetRequest, opts ...gax.CallOption) (*speechpb.PhraseSet, error) { + return c.internalClient.CreatePhraseSet(ctx, req, opts...) +} + +// GetPhraseSet get a phrase set. +func (c *AdaptationClient) GetPhraseSet(ctx context.Context, req *speechpb.GetPhraseSetRequest, opts ...gax.CallOption) (*speechpb.PhraseSet, error) { + return c.internalClient.GetPhraseSet(ctx, req, opts...) +} + +// ListPhraseSet list phrase sets. +func (c *AdaptationClient) ListPhraseSet(ctx context.Context, req *speechpb.ListPhraseSetRequest, opts ...gax.CallOption) *PhraseSetIterator { + return c.internalClient.ListPhraseSet(ctx, req, opts...) +} + +// UpdatePhraseSet update a phrase set. +func (c *AdaptationClient) UpdatePhraseSet(ctx context.Context, req *speechpb.UpdatePhraseSetRequest, opts ...gax.CallOption) (*speechpb.PhraseSet, error) { + return c.internalClient.UpdatePhraseSet(ctx, req, opts...) +} + +// DeletePhraseSet delete a phrase set. +func (c *AdaptationClient) DeletePhraseSet(ctx context.Context, req *speechpb.DeletePhraseSetRequest, opts ...gax.CallOption) error { + return c.internalClient.DeletePhraseSet(ctx, req, opts...) +} + +// CreateCustomClass create a custom class. +func (c *AdaptationClient) CreateCustomClass(ctx context.Context, req *speechpb.CreateCustomClassRequest, opts ...gax.CallOption) (*speechpb.CustomClass, error) { + return c.internalClient.CreateCustomClass(ctx, req, opts...) +} + +// GetCustomClass get a custom class. +func (c *AdaptationClient) GetCustomClass(ctx context.Context, req *speechpb.GetCustomClassRequest, opts ...gax.CallOption) (*speechpb.CustomClass, error) { + return c.internalClient.GetCustomClass(ctx, req, opts...) +} + +// ListCustomClasses list custom classes. +func (c *AdaptationClient) ListCustomClasses(ctx context.Context, req *speechpb.ListCustomClassesRequest, opts ...gax.CallOption) *CustomClassIterator { + return c.internalClient.ListCustomClasses(ctx, req, opts...) +} + +// UpdateCustomClass update a custom class. +func (c *AdaptationClient) UpdateCustomClass(ctx context.Context, req *speechpb.UpdateCustomClassRequest, opts ...gax.CallOption) (*speechpb.CustomClass, error) { + return c.internalClient.UpdateCustomClass(ctx, req, opts...) +} + +// DeleteCustomClass delete a custom class. +func (c *AdaptationClient) DeleteCustomClass(ctx context.Context, req *speechpb.DeleteCustomClassRequest, opts ...gax.CallOption) error { + return c.internalClient.DeleteCustomClass(ctx, req, opts...) +} + +// adaptationGRPCClient is a client for interacting with Cloud Speech-to-Text API over gRPC transport. +// +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type adaptationGRPCClient struct { + // Connection pool of gRPC connections to the service. + connPool gtransport.ConnPool + + // flag to opt out of default deadlines via GOOGLE_API_GO_EXPERIMENTAL_DISABLE_DEFAULT_DEADLINE + disableDeadlines bool + + // Points back to the CallOptions field of the containing AdaptationClient + CallOptions **AdaptationCallOptions + + // The gRPC API client. + adaptationClient speechpb.AdaptationClient + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewAdaptationClient creates a new adaptation client based on gRPC. +// The returned client must be Closed when it is done being used to clean up its underlying connections. +// +// Service that implements Google Cloud Speech Adaptation API. +func NewAdaptationClient(ctx context.Context, opts ...option.ClientOption) (*AdaptationClient, error) { + clientOpts := defaultAdaptationGRPCClientOptions() + if newAdaptationClientHook != nil { + hookOpts, err := newAdaptationClientHook(ctx, clientHookParams{}) + if err != nil { + return nil, err + } + clientOpts = append(clientOpts, hookOpts...) + } + + disableDeadlines, err := checkDisableDeadlines() + if err != nil { + return nil, err + } + + connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...) + if err != nil { + return nil, err + } + client := AdaptationClient{CallOptions: defaultAdaptationCallOptions()} + + c := &adaptationGRPCClient{ + connPool: connPool, + disableDeadlines: disableDeadlines, + adaptationClient: speechpb.NewAdaptationClient(connPool), + CallOptions: &client.CallOptions, + } + c.setGoogleClientInfo() + + client.internalClient = c + + return &client, nil +} + +// Connection returns a connection to the API service. +// +// Deprecated. +func (c *adaptationGRPCClient) Connection() *grpc.ClientConn { + return c.connPool.Conn() +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *adaptationGRPCClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version) + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *adaptationGRPCClient) Close() error { + return c.connPool.Close() +} + +func (c *adaptationGRPCClient) CreatePhraseSet(ctx context.Context, req *speechpb.CreatePhraseSetRequest, opts ...gax.CallOption) (*speechpb.PhraseSet, error) { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).CreatePhraseSet[0:len((*c.CallOptions).CreatePhraseSet):len((*c.CallOptions).CreatePhraseSet)], opts...) + var resp *speechpb.PhraseSet + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.adaptationClient.CreatePhraseSet(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *adaptationGRPCClient) GetPhraseSet(ctx context.Context, req *speechpb.GetPhraseSetRequest, opts ...gax.CallOption) (*speechpb.PhraseSet, error) { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).GetPhraseSet[0:len((*c.CallOptions).GetPhraseSet):len((*c.CallOptions).GetPhraseSet)], opts...) + var resp *speechpb.PhraseSet + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.adaptationClient.GetPhraseSet(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *adaptationGRPCClient) ListPhraseSet(ctx context.Context, req *speechpb.ListPhraseSetRequest, opts ...gax.CallOption) *PhraseSetIterator { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).ListPhraseSet[0:len((*c.CallOptions).ListPhraseSet):len((*c.CallOptions).ListPhraseSet)], opts...) + it := &PhraseSetIterator{} + req = proto.Clone(req).(*speechpb.ListPhraseSetRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]*speechpb.PhraseSet, string, error) { + resp := &speechpb.ListPhraseSetResponse{} + if pageToken != "" { + req.PageToken = pageToken + } + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else if pageSize != 0 { + req.PageSize = int32(pageSize) + } + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.adaptationClient.ListPhraseSet(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, "", err + } + + it.Response = resp + return resp.GetPhraseSets(), resp.GetNextPageToken(), nil + } + fetch := func(pageSize int, pageToken string) (string, error) { + items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) + if err != nil { + return "", err + } + it.items = append(it.items, items...) + return nextPageToken, nil + } + + it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) + it.pageInfo.MaxSize = int(req.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + + return it +} + +func (c *adaptationGRPCClient) UpdatePhraseSet(ctx context.Context, req *speechpb.UpdatePhraseSetRequest, opts ...gax.CallOption) (*speechpb.PhraseSet, error) { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "phrase_set.name", url.QueryEscape(req.GetPhraseSet().GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).UpdatePhraseSet[0:len((*c.CallOptions).UpdatePhraseSet):len((*c.CallOptions).UpdatePhraseSet)], opts...) + var resp *speechpb.PhraseSet + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.adaptationClient.UpdatePhraseSet(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *adaptationGRPCClient) DeletePhraseSet(ctx context.Context, req *speechpb.DeletePhraseSetRequest, opts ...gax.CallOption) error { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).DeletePhraseSet[0:len((*c.CallOptions).DeletePhraseSet):len((*c.CallOptions).DeletePhraseSet)], opts...) + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + _, err = c.adaptationClient.DeletePhraseSet(ctx, req, settings.GRPC...) + return err + }, opts...) + return err +} + +func (c *adaptationGRPCClient) CreateCustomClass(ctx context.Context, req *speechpb.CreateCustomClassRequest, opts ...gax.CallOption) (*speechpb.CustomClass, error) { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).CreateCustomClass[0:len((*c.CallOptions).CreateCustomClass):len((*c.CallOptions).CreateCustomClass)], opts...) + var resp *speechpb.CustomClass + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.adaptationClient.CreateCustomClass(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *adaptationGRPCClient) GetCustomClass(ctx context.Context, req *speechpb.GetCustomClassRequest, opts ...gax.CallOption) (*speechpb.CustomClass, error) { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).GetCustomClass[0:len((*c.CallOptions).GetCustomClass):len((*c.CallOptions).GetCustomClass)], opts...) + var resp *speechpb.CustomClass + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.adaptationClient.GetCustomClass(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *adaptationGRPCClient) ListCustomClasses(ctx context.Context, req *speechpb.ListCustomClassesRequest, opts ...gax.CallOption) *CustomClassIterator { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).ListCustomClasses[0:len((*c.CallOptions).ListCustomClasses):len((*c.CallOptions).ListCustomClasses)], opts...) + it := &CustomClassIterator{} + req = proto.Clone(req).(*speechpb.ListCustomClassesRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]*speechpb.CustomClass, string, error) { + resp := &speechpb.ListCustomClassesResponse{} + if pageToken != "" { + req.PageToken = pageToken + } + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else if pageSize != 0 { + req.PageSize = int32(pageSize) + } + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.adaptationClient.ListCustomClasses(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, "", err + } + + it.Response = resp + return resp.GetCustomClasses(), resp.GetNextPageToken(), nil + } + fetch := func(pageSize int, pageToken string) (string, error) { + items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) + if err != nil { + return "", err + } + it.items = append(it.items, items...) + return nextPageToken, nil + } + + it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) + it.pageInfo.MaxSize = int(req.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + + return it +} + +func (c *adaptationGRPCClient) UpdateCustomClass(ctx context.Context, req *speechpb.UpdateCustomClassRequest, opts ...gax.CallOption) (*speechpb.CustomClass, error) { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "custom_class.name", url.QueryEscape(req.GetCustomClass().GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).UpdateCustomClass[0:len((*c.CallOptions).UpdateCustomClass):len((*c.CallOptions).UpdateCustomClass)], opts...) + var resp *speechpb.CustomClass + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.adaptationClient.UpdateCustomClass(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *adaptationGRPCClient) DeleteCustomClass(ctx context.Context, req *speechpb.DeleteCustomClassRequest, opts ...gax.CallOption) error { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).DeleteCustomClass[0:len((*c.CallOptions).DeleteCustomClass):len((*c.CallOptions).DeleteCustomClass)], opts...) + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + _, err = c.adaptationClient.DeleteCustomClass(ctx, req, settings.GRPC...) + return err + }, opts...) + return err +} + +// CustomClassIterator manages a stream of *speechpb.CustomClass. +type CustomClassIterator struct { + items []*speechpb.CustomClass + pageInfo *iterator.PageInfo + nextFunc func() error + + // Response is the raw response for the current page. + // It must be cast to the RPC response type. + // Calling Next() or InternalFetch() updates this value. + Response interface{} + + // InternalFetch is for use by the Google Cloud Libraries only. + // It is not part of the stable interface of this package. + // + // InternalFetch returns results from a single call to the underlying RPC. + // The number of results is no greater than pageSize. + // If there are no more results, nextPageToken is empty and err is nil. + InternalFetch func(pageSize int, pageToken string) (results []*speechpb.CustomClass, nextPageToken string, err error) +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (it *CustomClassIterator) PageInfo() *iterator.PageInfo { + return it.pageInfo +} + +// Next returns the next result. Its second return value is iterator.Done if there are no more +// results. Once Next returns Done, all subsequent calls will return Done. +func (it *CustomClassIterator) Next() (*speechpb.CustomClass, error) { + var item *speechpb.CustomClass + if err := it.nextFunc(); err != nil { + return item, err + } + item = it.items[0] + it.items = it.items[1:] + return item, nil +} + +func (it *CustomClassIterator) bufLen() int { + return len(it.items) +} + +func (it *CustomClassIterator) takeBuf() interface{} { + b := it.items + it.items = nil + return b +} + +// PhraseSetIterator manages a stream of *speechpb.PhraseSet. +type PhraseSetIterator struct { + items []*speechpb.PhraseSet + pageInfo *iterator.PageInfo + nextFunc func() error + + // Response is the raw response for the current page. + // It must be cast to the RPC response type. + // Calling Next() or InternalFetch() updates this value. + Response interface{} + + // InternalFetch is for use by the Google Cloud Libraries only. + // It is not part of the stable interface of this package. + // + // InternalFetch returns results from a single call to the underlying RPC. + // The number of results is no greater than pageSize. + // If there are no more results, nextPageToken is empty and err is nil. + InternalFetch func(pageSize int, pageToken string) (results []*speechpb.PhraseSet, nextPageToken string, err error) +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (it *PhraseSetIterator) PageInfo() *iterator.PageInfo { + return it.pageInfo +} + +// Next returns the next result. Its second return value is iterator.Done if there are no more +// results. Once Next returns Done, all subsequent calls will return Done. +func (it *PhraseSetIterator) Next() (*speechpb.PhraseSet, error) { + var item *speechpb.PhraseSet + if err := it.nextFunc(); err != nil { + return item, err + } + item = it.items[0] + it.items = it.items[1:] + return item, nil +} + +func (it *PhraseSetIterator) bufLen() int { + return len(it.items) +} + +func (it *PhraseSetIterator) takeBuf() interface{} { + b := it.items + it.items = nil + return b +} diff --git a/speech/apiv1/adaptation_client_example_test.go b/speech/apiv1/adaptation_client_example_test.go new file mode 100644 index 000000000000..6f7930cbd3d4 --- /dev/null +++ b/speech/apiv1/adaptation_client_example_test.go @@ -0,0 +1,245 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go_gapic. DO NOT EDIT. + +package speech_test + +import ( + "context" + + speech "cloud.google.com/go/speech/apiv1" + "google.golang.org/api/iterator" + speechpb "google.golang.org/genproto/googleapis/cloud/speech/v1" +) + +func ExampleNewAdaptationClient() { + ctx := context.Background() + c, err := speech.NewAdaptationClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleAdaptationClient_CreatePhraseSet() { + ctx := context.Background() + c, err := speech.NewAdaptationClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &speechpb.CreatePhraseSetRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/speech/v1#CreatePhraseSetRequest. + } + resp, err := c.CreatePhraseSet(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleAdaptationClient_GetPhraseSet() { + ctx := context.Background() + c, err := speech.NewAdaptationClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &speechpb.GetPhraseSetRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/speech/v1#GetPhraseSetRequest. + } + resp, err := c.GetPhraseSet(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleAdaptationClient_ListPhraseSet() { + ctx := context.Background() + c, err := speech.NewAdaptationClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &speechpb.ListPhraseSetRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/speech/v1#ListPhraseSetRequest. + } + it := c.ListPhraseSet(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +func ExampleAdaptationClient_UpdatePhraseSet() { + ctx := context.Background() + c, err := speech.NewAdaptationClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &speechpb.UpdatePhraseSetRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/speech/v1#UpdatePhraseSetRequest. + } + resp, err := c.UpdatePhraseSet(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleAdaptationClient_DeletePhraseSet() { + ctx := context.Background() + c, err := speech.NewAdaptationClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &speechpb.DeletePhraseSetRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/speech/v1#DeletePhraseSetRequest. + } + err = c.DeletePhraseSet(ctx, req) + if err != nil { + // TODO: Handle error. + } +} + +func ExampleAdaptationClient_CreateCustomClass() { + ctx := context.Background() + c, err := speech.NewAdaptationClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &speechpb.CreateCustomClassRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/speech/v1#CreateCustomClassRequest. + } + resp, err := c.CreateCustomClass(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleAdaptationClient_GetCustomClass() { + ctx := context.Background() + c, err := speech.NewAdaptationClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &speechpb.GetCustomClassRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/speech/v1#GetCustomClassRequest. + } + resp, err := c.GetCustomClass(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleAdaptationClient_ListCustomClasses() { + ctx := context.Background() + c, err := speech.NewAdaptationClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &speechpb.ListCustomClassesRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/speech/v1#ListCustomClassesRequest. + } + it := c.ListCustomClasses(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +func ExampleAdaptationClient_UpdateCustomClass() { + ctx := context.Background() + c, err := speech.NewAdaptationClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &speechpb.UpdateCustomClassRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/speech/v1#UpdateCustomClassRequest. + } + resp, err := c.UpdateCustomClass(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleAdaptationClient_DeleteCustomClass() { + ctx := context.Background() + c, err := speech.NewAdaptationClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &speechpb.DeleteCustomClassRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/speech/v1#DeleteCustomClassRequest. + } + err = c.DeleteCustomClass(ctx, req) + if err != nil { + // TODO: Handle error. + } +} diff --git a/speech/apiv1/gapic_metadata.json b/speech/apiv1/gapic_metadata.json index 299da42f5ed3..20a2770f0b49 100644 --- a/speech/apiv1/gapic_metadata.json +++ b/speech/apiv1/gapic_metadata.json @@ -5,6 +5,65 @@ "protoPackage": "google.cloud.speech.v1", "libraryPackage": "cloud.google.com/go/speech/apiv1", "services": { + "Adaptation": { + "clients": { + "grpc": { + "libraryClient": "AdaptationClient", + "rpcs": { + "CreateCustomClass": { + "methods": [ + "CreateCustomClass" + ] + }, + "CreatePhraseSet": { + "methods": [ + "CreatePhraseSet" + ] + }, + "DeleteCustomClass": { + "methods": [ + "DeleteCustomClass" + ] + }, + "DeletePhraseSet": { + "methods": [ + "DeletePhraseSet" + ] + }, + "GetCustomClass": { + "methods": [ + "GetCustomClass" + ] + }, + "GetPhraseSet": { + "methods": [ + "GetPhraseSet" + ] + }, + "ListCustomClasses": { + "methods": [ + "ListCustomClasses" + ] + }, + "ListPhraseSet": { + "methods": [ + "ListPhraseSet" + ] + }, + "UpdateCustomClass": { + "methods": [ + "UpdateCustomClass" + ] + }, + "UpdatePhraseSet": { + "methods": [ + "UpdatePhraseSet" + ] + } + } + } + } + }, "Speech": { "clients": { "grpc": {